Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
 into 13501-allow-split-commissioner-admin
  • Loading branch information
msandstedt committed Jan 25, 2022
2 parents c34cf0b + de95567 commit 354c8f3
Show file tree
Hide file tree
Showing 62 changed files with 2,134 additions and 264 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2607,6 +2607,8 @@ server cluster TestCluster = 1295 {
readonly attribute LONG_OCTET_STRING listLongOctetString[] = 42;
readonly attribute TestFabricScoped listFabricScoped[] = 43;
attribute boolean timedWriteBoolean = 48;
attribute boolean generalErrorBoolean = 49;
attribute boolean clusterErrorBoolean = 50;
attribute nullable boolean nullableBoolean = 32768;
attribute nullable bitmap8 nullableBitmap8 = 32769;
attribute nullable bitmap16 nullableBitmap16 = 32770;
Expand Down
41 changes: 36 additions & 5 deletions examples/all-clusters-app/all-clusters-common/all-clusters-app.zap
Original file line number Diff line number Diff line change
Expand Up @@ -1718,7 +1718,7 @@
"reportableChange": 0
},
{
"name": "CalendarType",
"name": "ActiveCalendarType",
"code": 1,
"mfgCode": null,
"side": "server",
Expand Down Expand Up @@ -16549,6 +16549,36 @@
"maxInterval": 65534,
"reportableChange": 0
},
{
"name": "general_error_boolean",
"code": 49,
"mfgCode": null,
"side": "server",
"included": 1,
"storageOption": "External",
"singleton": 0,
"bounded": 0,
"defaultValue": "",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
"reportableChange": 0
},
{
"name": "cluster_error_boolean",
"code": 50,
"mfgCode": null,
"side": "server",
"included": 1,
"storageOption": "External",
"singleton": 0,
"bounded": 0,
"defaultValue": "",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
"reportableChange": 0
},
{
"name": "unsupported",
"code": 255,
Expand Down Expand Up @@ -17069,7 +17099,7 @@
"singleton": 0,
"bounded": 0,
"defaultValue": "",
"reportable": 0,
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
"reportableChange": 0
Expand All @@ -17084,7 +17114,7 @@
"singleton": 0,
"bounded": 0,
"defaultValue": "0",
"reportable": 0,
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
"reportableChange": 0
Expand Down Expand Up @@ -20465,5 +20495,6 @@
"endpointVersion": 1,
"deviceIdentifier": 256
}
]
}
],
"log": []
}
11 changes: 8 additions & 3 deletions examples/chip-tool/commands/common/CommandInvoker.h
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,8 @@ class CommandInvoker final : public ResponseReceiver<typename RequestType::Respo
return CHIP_NO_ERROR;
}

