Skip to content

Commit

Permalink
Enable enhanced setup flow in example app
Browse files Browse the repository at this point in the history
  • Loading branch information
swan-amazon committed Jun 18, 2024
1 parent c40949a commit d6a1d76
Show file tree
Hide file tree
Showing 3 changed files with 111 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7410,11 +7410,15 @@ endpoint 0 {
callback attribute regulatoryConfig;
callback attribute locationCapability;
callback attribute supportsConcurrentConnection;
ram attribute TCAcceptedVersion;
ram attribute TCMinRequiredVersion default = 1;
ram attribute TCAcknowledgements default = 0x0000;
ram attribute TCAcknowledgementsRequired default = true;
callback attribute generatedCommandList;
callback attribute acceptedCommandList;
callback attribute eventList;
callback attribute attributeList;
ram attribute featureMap default = 0;
ram attribute featureMap default = 1;
ram attribute clusterRevision default = 1;

handle command ArmFailSafe;
Expand All @@ -7423,6 +7427,8 @@ endpoint 0 {
handle command SetRegulatoryConfigResponse;
handle command CommissioningComplete;
handle command CommissioningCompleteResponse;
handle command SetTCAcknowledgements;
handle command SetTCAcknowledgementsResponse;
}

server cluster NetworkCommissioning {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2123,6 +2123,7 @@
"define": "GENERAL_COMMISSIONING_CLUSTER",
"side": "server",
"enabled": 1,
"apiMaturity": "provisional",
"commands": [
{
"name": "ArmFailSafe",
Expand Down Expand Up @@ -2171,6 +2172,22 @@
"source": "server",
"isIncoming": 0,
"isEnabled": 1
},
{
"name": "SetTCAcknowledgements",
"code": 6,
"mfgCode": null,
"source": "client",
"isIncoming": 1,
"isEnabled": 1,
},
{
"name": "SetTCAcknowledgementsResponse",
"code": 7,
"mfgCode": null,
"source": "server",
"isIncoming": 0,
"isEnabled": 1
}
],
"attributes": [
Expand Down Expand Up @@ -2254,6 +2271,70 @@
"maxInterval": 65534,
"reportableChange": 0
},
{
"name": "TCAcceptedVersion",
"code": 5,
"mfgCode": null,
"side": "server",
"type": "int16u",
"included": 1,
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
"defaultValue": "",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
"reportableChange": 0
},
{
"name": "TCMinRequiredVersion",
"code": 6,
"mfgCode": null,
"side": "server",
"type": "int16u",
"included": 1,
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
"defaultValue": "1",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
"reportableChange": 0
},
{
"name": "TCAcknowledgements",
"code": 7,
"mfgCode": null,
"side": "server",
"type": "bitmap16",
"included": 1,
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
"defaultValue": "0x0000",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
"reportableChange": 0
},
{
"name": "TCAcknowledgementsRequired",
"code": 8,
"mfgCode": null,
"side": "server",
"type": "boolean",
"included": 1,
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
"defaultValue": "true",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
"reportableChange": 0
},
{
"name": "GeneratedCommandList",
"code": 65528,
Expand Down Expand Up @@ -2328,7 +2409,7 @@
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
"defaultValue": "0",
"defaultValue": "1",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
Expand Down
23 changes: 22 additions & 1 deletion examples/all-clusters-app/linux/include/CHIPProjectAppConfig.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
*
* Copyright (c) 2022 Project CHIP Authors
* Copyright (c) 2022-2024 Project CHIP Authors
* All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
Expand Down Expand Up @@ -51,3 +51,24 @@
// Claim a device type while advertising that matches the device type on our
// endpoint 1. 0x0101 is the "Dimmable Light" device type.
#define CHIP_DEVICE_CONFIG_DEVICE_TYPE 0x0101

/**
* @brief Configures the required terms and conditions acknowledgements.
*
* This macro defines the required terms and conditions acknowledgements bitmask. The bit-field is 16 bits long, so the possible
* value range is [0, 65535). This setting can be used to require that terms and conditions are presented to the user during
* commissioning.
*/
#define CHIP_CONFIG_TC_REQUIRED_ACKNOWLEDGEMENTS 1 // Require that terms and conditions ordinal 1 must be accepted.

/**
* @brief Configures the latest known version of the terms and conditions.
*
* This macro defines the version number of the latest terms and conditions. It allows the application to iterate on revisions of
* the terms and conditions. A value of 0 indicates that no specific version is required. This setting can be used to enforce
* version-specific terms and conditions acknowledgements in the application. When the set of terms and conditions needs to be
* changes, the version number should be monotomically increased. If the lateast terms and conditions version is updated (most
* likely during an OTA) then this may signal to the Administrator that updated terms and conditions should be presented to the
* user.
*/
#define CHIP_CONFIG_TC_REQUIRED_ACKNOWLEDGEMENTS_VERSION 1 // The current terms and conditions revision is 1.

0 comments on commit d6a1d76

Please sign in to comment.