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

Mode base sdk implementation #27504

Merged
merged 107 commits into from
Jul 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
107 commits
Select commit Hold shift + click to select a range
a54729e
Added first draft of the ModeBase SDK implementation.
hicklin Jun 18, 2023
6908df2
Fixed build files and mode base source files from mode select referen…
hicklin Jun 20, 2023
5c80241
Fixed final errors.
hicklin Jun 20, 2023
76228bd
Removed global accessor functions in place instance attributes.
hicklin Jun 21, 2023
82f47c5
Renamed internal members to mX. Replaced the use the zap Feature map …
hicklin Jun 21, 2023
43716cd
Added Command Types and DecodableTypes to the SDK implementation to b…
hicklin Jun 22, 2023
f6bcebe
Added ModeBase attributes to the list of attributeAccessInterfaceAttr…
hicklin Jun 22, 2023
bbb7a9a
Merged the mode base delegate into the mode base instance due to attr…
hicklin Jun 26, 2023
8ae44c3
Added documentation and readme for the ModeBase alias.
hicklin Jun 26, 2023
f20b88e
Added the dishwasher mode cluster to the all-clusters-app example.
hicklin Jun 27, 2023
3bf67a1
Added the laundry washer mode cluster to the all-clusters-app example.
hicklin Jun 27, 2023
f4fba96
Added the refrigerator and temperature controlled cabinet mode cluste…
hicklin Jun 27, 2023
ff44741
Renamed the mode base alias all-clusters-app examples to the correct …
hicklin Jun 27, 2023
8da546c
Implemented interaction between the ModeBase and OnOff servers. Added…
hicklin Jun 27, 2023
ac67561
Restyled by whitespace
restyled-commits Jun 27, 2023
7d86b1c
Restyled by clang-format
restyled-commits Jun 27, 2023
56fe58c
Restyled by gn
restyled-commits Jun 27, 2023
088e22c
Restyled by prettier-markdown
restyled-commits Jun 27, 2023
80ebef7
Fixed copy paste issues in the mode base cluster objects.
hicklin Jun 27, 2023
fc2081b
Moved the ModeBaseAliasesInstanceMap into the ModeBase namespace and …
hicklin Jun 27, 2023
7312989
Moved OnOff server common behavior in a top-level anonymous namespace…
hicklin Jun 28, 2023
871c0d5
Apply suggestions from code review
hicklin Jun 28, 2023
ec8fb5c
Renamed the readme
hicklin Jun 28, 2023
cbc7401
Added doc to ModeBase instance init. Removed the use of using in made…
hicklin Jun 28, 2023
4e8c870
Added validity checking when updating attributes.
hicklin Jun 28, 2023
be64a61
Made ModeBase functions that are required to be implemented by the us…
hicklin Jun 28, 2023
86ab0d3
Renamed constants according to the convention.
hicklin Jun 29, 2023
4857328
Made persistant attributes persistant. Experimented with helper acces…
hicklin Jun 30, 2023
faf5fcd
Merge branch 'master' into mode_base_sdk_implementation
hicklin Jul 7, 2023
8e09591
Fixed code after merge
hicklin Jul 7, 2023
5db2f5e
Regenerats all-clusters-app.matter after merge
hicklin Jul 7, 2023
8492df6
Restyled by clang-format
restyled-commits Jul 7, 2023
df9b3c3
Restyled by prettier-markdown
restyled-commits Jul 7, 2023
eca02ba
Merge branch 'master' into mode_base_sdk_implementation
hicklin Jul 7, 2023
6b0c322
Simplified IsSupportedMode to make it more readable.
hicklin Jul 7, 2023
7bb0605
Removed the use of using from header files.
hicklin Jul 7, 2023
8528088
Removed the use of using from mode-base-server.h.
hicklin Jul 7, 2023
7f822f5
Enabled UpdateModeBaseCurrentModeToOnMode only when the ModeBase plug…
hicklin Jul 7, 2023
04b79dd
Restyled by clang-format
restyled-commits Jul 7, 2023
445de7a
Merge branch 'master' into mode_base_sdk_implementation
hicklin Jul 7, 2023
a58701f
In the OnOff server, include mode-base only when the ModeBase plugin …
hicklin Jul 7, 2023
3a65bd7
Merge branch 'mode_base_sdk_implementation' of github.com:dysonltd/co…
hicklin Jul 7, 2023
18978c6
Fixed AliasedCluster's type
hicklin Jul 10, 2023
a83ee26
Changed to calling of Update sttribute functions when loading persist…
hicklin Jul 10, 2023
e48dfaf
Moved the ChangeToModeResponse command from the accepted commands to …
hicklin Jul 10, 2023
f4fab17
Renamed isAliasedCluster to isDerivedCluster.
hicklin Jul 10, 2023
36ef75b
Refactored the supported modes encoding to make the Read switch state…
hicklin Jul 10, 2023
ed2ede8
Fixed typos in the ModeBase readme.
hicklin Jul 10, 2023
246e378
Simplified the encoding function and some comments.
hicklin Jul 10, 2023
e184dba
Fixed var naming and GetModeLabelByIndex return.
hicklin Jul 10, 2023
ae8f0c8
Fixed incorrect version number in some ModeBase derived clusters.
hicklin Jul 10, 2023
3ba3d7a
Made mode base derived cluster code more readble with using
hicklin Jul 10, 2023
6c3d685
Removed unneccissary namespace paths.
hicklin Jul 10, 2023
913dd48
Removed unneccissary size checking.
hicklin Jul 10, 2023
af14e9d
Refactored GetModeTagsByIndex to make it more readable.
hicklin Jul 10, 2023
77907a2
Added new StatusCode.
hicklin Jul 10, 2023
f1b32c9
Used chip::CharSpan::fromCharString to avoid setting the length.
hicklin Jul 18, 2023
ee06d16
Added missing function nampspace.
hicklin Jul 18, 2023
e7c5c7b
Made the mode-base-cluster-objects.h more readable by removing unnecc…
hicklin Jul 18, 2023
8669b14
Made the mode-base-cluster-objects.h more readable by simplifying the…
hicklin Jul 18, 2023
c68d35b
Removed redundant processing in the Read function.
hicklin Jul 18, 2023
5a4f76c
Added cluster constants to make the code more readabel.
hicklin Jul 18, 2023
db7c665
Merge branch 'mode_base_sdk_implementation' of github.com:dysonltd/co…
hicklin Jul 18, 2023
c35050c
Changed attribute write errors.
hicklin Jul 18, 2023
120ef41
Added attribute getters and setters documentaton.
hicklin Jul 18, 2023
d840516
Added FeatureMap to the list of attributeAccessInterfaceAttributes.
hicklin Jul 18, 2023
f9f5a66
Used std::set instead of std::map to hold the ModeBase Instances.
hicklin Jul 18, 2023
a70bfca
Removed the BuildModeOptionStruct helper function to avoid giving inc…
hicklin Jul 18, 2023
20a9f05
Changed the Delegate's API to remove the need for the GetNumberOfMode…
hicklin Jul 18, 2023
fc0bbbf
Changed checks for essetion setup in the ModeBase init to VerifyOrDie.
hicklin Jul 19, 2023
2a5a4f0
Moved the setting of the CurrentMode based on the StartUpMode, OnMode…
hicklin Jul 19, 2023
342c0b1
Added documentation about the required lifetime of the ModeBase Insta…
hicklin Jul 19, 2023
60f5944
Refoctored ModeBase to separate out the Delegate functionality into a…
hicklin Jul 19, 2023
2af8b14
Merge branch 'master' into mode_base_sdk_implementation
hicklin Jul 19, 2023
1b18bf3
Added generated code after merge
hicklin Jul 19, 2023
855ce5b
Restyled by clang-format
restyled-commits Jul 19, 2023
a535ec2
Restyled by gn
restyled-commits Jul 19, 2023
2b12dc4
Restyled by prettier-markdown
restyled-commits Jul 19, 2023
8dec365
Added ModeBase to the spellcheck. Allowed the use of set in mode-base…
hicklin Jul 19, 2023
c41b94e
Removed the ModeBase constraint that the cluster ID given should be o…
hicklin Jul 20, 2023
7e40350
Changed the ModeBase derived cluster's instatiation in the all-cluste…
hicklin Jul 20, 2023
995bdd1
Defined EMBER_AF_PLUGIN_MODE_BASE for the linux all-clustres-app to e…
hicklin Jul 20, 2023
0b732ff
Restyled by whitespace
restyled-commits Jul 20, 2023
7767e09
Restyled by clang-format
restyled-commits Jul 20, 2023
9e9c288
Restyled by prettier-markdown
restyled-commits Jul 20, 2023
9188c44
Merge branch 'master' into mode_base_sdk_implementation
hicklin Jul 20, 2023
e530917
Fixed the lock app gni argument chip_project_config_include_dirs as i…
hicklin Jul 20, 2023
089cc55
Fixed ModeBase derived clusters version numbers in zap.
hicklin Jul 20, 2023
6370c44
Apply suggestions from code review
hicklin Jul 20, 2023
c2a110c
Updated the Mode Base readme afther review.
hicklin Jul 20, 2023
ac416b1
Removed ModeBase from the .github/.wordlist.txt
hicklin Jul 20, 2023
cc64587
Unregister the AttributeAccessOverride when deconstructing a Mode Bas…
hicklin Jul 20, 2023
0585cb4
Added // nogncheck to the Mode Base includes in the OnOff server code.
hicklin Jul 20, 2023
bec02a7
Updated Mode Base function documentatio.
hicklin Jul 20, 2023
521b61f
Added read case for the Feature Map.
hicklin Jul 20, 2023
4ae4cd7
Merge branch 'master' into mode_base_sdk_implementation
hicklin Jul 20, 2023
21ebc28
Restyled by clang-format
restyled-commits Jul 20, 2023
03726a2
Restyled by prettier-markdown
restyled-commits Jul 20, 2023
3d63a73
used the feature map's enum instead of a literal number in the Mode B…
hicklin Jul 20, 2023
04dce9d
Restyled by clang-format
restyled-commits Jul 20, 2023
97681ff
Merge branch 'master' into mode_base_sdk_implementation
hicklin Jul 20, 2023
a202e37
Fixed return bug in the Mode Base RVC examples.
hicklin Jul 21, 2023
f76029e
Update .github/workflows/build.yaml
hicklin Jul 21, 2023
4356b50
Fixed attribute get issue in the Mode Base RVC example.
hicklin Jul 21, 2023
8768d7a
Merge branch 'master' into mode_base_sdk_implementation
hicklin Jul 21, 2023
096eb5d
Checkedout out-of-sync third-party repos to match what is on master.
hicklin Jul 21, 2023
c0a9ba3
Restyled by clang-format
restyled-commits Jul 21, 2023
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
309 changes: 309 additions & 0 deletions examples/all-clusters-app/all-clusters-common/all-clusters-app.matter
Original file line number Diff line number Diff line change
Expand Up @@ -2489,6 +2489,204 @@ server cluster ModeSelect = 80 {
command ChangeToMode(ChangeToModeRequest): DefaultSuccess = 0;
}

