Skip to content

Commit

Permalink
Addressed CI issues, and disabled subscription persistence and resump…
Browse files Browse the repository at this point in the history
…tion for cc13x2_26x2 and CYW30739
  • Loading branch information
jtung-apple committed Jan 20, 2023
1 parent 60a230c commit 87e4afe
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 18 deletions.
35 changes: 17 additions & 18 deletions src/app/SimpleSubscriptionResumptionStorage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ CHIP_ERROR SimpleSubscriptionResumptionStorage::FindByScopedNodeId(ScopedNodeId
if (pathCount)
{
subscriptions.mSubscriptions[i].mAttributePaths.Calloc(pathCount);
for (uint8_t j = 0; j < pathCount; j++)
for (uint16_t j = 0; j < pathCount; j++)
{
ReturnErrorOnFailure(reader.Next(kEndpointIdTag));
ReturnErrorOnFailure(reader.Get(subscriptions.mSubscriptions[i].mAttributePaths[j].mEndpointId));
Expand All @@ -224,7 +224,7 @@ CHIP_ERROR SimpleSubscriptionResumptionStorage::FindByScopedNodeId(ScopedNodeId
if (pathCount)
{
subscriptions.mSubscriptions[i].mEventPaths.Calloc(pathCount);
for (uint8_t j = 0; j < pathCount; j++)
for (uint16_t j = 0; j < pathCount; j++)
{
EventPathType eventPathType;
ReturnErrorOnFailure(reader.Next(kPathTypeTag));
Expand Down Expand Up @@ -423,30 +423,29 @@ CHIP_ERROR SimpleSubscriptionResumptionStorage::Delete(const SubscriptionInfo &
{
if (subscriptions.mSize)
{
ChipLogProgress(DataManagement, "JEFFTEST: - save smaller set");
return SaveSubscriptions(subscriptionNode, subscriptions);
}
else

// Remove node from index
SubscriptionIndex subscriptionIndex;
LoadIndex(subscriptionIndex);
for (size_t i = 0; i < subscriptionIndex.mSize; i++)
{
// Remove node from index
SubscriptionIndex subscriptionIndex;
LoadIndex(subscriptionIndex);
for (size_t i = 0; i < subscriptionIndex.mSize; i++)
if (subscriptionNode == subscriptionIndex.mNodes[i])
{
if (subscriptionNode == subscriptionIndex.mNodes[i])
subscriptionIndex.mSize--;
// if not last element, move last element here, essentially deleting this
if (i < subscriptionIndex.mSize)
{
subscriptionIndex.mSize--;
// if not last element, move last element here, essentially deleting this
if (i < subscriptionIndex.mSize)
{
subscriptionIndex.mNodes[i] = std::move(subscriptionIndex.mNodes[subscriptionIndex.mSize]);
}
break;
subscriptionIndex.mNodes[i] = std::move(subscriptionIndex.mNodes[subscriptionIndex.mSize]);
}
break;
}
SaveIndex(subscriptionIndex);

return mStorage->SyncDeleteKeyValue(GetStorageKey(subscriptionNode).KeyName());
}
SaveIndex(subscriptionIndex);

return mStorage->SyncDeleteKeyValue(GetStorageKey(subscriptionNode).KeyName());
}

return CHIP_NO_ERROR;
Expand Down
3 changes: 3 additions & 0 deletions src/platform/Infineon/CYW30739/CHIPPlatformConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,6 @@
#define CHIP_CONFIG_UNAUTHENTICATED_CONNECTION_POOL_SIZE 10
#define CHIP_DEVICE_CONFIG_ENABLE_JUST_IN_TIME_PROVISIONING 1
#define CHIP_DEVICE_CONFIG_ENABLE_THREAD_COMMISSIONABLE_DISCOVERY 1

// Disable subscription persistence and resumption until memory issues get sorted out
#define CHIP_CONFIG_PERSIST_SUBSCRIPTIONS 0
3 changes: 3 additions & 0 deletions src/platform/cc13x2_26x2/CHIPPlatformConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,3 +68,6 @@
#ifndef CHIP_CONFIG_MAX_FABRICS
#define CHIP_CONFIG_MAX_FABRICS 5
#endif

// Disable subscription persistence and resumption until memory issues get sorted out
#define CHIP_CONFIG_PERSIST_SUBSCRIPTIONS 0

0 comments on commit 87e4afe

Please sign in to comment.