Skip to content

Commit 8a9a015

Browse files
Add Wi-Fi Network Management Cluster and use correct NIM device type id
1 parent 443bb9c commit 8a9a015

File tree

14 files changed

+434
-11
lines changed

14 files changed

+434
-11
lines changed

.github/workflows/tests.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,7 @@ jobs:
189189
src/app/zap-templates/zcl/data-model/chip/wake-on-lan-cluster.xml \
190190
src/app/zap-templates/zcl/data-model/chip/washer-controls-cluster.xml \
191191
src/app/zap-templates/zcl/data-model/chip/wifi-network-diagnostics-cluster.xml \
192+
src/app/zap-templates/zcl/data-model/chip/wifi-network-management-cluster.xml \
192193
src/app/zap-templates/zcl/data-model/chip/window-covering.xml \
193194
src/app/zap-templates/zcl/data-model/chip/temperature-control-cluster.xml \
194195
src/app/zap-templates/zcl/data-model/chip/matter-devices.xml \

examples/network-manager-app/linux/main.cpp

+11
Original file line numberDiff line numberDiff line change
@@ -16,20 +16,31 @@
1616
*/
1717

1818
#include <AppMain.h>
19+
#include <app/clusters/wifi-network-management-server/wifi-network-management-server.h>
20+
#include <lib/support/Span.h>
1921

2022
using namespace chip;
2123
using namespace chip::app;
24+
using namespace chip::app::Clusters;
2225

2326
void ApplicationInit() {}
2427
void ApplicationShutdown() {}
2528

29+
ByteSpan ByteSpanFromCharSpan(CharSpan span)
30+
{
31+
return ByteSpan(reinterpret_cast<const uint8_t *>(span.data()), span.size());
32+
}
33+
2634
int main(int argc, char * argv[])
2735
{
2836
if (ChipLinuxAppInit(argc, argv) != 0)
2937
{
3038
return -1;
3139
}
3240

41+
WiFiNetworkManagement::Server::Instance().SetNetworkCredentials(ByteSpanFromCharSpan("MatterAP"_span),
42+
ByteSpanFromCharSpan("Seatec Astronomy"_span));
43+
3344
ChipLinuxAppMainLoop();
3445
return 0;
3546
}

examples/network-manager-app/network-manager-common/network-manager-app.zap