/** Attributes and commands for selecting a mode from a list of supported options. */
server cluster LaundryWasherMode = 81 {
enum ModeTag : ENUM16 {
kNormal = 16384;
kDelicate = 16385;
kHeavy = 16386;
kWhites = 16387;
}

bitmap Feature : BITMAP32 {
kOnOff = 0x1;
}

struct ModeTagStruct {
optional vendor_id mfgCode = 0;
enum16 value = 1;
}

struct ModeOptionStruct {
char_string<64> label = 0;
int8u mode = 1;
ModeTagStruct modeTags[] = 2;
}

readonly attribute ModeOptionStruct supportedModes[] = 0;
readonly attribute int8u currentMode = 1;
attribute nullable int8u startUpMode = 2;
attribute nullable int8u onMode = 3;
readonly attribute command_id generatedCommandList[] = 65528;
readonly attribute command_id acceptedCommandList[] = 65529;
readonly attribute event_id eventList[] = 65530;
readonly attribute attrib_id attributeList[] = 65531;
readonly attribute bitmap32 featureMap = 65532;
readonly attribute int16u clusterRevision = 65533;

request struct ChangeToModeRequest {
INT8U newMode = 0;
}

response struct ChangeToModeResponse = 1 {
ENUM8 status = 0;
optional CHAR_STRING statusText = 1;
}

command ChangeToMode(ChangeToModeRequest): ChangeToModeResponse = 0;
}

