Skip to content

Commit

Permalink
Remove EMBER_ZCL_STATUS_INSUFFICIENT_SPACE
Browse files Browse the repository at this point in the history
vivien-apple committed Dec 7, 2022
1 parent b47c4f4 commit 4d6e8a9
Showing 5 changed files with 10 additions and 11 deletions.
4 changes: 2 additions & 2 deletions src/app/clusters/scenes/scenes.cpp
Original file line number Diff line number Diff line change
@@ -491,7 +491,7 @@ EmberAfStatus emberAfScenesClusterStoreCurrentSceneCallback(chip::FabricIndex fa
// If the target index is still zero, the table is full.
if (index == EMBER_AF_SCENE_TABLE_NULL_INDEX)
{
return EMBER_ZCL_STATUS_INSUFFICIENT_SPACE;
return EMBER_ZCL_STATUS_RESOURCE_EXHAUSTED;
}

emberAfPluginScenesServerRetrieveSceneEntry(entry, index);
@@ -758,7 +758,7 @@ bool emberAfPluginScenesServerParseAddScene(
// If the target index is still zero, the table is full.
if (index == EMBER_AF_SCENE_TABLE_NULL_INDEX)
{
status = EMBER_ZCL_STATUS_INSUFFICIENT_SPACE;
status = EMBER_ZCL_STATUS_RESOURCE_EXHAUSTED;
goto kickout;
}

1 change: 0 additions & 1 deletion src/app/util/af-enums.h
Original file line number Diff line number Diff line change
@@ -39,7 +39,6 @@ enum EmberAfStatus : uint8_t
EMBER_ZCL_STATUS_CONSTRAINT_ERROR = 0x87,
EMBER_ZCL_STATUS_UNSUPPORTED_WRITE = 0x88,
EMBER_ZCL_STATUS_RESOURCE_EXHAUSTED = 0x89,
EMBER_ZCL_STATUS_INSUFFICIENT_SPACE = 0x89, // Deprecated; same as RESOURCE_EXHAUSTED
EMBER_ZCL_STATUS_DUPLICATE_EXISTS = 0x8A,
EMBER_ZCL_STATUS_NOT_FOUND = 0x8B,
EMBER_ZCL_STATUS_UNREPORTABLE_ATTRIBUTE = 0x8C,
12 changes: 6 additions & 6 deletions src/app/util/attribute-storage.cpp
Original file line number Diff line number Diff line change
@@ -197,7 +197,7 @@ EmberAfStatus emberAfSetDynamicEndpoint(uint16_t index, EndpointId id, const Emb

if (realIndex >= MAX_ENDPOINT_COUNT)
{
return EMBER_ZCL_STATUS_INSUFFICIENT_SPACE;
return EMBER_ZCL_STATUS_RESOURCE_EXHAUSTED;
}
if (id == kInvalidEndpointId)
{
@@ -207,7 +207,7 @@ EmberAfStatus emberAfSetDynamicEndpoint(uint16_t index, EndpointId id, const Emb
auto serverClusterCount = emberAfClusterCountForEndpointType(ep, /* server = */ true);
if (dataVersionStorage.size() < serverClusterCount)
{
return EMBER_ZCL_STATUS_INSUFFICIENT_SPACE;
return EMBER_ZCL_STATUS_RESOURCE_EXHAUSTED;
}

index = static_cast<uint16_t>(realIndex);
@@ -415,23 +415,23 @@ static EmberAfStatus typeSensitiveMemCopy(ClusterId clusterId, uint8_t * dest, u
{
if (bufferSize < 1)
{
return EMBER_ZCL_STATUS_INSUFFICIENT_SPACE;
return EMBER_ZCL_STATUS_RESOURCE_EXHAUSTED;
}
emberAfCopyString(dest, src, bufferSize - 1);
}
else if (emberAfIsLongStringAttributeType(attributeType))
{
if (bufferSize < 2)
{
return EMBER_ZCL_STATUS_INSUFFICIENT_SPACE;
return EMBER_ZCL_STATUS_RESOURCE_EXHAUSTED;
}
emberAfCopyLongString(dest, src, bufferSize - 2);
}
else if (emberAfIsThisDataTypeAListType(attributeType))
{
if (bufferSize < 2)
{
return EMBER_ZCL_STATUS_INSUFFICIENT_SPACE;
return EMBER_ZCL_STATUS_RESOURCE_EXHAUSTED;
}

// Just copy the length.
@@ -441,7 +441,7 @@ static EmberAfStatus typeSensitiveMemCopy(ClusterId clusterId, uint8_t * dest, u
{
if (!ignoreReadLength && readLength < am->size)
{
return EMBER_ZCL_STATUS_INSUFFICIENT_SPACE;
return EMBER_ZCL_STATUS_RESOURCE_EXHAUSTED;
}
if (src == nullptr)
{
2 changes: 1 addition & 1 deletion src/app/util/attribute-table.cpp
Original file line number Diff line number Diff line change
@@ -406,7 +406,7 @@ EmberAfStatus emAfReadAttribute(EndpointId endpoint, ClusterId cluster, Attribut
}
else
{ // failed, print debug info
if (status == EMBER_ZCL_STATUS_INSUFFICIENT_SPACE)
if (status == EMBER_ZCL_STATUS_RESOURCE_EXHAUSTED)
{
emberAfAttributesPrintln("READ: attribute size too large for caller");
emberAfAttributesFlush();
2 changes: 1 addition & 1 deletion src/app/util/generic-callbacks.h
Original file line number Diff line number Diff line change
@@ -110,7 +110,7 @@ bool emberAfAttributeWriteAccessCallback(chip::EndpointId endpoint, chip::Cluste
* value of EMBER_ZCL_STATUS_SUCCESS. Ensure that the size of the externally
* managed attribute value is smaller than what the buffer can hold. In the case
* of a buffer overflow throw an appropriate error such as
* EMBER_ZCL_STATUS_INSUFFICIENT_SPACE. Any other return value indicates the
* EMBER_ZCL_STATUS_RESOURCE_EXHAUSTED. Any other return value indicates the
* application was not able to read the attribute.
*/
EmberAfStatus emberAfExternalAttributeReadCallback(chip::EndpointId endpoint, chip::ClusterId clusterId,

0 comments on commit 4d6e8a9

Please sign in to comment.