+149-8
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"fileFormat": 2,
3-
"featureLevel": 100,
3+
"featureLevel": 102,
44
"creator": "zap",
55
"keyValuePairs": [
66
{
@@ -13,7 +13,7 @@
1313
},
1414
{
1515
"key": "manufacturerCodes",
16-
"value": "0x1002"
16+
"value": "0xFFF1"
1717
}
1818
],
1919
"package": [
@@ -29,6 +29,7 @@
2929
"pathRelativity": "relativeToZap",
3030
"path": "../../../src/app/zap-templates/app-templates.json",
3131
"type": "gen-templates-json",
32+
"category": "matter",
3233
"version": "chip-v1"
3334
}
3435
],
@@ -1352,10 +1353,10 @@
13521353
"side": "server",
13531354
"type": "int16u",
13541355
"included": 1,
1355-
"storageOption": "RAM",
1356+
"storageOption": "External",
13561357
"singleton": 0,
13571358
"bounded": 0,
1358-
"defaultValue": "1",
1359+
"defaultValue": "0",
13591360
"reportable": 1,
13601361
"minInterval": 0,
13611362
"maxInterval": 65344,
@@ -3016,14 +3017,14 @@
30163017
"id": 2,
30173018
"name": "Anonymous Endpoint Type",
30183019
"deviceTypeRef": {
3019-
"code": 4293984272,
3020+
"code": 144,
30203021
"profileId": 259,
30213022
"label": "MA-network-infrastructure-manager",
30223023
"name": "MA-network-infrastructure-manager"
30233024
},
30243025
"deviceTypes": [
30253026
{
3026-
"code": 4293984272,
3027+
"code": 144,
30273028
"profileId": 259,
30283029
"label": "MA-network-infrastructure-manager",
30293030
"name": "MA-network-infrastructure-manager"
@@ -3033,10 +3034,10 @@
30333034
1
30343035
],
30353036
"deviceIdentifiers": [
3036-
4293984272
3037+
144
30373038
],
30383039
"deviceTypeName": "MA-network-infrastructure-manager",
3039-
"deviceTypeCode": 4293984272,
3040+
"deviceTypeCode": 144,
30403041
"deviceTypeProfileId": 259,
30413042
"clusters": [
30423043
{
@@ -3208,6 +3209,146 @@
32083209
"reportableChange": 0
32093210
}
32103211
]
3212+
},
3213+
{
3214+
"name": "Wi-Fi Network Management",
3215+
"code": 3072,
3216+
"mfgCode": null,
3217+
"define": "WIFI_NETWORK_MANAGEMENT_CLUSTER",
3218+
"side": "server",
3219+
"enabled": 1,
3220+
"commands": [
3221+
{
3222+
"name": "NetworkPassphraseRequest",
3223+
"code": 0,
3224+
"mfgCode": null,
3225+
"source": "client",
3226+
"isIncoming": 1,
3227+
"isEnabled": 1
3228+
},
3229+
{
3230+
"name": "NetworkPassphraseResponse",
3231+
"code": 1,
3232+
"mfgCode": null,
3233+
"source": "server",
3234+
"isIncoming": 0,
3235+
"isEnabled": 1
3236+
}
3237+
],
3238+
"attributes": [
3239+
{
3240+
"name": "SSID",
3241+
"code": 1,
3242+
"mfgCode": null,
3243+
"side": "server",
3244+
"type": "octet_string",
3245+
"included": 1,
3246+
"storageOption": "External",
3247+
"singleton": 0,
3248+
"bounded": 0,
3249+
"defaultValue": null,
3250+
"reportable": 1,
3251+
"minInterval": 1,
3252+
"maxInterval": 65534,
3253+
"reportableChange": 0
3254+
},
3255+
{
3256+
"name": "GeneratedCommandList",
3257+
"code": 65528,
3258+
"mfgCode": null,
3259+
"side": "server",
3260+
"type": "array",
3261+
"included": 1,
3262+
"storageOption": "External",
3263+
"singleton": 0,
3264+
"bounded": 0,
3265+
"defaultValue": null,
3266+
"reportable": 1,
3267+
"minInterval": 1,
3268+
"maxInterval": 65534,
3269+
"reportableChange": 0
3270+
},
3271+
{
3272+
"name": "AcceptedCommandList",
3273+
"code": 65529,
3274+
"mfgCode": null,
3275+
"side": "server",
3276+
"type": "array",
3277+
"included": 1,
3278+
"storageOption": "External",
3279+
"singleton": 0,
3280+
"bounded": 0,
3281+
"defaultValue": null,
3282+
"reportable": 1,
3283+
"minInterval": 1,
3284+
"maxInterval": 65534,
3285+
"reportableChange": 0
3286+
},
3287+
{
3288+
"name": "EventList",
3289+
"code": 65530,
3290+
"mfgCode": null,
3291+
"side": "server",
3292+
"type": "array",
3293+
"included": 1,
3294+
"storageOption": "External",
3295+
"singleton": 0,
3296+
"bounded": 0,
3297+
"defaultValue": null,
3298+
"reportable": 1,
3299+
"minInterval": 1,
3300+
"maxInterval": 65534,
3301+
"reportableChange": 0
3302+
},
3303+
{
3304+
"name": "AttributeList",
3305+
"code": 65531,
3306+
"mfgCode": null,
3307+
"side": "server",
3308+
"type": "array",
3309+
"included": 1,
3310+
"storageOption": "External",
3311+
"singleton": 0,
3312+
"bounded": 0,
3313+
"defaultValue": null,
3314+
"reportable": 1,
3315+
"minInterval": 1,
3316+
"maxInterval": 65534,
3317+
"reportableChange": 0
3318+
},
3319+
{
3320+
"name": "FeatureMap",
3321+
"code": 65532,
3322+
"mfgCode": null,
3323+
"side": "server",
3324+
"type": "bitmap32",
3325+
"included": 1,
3326+
"storageOption": "RAM",
3327+
"singleton": 0,
3328+
"bounded": 0,
3329+
"defaultValue": "0",
3330+
"reportable": 1,
3331+
"minInterval": 1,
3332+
"maxInterval": 65534,
3333+
"reportableChange": 0
3334+
},
3335+
{
3336+
"name": "ClusterRevision",
3337+
"code": 65533,
3338+
"mfgCode": null,
3339+
"side": "server",
3340+
"type": "int16u",
3341+
"included": 1,
3342+
"storageOption": "RAM",
3343+
"singleton": 0,
3344+
"bounded": 0,
3345+
"defaultValue": "1",
3346+
"reportable": 1,
3347+
"minInterval": 1,
3348+
"maxInterval": 65534,
3349+
"reportableChange": 0
3350+
}
3351+
]
32113352
}
32123353
]
32133354
}

scripts/rules.matterlint

+1
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ load "../src/app/zap-templates/zcl/data-model/chip/user-label-cluster.xml";
9797
load "../src/app/zap-templates/zcl/data-model/chip/wake-on-lan-cluster.xml";
9898
load "../src/app/zap-templates/zcl/data-model/chip/washer-controls-cluster.xml";
9999
load "../src/app/zap-templates/zcl/data-model/chip/wifi-network-diagnostics-cluster.xml";
100+
load "../src/app/zap-templates/zcl/data-model/chip/wifi-network-management-cluster.xml";
100101
load "../src/app/zap-templates/zcl/data-model/chip/window-covering.xml";
101102
load "../src/app/zap-templates/zcl/data-model/chip/temperature-control-cluster.xml";
102103
load "../src/app/zap-templates/zcl/data-model/chip/refrigerator-alarm.xml";

src/app/CommandHandlerInterface.h

+2
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,10 @@
2323
#include <app/ConcreteCommandPath.h>
2424
#include <app/data-model/Decode.h>
2525
#include <app/data-model/List.h> // So we can encode lists
26+
#include <functional>
2627
#include <lib/core/DataModelTypes.h>
2728
#include <lib/support/Iterators.h>
29+
#include <type_traits>
2830

2931
namespace chip {
3032
namespace app {

0 commit comments

Comments
 (0)