/** Attributes and commands for selecting a mode from a list of supported options. */
server cluster RefrigeratorAndTemperatureControlledCabinetMode = 82 {
enum ModeTag : ENUM16 {
kRapidCool = 16384;
kRapidFreeze = 16385;
}

bitmap Feature : BITMAP32 {
kOnOff = 0x1;
}

struct ModeTagStruct {
optional vendor_id mfgCode = 0;
enum16 value = 1;
}

struct ModeOptionStruct {
char_string<64> label = 0;
int8u mode = 1;
ModeTagStruct modeTags[] = 2;
}

readonly attribute ModeOptionStruct supportedModes[] = 0;
readonly attribute int8u currentMode = 1;
attribute nullable int8u startUpMode = 2;
attribute nullable int8u onMode = 3;
readonly attribute command_id generatedCommandList[] = 65528;
readonly attribute command_id acceptedCommandList[] = 65529;
readonly attribute event_id eventList[] = 65530;
readonly attribute attrib_id attributeList[] = 65531;
readonly attribute bitmap32 featureMap = 65532;
readonly attribute int16u clusterRevision = 65533;

request struct ChangeToModeRequest {
INT8U newMode = 0;
}

response struct ChangeToModeResponse = 1 {
ENUM8 status = 0;
optional CHAR_STRING statusText = 1;
}

command ChangeToMode(ChangeToModeRequest): ChangeToModeResponse = 0;
}

