Skip to content

Commit

Permalink
[NXP] Add wifi/tread/software diagnostics support, apply wifi tests f…
Browse files Browse the repository at this point in the history
…ixes, add second BR interface (#35820)

* [NXP][platform][common] Fix test TC CNET 4.9: failed to remove wifi network

Signed-off-by: Martin Girardot <[email protected]>

* [NXP][platform][common] Fix TC-CNET-4.11 test

Signed-off-by: Martin Girardot <[email protected]>

* [NXP][platform][common] Add wifi diagnostics and Software Diagnostics, use wlan API instead of wifi

Signed-off-by: Martin Girardot <[email protected]>

* [NXP][zap][thermostat] Add Software, wifi and OT Diagnostics

Signed-off-by: Martin Girardot <[email protected]>

* [NXP][examples][thermostat] Update secondary nwk if cluster location in ZAP

This commit updates the location of the secondary network interface in the zap
 file according to Matter 1.4 spec desciption. When both SNI and TBRM
clusters are present, they are set on the same endpoint.

Signed-off-by: Marius Preda <[email protected]>

* [NXP] Enable wifi/thread/software diagnostics

Signed-off-by: Martin Girardot <[email protected]>

* [NXP] add support of new wifi diagnostics, only available with sdk 2.16.100

Signed-off-by: Martin Girardot <[email protected]>

* Restyled by clang-format

* [NXP] Update zap to add new wifi diagnostics

Signed-off-by: Martin Girardot <[email protected]>

* [NXP] Fix BR zap according to PR comments

Signed-off-by: Martin Girardot <[email protected]>

---------

Signed-off-by: Martin Girardot <[email protected]>
Signed-off-by: Marius Preda <[email protected]>
Co-authored-by: Marius Preda <[email protected]>
Co-authored-by: Restyled.io <[email protected]>
  • Loading branch information
3 people committed Oct 1, 2024
1 parent 3b9df6d commit d404400
Show file tree
Hide file tree
Showing 11 changed files with 2,352 additions and 1,260 deletions.
332 changes: 138 additions & 194 deletions examples/thermostat/nxp/zap/thermostat_matter_br.matter

Large diffs are not rendered by default.

2,351 changes: 1,351 additions & 1,000 deletions examples/thermostat/nxp/zap/thermostat_matter_br.zap

Large diffs are not rendered by default.

52 changes: 52 additions & 0 deletions examples/thermostat/nxp/zap/thermostat_matter_thread.matter
Original file line number Diff line number Diff line change
Expand Up @@ -1269,6 +1269,43 @@ cluster GeneralDiagnostics = 51 {
command PayloadTestRequest(PayloadTestRequestRequest): PayloadTestResponse = 3;
}

/** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */
cluster SoftwareDiagnostics = 52 {
revision 1; // NOTE: Default/not specifically set

bitmap Feature : bitmap32 {
kWatermarks = 0x1;
}

struct ThreadMetricsStruct {
int64u id = 0;
optional char_string<8> name = 1;
optional int32u stackFreeCurrent = 2;
optional int32u stackFreeMinimum = 3;
optional int32u stackSize = 4;
}

info event SoftwareFault = 0 {
int64u id = 0;
optional char_string name = 1;
optional octet_string faultRecording = 2;
}

readonly attribute optional ThreadMetricsStruct threadMetrics[] = 0;
readonly attribute optional int64u currentHeapFree = 1;
readonly attribute optional int64u currentHeapUsed = 2;
readonly attribute optional int64u currentHeapHighWatermark = 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;

/** Reception of this command SHALL reset the values: The StackFreeMinimum field of the ThreadMetrics attribute, CurrentHeapHighWaterMark attribute. */
command access(invoke: manage) ResetWatermarks(): DefaultSuccess = 0;
}

/** The Thread Network Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems */
cluster ThreadNetworkDiagnostics = 53 {
revision 2;
Expand Down Expand Up @@ -2233,7 +2270,22 @@ endpoint 0 {
handle command TimeSnapshotResponse;
}

server cluster SoftwareDiagnostics {
callback attribute threadMetrics;
callback attribute currentHeapFree;
callback attribute currentHeapUsed;
callback attribute currentHeapHighWatermark;
callback attribute generatedCommandList;
callback attribute acceptedCommandList;
callback attribute eventList;
callback attribute attributeList;
callback attribute featureMap;
ram attribute clusterRevision default = 1;
}

server cluster ThreadNetworkDiagnostics {
emits event ConnectionStatus;
emits event NetworkFaultChange;
callback attribute channel;
callback attribute routingRole;
callback attribute networkName;
Expand Down
186 changes: 186 additions & 0 deletions examples/thermostat/nxp/zap/thermostat_matter_thread.zap
Original file line number Diff line number Diff line change
Expand Up @@ -1848,6 +1848,176 @@
}
]
},
{
"name": "Software Diagnostics",
"code": 52,
"mfgCode": null,
"define": "SOFTWARE_DIAGNOSTICS_CLUSTER",
"side": "server",
"enabled": 1,
"attributes": [
{
"name": "ThreadMetrics",
"code": 0,
"mfgCode": null,
"side": "server",
"type": "array",
"included": 1,
"storageOption": "External",
"singleton": 0,
"bounded": 0,
"defaultValue": null,
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
"reportableChange": 0
},
{
"name": "CurrentHeapFree",
"code": 1,
"mfgCode": null,
"side": "server",
"type": "int64u",
"included": 1,
"storageOption": "External",
"singleton": 0,
"bounded": 0,
"defaultValue": null,
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
"reportableChange": 0
},
{
"name": "CurrentHeapUsed",
"code": 2,
"mfgCode": null,
"side": "server",
"type": "int64u",
"included": 1,
"storageOption": "External",
"singleton": 0,
"bounded": 0,
"defaultValue": null,
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
"reportableChange": 0
},
{
"name": "CurrentHeapHighWatermark",
"code": 3,
"mfgCode": null,
"side": "server",
"type": "int64u",
"included": 1,
"storageOption": "External",
"singleton": 0,
"bounded": 0,
"defaultValue": null,
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
"reportableChange": 0
},
{
"name": "GeneratedCommandList",
"code": 65528,
"mfgCode": null,
"side": "server",
"type": "array",
"included": 1,
"storageOption": "External",
"singleton": 0,
"bounded": 0,
"defaultValue": null,
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
"reportableChange": 0
},
{
"name": "AcceptedCommandList",
"code": 65529,
"mfgCode": null,
"side": "server",
"type": "array",
"included": 1,
"storageOption": "External",
"singleton": 0,
"bounded": 0,
"defaultValue": null,
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
"reportableChange": 0
},
{
"name": "EventList",
"code": 65530,
"mfgCode": null,
"side": "server",
"type": "array",
"included": 1,
"storageOption": "External",
"singleton": 0,
"bounded": 0,
"defaultValue": null,
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
"reportableChange": 0
},
{
"name": "AttributeList",
"code": 65531,
"mfgCode": null,
"side": "server",
"type": "array",
"included": 1,
"storageOption": "External",
"singleton": 0,
"bounded": 0,
"defaultValue": null,
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
"reportableChange": 0
},
{
"name": "FeatureMap",
"code": 65532,
"mfgCode": null,
"side": "server",
"type": "bitmap32",
"included": 1,
"storageOption": "External",
"singleton": 0,
"bounded": 0,
"defaultValue": null,
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
"reportableChange": 0
},
{
"name": "ClusterRevision",
"code": 65533,
"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": "Thread Network Diagnostics",
"code": 53,
Expand Down Expand Up @@ -2954,6 +3124,22 @@
"maxInterval": 65344,
"reportableChange": 0
}
],
"events": [
{
"name": "ConnectionStatus",
"code": 0,
"mfgCode": null,
"side": "server",
"included": 1
},
{
"name": "NetworkFaultChange",
"code": 1,
"mfgCode": null,
"side": "server",
"included": 1
}
]
},
{
Expand Down
62 changes: 62 additions & 0 deletions examples/thermostat/nxp/zap/thermostat_matter_wifi.matter
Original file line number Diff line number Diff line change
Expand Up @@ -1269,6 +1269,43 @@ cluster GeneralDiagnostics = 51 {
command PayloadTestRequest(PayloadTestRequestRequest): PayloadTestResponse = 3;
}

/** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */
cluster SoftwareDiagnostics = 52 {
revision 1; // NOTE: Default/not specifically set

bitmap Feature : bitmap32 {
kWatermarks = 0x1;
}

struct ThreadMetricsStruct {
int64u id = 0;
optional char_string<8> name = 1;
optional int32u stackFreeCurrent = 2;
optional int32u stackFreeMinimum = 3;
optional int32u stackSize = 4;
}

info event SoftwareFault = 0 {
int64u id = 0;
optional char_string name = 1;
optional octet_string faultRecording = 2;
}

readonly attribute optional ThreadMetricsStruct threadMetrics[] = 0;
readonly attribute optional int64u currentHeapFree = 1;
readonly attribute optional int64u currentHeapUsed = 2;
readonly attribute optional int64u currentHeapHighWatermark = 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;

/** Reception of this command SHALL reset the values: The StackFreeMinimum field of the ThreadMetrics attribute, CurrentHeapHighWaterMark attribute. */
command access(invoke: manage) ResetWatermarks(): DefaultSuccess = 0;
}

/** The Wi-Fi Network Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */
cluster WiFiNetworkDiagnostics = 54 {
revision 1; // NOTE: Default/not specifically set
Expand Down Expand Up @@ -2143,19 +2180,44 @@ endpoint 0 {
handle command TimeSnapshotResponse;
}

server cluster SoftwareDiagnostics {
callback attribute threadMetrics;
callback attribute currentHeapFree;
callback attribute currentHeapUsed;
callback attribute currentHeapHighWatermark;
callback attribute generatedCommandList;
callback attribute acceptedCommandList;
callback attribute eventList;
callback attribute attributeList;
callback attribute featureMap;
ram attribute clusterRevision default = 1;
}

server cluster WiFiNetworkDiagnostics {
emits event Disconnection;
emits event AssociationFailure;
emits event ConnectionStatus;
callback attribute bssid;
callback attribute securityType;
callback attribute wiFiVersion;
callback attribute channelNumber;
callback attribute rssi;
callback attribute beaconLostCount;
callback attribute beaconRxCount;
callback attribute packetMulticastRxCount;
callback attribute packetMulticastTxCount;
callback attribute packetUnicastRxCount;
callback attribute packetUnicastTxCount;
callback attribute currentMaxRate;
callback attribute overrunCount;
callback attribute generatedCommandList;
callback attribute acceptedCommandList;
callback attribute eventList;
callback attribute attributeList;
ram attribute featureMap default = 0;
ram attribute clusterRevision default = 1;

handle command ResetCounts;
}

server cluster AdministratorCommissioning {
Expand Down
Loading

0 comments on commit d404400

Please sign in to comment.