Skip to content

Commit

Permalink
Regenerate generated files
Browse files Browse the repository at this point in the history
  • Loading branch information
bzbarsky-apple committed Jun 25, 2021
1 parent c6c3607 commit 7bad07e
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ uint16_t emberAfCopyList(ClusterId clusterId, EmberAfAttributeMetadata * am, boo
{
case 0x0000: // accepts header list
{
entryOffset = GetByteSpanOffsetFromIndex(write ? dest : src, am->size, index - 1);
entryOffset = GetByteSpanOffsetFromIndex(write ? dest : src, am->size, static_cast<uint16_t>(index - 1));
if (entryOffset == 0)
{
ChipLogError(Zcl, "Index %" PRId32 " is invalid.", index);
Expand All @@ -155,7 +155,12 @@ uint16_t emberAfCopyList(ClusterId clusterId, EmberAfAttributeMetadata * am, boo
return 0;
}

entryLength = acceptsHeaderListSpan->size();
if (!CanCastTo<uint16_t>(acceptsHeaderListSpan->size()))
{
ChipLogError(Zcl, "Span size %zu is too large", acceptsHeaderListSpan->size());
return 0;
}
entryLength = static_cast<uint16_t>(acceptsHeaderListSpan->size());
break;
}
case 0x0001: // supported streaming types
Expand Down Expand Up @@ -548,7 +553,7 @@ uint16_t emberAfCopyList(ClusterId clusterId, EmberAfAttributeMetadata * am, boo
}
case 0x001B: // list_octet_string
{
entryOffset = GetByteSpanOffsetFromIndex(write ? dest : src, am->size, index - 1);
entryOffset = GetByteSpanOffsetFromIndex(write ? dest : src, am->size, static_cast<uint16_t>(index - 1));
if (entryOffset == 0)
{
ChipLogError(Zcl, "Index %" PRId32 " is invalid.", index);
Expand All @@ -565,7 +570,12 @@ uint16_t emberAfCopyList(ClusterId clusterId, EmberAfAttributeMetadata * am, boo
return 0;
}

entryLength = listOctetStringSpan->size();
if (!CanCastTo<uint16_t>(listOctetStringSpan->size()))
{
ChipLogError(Zcl, "Span size %zu is too large", listOctetStringSpan->size());
return 0;
}
entryLength = static_cast<uint16_t>(listOctetStringSpan->size());
break;
}
case 0x001C: // list_struct_octet_string
Expand Down
9 changes: 7 additions & 2 deletions examples/tv-app/tv-common/gen/attribute-size.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ uint16_t emberAfCopyList(ClusterId clusterId, EmberAfAttributeMetadata * am, boo
{
case 0x0000: // accepts header list
{
entryOffset = GetByteSpanOffsetFromIndex(write ? dest : src, am->size, index - 1);
entryOffset = GetByteSpanOffsetFromIndex(write ? dest : src, am->size, static_cast<uint16_t>(index - 1));
if (entryOffset == 0)
{
ChipLogError(Zcl, "Index %" PRId32 " is invalid.", index);
Expand All @@ -155,7 +155,12 @@ uint16_t emberAfCopyList(ClusterId clusterId, EmberAfAttributeMetadata * am, boo
return 0;
}

entryLength = acceptsHeaderListSpan->size();
if (!CanCastTo<uint16_t>(acceptsHeaderListSpan->size()))
{
ChipLogError(Zcl, "Span size %zu is too large", acceptsHeaderListSpan->size());
return 0;
}
entryLength = static_cast<uint16_t>(acceptsHeaderListSpan->size());
break;
}
case 0x0001: // supported streaming types
Expand Down
4 changes: 2 additions & 2 deletions src/controller/data_model/gen/CHIPClientCallbacks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -881,10 +881,10 @@ bool emberAfReadAttributesResponseCallback(ClusterId clusterId, uint8_t * messag
data[i].LQI = emberAfGetInt8u(message, 0, 1);
message += 1;
CHECK_MESSAGE_LENGTH(1);
data[i].AverageRssi = emberAfGetInt8u(message, 0, 1);
data[i].AverageRssi = emberAfGetInt8s(message, 0, 1);
message += 1;
CHECK_MESSAGE_LENGTH(1);
data[i].LastRssi = emberAfGetInt8u(message, 0, 1);
data[i].LastRssi = emberAfGetInt8s(message, 0, 1);
message += 1;
CHECK_MESSAGE_LENGTH(1);
data[i].FrameErrorRate = emberAfGetInt8u(message, 0, 1);
Expand Down

0 comments on commit 7bad07e

Please sign in to comment.