/** Attributes and commands for selecting a mode from a list of supported options. */
server cluster RvcRunMode = 84 {
enum ModeTag : ENUM16 {
kIdle = 16384;
kCleaning = 16385;
}

enum StatusCode : ENUM8 {
kStuck = 65;
kDustBinMissing = 66;
kDustBinFull = 67;
kWaterTankEmpty = 68;
kWaterTankMissing = 69;
kWaterTankLidOpen = 70;
kMopCleaningPadMissing = 71;
kBatteryLow = 72;
}

bitmap Feature : BITMAP32 {
kOnOff = 0x1;
}

struct ModeTagStruct {
optional vendor_id mfgCode = 0;
enum16 value = 1;
}

struct ModeOptionStruct {
char_string<64> label = 0;
int8u mode = 1;
ModeTagStruct modeTags[] = 2;
}

readonly attribute ModeOptionStruct supportedModes[] = 0;
readonly attribute int8u currentMode = 1;
attribute nullable int8u startUpMode = 2;
attribute nullable int8u onMode = 3;
readonly attribute command_id generatedCommandList[] = 65528;
readonly attribute command_id acceptedCommandList[] = 65529;
readonly attribute event_id eventList[] = 65530;
readonly attribute attrib_id attributeList[] = 65531;
readonly attribute bitmap32 featureMap = 65532;
readonly attribute int16u clusterRevision = 65533;

request struct ChangeToModeRequest {
INT8U newMode = 0;
}

response struct ChangeToModeResponse = 1 {
ENUM8 status = 0;
optional CHAR_STRING statusText = 1;
}

command ChangeToMode(ChangeToModeRequest): ChangeToModeResponse = 0;
}

/** Attributes and commands for selecting a mode from a list of supported options. */
server cluster RvcCleanMode = 85 {
enum ModeTag : ENUM16 {
kDeepClean = 16384;
kVacuum = 16385;
kMop = 16386;
}

enum StatusCode : ENUM8 {
kCleaningInProgress = 64;
}

bitmap Feature : BITMAP32 {
kOnOff = 0x1;
}

struct ModeTagStruct {
optional vendor_id mfgCode = 0;
enum16 value = 1;
}

struct ModeOptionStruct {
char_string<64> label = 0;
int8u mode = 1;
ModeTagStruct modeTags[] = 2;
}

readonly attribute ModeOptionStruct supportedModes[] = 0;
readonly attribute int8u currentMode = 1;
attribute nullable int8u startUpMode = 2;
attribute nullable int8u onMode = 3;
readonly attribute command_id generatedCommandList[] = 65528;
readonly attribute command_id acceptedCommandList[] = 65529;
readonly attribute event_id eventList[] = 65530;
readonly attribute attrib_id attributeList[] = 65531;
readonly attribute bitmap32 featureMap = 65532;
readonly attribute int16u clusterRevision = 65533;

request struct ChangeToModeRequest {
INT8U newMode = 0;
}

response struct ChangeToModeResponse = 1 {
ENUM8 status = 0;
optional CHAR_STRING statusText = 1;
}

command ChangeToMode(ChangeToModeRequest): ChangeToModeResponse = 0;
}