CHIP_ERROR InvokeGroupCommand(Messaging::ExchangeManager * exchangeManager, GroupId groupId, const RequestType & aRequestData)
CHIP_ERROR InvokeGroupCommand(Messaging::ExchangeManager * exchangeManager, FabricIndex fabric, GroupId groupId,
const RequestType & aRequestData)
{
app::CommandPathParams commandPath = { 0 /* endpoint */, groupId, RequestType::GetClusterId(), RequestType::GetCommandId(),
(app::CommandPathFlags::kGroupIdValid) };
Expand All @@ -116,7 +117,7 @@ class CommandInvoker final : public ResponseReceiver<typename RequestType::Respo

ReturnErrorOnFailure(commandSender->AddRequestData(commandPath, aRequestData));

Optional<SessionHandle> session = exchangeManager->GetSessionManager()->CreateGroupSession(groupId);
Optional<SessionHandle> session = exchangeManager->GetSessionManager()->CreateGroupSession(groupId, fabric);
if (!session.HasValue())
{
return CHIP_ERROR_NO_MEMORY;
Expand Down Expand Up @@ -231,7 +232,11 @@ CHIP_ERROR InvokeGroupCommand(DeviceProxy * aDevice, void * aContext,

// invoker will be deleted by the onDone call before the return of InvokeGroupCommand
// invoker should not be used after the InvokeGroupCommand call
ReturnErrorOnFailure(invoker->InvokeGroupCommand(aDevice->GetExchangeManager(), groupId, aRequestData));
//
// We assume the aDevice already has a Case session which is way we can use he established Secure Session
ReturnErrorOnFailure(invoker->InvokeGroupCommand(aDevice->GetExchangeManager(),
aDevice->GetSecureSession().Value()->AsSecureSession()->GetFabricIndex(),
groupId, aRequestData));

// invoker is already deleted and is not to be used
invoker.release();
Expand Down
1 change: 1 addition & 0 deletions examples/lighting-app/esp32/main/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ idf_component_register(PRIV_INCLUDE_DIRS
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/user-label-server"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/wifi-network-diagnostics-server"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/ota-requestor"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/groups-server"
PRIV_REQUIRES chip QRCode bt led_strip app_update)

set_property(TARGET ${COMPONENT_LIB} PROPERTY CXX_STANDARD 17)
Expand Down
57 changes: 57 additions & 0 deletions examples/lighting-app/lighting-common/lighting-app.matter
Original file line number Diff line number Diff line change
Expand Up @@ -542,6 +542,61 @@ server cluster GeneralDiagnostics = 51 {
readonly global attribute int16u clusterRevision = 65533;
}

server cluster Groups = 4 {
readonly attribute bitmap8 nameSupport = 0;
readonly global attribute int16u clusterRevision = 65533;

request struct AddGroupRequest {
INT16U groupId = 0;
CHAR_STRING groupName = 1;
}

request struct AddGroupIfIdentifyingRequest {
INT16U groupId = 0;
CHAR_STRING groupName = 1;
}

request struct GetGroupMembershipRequest {
INT16U groupList[] = 0;
}

request struct RemoveGroupRequest {
INT16U groupId = 0;
}

request struct ViewGroupRequest {
INT16U groupId = 0;
}

response struct AddGroupResponse {
ENUM8 status = 0;
INT16U groupId = 1;
}

response struct GetGroupMembershipResponse {
INT8U capacity = 0;
INT16U groupList[] = 1;
}

response struct RemoveGroupResponse {
ENUM8 status = 0;
INT16U groupId = 1;
}

response struct ViewGroupResponse {
ENUM8 status = 0;
INT16U groupId = 1;
CHAR_STRING groupName = 2;
}

command AddGroup(AddGroupRequest): AddGroupResponse = 0;
command AddGroupIfIdentifying(AddGroupIfIdentifyingRequest): DefaultSuccess = 5;
command GetGroupMembership(GetGroupMembershipRequest): GetGroupMembershipResponse = 2;
command RemoveAllGroups(): DefaultSuccess = 4;
command RemoveGroup(RemoveGroupRequest): RemoveGroupResponse = 3;
command ViewGroup(ViewGroupRequest): ViewGroupResponse = 1;
}

server cluster Identify = 3 {
enum IdentifyEffectIdentifier : ENUM8 {
kBlink = 0;
Expand Down Expand Up @@ -1424,6 +1479,7 @@ endpoint 0 {
server cluster FixedLabel;
server cluster GeneralCommissioning;
server cluster GeneralDiagnostics;
server cluster Groups;
server cluster LocalizationConfiguration;
server cluster NetworkCommissioning;
binding cluster OtaSoftwareUpdateProvider;
Expand All @@ -1440,6 +1496,7 @@ endpoint 0 {
endpoint 1 {
server cluster ColorControl;
server cluster Descriptor;
server cluster Groups;
server cluster Identify;
server cluster LevelControl;
server cluster OccupancySensing;
Expand Down
24 changes: 22 additions & 2 deletions examples/lighting-app/lighting-common/lighting-app.zap
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@
"mfgCode": null,
"define": "GROUPS_CLUSTER",
"side": "server",
"enabled": 0,
"enabled": 1,
"commands": [
{
"name": "AddGroupResponse",
Expand Down Expand Up @@ -4653,7 +4653,7 @@
"mfgCode": null,
"define": "GROUPS_CLUSTER",
"side": "server",
"enabled": 0,
"enabled": 1,
"commands": [
{
"name": "AddGroupResponse",
Expand Down Expand Up @@ -6734,6 +6734,26 @@
}
]
},
{
"name": "Groups",
"code": 4,
"mfgCode": null,
"define": "GROUPS_CLUSTER",
"side": "client",
"enabled": 0,
"commands": [],
"attributes": []
},
{
"name": "Groups",
"code": 4,
"mfgCode": null,
"define": "GROUPS_CLUSTER",
"side": "server",
"enabled": 0,
"commands": [],
"attributes": []
},
{
"name": "On/Off",
"code": 6,
Expand Down
1 change: 1 addition & 0 deletions examples/lighting-app/mbed/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ target_sources(${APP_TARGET} PRIVATE
${CHIP_ROOT}/src/app/clusters/ota-requestor/ota-requestor-server.cpp
${CHIP_ROOT}/src/app/clusters/ota-requestor/BDXDownloader.cpp
${CHIP_ROOT}/src/app/clusters/ota-requestor/OTARequestor.cpp
${CHIP_ROOT}/src/app/clusters/groups-server/groups-server.cpp
)

target_link_libraries(${APP_TARGET} mbed-os-posix-socket mbed-os mbed-ble mbed-events mbed-netsocket mbed-storage mbed-storage-kv-global-api mbed-mbedtls mbed-emac chip)
Expand Down
1 change: 1 addition & 0 deletions examples/lighting-app/telink/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -100,4 +100,5 @@ target_sources(app PRIVATE
${CHIP_ROOT}/src/app/clusters/ota-requestor/ota-requestor-server.cpp
${CHIP_ROOT}/src/app/clusters/ota-requestor/BDXDownloader.cpp
${CHIP_ROOT}/src/app/clusters/ota-requestor/OTARequestor.cpp
${CHIP_ROOT}/src/app/clusters/groups-server/groups-server.cpp
)
Loading

0 comments on commit 354c8f3

Please sign in to comment.