Skip to content

Commit d404400

Browse files
Martin-NXPmarius-predarestyled-commits
authored
[NXP] Add wifi/tread/software diagnostics support, apply wifi tests fixes, add second BR interface (project-chip#35820)
* [NXP][platform][common] Fix test TC CNET 4.9: failed to remove wifi network Signed-off-by: Martin Girardot <martin.girardot@nxp.com> * [NXP][platform][common] Fix TC-CNET-4.11 test Signed-off-by: Martin Girardot <martin.girardot@nxp.com> * [NXP][platform][common] Add wifi diagnostics and Software Diagnostics, use wlan API instead of wifi Signed-off-by: Martin Girardot <martin.girardot@nxp.com> * [NXP][zap][thermostat] Add Software, wifi and OT Diagnostics Signed-off-by: Martin Girardot <martin.girardot@nxp.com> * [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 <marius.preda@nxp.com> * [NXP] Enable wifi/thread/software diagnostics Signed-off-by: Martin Girardot <martin.girardot@nxp.com> * [NXP] add support of new wifi diagnostics, only available with sdk 2.16.100 Signed-off-by: Martin Girardot <martin.girardot@nxp.com> * Restyled by clang-format * [NXP] Update zap to add new wifi diagnostics Signed-off-by: Martin Girardot <martin.girardot@nxp.com> * [NXP] Fix BR zap according to PR comments Signed-off-by: Martin Girardot <martin.girardot@nxp.com> --------- Signed-off-by: Martin Girardot <martin.girardot@nxp.com> Signed-off-by: Marius Preda <marius.preda@nxp.com> Co-authored-by: Marius Preda <marius.preda@nxp.com> Co-authored-by: Restyled.io <commits@restyled.io>
1 parent 3b9df6d commit d404400

11 files changed

+2352
-1260
lines changed

examples/thermostat/nxp/zap/thermostat_matter_br.matter

+138-194
Large diffs are not rendered by default.

examples/thermostat/nxp/zap/thermostat_matter_br.zap

+1,351-1,000
Large diffs are not rendered by default.

examples/thermostat/nxp/zap/thermostat_matter_thread.matter

+52
Original file line numberDiff line numberDiff line change
@@ -1269,6 +1269,43 @@ cluster GeneralDiagnostics = 51 {
12691269
command PayloadTestRequest(PayloadTestRequestRequest): PayloadTestResponse = 3;
12701270
}
12711271

1272+
/** 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. */
1273+
cluster SoftwareDiagnostics = 52 {
1274+
revision 1; // NOTE: Default/not specifically set
1275+
1276+
bitmap Feature : bitmap32 {
1277+
kWatermarks = 0x1;
1278+
}
1279+
1280+
struct ThreadMetricsStruct {
1281+
int64u id = 0;
1282+
optional char_string<8> name = 1;
1283+
optional int32u stackFreeCurrent = 2;
1284+
optional int32u stackFreeMinimum = 3;
1285+
optional int32u stackSize = 4;
1286+
}
1287+
1288+
info event SoftwareFault = 0 {
1289+
int64u id = 0;
1290+
optional char_string name = 1;
1291+
optional octet_string faultRecording = 2;
1292+
}
1293+
1294+
readonly attribute optional ThreadMetricsStruct threadMetrics[] = 0;
1295+
readonly attribute optional int64u currentHeapFree = 1;
1296+
readonly attribute optional int64u currentHeapUsed = 2;
1297+
readonly attribute optional int64u currentHeapHighWatermark = 3;
1298+
readonly attribute command_id generatedCommandList[] = 65528;
1299+
readonly attribute command_id acceptedCommandList[] = 65529;
1300+
readonly attribute event_id eventList[] = 65530;
1301+
readonly attribute attrib_id attributeList[] = 65531;
1302+
readonly attribute bitmap32 featureMap = 65532;
1303+
readonly attribute int16u clusterRevision = 65533;
1304+
1305+
/** Reception of this command SHALL reset the values: The StackFreeMinimum field of the ThreadMetrics attribute, CurrentHeapHighWaterMark attribute. */
1306+
command access(invoke: manage) ResetWatermarks(): DefaultSuccess = 0;
1307+
}
1308+
12721309
/** 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 */
12731310
cluster ThreadNetworkDiagnostics = 53 {
12741311
revision 2;
@@ -2233,7 +2270,22 @@ endpoint 0 {
22332270
handle command TimeSnapshotResponse;
22342271
}
22352272

2273+
server cluster SoftwareDiagnostics {
2274+
callback attribute threadMetrics;
2275+
callback attribute currentHeapFree;
2276+
callback attribute currentHeapUsed;
2277+
callback attribute currentHeapHighWatermark;
2278+
callback attribute generatedCommandList;
2279+
callback attribute acceptedCommandList;
2280+
callback attribute eventList;
2281+
callback attribute attributeList;
2282+
callback attribute featureMap;
2283+
ram attribute clusterRevision default = 1;
2284+
}
2285+
22362286
server cluster ThreadNetworkDiagnostics {
2287+
emits event ConnectionStatus;
2288+
emits event NetworkFaultChange;
22372289
callback attribute channel;
22382290
callback attribute routingRole;
22392291
callback attribute networkName;

examples/thermostat/nxp/zap/thermostat_matter_thread.zap

+186
Original file line numberDiff line numberDiff line change
@@ -1848,6 +1848,176 @@
18481848
}
18491849
]
18501850
},
1851+
{
1852+
"name": "Software Diagnostics",
1853+
"code": 52,
1854+
"mfgCode": null,
1855+
"define": "SOFTWARE_DIAGNOSTICS_CLUSTER",
1856+
"side": "server",
1857+
"enabled": 1,
1858+
"attributes": [
1859+
{
1860+
"name": "ThreadMetrics",
1861+
"code": 0,
1862+
"mfgCode": null,
1863+
"side": "server",
1864+
"type": "array",
1865+
"included": 1,
1866+
"storageOption": "External",
1867+
"singleton": 0,
1868+
"bounded": 0,
1869+
"defaultValue": null,
1870+
"reportable": 1,
1871+
"minInterval": 1,
1872+
"maxInterval": 65534,
1873+
"reportableChange": 0
1874+
},
1875+
{
1876+
"name": "CurrentHeapFree",
1877+
"code": 1,
1878+
"mfgCode": null,
1879+
"side": "server",
1880+
"type": "int64u",
1881+
"included": 1,
1882+
"storageOption": "External",
1883+
"singleton": 0,
1884+
"bounded": 0,
1885+
"defaultValue": null,
1886+
"reportable": 1,
1887+
"minInterval": 1,
1888+
"maxInterval": 65534,
1889+
"reportableChange": 0
1890+
},
1891+
{
1892+
"name": "CurrentHeapUsed",
1893+
"code": 2,
1894+
"mfgCode": null,
1895+
"side": "server",
1896+
"type": "int64u",
1897+
"included": 1,
1898+
"storageOption": "External",
1899+
"singleton": 0,
1900+
"bounded": 0,
1901+
"defaultValue": null,
1902+
"reportable": 1,
1903+
"minInterval": 1,
1904+
"maxInterval": 65534,
1905+
"reportableChange": 0
1906+
},
1907+
{
1908+
"name": "CurrentHeapHighWatermark",
1909+
"code": 3,
1910+
"mfgCode": null,
1911+
"side": "server",
1912+
"type": "int64u",
1913+
"included": 1,
1914+
"storageOption": "External",
1915+
"singleton": 0,
1916+
"bounded": 0,
1917+
"defaultValue": null,
1918+
"reportable": 1,
1919+
"minInterval": 1,
1920+
"maxInterval": 65534,
1921+
"reportableChange": 0
1922+
},
1923+
{
1924+
"name": "GeneratedCommandList",
1925+
"code": 65528,
1926+
"mfgCode": null,
1927+
"side": "server",
1928+
"type": "array",
1929+
"included": 1,
1930+
"storageOption": "External",
1931+
"singleton": 0,
1932+
"bounded": 0,
1933+
"defaultValue": null,
1934+
"reportable": 1,
1935+
"minInterval": 1,
1936+
"maxInterval": 65534,
1937+
"reportableChange": 0
1938+
},
1939+
{
1940+
"name": "AcceptedCommandList",
1941+
"code": 65529,
1942+
"mfgCode": null,
1943+
"side": "server",
1944+
"type": "array",
1945+
"included": 1,
1946+
"storageOption": "External",
1947+
"singleton": 0,
1948+
"bounded": 0,
1949+
"defaultValue": null,
1950+
"reportable": 1,
1951+
"minInterval": 1,
1952+
"maxInterval": 65534,
1953+
"reportableChange": 0
1954+
},
1955+
{
1956+
"name": "EventList",
1957+
"code": 65530,
1958+
"mfgCode": null,
1959+
"side": "server",
1960+
"type": "array",
1961+
"included": 1,
1962+
"storageOption": "External",
1963+
"singleton": 0,
1964+
"bounded": 0,
1965+
"defaultValue": null,
1966+
"reportable": 1,
1967+
"minInterval": 1,
1968+
"maxInterval": 65534,
1969+
"reportableChange": 0
1970+
},
1971+
{
1972+
"name": "AttributeList",
1973+
"code": 65531,
1974+
"mfgCode": null,
1975+
"side": "server",
1976+
"type": "array",
1977+
"included": 1,
1978+
"storageOption": "External",
1979+
"singleton": 0,
1980+
"bounded": 0,
1981+
"defaultValue": null,
1982+
"reportable": 1,
1983+
"minInterval": 1,
1984+
"maxInterval": 65534,
1985+
"reportableChange": 0
1986+
},
1987+
{
1988+
"name": "FeatureMap",
1989+
"code": 65532,
1990+
"mfgCode": null,
1991+
"side": "server",
1992+
"type": "bitmap32",
1993+
"included": 1,
1994+
"storageOption": "External",
1995+
"singleton": 0,
1996+
"bounded": 0,
1997+
"defaultValue": null,
1998+
"reportable": 1,
1999+
"minInterval": 1,
2000+
"maxInterval": 65534,
2001+
"reportableChange": 0
2002+
},
2003+
{
2004+
"name": "ClusterRevision",
2005+
"code": 65533,
2006+
"mfgCode": null,
2007+
"side": "server",
2008+
"type": "int16u",
2009+
"included": 1,
2010+
"storageOption": "RAM",
2011+
"singleton": 0,
2012+
"bounded": 0,
2013+
"defaultValue": "1",
2014+
"reportable": 1,
2015+
"minInterval": 1,
2016+
"maxInterval": 65534,
2017+
"reportableChange": 0
2018+
}
2019+
]
2020+
},
18512021
{
18522022
"name": "Thread Network Diagnostics",
18532023
"code": 53,
@@ -2954,6 +3124,22 @@
29543124
"maxInterval": 65344,
29553125
"reportableChange": 0
29563126
}
3127+
],
3128+
"events": [
3129+
{
3130+
"name": "ConnectionStatus",
3131+
"code": 0,
3132+
"mfgCode": null,
3133+
"side": "server",
3134+
"included": 1
3135+
},
3136+
{
3137+
"name": "NetworkFaultChange",
3138+
"code": 1,
3139+
"mfgCode": null,
3140+
"side": "server",
3141+
"included": 1
3142+
}
29573143
]
29583144
},
29593145
{

examples/thermostat/nxp/zap/thermostat_matter_wifi.matter

+62
Original file line numberDiff line numberDiff line change
@@ -1269,6 +1269,43 @@ cluster GeneralDiagnostics = 51 {
12691269
command PayloadTestRequest(PayloadTestRequestRequest): PayloadTestResponse = 3;
12701270
}
12711271

1272+
/** 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. */
1273+
cluster SoftwareDiagnostics = 52 {
1274+
revision 1; // NOTE: Default/not specifically set
1275+
1276+
bitmap Feature : bitmap32 {
1277+
kWatermarks = 0x1;
1278+
}
1279+
1280+
struct ThreadMetricsStruct {
1281+
int64u id = 0;
1282+
optional char_string<8> name = 1;
1283+
optional int32u stackFreeCurrent = 2;
1284+
optional int32u stackFreeMinimum = 3;
1285+
optional int32u stackSize = 4;
1286+
}
1287+
1288+
info event SoftwareFault = 0 {
1289+
int64u id = 0;
1290+
optional char_string name = 1;
1291+
optional octet_string faultRecording = 2;
1292+
}
1293+
1294+
readonly attribute optional ThreadMetricsStruct threadMetrics[] = 0;
1295+
readonly attribute optional int64u currentHeapFree = 1;
1296+
readonly attribute optional int64u currentHeapUsed = 2;
1297+
readonly attribute optional int64u currentHeapHighWatermark = 3;
1298+
readonly attribute command_id generatedCommandList[] = 65528;
1299+
readonly attribute command_id acceptedCommandList[] = 65529;
1300+
readonly attribute event_id eventList[] = 65530;
1301+
readonly attribute attrib_id attributeList[] = 65531;
1302+
readonly attribute bitmap32 featureMap = 65532;
1303+
readonly attribute int16u clusterRevision = 65533;
1304+
1305+
/** Reception of this command SHALL reset the values: The StackFreeMinimum field of the ThreadMetrics attribute, CurrentHeapHighWaterMark attribute. */
1306+
command access(invoke: manage) ResetWatermarks(): DefaultSuccess = 0;
1307+
}
1308+
12721309
/** 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. */
12731310
cluster WiFiNetworkDiagnostics = 54 {
12741311
revision 1; // NOTE: Default/not specifically set
@@ -2143,19 +2180,44 @@ endpoint 0 {
21432180
handle command TimeSnapshotResponse;
21442181
}
21452182

2183+
server cluster SoftwareDiagnostics {
2184+
callback attribute threadMetrics;
2185+
callback attribute currentHeapFree;
2186+
callback attribute currentHeapUsed;
2187+
callback attribute currentHeapHighWatermark;
2188+
callback attribute generatedCommandList;
2189+
callback attribute acceptedCommandList;
2190+
callback attribute eventList;
2191+
callback attribute attributeList;
2192+
callback attribute featureMap;
2193+
ram attribute clusterRevision default = 1;
2194+
}
2195+
21462196
server cluster WiFiNetworkDiagnostics {
2197+
emits event Disconnection;
2198+
emits event AssociationFailure;
2199+
emits event ConnectionStatus;
21472200
callback attribute bssid;
21482201
callback attribute securityType;
21492202
callback attribute wiFiVersion;
21502203
callback attribute channelNumber;
21512204
callback attribute rssi;
2205+
callback attribute beaconLostCount;
2206+
callback attribute beaconRxCount;
2207+
callback attribute packetMulticastRxCount;
2208+
callback attribute packetMulticastTxCount;
2209+
callback attribute packetUnicastRxCount;
2210+
callback attribute packetUnicastTxCount;
21522211
callback attribute currentMaxRate;
2212+
callback attribute overrunCount;
21532213
callback attribute generatedCommandList;
21542214
callback attribute acceptedCommandList;
21552215
callback attribute eventList;
21562216
callback attribute attributeList;
21572217
ram attribute featureMap default = 0;
21582218
ram attribute clusterRevision default = 1;
2219+
2220+
handle command ResetCounts;
21592221
}
21602222

21612223
server cluster AdministratorCommissioning {

0 commit comments

Comments
 (0)