/** Attributes and commands for configuring the temperature control, and reporting temperature. */
server cluster TemperatureControl = 86 {
bitmap Feature : BITMAP32 {
Expand Down Expand Up @@ -2538,6 +2736,52 @@ server cluster RefrigeratorAlarm = 87 {
readonly attribute int16u clusterRevision = 65533;
}

/** Attributes and commands for selecting a mode from a list of supported options. */
server cluster DishwasherMode = 89 {
enum ModeTag : ENUM16 {
kNormal = 16384;
kHeavy = 16385;
kLight = 16386;
}

bitmap Feature : BITMAP32 {
kOnOff = 0x1;
}

struct ModeTagStruct {
optional vendor_id mfgCode = 0;
enum16 value = 1;
}

struct ModeOptionStruct {
char_string<64> label = 0;
int8u mode = 1;
ModeTagStruct modeTags[] = 2;
}

readonly attribute ModeOptionStruct supportedModes[] = 0;
readonly attribute int8u currentMode = 1;
attribute nullable int8u startUpMode = 2;
attribute nullable int8u onMode = 3;
readonly attribute command_id generatedCommandList[] = 65528;
readonly attribute command_id acceptedCommandList[] = 65529;
readonly attribute event_id eventList[] = 65530;
readonly attribute attrib_id attributeList[] = 65531;
readonly attribute bitmap32 featureMap = 65532;
readonly attribute int16u clusterRevision = 65533;

request struct ChangeToModeRequest {
INT8U newMode = 0;
}

response struct ChangeToModeResponse = 1 {
ENUM8 status = 0;
optional CHAR_STRING statusText = 1;
}

command ChangeToMode(ChangeToModeRequest): ChangeToModeResponse = 0;
}

/** Attributes for reporting air quality classification */
server cluster AirQuality = 91 {
enum AirQualityEnum : ENUM8 {
Expand Down Expand Up @@ -6243,6 +6487,58 @@ endpoint 1 {
ram attribute manufacturerExtension default = 255;
}

server cluster LaundryWasherMode {
callback attribute supportedModes;
callback attribute currentMode;
callback attribute startUpMode;
callback attribute onMode;
callback attribute generatedCommandList;
callback attribute acceptedCommandList;
callback attribute eventList;
callback attribute attributeList;
ram attribute featureMap default = 0;
ram attribute clusterRevision default = 1;
}

server cluster RefrigeratorAndTemperatureControlledCabinetMode {
callback attribute supportedModes;
callback attribute currentMode;
callback attribute startUpMode;
callback attribute onMode;
callback attribute generatedCommandList;
callback attribute acceptedCommandList;
callback attribute eventList;
callback attribute attributeList;
ram attribute featureMap default = 0;
ram attribute clusterRevision default = 1;
}

server cluster RvcRunMode {
callback attribute supportedModes;
callback attribute currentMode;
callback attribute startUpMode;
callback attribute onMode;
callback attribute generatedCommandList;
callback attribute acceptedCommandList;
callback attribute eventList;
callback attribute attributeList;
ram attribute featureMap default = 0;
ram attribute clusterRevision default = 1;
}

server cluster RvcCleanMode {
callback attribute supportedModes;
callback attribute currentMode;
callback attribute startUpMode;
callback attribute onMode;
callback attribute generatedCommandList;
callback attribute acceptedCommandList;
callback attribute eventList;
callback attribute attributeList;
ram attribute featureMap default = 0;
ram attribute clusterRevision default = 1;
}

server cluster TemperatureControl {
ram attribute selectedTemperatureLevel default = 0;
callback attribute supportedTemperatureLevels;
Expand All @@ -6267,6 +6563,19 @@ endpoint 1 {
ram attribute clusterRevision default = 1;
}

server cluster DishwasherMode {
callback attribute supportedModes;
callback attribute currentMode;
callback attribute startUpMode;
callback attribute onMode;
callback attribute generatedCommandList;
callback attribute acceptedCommandList;
callback attribute eventList;
callback attribute attributeList;
ram attribute featureMap default = 0;
ram attribute clusterRevision default = 1;
}

server cluster AirQuality {
ram attribute airQuality default = 0;
callback attribute generatedCommandList;
Expand Down
Loading