Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Label to FabricDescriptorStruct and hook up logic with UpdateFabr… #7361

Merged
merged 2 commits into from
Jun 3, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions config/nrfconnect/app/enable-gnu-std.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
add_library(gnu17 INTERFACE)
target_compile_options(gnu17 INTERFACE -std=gnu++17 -D_SYS__PTHREADTYPES_H_)
target_link_libraries(app PRIVATE gnu17)
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,7 @@ uint16_t emberAfCopyList(ClusterId clusterId, EmberAfAttributeMetadata * am, boo
{
case 0x0001: // fabrics list
{
entryLength = 18;
entryLength = 52;
if (((index - 1) * entryLength) > (am->size - entryLength))
{
ChipLogError(Zcl, "Index %l is invalid.", index);
Expand All @@ -434,7 +434,15 @@ uint16_t emberAfCopyList(ClusterId clusterId, EmberAfAttributeMetadata * am, boo
copyListMember(write ? dest : (uint8_t *) &entry->VendorId, write ? (uint8_t *) &entry->VendorId : src, write,
&entryOffset, sizeof(entry->VendorId)); // INT16U
copyListMember(write ? dest : (uint8_t *) &entry->NodeId, write ? (uint8_t *) &entry->NodeId : src, write, &entryOffset,
sizeof(entry->NodeId)); // NODE_ID
sizeof(entry->NodeId)); // NODE_ID
chip::ByteSpan * LabelSpan = &entry->Label; // OCTET_STRING
if (CHIP_NO_ERROR !=
(write ? WriteByteSpan(dest + entryOffset, 34, LabelSpan) : ReadByteSpan(src + entryOffset, 34, LabelSpan)))
{
ChipLogError(Zcl, "Index %l is invalid. Not enough remaining space", index);
return 0;
}
entryOffset = static_cast<uint16_t>(entryOffset + 34);
break;
}
}
Expand Down Expand Up @@ -858,7 +866,7 @@ uint16_t emberAfAttributeValueListSize(ClusterId clusterId, AttributeId attribut
{
case 0x0001: // fabrics list
// Struct _FabricDescriptor
entryLength = 18;
entryLength = 52;
break;
}
break;
Expand Down
14 changes: 11 additions & 3 deletions examples/bridge-app/bridge-common/gen/attribute-size.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ uint16_t emberAfCopyList(ClusterId clusterId, EmberAfAttributeMetadata * am, boo
{
case 0x0001: // fabrics list
{
entryLength = 18;
entryLength = 52;
if (((index - 1) * entryLength) > (am->size - entryLength))
{
ChipLogError(Zcl, "Index %l is invalid.", index);
Expand All @@ -238,7 +238,15 @@ uint16_t emberAfCopyList(ClusterId clusterId, EmberAfAttributeMetadata * am, boo
copyListMember(write ? dest : (uint8_t *) &entry->VendorId, write ? (uint8_t *) &entry->VendorId : src, write,
&entryOffset, sizeof(entry->VendorId)); // INT16U
copyListMember(write ? dest : (uint8_t *) &entry->NodeId, write ? (uint8_t *) &entry->NodeId : src, write, &entryOffset,
sizeof(entry->NodeId)); // NODE_ID
sizeof(entry->NodeId)); // NODE_ID
chip::ByteSpan * LabelSpan = &entry->Label; // OCTET_STRING
if (CHIP_NO_ERROR !=
(write ? WriteByteSpan(dest + entryOffset, 34, LabelSpan) : ReadByteSpan(src + entryOffset, 34, LabelSpan)))
{
ChipLogError(Zcl, "Index %l is invalid. Not enough remaining space", index);
return 0;
}
entryOffset = static_cast<uint16_t>(entryOffset + 34);
break;
}
}
Expand Down Expand Up @@ -462,7 +470,7 @@ uint16_t emberAfAttributeValueListSize(ClusterId clusterId, AttributeId attribut
{
case 0x0001: // fabrics list
// Struct _FabricDescriptor
entryLength = 18;
entryLength = 52;
break;
}
break;
Expand Down
1 change: 1 addition & 0 deletions examples/chip-tool/commands/clusters/Commands.h
Original file line number Diff line number Diff line change
Expand Up @@ -879,6 +879,7 @@ static void OnOperationalCredentialsFabricsListListAttributeResponse(void * cont
ChipLogProgress(chipTool, " FabricId: %" PRIu64 "", entries[i].FabricId);
ChipLogProgress(chipTool, " VendorId: %" PRIu16 "", entries[i].VendorId);
ChipLogProgress(chipTool, " NodeId: %" PRIu64 "", entries[i].NodeId);
ChipLogProgress(Zcl, " Label: %zu", entries[i].Label.size());
}

ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
Expand Down
14 changes: 11 additions & 3 deletions examples/lighting-app/lighting-common/gen/attribute-size.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ uint16_t emberAfCopyList(ClusterId clusterId, EmberAfAttributeMetadata * am, boo
{
case 0x0001: // fabrics list
{
entryLength = 18;
entryLength = 52;
if (((index - 1) * entryLength) > (am->size - entryLength))
{
ChipLogError(Zcl, "Index %l is invalid.", index);
Expand All @@ -140,7 +140,15 @@ uint16_t emberAfCopyList(ClusterId clusterId, EmberAfAttributeMetadata * am, boo
copyListMember(write ? dest : (uint8_t *) &entry->VendorId, write ? (uint8_t *) &entry->VendorId : src, write,
&entryOffset, sizeof(entry->VendorId)); // INT16U
copyListMember(write ? dest : (uint8_t *) &entry->NodeId, write ? (uint8_t *) &entry->NodeId : src, write, &entryOffset,
sizeof(entry->NodeId)); // NODE_ID
sizeof(entry->NodeId)); // NODE_ID
chip::ByteSpan * LabelSpan = &entry->Label; // OCTET_STRING
if (CHIP_NO_ERROR !=
(write ? WriteByteSpan(dest + entryOffset, 34, LabelSpan) : ReadByteSpan(src + entryOffset, 34, LabelSpan)))
{
ChipLogError(Zcl, "Index %l is invalid. Not enough remaining space", index);
return 0;
}
entryOffset = static_cast<uint16_t>(entryOffset + 34);
break;
}
}
Expand Down Expand Up @@ -334,7 +342,7 @@ uint16_t emberAfAttributeValueListSize(ClusterId clusterId, AttributeId attribut
{
case 0x0001: // fabrics list
// Struct _FabricDescriptor
entryLength = 18;
entryLength = 52;
break;
}
break;
Expand Down
2 changes: 2 additions & 0 deletions examples/lighting-app/nrfconnect/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ find_package(Zephyr HINTS $ENV{ZEPHYR_BASE})

project(chip-nrfconnect-lighting-example)

include(${CHIP_ROOT}/config/nrfconnect/app/enable-gnu-std.cmake)

target_compile_options(app PRIVATE -Werror)

target_include_directories(app PRIVATE
Expand Down
14 changes: 11 additions & 3 deletions examples/lock-app/lock-common/gen/attribute-size.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ uint16_t emberAfCopyList(ClusterId clusterId, EmberAfAttributeMetadata * am, boo
{
case 0x0001: // fabrics list
{
entryLength = 18;
entryLength = 52;
if (((index - 1) * entryLength) > (am->size - entryLength))
{
ChipLogError(Zcl, "Index %l is invalid.", index);
Expand All @@ -140,7 +140,15 @@ uint16_t emberAfCopyList(ClusterId clusterId, EmberAfAttributeMetadata * am, boo
copyListMember(write ? dest : (uint8_t *) &entry->VendorId, write ? (uint8_t *) &entry->VendorId : src, write,
&entryOffset, sizeof(entry->VendorId)); // INT16U
copyListMember(write ? dest : (uint8_t *) &entry->NodeId, write ? (uint8_t *) &entry->NodeId : src, write, &entryOffset,
sizeof(entry->NodeId)); // NODE_ID
sizeof(entry->NodeId)); // NODE_ID
chip::ByteSpan * LabelSpan = &entry->Label; // OCTET_STRING
if (CHIP_NO_ERROR !=
(write ? WriteByteSpan(dest + entryOffset, 34, LabelSpan) : ReadByteSpan(src + entryOffset, 34, LabelSpan)))
{
ChipLogError(Zcl, "Index %l is invalid. Not enough remaining space", index);
return 0;
}
entryOffset = static_cast<uint16_t>(entryOffset + 34);
break;
}
}
Expand Down Expand Up @@ -334,7 +342,7 @@ uint16_t emberAfAttributeValueListSize(ClusterId clusterId, AttributeId attribut
{
case 0x0001: // fabrics list
// Struct _FabricDescriptor
entryLength = 18;
entryLength = 52;
break;
}
break;
Expand Down
2 changes: 2 additions & 0 deletions examples/lock-app/nrfconnect/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ target_compile_options(app PRIVATE -Werror)

project(chip-nrfconnect-lock-example)

include(${CHIP_ROOT}/config/nrfconnect/app/enable-gnu-std.cmake)

target_include_directories(app PRIVATE
main/include
${LOCK_COMMON}
Expand Down
2 changes: 2 additions & 0 deletions examples/pigweed-app/nrfconnect/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ find_package(Zephyr HINTS $ENV{ZEPHYR_BASE})

project(chip-nrf52840-pigweed-example)

include(${CHIP_ROOT}/config/nrfconnect/app/enable-gnu-std.cmake)

target_compile_options(app PRIVATE -Werror)

include(${PIGWEED_ROOT}/pw_build/pigweed.cmake)
Expand Down
2 changes: 2 additions & 0 deletions examples/pump-app/nrfconnect/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ target_compile_options(app PRIVATE -Werror)

project(chip-nrfconnect-pump-example)

include(${CHIP_ROOT}/config/nrfconnect/app/enable-gnu-std.cmake)

target_include_directories(app PRIVATE
main/include
${PUMP_COMMON}
Expand Down
14 changes: 11 additions & 3 deletions examples/pump-app/pump-common/gen/attribute-size.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ uint16_t emberAfCopyList(ClusterId clusterId, EmberAfAttributeMetadata * am, boo
{
case 0x0001: // fabrics list
{
entryLength = 18;
entryLength = 52;
if (((index - 1) * entryLength) > (am->size - entryLength))
{
ChipLogError(Zcl, "Index %l is invalid.", index);
Expand All @@ -140,7 +140,15 @@ uint16_t emberAfCopyList(ClusterId clusterId, EmberAfAttributeMetadata * am, boo
copyListMember(write ? dest : (uint8_t *) &entry->VendorId, write ? (uint8_t *) &entry->VendorId : src, write,
&entryOffset, sizeof(entry->VendorId)); // INT16U
copyListMember(write ? dest : (uint8_t *) &entry->NodeId, write ? (uint8_t *) &entry->NodeId : src, write, &entryOffset,
sizeof(entry->NodeId)); // NODE_ID
sizeof(entry->NodeId)); // NODE_ID
chip::ByteSpan * LabelSpan = &entry->Label; // OCTET_STRING
if (CHIP_NO_ERROR !=
(write ? WriteByteSpan(dest + entryOffset, 34, LabelSpan) : ReadByteSpan(src + entryOffset, 34, LabelSpan)))
{
ChipLogError(Zcl, "Index %l is invalid. Not enough remaining space", index);
return 0;
}
entryOffset = static_cast<uint16_t>(entryOffset + 34);
break;
}
}
Expand Down Expand Up @@ -334,7 +342,7 @@ uint16_t emberAfAttributeValueListSize(ClusterId clusterId, AttributeId attribut
{
case 0x0001: // fabrics list
// Struct _FabricDescriptor
entryLength = 18;
entryLength = 52;
break;
}
break;
Expand Down
2 changes: 2 additions & 0 deletions examples/pump-controller-app/nrfconnect/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ target_compile_options(app PRIVATE -Werror)

project(chip-nrfconnect-pump-controller-example)

include(${CHIP_ROOT}/config/nrfconnect/app/enable-gnu-std.cmake)

target_include_directories(app PRIVATE
main/include
${PUMPC_COMMON}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ uint16_t emberAfCopyList(ClusterId clusterId, EmberAfAttributeMetadata * am, boo
{
case 0x0001: // fabrics list
{
entryLength = 18;
entryLength = 52;
if (((index - 1) * entryLength) > (am->size - entryLength))
{
ChipLogError(Zcl, "Index %l is invalid.", index);
Expand All @@ -140,7 +140,15 @@ uint16_t emberAfCopyList(ClusterId clusterId, EmberAfAttributeMetadata * am, boo
copyListMember(write ? dest : (uint8_t *) &entry->VendorId, write ? (uint8_t *) &entry->VendorId : src, write,
&entryOffset, sizeof(entry->VendorId)); // INT16U
copyListMember(write ? dest : (uint8_t *) &entry->NodeId, write ? (uint8_t *) &entry->NodeId : src, write, &entryOffset,
sizeof(entry->NodeId)); // NODE_ID
sizeof(entry->NodeId)); // NODE_ID
chip::ByteSpan * LabelSpan = &entry->Label; // OCTET_STRING
if (CHIP_NO_ERROR !=
(write ? WriteByteSpan(dest + entryOffset, 34, LabelSpan) : ReadByteSpan(src + entryOffset, 34, LabelSpan)))
{
ChipLogError(Zcl, "Index %l is invalid. Not enough remaining space", index);
return 0;
}
entryOffset = static_cast<uint16_t>(entryOffset + 34);
break;
}
}
Expand Down Expand Up @@ -334,7 +342,7 @@ uint16_t emberAfAttributeValueListSize(ClusterId clusterId, AttributeId attribut
{
case 0x0001: // fabrics list
// Struct _FabricDescriptor
entryLength = 18;
entryLength = 52;
break;
}
break;
Expand Down
2 changes: 2 additions & 0 deletions examples/shell/nrfconnect/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ find_package(Zephyr HINTS $ENV{ZEPHYR_BASE})

project(chip-nrfconnect-shell-example)

include(${CHIP_ROOT}/config/nrfconnect/app/enable-gnu-std.cmake)

target_compile_options(app PRIVATE -Werror)

target_include_directories(app PRIVATE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ uint16_t emberAfCopyList(ClusterId clusterId, EmberAfAttributeMetadata * am, boo
{
case 0x0001: // fabrics list
{
entryLength = 18;
entryLength = 52;
if (((index - 1) * entryLength) > (am->size - entryLength))
{
ChipLogError(Zcl, "Index %l is invalid.", index);
Expand All @@ -140,7 +140,15 @@ uint16_t emberAfCopyList(ClusterId clusterId, EmberAfAttributeMetadata * am, boo
copyListMember(write ? dest : (uint8_t *) &entry->VendorId, write ? (uint8_t *) &entry->VendorId : src, write,
&entryOffset, sizeof(entry->VendorId)); // INT16U
copyListMember(write ? dest : (uint8_t *) &entry->NodeId, write ? (uint8_t *) &entry->NodeId : src, write, &entryOffset,
sizeof(entry->NodeId)); // NODE_ID
sizeof(entry->NodeId)); // NODE_ID
chip::ByteSpan * LabelSpan = &entry->Label; // OCTET_STRING
if (CHIP_NO_ERROR !=
(write ? WriteByteSpan(dest + entryOffset, 34, LabelSpan) : ReadByteSpan(src + entryOffset, 34, LabelSpan)))
{
ChipLogError(Zcl, "Index %l is invalid. Not enough remaining space", index);
return 0;
}
entryOffset = static_cast<uint16_t>(entryOffset + 34);
break;
}
}
Expand Down Expand Up @@ -179,7 +187,7 @@ uint16_t emberAfAttributeValueListSize(ClusterId clusterId, AttributeId attribut
{
case 0x0001: // fabrics list
// Struct _FabricDescriptor
entryLength = 18;
entryLength = 52;
break;
}
break;
Expand Down
14 changes: 11 additions & 3 deletions examples/tv-app/tv-common/gen/attribute-size.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ uint16_t emberAfCopyList(ClusterId clusterId, EmberAfAttributeMetadata * am, boo
{
case 0x0001: // fabrics list
{
entryLength = 18;
entryLength = 52;
if (((index - 1) * entryLength) > (am->size - entryLength))
{
ChipLogError(Zcl, "Index %l is invalid.", index);
Expand All @@ -338,7 +338,15 @@ uint16_t emberAfCopyList(ClusterId clusterId, EmberAfAttributeMetadata * am, boo
copyListMember(write ? dest : (uint8_t *) &entry->VendorId, write ? (uint8_t *) &entry->VendorId : src, write,
&entryOffset, sizeof(entry->VendorId)); // INT16U
copyListMember(write ? dest : (uint8_t *) &entry->NodeId, write ? (uint8_t *) &entry->NodeId : src, write, &entryOffset,
sizeof(entry->NodeId)); // NODE_ID
sizeof(entry->NodeId)); // NODE_ID
chip::ByteSpan * LabelSpan = &entry->Label; // OCTET_STRING
if (CHIP_NO_ERROR !=
(write ? WriteByteSpan(dest + entryOffset, 34, LabelSpan) : ReadByteSpan(src + entryOffset, 34, LabelSpan)))
{
ChipLogError(Zcl, "Index %l is invalid. Not enough remaining space", index);
return 0;
}
entryOffset = static_cast<uint16_t>(entryOffset + 34);
break;
}
}
Expand Down Expand Up @@ -674,7 +682,7 @@ uint16_t emberAfAttributeValueListSize(ClusterId clusterId, AttributeId attribut
{
case 0x0001: // fabrics list
// Struct _FabricDescriptor
entryLength = 18;
entryLength = 52;
break;
}
break;
Expand Down
Loading