From fae3888d4baadd8d3b598e13e6c01b06c0180e97 Mon Sep 17 00:00:00 2001 From: Song GUO Date: Tue, 5 Apr 2022 19:41:22 +0800 Subject: [PATCH] [NWPROV] Fix spec compliance issues (#17038) * Fix spec compliance of network commissioning cluster * Update existing platform code * Run Codegen --- .../all-clusters-app.matter | 30 ++++--- .../bridge-common/bridge-app.matter | 30 ++++--- .../door-lock-common/door-lock-app.matter | 30 ++++--- .../light-switch-app.matter | 30 ++++--- .../lighting-common/lighting-app.matter | 30 ++++--- examples/lock-app/lock-common/lock-app.matter | 30 ++++--- .../log-source-common/log-source-app.matter | 28 ++++--- .../ota-provider-app.matter | 30 ++++--- .../ota-requestor-app.matter | 30 ++++--- .../placeholder/linux/apps/app1/config.matter | 30 ++++--- .../placeholder/linux/apps/app2/config.matter | 30 ++++--- examples/pump-app/pump-common/pump-app.matter | 30 ++++--- .../pump-controller-app.matter | 30 ++++--- .../esp32/main/temperature-measurement.matter | 30 ++++--- .../thermostat-common/thermostat.matter | 30 ++++--- examples/tv-app/tv-common/tv-app.matter | 60 +++++++++----- .../tv-casting-common/tv-casting-app.matter | 30 ++++--- examples/window-app/common/window-app.matter | 30 ++++--- .../network-commissioning.cpp | 82 ++++++++++++++----- .../zcl/data-model/chip/commissioning.xml | 41 +++++----- .../data_model/controller-clusters.matter | 30 ++++--- .../zap-generated/CHIPInvokeCallbacks.cpp | 65 ++++++++++----- .../chip/devicecontroller/ChipClusters.java | 13 +-- .../chip/devicecontroller/ChipStructs.java | 10 +-- .../devicecontroller/ClusterInfoMapping.java | 15 ++-- .../python/chip/clusters/Objects.py | 36 ++++---- .../CHIP/zap-generated/CHIPCallbackBridge.mm | 33 +++++--- .../CHIP/zap-generated/CHIPClustersObjc.h | 10 ++- .../CHIP/zap-generated/CHIPClustersObjc.mm | 20 +++-- .../zap-generated/CHIPCommandPayloadsObjc.h | 8 +- .../zap-generated/CHIPCommandPayloadsObjc.mm | 8 +- .../CHIP/zap-generated/CHIPStructsObjc.h | 2 +- .../CHIP/zap-generated/CHIPStructsObjc.mm | 2 +- src/include/platform/NetworkCommissioning.h | 13 ++- .../Ameba/NetworkCommissioningDriver.h | 2 +- .../EFR32/NetworkCommissioningWiFiDriver.cpp | 8 +- .../EFR32/NetworkCommissioningWiFiDriver.h | 2 +- .../ESP32/NetworkCommissioningDriver.h | 2 +- .../Linux/ConnectivityManagerImpl.cpp | 2 +- src/platform/P6/NetworkCommissioningDriver.h | 2 +- .../BL602/NetworkCommissioningDriver.h | 6 +- .../mbed/NetworkCommissioningDriver.h | 2 +- .../app-common/zap-generated/af-structs.h | 4 +- .../app-common/zap-generated/cluster-enums.h | 10 +++ .../zap-generated/cluster-objects.h | 30 +++---- 45 files changed, 655 insertions(+), 371 deletions(-) diff --git a/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter b/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter index 7e65f2ae525471..d55b68df092709 100644 --- a/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter +++ b/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter @@ -2037,27 +2037,35 @@ server cluster NetworkCommissioning = 49 { kEthernetNetworkInterface = 0x4; } + bitmap WiFiSecurity : BITMAP8 { + kUnencrypted = 0x1; + kWepPersonal = 0x2; + kWpaPersonal = 0x4; + kWpa2Personal = 0x8; + kWpa3Personal = 0x10; + } + struct NetworkInfo { - OCTET_STRING networkID = 0; + OCTET_STRING<32> networkID = 0; BOOLEAN connected = 1; } struct WiFiInterfaceScanResult { - BITMAP8 security = 0; - OCTET_STRING ssid = 1; - OCTET_STRING bssid = 2; + WiFiSecurity security = 0; + OCTET_STRING<32> ssid = 1; + OCTET_STRING<6> bssid = 2; INT16U channel = 3; WiFiBand wiFiBand = 4; INT8S rssi = 5; } struct ThreadInterfaceScanResult { - INT64U panId = 0; + INT16U panId = 0; INT64U extendedPanId = 1; - CHAR_STRING networkName = 2; + CHAR_STRING<16> networkName = 2; INT16U channel = 3; INT8U version = 4; - INT64U extendedAddress = 5; + OCTET_STRING<8> extendedAddress = 5; INT8S rssi = 6; INT8U lqi = 7; } @@ -2074,7 +2082,7 @@ server cluster NetworkCommissioning = 49 { readonly global attribute int16u clusterRevision = 65533; request struct ScanNetworksRequest { - OCTET_STRING ssid = 0; + optional nullable OCTET_STRING ssid = 0; optional INT64U breadcrumb = 1; } @@ -2107,7 +2115,7 @@ server cluster NetworkCommissioning = 49 { response struct ScanNetworksResponse { NetworkCommissioningStatus networkingStatus = 0; - CHAR_STRING debugText = 1; + optional CHAR_STRING debugText = 1; optional WiFiInterfaceScanResult wiFiScanResults[] = 2; optional ThreadInterfaceScanResult threadScanResults[] = 3; } @@ -2120,8 +2128,8 @@ server cluster NetworkCommissioning = 49 { response struct ConnectNetworkResponse { NetworkCommissioningStatus networkingStatus = 0; - CHAR_STRING debugText = 1; - INT32S errorValue = 2; + optional CHAR_STRING debugText = 1; + nullable INT32S errorValue = 2; } command ScanNetworks(ScanNetworksRequest): ScanNetworksResponse = 0; diff --git a/examples/bridge-app/bridge-common/bridge-app.matter b/examples/bridge-app/bridge-common/bridge-app.matter index 1f21b34ed80857..aa1775ee5d6b60 100644 --- a/examples/bridge-app/bridge-common/bridge-app.matter +++ b/examples/bridge-app/bridge-common/bridge-app.matter @@ -550,27 +550,35 @@ server cluster NetworkCommissioning = 49 { kEthernetNetworkInterface = 0x4; } + bitmap WiFiSecurity : BITMAP8 { + kUnencrypted = 0x1; + kWepPersonal = 0x2; + kWpaPersonal = 0x4; + kWpa2Personal = 0x8; + kWpa3Personal = 0x10; + } + struct NetworkInfo { - OCTET_STRING networkID = 0; + OCTET_STRING<32> networkID = 0; BOOLEAN connected = 1; } struct WiFiInterfaceScanResult { - BITMAP8 security = 0; - OCTET_STRING ssid = 1; - OCTET_STRING bssid = 2; + WiFiSecurity security = 0; + OCTET_STRING<32> ssid = 1; + OCTET_STRING<6> bssid = 2; INT16U channel = 3; WiFiBand wiFiBand = 4; INT8S rssi = 5; } struct ThreadInterfaceScanResult { - INT64U panId = 0; + INT16U panId = 0; INT64U extendedPanId = 1; - CHAR_STRING networkName = 2; + CHAR_STRING<16> networkName = 2; INT16U channel = 3; INT8U version = 4; - INT64U extendedAddress = 5; + OCTET_STRING<8> extendedAddress = 5; INT8S rssi = 6; INT8U lqi = 7; } @@ -587,7 +595,7 @@ server cluster NetworkCommissioning = 49 { readonly global attribute int16u clusterRevision = 65533; request struct ScanNetworksRequest { - OCTET_STRING ssid = 0; + optional nullable OCTET_STRING ssid = 0; optional INT64U breadcrumb = 1; } @@ -620,7 +628,7 @@ server cluster NetworkCommissioning = 49 { response struct ScanNetworksResponse { NetworkCommissioningStatus networkingStatus = 0; - CHAR_STRING debugText = 1; + optional CHAR_STRING debugText = 1; optional WiFiInterfaceScanResult wiFiScanResults[] = 2; optional ThreadInterfaceScanResult threadScanResults[] = 3; } @@ -633,8 +641,8 @@ server cluster NetworkCommissioning = 49 { response struct ConnectNetworkResponse { NetworkCommissioningStatus networkingStatus = 0; - CHAR_STRING debugText = 1; - INT32S errorValue = 2; + optional CHAR_STRING debugText = 1; + nullable INT32S errorValue = 2; } command ScanNetworks(ScanNetworksRequest): ScanNetworksResponse = 0; diff --git a/examples/door-lock-app/door-lock-common/door-lock-app.matter b/examples/door-lock-app/door-lock-common/door-lock-app.matter index ce063313690ddc..9377227de2e868 100644 --- a/examples/door-lock-app/door-lock-common/door-lock-app.matter +++ b/examples/door-lock-app/door-lock-common/door-lock-app.matter @@ -947,27 +947,35 @@ server cluster NetworkCommissioning = 49 { kEthernetNetworkInterface = 0x4; } + bitmap WiFiSecurity : BITMAP8 { + kUnencrypted = 0x1; + kWepPersonal = 0x2; + kWpaPersonal = 0x4; + kWpa2Personal = 0x8; + kWpa3Personal = 0x10; + } + struct NetworkInfo { - OCTET_STRING networkID = 0; + OCTET_STRING<32> networkID = 0; BOOLEAN connected = 1; } struct WiFiInterfaceScanResult { - BITMAP8 security = 0; - OCTET_STRING ssid = 1; - OCTET_STRING bssid = 2; + WiFiSecurity security = 0; + OCTET_STRING<32> ssid = 1; + OCTET_STRING<6> bssid = 2; INT16U channel = 3; WiFiBand wiFiBand = 4; INT8S rssi = 5; } struct ThreadInterfaceScanResult { - INT64U panId = 0; + INT16U panId = 0; INT64U extendedPanId = 1; - CHAR_STRING networkName = 2; + CHAR_STRING<16> networkName = 2; INT16U channel = 3; INT8U version = 4; - INT64U extendedAddress = 5; + OCTET_STRING<8> extendedAddress = 5; INT8S rssi = 6; INT8U lqi = 7; } @@ -984,7 +992,7 @@ server cluster NetworkCommissioning = 49 { readonly global attribute int16u clusterRevision = 65533; request struct ScanNetworksRequest { - OCTET_STRING ssid = 0; + optional nullable OCTET_STRING ssid = 0; optional INT64U breadcrumb = 1; } @@ -1017,7 +1025,7 @@ server cluster NetworkCommissioning = 49 { response struct ScanNetworksResponse { NetworkCommissioningStatus networkingStatus = 0; - CHAR_STRING debugText = 1; + optional CHAR_STRING debugText = 1; optional WiFiInterfaceScanResult wiFiScanResults[] = 2; optional ThreadInterfaceScanResult threadScanResults[] = 3; } @@ -1030,8 +1038,8 @@ server cluster NetworkCommissioning = 49 { response struct ConnectNetworkResponse { NetworkCommissioningStatus networkingStatus = 0; - CHAR_STRING debugText = 1; - INT32S errorValue = 2; + optional CHAR_STRING debugText = 1; + nullable INT32S errorValue = 2; } command ScanNetworks(ScanNetworksRequest): ScanNetworksResponse = 0; diff --git a/examples/light-switch-app/light-switch-common/light-switch-app.matter b/examples/light-switch-app/light-switch-common/light-switch-app.matter index 7ca2ce1f7b3d65..170145e0e65127 100644 --- a/examples/light-switch-app/light-switch-common/light-switch-app.matter +++ b/examples/light-switch-app/light-switch-common/light-switch-app.matter @@ -839,27 +839,35 @@ server cluster NetworkCommissioning = 49 { kEthernetNetworkInterface = 0x4; } + bitmap WiFiSecurity : BITMAP8 { + kUnencrypted = 0x1; + kWepPersonal = 0x2; + kWpaPersonal = 0x4; + kWpa2Personal = 0x8; + kWpa3Personal = 0x10; + } + struct NetworkInfo { - OCTET_STRING networkID = 0; + OCTET_STRING<32> networkID = 0; BOOLEAN connected = 1; } struct WiFiInterfaceScanResult { - BITMAP8 security = 0; - OCTET_STRING ssid = 1; - OCTET_STRING bssid = 2; + WiFiSecurity security = 0; + OCTET_STRING<32> ssid = 1; + OCTET_STRING<6> bssid = 2; INT16U channel = 3; WiFiBand wiFiBand = 4; INT8S rssi = 5; } struct ThreadInterfaceScanResult { - INT64U panId = 0; + INT16U panId = 0; INT64U extendedPanId = 1; - CHAR_STRING networkName = 2; + CHAR_STRING<16> networkName = 2; INT16U channel = 3; INT8U version = 4; - INT64U extendedAddress = 5; + OCTET_STRING<8> extendedAddress = 5; INT8S rssi = 6; INT8U lqi = 7; } @@ -876,7 +884,7 @@ server cluster NetworkCommissioning = 49 { readonly global attribute int16u clusterRevision = 65533; request struct ScanNetworksRequest { - OCTET_STRING ssid = 0; + optional nullable OCTET_STRING ssid = 0; optional INT64U breadcrumb = 1; } @@ -909,7 +917,7 @@ server cluster NetworkCommissioning = 49 { response struct ScanNetworksResponse { NetworkCommissioningStatus networkingStatus = 0; - CHAR_STRING debugText = 1; + optional CHAR_STRING debugText = 1; optional WiFiInterfaceScanResult wiFiScanResults[] = 2; optional ThreadInterfaceScanResult threadScanResults[] = 3; } @@ -922,8 +930,8 @@ server cluster NetworkCommissioning = 49 { response struct ConnectNetworkResponse { NetworkCommissioningStatus networkingStatus = 0; - CHAR_STRING debugText = 1; - INT32S errorValue = 2; + optional CHAR_STRING debugText = 1; + nullable INT32S errorValue = 2; } command ScanNetworks(ScanNetworksRequest): ScanNetworksResponse = 0; diff --git a/examples/lighting-app/lighting-common/lighting-app.matter b/examples/lighting-app/lighting-common/lighting-app.matter index c697dc9524683a..b6bc07d9c8a3b5 100644 --- a/examples/lighting-app/lighting-common/lighting-app.matter +++ b/examples/lighting-app/lighting-common/lighting-app.matter @@ -910,27 +910,35 @@ server cluster NetworkCommissioning = 49 { kEthernetNetworkInterface = 0x4; } + bitmap WiFiSecurity : BITMAP8 { + kUnencrypted = 0x1; + kWepPersonal = 0x2; + kWpaPersonal = 0x4; + kWpa2Personal = 0x8; + kWpa3Personal = 0x10; + } + struct NetworkInfo { - OCTET_STRING networkID = 0; + OCTET_STRING<32> networkID = 0; BOOLEAN connected = 1; } struct WiFiInterfaceScanResult { - BITMAP8 security = 0; - OCTET_STRING ssid = 1; - OCTET_STRING bssid = 2; + WiFiSecurity security = 0; + OCTET_STRING<32> ssid = 1; + OCTET_STRING<6> bssid = 2; INT16U channel = 3; WiFiBand wiFiBand = 4; INT8S rssi = 5; } struct ThreadInterfaceScanResult { - INT64U panId = 0; + INT16U panId = 0; INT64U extendedPanId = 1; - CHAR_STRING networkName = 2; + CHAR_STRING<16> networkName = 2; INT16U channel = 3; INT8U version = 4; - INT64U extendedAddress = 5; + OCTET_STRING<8> extendedAddress = 5; INT8S rssi = 6; INT8U lqi = 7; } @@ -947,7 +955,7 @@ server cluster NetworkCommissioning = 49 { readonly global attribute int16u clusterRevision = 65533; request struct ScanNetworksRequest { - OCTET_STRING ssid = 0; + optional nullable OCTET_STRING ssid = 0; optional INT64U breadcrumb = 1; } @@ -980,7 +988,7 @@ server cluster NetworkCommissioning = 49 { response struct ScanNetworksResponse { NetworkCommissioningStatus networkingStatus = 0; - CHAR_STRING debugText = 1; + optional CHAR_STRING debugText = 1; optional WiFiInterfaceScanResult wiFiScanResults[] = 2; optional ThreadInterfaceScanResult threadScanResults[] = 3; } @@ -993,8 +1001,8 @@ server cluster NetworkCommissioning = 49 { response struct ConnectNetworkResponse { NetworkCommissioningStatus networkingStatus = 0; - CHAR_STRING debugText = 1; - INT32S errorValue = 2; + optional CHAR_STRING debugText = 1; + nullable INT32S errorValue = 2; } command ScanNetworks(ScanNetworksRequest): ScanNetworksResponse = 0; diff --git a/examples/lock-app/lock-common/lock-app.matter b/examples/lock-app/lock-common/lock-app.matter index d658430da14f54..1af4946c14522d 100644 --- a/examples/lock-app/lock-common/lock-app.matter +++ b/examples/lock-app/lock-common/lock-app.matter @@ -403,27 +403,35 @@ server cluster NetworkCommissioning = 49 { kEthernetNetworkInterface = 0x4; } + bitmap WiFiSecurity : BITMAP8 { + kUnencrypted = 0x1; + kWepPersonal = 0x2; + kWpaPersonal = 0x4; + kWpa2Personal = 0x8; + kWpa3Personal = 0x10; + } + struct NetworkInfo { - OCTET_STRING networkID = 0; + OCTET_STRING<32> networkID = 0; BOOLEAN connected = 1; } struct WiFiInterfaceScanResult { - BITMAP8 security = 0; - OCTET_STRING ssid = 1; - OCTET_STRING bssid = 2; + WiFiSecurity security = 0; + OCTET_STRING<32> ssid = 1; + OCTET_STRING<6> bssid = 2; INT16U channel = 3; WiFiBand wiFiBand = 4; INT8S rssi = 5; } struct ThreadInterfaceScanResult { - INT64U panId = 0; + INT16U panId = 0; INT64U extendedPanId = 1; - CHAR_STRING networkName = 2; + CHAR_STRING<16> networkName = 2; INT16U channel = 3; INT8U version = 4; - INT64U extendedAddress = 5; + OCTET_STRING<8> extendedAddress = 5; INT8S rssi = 6; INT8U lqi = 7; } @@ -440,7 +448,7 @@ server cluster NetworkCommissioning = 49 { readonly global attribute int16u clusterRevision = 65533; request struct ScanNetworksRequest { - OCTET_STRING ssid = 0; + optional nullable OCTET_STRING ssid = 0; optional INT64U breadcrumb = 1; } @@ -473,7 +481,7 @@ server cluster NetworkCommissioning = 49 { response struct ScanNetworksResponse { NetworkCommissioningStatus networkingStatus = 0; - CHAR_STRING debugText = 1; + optional CHAR_STRING debugText = 1; optional WiFiInterfaceScanResult wiFiScanResults[] = 2; optional ThreadInterfaceScanResult threadScanResults[] = 3; } @@ -486,8 +494,8 @@ server cluster NetworkCommissioning = 49 { response struct ConnectNetworkResponse { NetworkCommissioningStatus networkingStatus = 0; - CHAR_STRING debugText = 1; - INT32S errorValue = 2; + optional CHAR_STRING debugText = 1; + nullable INT32S errorValue = 2; } command ScanNetworks(ScanNetworksRequest): ScanNetworksResponse = 0; diff --git a/examples/log-source-app/log-source-common/log-source-app.matter b/examples/log-source-app/log-source-common/log-source-app.matter index 800f9564284329..cf5b4ae8da4c8c 100644 --- a/examples/log-source-app/log-source-common/log-source-app.matter +++ b/examples/log-source-app/log-source-common/log-source-app.matter @@ -208,22 +208,30 @@ server cluster NetworkCommissioning = 49 { kEthernetNetworkInterface = 0x4; } + bitmap WiFiSecurity : BITMAP8 { + kUnencrypted = 0x1; + kWepPersonal = 0x2; + kWpaPersonal = 0x4; + kWpa2Personal = 0x8; + kWpa3Personal = 0x10; + } + struct WiFiInterfaceScanResult { - BITMAP8 security = 0; - OCTET_STRING ssid = 1; - OCTET_STRING bssid = 2; + WiFiSecurity security = 0; + OCTET_STRING<32> ssid = 1; + OCTET_STRING<6> bssid = 2; INT16U channel = 3; WiFiBand wiFiBand = 4; INT8S rssi = 5; } struct ThreadInterfaceScanResult { - INT64U panId = 0; + INT16U panId = 0; INT64U extendedPanId = 1; - CHAR_STRING networkName = 2; + CHAR_STRING<16> networkName = 2; INT16U channel = 3; INT8U version = 4; - INT64U extendedAddress = 5; + OCTET_STRING<8> extendedAddress = 5; INT8S rssi = 6; INT8U lqi = 7; } @@ -231,7 +239,7 @@ server cluster NetworkCommissioning = 49 { readonly global attribute int16u clusterRevision = 65533; request struct ScanNetworksRequest { - OCTET_STRING ssid = 0; + optional nullable OCTET_STRING ssid = 0; optional INT64U breadcrumb = 1; } @@ -264,7 +272,7 @@ server cluster NetworkCommissioning = 49 { response struct ScanNetworksResponse { NetworkCommissioningStatus networkingStatus = 0; - CHAR_STRING debugText = 1; + optional CHAR_STRING debugText = 1; optional WiFiInterfaceScanResult wiFiScanResults[] = 2; optional ThreadInterfaceScanResult threadScanResults[] = 3; } @@ -277,8 +285,8 @@ server cluster NetworkCommissioning = 49 { response struct ConnectNetworkResponse { NetworkCommissioningStatus networkingStatus = 0; - CHAR_STRING debugText = 1; - INT32S errorValue = 2; + optional CHAR_STRING debugText = 1; + nullable INT32S errorValue = 2; } command ScanNetworks(ScanNetworksRequest): ScanNetworksResponse = 0; diff --git a/examples/ota-provider-app/ota-provider-common/ota-provider-app.matter b/examples/ota-provider-app/ota-provider-common/ota-provider-app.matter index f2a77bbc0a7c43..12739e43e01a0e 100644 --- a/examples/ota-provider-app/ota-provider-common/ota-provider-app.matter +++ b/examples/ota-provider-app/ota-provider-common/ota-provider-app.matter @@ -267,27 +267,35 @@ server cluster NetworkCommissioning = 49 { kEthernetNetworkInterface = 0x4; } + bitmap WiFiSecurity : BITMAP8 { + kUnencrypted = 0x1; + kWepPersonal = 0x2; + kWpaPersonal = 0x4; + kWpa2Personal = 0x8; + kWpa3Personal = 0x10; + } + struct NetworkInfo { - OCTET_STRING networkID = 0; + OCTET_STRING<32> networkID = 0; BOOLEAN connected = 1; } struct WiFiInterfaceScanResult { - BITMAP8 security = 0; - OCTET_STRING ssid = 1; - OCTET_STRING bssid = 2; + WiFiSecurity security = 0; + OCTET_STRING<32> ssid = 1; + OCTET_STRING<6> bssid = 2; INT16U channel = 3; WiFiBand wiFiBand = 4; INT8S rssi = 5; } struct ThreadInterfaceScanResult { - INT64U panId = 0; + INT16U panId = 0; INT64U extendedPanId = 1; - CHAR_STRING networkName = 2; + CHAR_STRING<16> networkName = 2; INT16U channel = 3; INT8U version = 4; - INT64U extendedAddress = 5; + OCTET_STRING<8> extendedAddress = 5; INT8S rssi = 6; INT8U lqi = 7; } @@ -304,7 +312,7 @@ server cluster NetworkCommissioning = 49 { readonly global attribute int16u clusterRevision = 65533; request struct ScanNetworksRequest { - OCTET_STRING ssid = 0; + optional nullable OCTET_STRING ssid = 0; optional INT64U breadcrumb = 1; } @@ -337,7 +345,7 @@ server cluster NetworkCommissioning = 49 { response struct ScanNetworksResponse { NetworkCommissioningStatus networkingStatus = 0; - CHAR_STRING debugText = 1; + optional CHAR_STRING debugText = 1; optional WiFiInterfaceScanResult wiFiScanResults[] = 2; optional ThreadInterfaceScanResult threadScanResults[] = 3; } @@ -350,8 +358,8 @@ server cluster NetworkCommissioning = 49 { response struct ConnectNetworkResponse { NetworkCommissioningStatus networkingStatus = 0; - CHAR_STRING debugText = 1; - INT32S errorValue = 2; + optional CHAR_STRING debugText = 1; + nullable INT32S errorValue = 2; } command ScanNetworks(ScanNetworksRequest): ScanNetworksResponse = 0; diff --git a/examples/ota-requestor-app/ota-requestor-common/ota-requestor-app.matter b/examples/ota-requestor-app/ota-requestor-common/ota-requestor-app.matter index d2f259dfc59c5c..68f1f053fe5147 100644 --- a/examples/ota-requestor-app/ota-requestor-common/ota-requestor-app.matter +++ b/examples/ota-requestor-app/ota-requestor-common/ota-requestor-app.matter @@ -240,27 +240,35 @@ server cluster NetworkCommissioning = 49 { kEthernetNetworkInterface = 0x4; } + bitmap WiFiSecurity : BITMAP8 { + kUnencrypted = 0x1; + kWepPersonal = 0x2; + kWpaPersonal = 0x4; + kWpa2Personal = 0x8; + kWpa3Personal = 0x10; + } + struct NetworkInfo { - OCTET_STRING networkID = 0; + OCTET_STRING<32> networkID = 0; BOOLEAN connected = 1; } struct WiFiInterfaceScanResult { - BITMAP8 security = 0; - OCTET_STRING ssid = 1; - OCTET_STRING bssid = 2; + WiFiSecurity security = 0; + OCTET_STRING<32> ssid = 1; + OCTET_STRING<6> bssid = 2; INT16U channel = 3; WiFiBand wiFiBand = 4; INT8S rssi = 5; } struct ThreadInterfaceScanResult { - INT64U panId = 0; + INT16U panId = 0; INT64U extendedPanId = 1; - CHAR_STRING networkName = 2; + CHAR_STRING<16> networkName = 2; INT16U channel = 3; INT8U version = 4; - INT64U extendedAddress = 5; + OCTET_STRING<8> extendedAddress = 5; INT8S rssi = 6; INT8U lqi = 7; } @@ -277,7 +285,7 @@ server cluster NetworkCommissioning = 49 { readonly global attribute int16u clusterRevision = 65533; request struct ScanNetworksRequest { - OCTET_STRING ssid = 0; + optional nullable OCTET_STRING ssid = 0; optional INT64U breadcrumb = 1; } @@ -310,7 +318,7 @@ server cluster NetworkCommissioning = 49 { response struct ScanNetworksResponse { NetworkCommissioningStatus networkingStatus = 0; - CHAR_STRING debugText = 1; + optional CHAR_STRING debugText = 1; optional WiFiInterfaceScanResult wiFiScanResults[] = 2; optional ThreadInterfaceScanResult threadScanResults[] = 3; } @@ -323,8 +331,8 @@ server cluster NetworkCommissioning = 49 { response struct ConnectNetworkResponse { NetworkCommissioningStatus networkingStatus = 0; - CHAR_STRING debugText = 1; - INT32S errorValue = 2; + optional CHAR_STRING debugText = 1; + nullable INT32S errorValue = 2; } command ScanNetworks(ScanNetworksRequest): ScanNetworksResponse = 0; diff --git a/examples/placeholder/linux/apps/app1/config.matter b/examples/placeholder/linux/apps/app1/config.matter index 995f5e1670fc03..e04b0901bd34b6 100644 --- a/examples/placeholder/linux/apps/app1/config.matter +++ b/examples/placeholder/linux/apps/app1/config.matter @@ -1096,27 +1096,35 @@ server cluster NetworkCommissioning = 49 { kEthernetNetworkInterface = 0x4; } + bitmap WiFiSecurity : BITMAP8 { + kUnencrypted = 0x1; + kWepPersonal = 0x2; + kWpaPersonal = 0x4; + kWpa2Personal = 0x8; + kWpa3Personal = 0x10; + } + struct NetworkInfo { - OCTET_STRING networkID = 0; + OCTET_STRING<32> networkID = 0; BOOLEAN connected = 1; } struct WiFiInterfaceScanResult { - BITMAP8 security = 0; - OCTET_STRING ssid = 1; - OCTET_STRING bssid = 2; + WiFiSecurity security = 0; + OCTET_STRING<32> ssid = 1; + OCTET_STRING<6> bssid = 2; INT16U channel = 3; WiFiBand wiFiBand = 4; INT8S rssi = 5; } struct ThreadInterfaceScanResult { - INT64U panId = 0; + INT16U panId = 0; INT64U extendedPanId = 1; - CHAR_STRING networkName = 2; + CHAR_STRING<16> networkName = 2; INT16U channel = 3; INT8U version = 4; - INT64U extendedAddress = 5; + OCTET_STRING<8> extendedAddress = 5; INT8S rssi = 6; INT8U lqi = 7; } @@ -1133,7 +1141,7 @@ server cluster NetworkCommissioning = 49 { readonly global attribute int16u clusterRevision = 65533; request struct ScanNetworksRequest { - OCTET_STRING ssid = 0; + optional nullable OCTET_STRING ssid = 0; optional INT64U breadcrumb = 1; } @@ -1166,7 +1174,7 @@ server cluster NetworkCommissioning = 49 { response struct ScanNetworksResponse { NetworkCommissioningStatus networkingStatus = 0; - CHAR_STRING debugText = 1; + optional CHAR_STRING debugText = 1; optional WiFiInterfaceScanResult wiFiScanResults[] = 2; optional ThreadInterfaceScanResult threadScanResults[] = 3; } @@ -1179,8 +1187,8 @@ server cluster NetworkCommissioning = 49 { response struct ConnectNetworkResponse { NetworkCommissioningStatus networkingStatus = 0; - CHAR_STRING debugText = 1; - INT32S errorValue = 2; + optional CHAR_STRING debugText = 1; + nullable INT32S errorValue = 2; } command ScanNetworks(ScanNetworksRequest): ScanNetworksResponse = 0; diff --git a/examples/placeholder/linux/apps/app2/config.matter b/examples/placeholder/linux/apps/app2/config.matter index 995f5e1670fc03..e04b0901bd34b6 100644 --- a/examples/placeholder/linux/apps/app2/config.matter +++ b/examples/placeholder/linux/apps/app2/config.matter @@ -1096,27 +1096,35 @@ server cluster NetworkCommissioning = 49 { kEthernetNetworkInterface = 0x4; } + bitmap WiFiSecurity : BITMAP8 { + kUnencrypted = 0x1; + kWepPersonal = 0x2; + kWpaPersonal = 0x4; + kWpa2Personal = 0x8; + kWpa3Personal = 0x10; + } + struct NetworkInfo { - OCTET_STRING networkID = 0; + OCTET_STRING<32> networkID = 0; BOOLEAN connected = 1; } struct WiFiInterfaceScanResult { - BITMAP8 security = 0; - OCTET_STRING ssid = 1; - OCTET_STRING bssid = 2; + WiFiSecurity security = 0; + OCTET_STRING<32> ssid = 1; + OCTET_STRING<6> bssid = 2; INT16U channel = 3; WiFiBand wiFiBand = 4; INT8S rssi = 5; } struct ThreadInterfaceScanResult { - INT64U panId = 0; + INT16U panId = 0; INT64U extendedPanId = 1; - CHAR_STRING networkName = 2; + CHAR_STRING<16> networkName = 2; INT16U channel = 3; INT8U version = 4; - INT64U extendedAddress = 5; + OCTET_STRING<8> extendedAddress = 5; INT8S rssi = 6; INT8U lqi = 7; } @@ -1133,7 +1141,7 @@ server cluster NetworkCommissioning = 49 { readonly global attribute int16u clusterRevision = 65533; request struct ScanNetworksRequest { - OCTET_STRING ssid = 0; + optional nullable OCTET_STRING ssid = 0; optional INT64U breadcrumb = 1; } @@ -1166,7 +1174,7 @@ server cluster NetworkCommissioning = 49 { response struct ScanNetworksResponse { NetworkCommissioningStatus networkingStatus = 0; - CHAR_STRING debugText = 1; + optional CHAR_STRING debugText = 1; optional WiFiInterfaceScanResult wiFiScanResults[] = 2; optional ThreadInterfaceScanResult threadScanResults[] = 3; } @@ -1179,8 +1187,8 @@ server cluster NetworkCommissioning = 49 { response struct ConnectNetworkResponse { NetworkCommissioningStatus networkingStatus = 0; - CHAR_STRING debugText = 1; - INT32S errorValue = 2; + optional CHAR_STRING debugText = 1; + nullable INT32S errorValue = 2; } command ScanNetworks(ScanNetworksRequest): ScanNetworksResponse = 0; diff --git a/examples/pump-app/pump-common/pump-app.matter b/examples/pump-app/pump-common/pump-app.matter index 402c3b64d7fa1e..5035e3c3eb7baa 100644 --- a/examples/pump-app/pump-common/pump-app.matter +++ b/examples/pump-app/pump-common/pump-app.matter @@ -650,27 +650,35 @@ server cluster NetworkCommissioning = 49 { kEthernetNetworkInterface = 0x4; } + bitmap WiFiSecurity : BITMAP8 { + kUnencrypted = 0x1; + kWepPersonal = 0x2; + kWpaPersonal = 0x4; + kWpa2Personal = 0x8; + kWpa3Personal = 0x10; + } + struct NetworkInfo { - OCTET_STRING networkID = 0; + OCTET_STRING<32> networkID = 0; BOOLEAN connected = 1; } struct WiFiInterfaceScanResult { - BITMAP8 security = 0; - OCTET_STRING ssid = 1; - OCTET_STRING bssid = 2; + WiFiSecurity security = 0; + OCTET_STRING<32> ssid = 1; + OCTET_STRING<6> bssid = 2; INT16U channel = 3; WiFiBand wiFiBand = 4; INT8S rssi = 5; } struct ThreadInterfaceScanResult { - INT64U panId = 0; + INT16U panId = 0; INT64U extendedPanId = 1; - CHAR_STRING networkName = 2; + CHAR_STRING<16> networkName = 2; INT16U channel = 3; INT8U version = 4; - INT64U extendedAddress = 5; + OCTET_STRING<8> extendedAddress = 5; INT8S rssi = 6; INT8U lqi = 7; } @@ -687,7 +695,7 @@ server cluster NetworkCommissioning = 49 { readonly global attribute int16u clusterRevision = 65533; request struct ScanNetworksRequest { - OCTET_STRING ssid = 0; + optional nullable OCTET_STRING ssid = 0; optional INT64U breadcrumb = 1; } @@ -720,7 +728,7 @@ server cluster NetworkCommissioning = 49 { response struct ScanNetworksResponse { NetworkCommissioningStatus networkingStatus = 0; - CHAR_STRING debugText = 1; + optional CHAR_STRING debugText = 1; optional WiFiInterfaceScanResult wiFiScanResults[] = 2; optional ThreadInterfaceScanResult threadScanResults[] = 3; } @@ -733,8 +741,8 @@ server cluster NetworkCommissioning = 49 { response struct ConnectNetworkResponse { NetworkCommissioningStatus networkingStatus = 0; - CHAR_STRING debugText = 1; - INT32S errorValue = 2; + optional CHAR_STRING debugText = 1; + nullable INT32S errorValue = 2; } command ScanNetworks(ScanNetworksRequest): ScanNetworksResponse = 0; diff --git a/examples/pump-controller-app/pump-controller-common/pump-controller-app.matter b/examples/pump-controller-app/pump-controller-common/pump-controller-app.matter index 17c76cbb874026..ebb6efff1656a6 100644 --- a/examples/pump-controller-app/pump-controller-common/pump-controller-app.matter +++ b/examples/pump-controller-app/pump-controller-common/pump-controller-app.matter @@ -561,27 +561,35 @@ server cluster NetworkCommissioning = 49 { kEthernetNetworkInterface = 0x4; } + bitmap WiFiSecurity : BITMAP8 { + kUnencrypted = 0x1; + kWepPersonal = 0x2; + kWpaPersonal = 0x4; + kWpa2Personal = 0x8; + kWpa3Personal = 0x10; + } + struct NetworkInfo { - OCTET_STRING networkID = 0; + OCTET_STRING<32> networkID = 0; BOOLEAN connected = 1; } struct WiFiInterfaceScanResult { - BITMAP8 security = 0; - OCTET_STRING ssid = 1; - OCTET_STRING bssid = 2; + WiFiSecurity security = 0; + OCTET_STRING<32> ssid = 1; + OCTET_STRING<6> bssid = 2; INT16U channel = 3; WiFiBand wiFiBand = 4; INT8S rssi = 5; } struct ThreadInterfaceScanResult { - INT64U panId = 0; + INT16U panId = 0; INT64U extendedPanId = 1; - CHAR_STRING networkName = 2; + CHAR_STRING<16> networkName = 2; INT16U channel = 3; INT8U version = 4; - INT64U extendedAddress = 5; + OCTET_STRING<8> extendedAddress = 5; INT8S rssi = 6; INT8U lqi = 7; } @@ -598,7 +606,7 @@ server cluster NetworkCommissioning = 49 { readonly global attribute int16u clusterRevision = 65533; request struct ScanNetworksRequest { - OCTET_STRING ssid = 0; + optional nullable OCTET_STRING ssid = 0; optional INT64U breadcrumb = 1; } @@ -631,7 +639,7 @@ server cluster NetworkCommissioning = 49 { response struct ScanNetworksResponse { NetworkCommissioningStatus networkingStatus = 0; - CHAR_STRING debugText = 1; + optional CHAR_STRING debugText = 1; optional WiFiInterfaceScanResult wiFiScanResults[] = 2; optional ThreadInterfaceScanResult threadScanResults[] = 3; } @@ -644,8 +652,8 @@ server cluster NetworkCommissioning = 49 { response struct ConnectNetworkResponse { NetworkCommissioningStatus networkingStatus = 0; - CHAR_STRING debugText = 1; - INT32S errorValue = 2; + optional CHAR_STRING debugText = 1; + nullable INT32S errorValue = 2; } command ScanNetworks(ScanNetworksRequest): ScanNetworksResponse = 0; diff --git a/examples/temperature-measurement-app/esp32/main/temperature-measurement.matter b/examples/temperature-measurement-app/esp32/main/temperature-measurement.matter index 072068a81de046..81c2209a91e5c6 100644 --- a/examples/temperature-measurement-app/esp32/main/temperature-measurement.matter +++ b/examples/temperature-measurement-app/esp32/main/temperature-measurement.matter @@ -401,27 +401,35 @@ server cluster NetworkCommissioning = 49 { kEthernetNetworkInterface = 0x4; } + bitmap WiFiSecurity : BITMAP8 { + kUnencrypted = 0x1; + kWepPersonal = 0x2; + kWpaPersonal = 0x4; + kWpa2Personal = 0x8; + kWpa3Personal = 0x10; + } + struct NetworkInfo { - OCTET_STRING networkID = 0; + OCTET_STRING<32> networkID = 0; BOOLEAN connected = 1; } struct WiFiInterfaceScanResult { - BITMAP8 security = 0; - OCTET_STRING ssid = 1; - OCTET_STRING bssid = 2; + WiFiSecurity security = 0; + OCTET_STRING<32> ssid = 1; + OCTET_STRING<6> bssid = 2; INT16U channel = 3; WiFiBand wiFiBand = 4; INT8S rssi = 5; } struct ThreadInterfaceScanResult { - INT64U panId = 0; + INT16U panId = 0; INT64U extendedPanId = 1; - CHAR_STRING networkName = 2; + CHAR_STRING<16> networkName = 2; INT16U channel = 3; INT8U version = 4; - INT64U extendedAddress = 5; + OCTET_STRING<8> extendedAddress = 5; INT8S rssi = 6; INT8U lqi = 7; } @@ -438,7 +446,7 @@ server cluster NetworkCommissioning = 49 { readonly global attribute int16u clusterRevision = 65533; request struct ScanNetworksRequest { - OCTET_STRING ssid = 0; + optional nullable OCTET_STRING ssid = 0; optional INT64U breadcrumb = 1; } @@ -466,7 +474,7 @@ server cluster NetworkCommissioning = 49 { response struct ScanNetworksResponse { NetworkCommissioningStatus networkingStatus = 0; - CHAR_STRING debugText = 1; + optional CHAR_STRING debugText = 1; optional WiFiInterfaceScanResult wiFiScanResults[] = 2; optional ThreadInterfaceScanResult threadScanResults[] = 3; } @@ -479,8 +487,8 @@ server cluster NetworkCommissioning = 49 { response struct ConnectNetworkResponse { NetworkCommissioningStatus networkingStatus = 0; - CHAR_STRING debugText = 1; - INT32S errorValue = 2; + optional CHAR_STRING debugText = 1; + nullable INT32S errorValue = 2; } command ScanNetworks(ScanNetworksRequest): ScanNetworksResponse = 0; diff --git a/examples/thermostat/thermostat-common/thermostat.matter b/examples/thermostat/thermostat-common/thermostat.matter index b2618a97fb277e..ae3d2209f60615 100644 --- a/examples/thermostat/thermostat-common/thermostat.matter +++ b/examples/thermostat/thermostat-common/thermostat.matter @@ -571,27 +571,35 @@ server cluster NetworkCommissioning = 49 { kEthernetNetworkInterface = 0x4; } + bitmap WiFiSecurity : BITMAP8 { + kUnencrypted = 0x1; + kWepPersonal = 0x2; + kWpaPersonal = 0x4; + kWpa2Personal = 0x8; + kWpa3Personal = 0x10; + } + struct NetworkInfo { - OCTET_STRING networkID = 0; + OCTET_STRING<32> networkID = 0; BOOLEAN connected = 1; } struct WiFiInterfaceScanResult { - BITMAP8 security = 0; - OCTET_STRING ssid = 1; - OCTET_STRING bssid = 2; + WiFiSecurity security = 0; + OCTET_STRING<32> ssid = 1; + OCTET_STRING<6> bssid = 2; INT16U channel = 3; WiFiBand wiFiBand = 4; INT8S rssi = 5; } struct ThreadInterfaceScanResult { - INT64U panId = 0; + INT16U panId = 0; INT64U extendedPanId = 1; - CHAR_STRING networkName = 2; + CHAR_STRING<16> networkName = 2; INT16U channel = 3; INT8U version = 4; - INT64U extendedAddress = 5; + OCTET_STRING<8> extendedAddress = 5; INT8S rssi = 6; INT8U lqi = 7; } @@ -608,7 +616,7 @@ server cluster NetworkCommissioning = 49 { readonly global attribute int16u clusterRevision = 65533; request struct ScanNetworksRequest { - OCTET_STRING ssid = 0; + optional nullable OCTET_STRING ssid = 0; optional INT64U breadcrumb = 1; } @@ -641,7 +649,7 @@ server cluster NetworkCommissioning = 49 { response struct ScanNetworksResponse { NetworkCommissioningStatus networkingStatus = 0; - CHAR_STRING debugText = 1; + optional CHAR_STRING debugText = 1; optional WiFiInterfaceScanResult wiFiScanResults[] = 2; optional ThreadInterfaceScanResult threadScanResults[] = 3; } @@ -654,8 +662,8 @@ server cluster NetworkCommissioning = 49 { response struct ConnectNetworkResponse { NetworkCommissioningStatus networkingStatus = 0; - CHAR_STRING debugText = 1; - INT32S errorValue = 2; + optional CHAR_STRING debugText = 1; + nullable INT32S errorValue = 2; } command ScanNetworks(ScanNetworksRequest): ScanNetworksResponse = 0; diff --git a/examples/tv-app/tv-common/tv-app.matter b/examples/tv-app/tv-common/tv-app.matter index fc7404bfaa70a0..d7fa082327e15a 100644 --- a/examples/tv-app/tv-common/tv-app.matter +++ b/examples/tv-app/tv-common/tv-app.matter @@ -1108,27 +1108,35 @@ client cluster NetworkCommissioning = 49 { kEthernetNetworkInterface = 0x4; } + bitmap WiFiSecurity : BITMAP8 { + kUnencrypted = 0x1; + kWepPersonal = 0x2; + kWpaPersonal = 0x4; + kWpa2Personal = 0x8; + kWpa3Personal = 0x10; + } + struct NetworkInfo { - OCTET_STRING networkID = 0; + OCTET_STRING<32> networkID = 0; BOOLEAN connected = 1; } struct WiFiInterfaceScanResult { - BITMAP8 security = 0; - OCTET_STRING ssid = 1; - OCTET_STRING bssid = 2; + WiFiSecurity security = 0; + OCTET_STRING<32> ssid = 1; + OCTET_STRING<6> bssid = 2; INT16U channel = 3; WiFiBand wiFiBand = 4; INT8S rssi = 5; } struct ThreadInterfaceScanResult { - INT64U panId = 0; + INT16U panId = 0; INT64U extendedPanId = 1; - CHAR_STRING networkName = 2; + CHAR_STRING<16> networkName = 2; INT16U channel = 3; INT8U version = 4; - INT64U extendedAddress = 5; + OCTET_STRING<8> extendedAddress = 5; INT8S rssi = 6; INT8U lqi = 7; } @@ -1145,7 +1153,7 @@ client cluster NetworkCommissioning = 49 { readonly global attribute int16u clusterRevision = 65533; request struct ScanNetworksRequest { - OCTET_STRING ssid = 0; + optional nullable OCTET_STRING ssid = 0; optional INT64U breadcrumb = 1; } @@ -1178,7 +1186,7 @@ client cluster NetworkCommissioning = 49 { response struct ScanNetworksResponse { NetworkCommissioningStatus networkingStatus = 0; - CHAR_STRING debugText = 1; + optional CHAR_STRING debugText = 1; optional WiFiInterfaceScanResult wiFiScanResults[] = 2; optional ThreadInterfaceScanResult threadScanResults[] = 3; } @@ -1191,8 +1199,8 @@ client cluster NetworkCommissioning = 49 { response struct ConnectNetworkResponse { NetworkCommissioningStatus networkingStatus = 0; - CHAR_STRING debugText = 1; - INT32S errorValue = 2; + optional CHAR_STRING debugText = 1; + nullable INT32S errorValue = 2; } command ScanNetworks(ScanNetworksRequest): ScanNetworksResponse = 0; @@ -1234,27 +1242,35 @@ server cluster NetworkCommissioning = 49 { kEthernetNetworkInterface = 0x4; } + bitmap WiFiSecurity : BITMAP8 { + kUnencrypted = 0x1; + kWepPersonal = 0x2; + kWpaPersonal = 0x4; + kWpa2Personal = 0x8; + kWpa3Personal = 0x10; + } + struct NetworkInfo { - OCTET_STRING networkID = 0; + OCTET_STRING<32> networkID = 0; BOOLEAN connected = 1; } struct WiFiInterfaceScanResult { - BITMAP8 security = 0; - OCTET_STRING ssid = 1; - OCTET_STRING bssid = 2; + WiFiSecurity security = 0; + OCTET_STRING<32> ssid = 1; + OCTET_STRING<6> bssid = 2; INT16U channel = 3; WiFiBand wiFiBand = 4; INT8S rssi = 5; } struct ThreadInterfaceScanResult { - INT64U panId = 0; + INT16U panId = 0; INT64U extendedPanId = 1; - CHAR_STRING networkName = 2; + CHAR_STRING<16> networkName = 2; INT16U channel = 3; INT8U version = 4; - INT64U extendedAddress = 5; + OCTET_STRING<8> extendedAddress = 5; INT8S rssi = 6; INT8U lqi = 7; } @@ -1271,7 +1287,7 @@ server cluster NetworkCommissioning = 49 { readonly global attribute int16u clusterRevision = 65533; request struct ScanNetworksRequest { - OCTET_STRING ssid = 0; + optional nullable OCTET_STRING ssid = 0; optional INT64U breadcrumb = 1; } @@ -1304,7 +1320,7 @@ server cluster NetworkCommissioning = 49 { response struct ScanNetworksResponse { NetworkCommissioningStatus networkingStatus = 0; - CHAR_STRING debugText = 1; + optional CHAR_STRING debugText = 1; optional WiFiInterfaceScanResult wiFiScanResults[] = 2; optional ThreadInterfaceScanResult threadScanResults[] = 3; } @@ -1317,8 +1333,8 @@ server cluster NetworkCommissioning = 49 { response struct ConnectNetworkResponse { NetworkCommissioningStatus networkingStatus = 0; - CHAR_STRING debugText = 1; - INT32S errorValue = 2; + optional CHAR_STRING debugText = 1; + nullable INT32S errorValue = 2; } command ScanNetworks(ScanNetworksRequest): ScanNetworksResponse = 0; diff --git a/examples/tv-casting-app/tv-casting-common/tv-casting-app.matter b/examples/tv-casting-app/tv-casting-common/tv-casting-app.matter index 6d212c00ca1217..cba29cf836bd4c 100644 --- a/examples/tv-casting-app/tv-casting-common/tv-casting-app.matter +++ b/examples/tv-casting-app/tv-casting-common/tv-casting-app.matter @@ -1260,27 +1260,35 @@ server cluster NetworkCommissioning = 49 { kEthernetNetworkInterface = 0x4; } + bitmap WiFiSecurity : BITMAP8 { + kUnencrypted = 0x1; + kWepPersonal = 0x2; + kWpaPersonal = 0x4; + kWpa2Personal = 0x8; + kWpa3Personal = 0x10; + } + struct NetworkInfo { - OCTET_STRING networkID = 0; + OCTET_STRING<32> networkID = 0; BOOLEAN connected = 1; } struct WiFiInterfaceScanResult { - BITMAP8 security = 0; - OCTET_STRING ssid = 1; - OCTET_STRING bssid = 2; + WiFiSecurity security = 0; + OCTET_STRING<32> ssid = 1; + OCTET_STRING<6> bssid = 2; INT16U channel = 3; WiFiBand wiFiBand = 4; INT8S rssi = 5; } struct ThreadInterfaceScanResult { - INT64U panId = 0; + INT16U panId = 0; INT64U extendedPanId = 1; - CHAR_STRING networkName = 2; + CHAR_STRING<16> networkName = 2; INT16U channel = 3; INT8U version = 4; - INT64U extendedAddress = 5; + OCTET_STRING<8> extendedAddress = 5; INT8S rssi = 6; INT8U lqi = 7; } @@ -1297,7 +1305,7 @@ server cluster NetworkCommissioning = 49 { readonly global attribute int16u clusterRevision = 65533; request struct ScanNetworksRequest { - OCTET_STRING ssid = 0; + optional nullable OCTET_STRING ssid = 0; optional INT64U breadcrumb = 1; } @@ -1330,7 +1338,7 @@ server cluster NetworkCommissioning = 49 { response struct ScanNetworksResponse { NetworkCommissioningStatus networkingStatus = 0; - CHAR_STRING debugText = 1; + optional CHAR_STRING debugText = 1; optional WiFiInterfaceScanResult wiFiScanResults[] = 2; optional ThreadInterfaceScanResult threadScanResults[] = 3; } @@ -1343,8 +1351,8 @@ server cluster NetworkCommissioning = 49 { response struct ConnectNetworkResponse { NetworkCommissioningStatus networkingStatus = 0; - CHAR_STRING debugText = 1; - INT32S errorValue = 2; + optional CHAR_STRING debugText = 1; + nullable INT32S errorValue = 2; } command ScanNetworks(ScanNetworksRequest): ScanNetworksResponse = 0; diff --git a/examples/window-app/common/window-app.matter b/examples/window-app/common/window-app.matter index 5681c8f3911047..829787c8b939a4 100644 --- a/examples/window-app/common/window-app.matter +++ b/examples/window-app/common/window-app.matter @@ -504,27 +504,35 @@ server cluster NetworkCommissioning = 49 { kEthernetNetworkInterface = 0x4; } + bitmap WiFiSecurity : BITMAP8 { + kUnencrypted = 0x1; + kWepPersonal = 0x2; + kWpaPersonal = 0x4; + kWpa2Personal = 0x8; + kWpa3Personal = 0x10; + } + struct NetworkInfo { - OCTET_STRING networkID = 0; + OCTET_STRING<32> networkID = 0; BOOLEAN connected = 1; } struct WiFiInterfaceScanResult { - BITMAP8 security = 0; - OCTET_STRING ssid = 1; - OCTET_STRING bssid = 2; + WiFiSecurity security = 0; + OCTET_STRING<32> ssid = 1; + OCTET_STRING<6> bssid = 2; INT16U channel = 3; WiFiBand wiFiBand = 4; INT8S rssi = 5; } struct ThreadInterfaceScanResult { - INT64U panId = 0; + INT16U panId = 0; INT64U extendedPanId = 1; - CHAR_STRING networkName = 2; + CHAR_STRING<16> networkName = 2; INT16U channel = 3; INT8U version = 4; - INT64U extendedAddress = 5; + OCTET_STRING<8> extendedAddress = 5; INT8S rssi = 6; INT8U lqi = 7; } @@ -544,7 +552,7 @@ server cluster NetworkCommissioning = 49 { readonly global attribute int16u clusterRevision = 65533; request struct ScanNetworksRequest { - OCTET_STRING ssid = 0; + optional nullable OCTET_STRING ssid = 0; optional INT64U breadcrumb = 1; } @@ -577,7 +585,7 @@ server cluster NetworkCommissioning = 49 { response struct ScanNetworksResponse { NetworkCommissioningStatus networkingStatus = 0; - CHAR_STRING debugText = 1; + optional CHAR_STRING debugText = 1; optional WiFiInterfaceScanResult wiFiScanResults[] = 2; optional ThreadInterfaceScanResult threadScanResults[] = 3; } @@ -590,8 +598,8 @@ server cluster NetworkCommissioning = 49 { response struct ConnectNetworkResponse { NetworkCommissioningStatus networkingStatus = 0; - CHAR_STRING debugText = 1; - INT32S errorValue = 2; + optional CHAR_STRING debugText = 1; + nullable INT32S errorValue = 2; } command ScanNetworks(ScanNetworksRequest): ScanNetworksResponse = 0; diff --git a/src/app/clusters/network-commissioning/network-commissioning.cpp b/src/app/clusters/network-commissioning/network-commissioning.cpp index f803e738def0ae..8d51e8791871da 100644 --- a/src/app/clusters/network-commissioning/network-commissioning.cpp +++ b/src/app/clusters/network-commissioning/network-commissioning.cpp @@ -79,6 +79,28 @@ NetworkCommissioning::WiFiBand ToClusterObjectEnum(DeviceLayer::NetworkCommissio return static_cast(to_underlying(band)); } +chip::BitFlags +ToClusterObjectBitFlags(const chip::BitFlags & security) +{ + using ClusterObject = NetworkCommissioning::WiFiSecurity; + using PlatformInterface = NetworkCommissioning::WiFiSecurity; + + static_assert(to_underlying(ClusterObject::kUnencrypted) == to_underlying(PlatformInterface::kUnencrypted), + "kUnencrypted value mismatch."); + static_assert(to_underlying(ClusterObject::kWepPersonal) == to_underlying(PlatformInterface::kWepPersonal), + "kWepPersonal value mismatch."); + static_assert(to_underlying(ClusterObject::kWpaPersonal) == to_underlying(PlatformInterface::kWpaPersonal), + "kWpaPersonal value mismatch."); + static_assert(to_underlying(ClusterObject::kWpa2Personal) == to_underlying(PlatformInterface::kWpa2Personal), + "kWpa2Personal value mismatch."); + static_assert(to_underlying(ClusterObject::kWpa3Personal) == to_underlying(PlatformInterface::kWpa3Personal), + "kWpa3Personal value mismatch."); + + chip::BitFlags ret; + ret.SetRaw(security.Raw()); + return ret; +} + } // namespace CHIP_ERROR Instance::Init() @@ -272,8 +294,19 @@ void Instance::HandleScanNetworks(HandlerContext & ctx, const Commands::ScanNetw MATTER_TRACE_EVENT_SCOPE("HandleScanNetwork", "NetworkCommissioning"); if (mFeatureFlags.Has(NetworkCommissioningFeature::kWiFiNetworkInterface)) { + if (!req.ssid.HasValue()) + { + ctx.mCommandHandler.AddStatus(ctx.mRequestPath, Protocols::InteractionModel::Status::InvalidCommand); + return; + } + const auto nullableSSID = req.ssid.Value(); + ByteSpan ssid; + if (!nullableSSID.IsNull()) + { + ssid = nullableSSID.Value(); + } mAsyncCommandHandle = CommandHandler::Handle(&ctx.mCommandHandler); - mpDriver.Get()->ScanNetworks(req.ssid, this); + mpDriver.Get()->ScanNetworks(ssid, this); } else if (mFeatureFlags.Has(NetworkCommissioningFeature::kThreadNetworkInterface)) { @@ -379,7 +412,7 @@ void Instance::HandleReorderNetwork(HandlerContext & ctx, const Commands::Reorde ctx.mCommandHandler.AddResponse(ctx.mRequestPath, response); } -void Instance::OnResult(Status commissioningError, CharSpan errorText, int32_t interfaceStatus) +void Instance::OnResult(Status commissioningError, CharSpan debugText, int32_t interfaceStatus) { auto commandHandleRef = std::move(mAsyncCommandHandle); auto commandHandle = commandHandleRef.Get(); @@ -392,28 +425,27 @@ void Instance::OnResult(Status commissioningError, CharSpan errorText, int32_t i Commands::ConnectNetworkResponse::Type response; response.networkingStatus = ToClusterObjectEnum(commissioningError); - response.debugText = errorText; - response.errorValue = interfaceStatus; - commandHandle->AddResponse(mPath, response); - - mLastNetworkIDLen = mConnectingNetworkIDLen; - memcpy(mLastNetworkID, mConnectingNetworkID, mLastNetworkIDLen); - mLastNetworkingStatusValue.SetNonNull(ToClusterObjectEnum(commissioningError)); - + if (debugText.size() != 0) + { + response.debugText.SetValue(debugText); + } if (commissioningError == Status::kSuccess) { + DeviceLayer::DeviceControlServer::DeviceControlSvr().ConnectNetworkForOperational( + ByteSpan(mLastNetworkID, mLastNetworkIDLen)); mLastConnectErrorValue.SetNull(); } else { + response.errorValue.SetNonNull(interfaceStatus); mLastConnectErrorValue.SetNonNull(interfaceStatus); } - if (commissioningError == Status::kSuccess) - { - DeviceLayer::DeviceControlServer::DeviceControlSvr().ConnectNetworkForOperational( - ByteSpan(mLastNetworkID, mLastNetworkIDLen)); - } + mLastNetworkIDLen = mConnectingNetworkIDLen; + memcpy(mLastNetworkID, mConnectingNetworkID, mLastNetworkIDLen); + mLastNetworkingStatusValue.SetNonNull(ToClusterObjectEnum(commissioningError)); + + commandHandle->AddResponse(mPath, response); } void Instance::OnFinished(Status status, CharSpan debugText, ThreadScanResponseIterator * networks) @@ -436,6 +468,7 @@ void Instance::OnFinished(Status status, CharSpan debugText, ThreadScanResponseI TLV::TLVType listContainerType; ThreadScanResponse scanResponse; size_t networksEncoded = 0; + uint8_t extendedAddressBuffer[8]; SuccessOrExit(err = commandHandle->PrepareCommand( ConcreteCommandPath(mPath.mEndpointId, NetworkCommissioning::Id, Commands::ScanNetworksResponse::Id))); @@ -443,8 +476,11 @@ void Instance::OnFinished(Status status, CharSpan debugText, ThreadScanResponseI SuccessOrExit(err = writer->Put(TLV::ContextTag(to_underlying(Commands::ScanNetworksResponse::Fields::kNetworkingStatus)), ToClusterObjectEnum(status))); - SuccessOrExit(err = DataModel::Encode( - *writer, TLV::ContextTag(to_underlying(Commands::ScanNetworksResponse::Fields::kDebugText)), debugText)); + if (debugText.size() != 0) + { + SuccessOrExit(err = DataModel::Encode( + *writer, TLV::ContextTag(to_underlying(Commands::ScanNetworksResponse::Fields::kDebugText)), debugText)); + } SuccessOrExit( err = writer->StartContainer(TLV::ContextTag(to_underlying(Commands::ScanNetworksResponse::Fields::kThreadScanResults)), TLV::TLVType::kTLVType_Array, listContainerType)); @@ -452,12 +488,13 @@ void Instance::OnFinished(Status status, CharSpan debugText, ThreadScanResponseI for (; networks != nullptr && networks->Next(scanResponse) && networksEncoded < kMaxNetworksInScanResponse; networksEncoded++) { Structs::ThreadInterfaceScanResult::Type result; + Encoding::BigEndian::Put64(extendedAddressBuffer, scanResponse.extendedAddress); result.panId = scanResponse.panId; result.extendedPanId = scanResponse.extendedPanId; result.networkName = CharSpan(scanResponse.networkName, scanResponse.networkNameLen); result.channel = scanResponse.channel; result.version = scanResponse.version; - result.extendedAddress = scanResponse.extendedAddress; + result.extendedAddress = ByteSpan(extendedAddressBuffer); result.rssi = scanResponse.rssi; result.lqi = scanResponse.lqi; SuccessOrExit(err = DataModel::Encode(*writer, TLV::AnonymousTag(), result)); @@ -501,8 +538,11 @@ void Instance::OnFinished(Status status, CharSpan debugText, WiFiScanResponseIte SuccessOrExit(err = writer->Put(TLV::ContextTag(to_underlying(Commands::ScanNetworksResponse::Fields::kNetworkingStatus)), ToClusterObjectEnum(status))); - SuccessOrExit(err = DataModel::Encode( - *writer, TLV::ContextTag(to_underlying(Commands::ScanNetworksResponse::Fields::kDebugText)), debugText)); + if (debugText.size() != 0) + { + SuccessOrExit(err = DataModel::Encode( + *writer, TLV::ContextTag(to_underlying(Commands::ScanNetworksResponse::Fields::kDebugText)), debugText)); + } SuccessOrExit( err = writer->StartContainer(TLV::ContextTag(to_underlying(Commands::ScanNetworksResponse::Fields::kWiFiScanResults)), TLV::TLVType::kTLVType_Array, listContainerType)); @@ -510,7 +550,7 @@ void Instance::OnFinished(Status status, CharSpan debugText, WiFiScanResponseIte for (; networks != nullptr && networks->Next(scanResponse) && networksEncoded < kMaxNetworksInScanResponse; networksEncoded++) { Structs::WiFiInterfaceScanResult::Type result; - result.security = scanResponse.security; + result.security = ToClusterObjectBitFlags(scanResponse.security); result.ssid = ByteSpan(scanResponse.ssid, scanResponse.ssidLen); result.bssid = ByteSpan(scanResponse.bssid, sizeof(scanResponse.bssid)); result.channel = scanResponse.channel; diff --git a/src/app/zap-templates/zcl/data-model/chip/commissioning.xml b/src/app/zap-templates/zcl/data-model/chip/commissioning.xml index aafac110635b1b..f520730f145e7a 100644 --- a/src/app/zap-templates/zcl/data-model/chip/commissioning.xml +++ b/src/app/zap-templates/zcl/data-model/chip/commissioning.xml @@ -41,6 +41,7 @@ limitations under the License. + @@ -49,27 +50,27 @@ limitations under the License. - - - + + + - + - + - + - + @@ -84,8 +85,8 @@ limitations under the License. MaxNetworks Networks - ScanMaxTimeSeconds - ConnectMaxTimeSeconds + ScanMaxTimeSeconds + ConnectMaxTimeSeconds InterfaceEnabled LastNetworkingStatus LastNetworkID @@ -93,52 +94,52 @@ limitations under the License. Detemine the set of networks the device sees as available. - + Relay the set of networks the device sees as available back to the client. - + Add or update the credentials for a given Wi-Fi network. - - + + Add or update the credentials for a given Thread network. - + Remove the definition of a given network (including its credentials). - + Response command for various commands that add/remove/modify network credentials. - + Connect to the specified network, using previously-defined credentials. - + Command that indicates whether we have succcessfully connected to a network. - - + + Modify the order in which networks will be presented in the Networks attribute. - + diff --git a/src/controller/data_model/controller-clusters.matter b/src/controller/data_model/controller-clusters.matter index 3f7a2f9a8fac1b..4dc88a122886fe 100644 --- a/src/controller/data_model/controller-clusters.matter +++ b/src/controller/data_model/controller-clusters.matter @@ -2425,27 +2425,35 @@ client cluster NetworkCommissioning = 49 { kEthernetNetworkInterface = 0x4; } + bitmap WiFiSecurity : BITMAP8 { + kUnencrypted = 0x1; + kWepPersonal = 0x2; + kWpaPersonal = 0x4; + kWpa2Personal = 0x8; + kWpa3Personal = 0x10; + } + struct NetworkInfo { - OCTET_STRING networkID = 0; + OCTET_STRING<32> networkID = 0; BOOLEAN connected = 1; } struct WiFiInterfaceScanResult { - BITMAP8 security = 0; - OCTET_STRING ssid = 1; - OCTET_STRING bssid = 2; + WiFiSecurity security = 0; + OCTET_STRING<32> ssid = 1; + OCTET_STRING<6> bssid = 2; INT16U channel = 3; WiFiBand wiFiBand = 4; INT8S rssi = 5; } struct ThreadInterfaceScanResult { - INT64U panId = 0; + INT16U panId = 0; INT64U extendedPanId = 1; - CHAR_STRING networkName = 2; + CHAR_STRING<16> networkName = 2; INT16U channel = 3; INT8U version = 4; - INT64U extendedAddress = 5; + OCTET_STRING<8> extendedAddress = 5; INT8S rssi = 6; INT8U lqi = 7; } @@ -2464,7 +2472,7 @@ client cluster NetworkCommissioning = 49 { readonly global attribute int16u clusterRevision = 65533; request struct ScanNetworksRequest { - OCTET_STRING ssid = 0; + optional nullable OCTET_STRING ssid = 0; optional INT64U breadcrumb = 1; } @@ -2497,7 +2505,7 @@ client cluster NetworkCommissioning = 49 { response struct ScanNetworksResponse { NetworkCommissioningStatus networkingStatus = 0; - CHAR_STRING debugText = 1; + optional CHAR_STRING debugText = 1; optional WiFiInterfaceScanResult wiFiScanResults[] = 2; optional ThreadInterfaceScanResult threadScanResults[] = 3; } @@ -2510,8 +2518,8 @@ client cluster NetworkCommissioning = 49 { response struct ConnectNetworkResponse { NetworkCommissioningStatus networkingStatus = 0; - CHAR_STRING debugText = 1; - INT32S errorValue = 2; + optional CHAR_STRING debugText = 1; + nullable INT32S errorValue = 2; } command ScanNetworks(ScanNetworksRequest): ScanNetworksResponse = 0; diff --git a/src/controller/java/zap-generated/CHIPInvokeCallbacks.cpp b/src/controller/java/zap-generated/CHIPInvokeCallbacks.cpp index 5bfce2a682bf08..c7eb45828043aa 100644 --- a/src/controller/java/zap-generated/CHIPInvokeCallbacks.cpp +++ b/src/controller/java/zap-generated/CHIPInvokeCallbacks.cpp @@ -1969,7 +1969,7 @@ void CHIPNetworkCommissioningClusterConnectNetworkResponseCallback::CallbackFn( VerifyOrReturn(javaCallbackRef != nullptr); err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", - "(Ljava/lang/Integer;Ljava/lang/String;Ljava/lang/Long;)V", &javaMethod); + "(Ljava/lang/Integer;Ljava/util/Optional;Ljava/lang/Long;)V", &javaMethod); VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error invoking Java callback: %s", ErrorStr(err))); jobject NetworkingStatus; @@ -1979,12 +1979,29 @@ void CHIPNetworkCommissioningClusterConnectNetworkResponseCallback::CallbackFn( NetworkingStatusClassName.c_str(), NetworkingStatusCtorSignature.c_str(), static_cast(dataResponse.networkingStatus), NetworkingStatus); jobject DebugText; - DebugText = env->NewStringUTF(std::string(dataResponse.debugText.data(), dataResponse.debugText.size()).c_str()); + if (!dataResponse.debugText.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, DebugText); + } + else + { + jobject DebugTextInsideOptional; + DebugTextInsideOptional = + env->NewStringUTF(std::string(dataResponse.debugText.Value().data(), dataResponse.debugText.Value().size()).c_str()); + chip::JniReferences::GetInstance().CreateOptional(DebugTextInsideOptional, DebugText); + } jobject ErrorValue; - std::string ErrorValueClassName = "java/lang/Long"; - std::string ErrorValueCtorSignature = "(J)V"; - chip::JniReferences::GetInstance().CreateBoxedObject(ErrorValueClassName.c_str(), ErrorValueCtorSignature.c_str(), - dataResponse.errorValue, ErrorValue); + if (dataResponse.errorValue.IsNull()) + { + ErrorValue = nullptr; + } + else + { + std::string ErrorValueClassName = "java/lang/Long"; + std::string ErrorValueCtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(ErrorValueClassName.c_str(), ErrorValueCtorSignature.c_str(), + dataResponse.errorValue.Value(), ErrorValue); + } env->CallVoidMethod(javaCallbackRef, javaMethod, NetworkingStatus, DebugText, ErrorValue); } @@ -2129,7 +2146,7 @@ void CHIPNetworkCommissioningClusterScanNetworksResponseCallback::CallbackFn( VerifyOrReturn(javaCallbackRef != nullptr); err = JniReferences::GetInstance().FindMethod( - env, javaCallbackRef, "onSuccess", "(Ljava/lang/Integer;Ljava/lang/String;Ljava/util/Optional;Ljava/util/Optional;)V", + env, javaCallbackRef, "onSuccess", "(Ljava/lang/Integer;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;)V", &javaMethod); VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error invoking Java callback: %s", ErrorStr(err))); @@ -2140,7 +2157,17 @@ void CHIPNetworkCommissioningClusterScanNetworksResponseCallback::CallbackFn( NetworkingStatusClassName.c_str(), NetworkingStatusCtorSignature.c_str(), static_cast(dataResponse.networkingStatus), NetworkingStatus); jobject DebugText; - DebugText = env->NewStringUTF(std::string(dataResponse.debugText.data(), dataResponse.debugText.size()).c_str()); + if (!dataResponse.debugText.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, DebugText); + } + else + { + jobject DebugTextInsideOptional; + DebugTextInsideOptional = + env->NewStringUTF(std::string(dataResponse.debugText.Value().data(), dataResponse.debugText.Value().size()).c_str()); + chip::JniReferences::GetInstance().CreateOptional(DebugTextInsideOptional, DebugText); + } jobject WiFiScanResults; if (!dataResponse.wiFiScanResults.HasValue()) { @@ -2161,7 +2188,7 @@ void CHIPNetworkCommissioningClusterScanNetworksResponseCallback::CallbackFn( std::string newElement_1_securityCtorSignature = "(I)V"; chip::JniReferences::GetInstance().CreateBoxedObject(newElement_1_securityClassName.c_str(), newElement_1_securityCtorSignature.c_str(), - entry_1.security, newElement_1_security); + entry_1.security.Raw(), newElement_1_security); jobject newElement_1_ssid; jbyteArray newElement_1_ssidByteArray = env->NewByteArray(static_cast(entry_1.ssid.size())); env->SetByteArrayRegion(newElement_1_ssidByteArray, 0, static_cast(entry_1.ssid.size()), @@ -2231,9 +2258,9 @@ void CHIPNetworkCommissioningClusterScanNetworksResponseCallback::CallbackFn( auto & entry_1 = iter_ThreadScanResultsInsideOptional_1.GetValue(); jobject newElement_1; jobject newElement_1_panId; - std::string newElement_1_panIdClassName = "java/lang/Long"; - std::string newElement_1_panIdCtorSignature = "(J)V"; - chip::JniReferences::GetInstance().CreateBoxedObject( + std::string newElement_1_panIdClassName = "java/lang/Integer"; + std::string newElement_1_panIdCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( newElement_1_panIdClassName.c_str(), newElement_1_panIdCtorSignature.c_str(), entry_1.panId, newElement_1_panId); jobject newElement_1_extendedPanId; std::string newElement_1_extendedPanIdClassName = "java/lang/Long"; @@ -2257,11 +2284,11 @@ void CHIPNetworkCommissioningClusterScanNetworksResponseCallback::CallbackFn( newElement_1_versionCtorSignature.c_str(), entry_1.version, newElement_1_version); jobject newElement_1_extendedAddress; - std::string newElement_1_extendedAddressClassName = "java/lang/Long"; - std::string newElement_1_extendedAddressCtorSignature = "(J)V"; - chip::JniReferences::GetInstance().CreateBoxedObject(newElement_1_extendedAddressClassName.c_str(), - newElement_1_extendedAddressCtorSignature.c_str(), - entry_1.extendedAddress, newElement_1_extendedAddress); + jbyteArray newElement_1_extendedAddressByteArray = + env->NewByteArray(static_cast(entry_1.extendedAddress.size())); + env->SetByteArrayRegion(newElement_1_extendedAddressByteArray, 0, static_cast(entry_1.extendedAddress.size()), + reinterpret_cast(entry_1.extendedAddress.data())); + newElement_1_extendedAddress = newElement_1_extendedAddressByteArray; jobject newElement_1_rssi; std::string newElement_1_rssiClassName = "java/lang/Integer"; std::string newElement_1_rssiCtorSignature = "(I)V"; @@ -2284,8 +2311,8 @@ void CHIPNetworkCommissioningClusterScanNetworksResponseCallback::CallbackFn( } jmethodID threadInterfaceScanResultStructCtor = env->GetMethodID(threadInterfaceScanResultStructClass, "", - "(Ljava/lang/Long;Ljava/lang/Long;Ljava/lang/String;Ljava/lang/Integer;Ljava/lang/Integer;Ljava/" - "lang/Long;Ljava/lang/Integer;Ljava/lang/Integer;)V"); + "(Ljava/lang/Integer;Ljava/lang/Long;Ljava/lang/String;Ljava/lang/Integer;Ljava/lang/" + "Integer;[BLjava/lang/Integer;Ljava/lang/Integer;)V"); if (threadInterfaceScanResultStructCtor == nullptr) { ChipLogError(Zcl, "Could not find ChipStructs$NetworkCommissioningClusterThreadInterfaceScanResult constructor"); diff --git a/src/controller/java/zap-generated/chip/devicecontroller/ChipClusters.java b/src/controller/java/zap-generated/chip/devicecontroller/ChipClusters.java index 8cbf4e10faa7c2..9ed965a2a9b3a7 100644 --- a/src/controller/java/zap-generated/chip/devicecontroller/ChipClusters.java +++ b/src/controller/java/zap-generated/chip/devicecontroller/ChipClusters.java @@ -11415,13 +11415,15 @@ public void reorderNetwork( } public void scanNetworks( - ScanNetworksResponseCallback callback, byte[] ssid, Optional breadcrumb) { + ScanNetworksResponseCallback callback, + @Nullable Optional ssid, + Optional breadcrumb) { scanNetworks(chipClusterPtr, callback, ssid, breadcrumb, null); } public void scanNetworks( ScanNetworksResponseCallback callback, - byte[] ssid, + @Nullable Optional ssid, Optional breadcrumb, int timedInvokeTimeoutMs) { scanNetworks(chipClusterPtr, callback, ssid, breadcrumb, timedInvokeTimeoutMs); @@ -11467,12 +11469,13 @@ private native void reorderNetwork( private native void scanNetworks( long chipClusterPtr, ScanNetworksResponseCallback Callback, - byte[] ssid, + @Nullable Optional ssid, Optional breadcrumb, @Nullable Integer timedInvokeTimeoutMs); public interface ConnectNetworkResponseCallback { - void onSuccess(Integer networkingStatus, String debugText, Long errorValue); + void onSuccess( + Integer networkingStatus, Optional debugText, @Nullable Long errorValue); void onError(Exception error); } @@ -11487,7 +11490,7 @@ void onSuccess( public interface ScanNetworksResponseCallback { void onSuccess( Integer networkingStatus, - String debugText, + Optional debugText, Optional> wiFiScanResults, Optional> diff --git a/src/controller/java/zap-generated/chip/devicecontroller/ChipStructs.java b/src/controller/java/zap-generated/chip/devicecontroller/ChipStructs.java index 67be474ef5dc1d..c25119a4659464 100644 --- a/src/controller/java/zap-generated/chip/devicecontroller/ChipStructs.java +++ b/src/controller/java/zap-generated/chip/devicecontroller/ChipStructs.java @@ -1043,22 +1043,22 @@ public String toString() { } public static class NetworkCommissioningClusterThreadInterfaceScanResult { - public Long panId; + public Integer panId; public Long extendedPanId; public String networkName; public Integer channel; public Integer version; - public Long extendedAddress; + public byte[] extendedAddress; public Integer rssi; public Integer lqi; public NetworkCommissioningClusterThreadInterfaceScanResult( - Long panId, + Integer panId, Long extendedPanId, String networkName, Integer channel, Integer version, - Long extendedAddress, + byte[] extendedAddress, Integer rssi, Integer lqi) { this.panId = panId; @@ -1091,7 +1091,7 @@ public String toString() { output.append(version); output.append("\n"); output.append("\textendedAddress: "); - output.append(extendedAddress); + output.append(Arrays.toString(extendedAddress)); output.append("\n"); output.append("\trssi: "); output.append(rssi); diff --git a/src/controller/java/zap-generated/chip/devicecontroller/ClusterInfoMapping.java b/src/controller/java/zap-generated/chip/devicecontroller/ClusterInfoMapping.java index cd1de27e904f26..28cefd47a9621b 100644 --- a/src/controller/java/zap-generated/chip/devicecontroller/ClusterInfoMapping.java +++ b/src/controller/java/zap-generated/chip/devicecontroller/ClusterInfoMapping.java @@ -4132,12 +4132,14 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(Integer NetworkingStatus, String DebugText, Long ErrorValue) { + public void onSuccess( + Integer NetworkingStatus, Optional DebugText, @Nullable Long ErrorValue) { Map responseValues = new LinkedHashMap<>(); CommandResponseInfo NetworkingStatusResponseValue = new CommandResponseInfo("NetworkingStatus", "Integer"); responseValues.put(NetworkingStatusResponseValue, NetworkingStatus); - CommandResponseInfo DebugTextResponseValue = new CommandResponseInfo("DebugText", "String"); + CommandResponseInfo DebugTextResponseValue = + new CommandResponseInfo("DebugText", "Optional"); responseValues.put(DebugTextResponseValue, DebugText); CommandResponseInfo ErrorValueResponseValue = new CommandResponseInfo("ErrorValue", "Long"); responseValues.put(ErrorValueResponseValue, ErrorValue); @@ -4195,7 +4197,7 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { @Override public void onSuccess( Integer NetworkingStatus, - String DebugText, + Optional DebugText, Optional> WiFiScanResults, Optional> @@ -4204,7 +4206,8 @@ public void onSuccess( CommandResponseInfo NetworkingStatusResponseValue = new CommandResponseInfo("NetworkingStatus", "Integer"); responseValues.put(NetworkingStatusResponseValue, NetworkingStatus); - CommandResponseInfo DebugTextResponseValue = new CommandResponseInfo("DebugText", "String"); + CommandResponseInfo DebugTextResponseValue = + new CommandResponseInfo("DebugText", "Optional"); responseValues.put(DebugTextResponseValue, DebugText); // WiFiScanResults: /* TYPE WARNING: array array defaults to */ uint8_t * // Conversion from this type to Java is not properly implemented yet @@ -10516,7 +10519,7 @@ public Map> getCommandMap() { Map networkCommissioningscanNetworksCommandParams = new LinkedHashMap(); CommandParameterInfo networkCommissioningscanNetworksssidCommandParameterInfo = - new CommandParameterInfo("ssid", byte[].class); + new CommandParameterInfo("ssid", Optional.class); networkCommissioningscanNetworksCommandParams.put( "ssid", networkCommissioningscanNetworksssidCommandParameterInfo); @@ -10532,7 +10535,7 @@ public Map> getCommandMap() { .scanNetworks( (ChipClusters.NetworkCommissioningCluster.ScanNetworksResponseCallback) callback, - (byte[]) commandArguments.get("ssid"), + (Optional) commandArguments.get("ssid"), (Optional) commandArguments.get("breadcrumb")); }, () -> new DelegatedScanNetworksResponseCallback(), diff --git a/src/controller/python/chip/clusters/Objects.py b/src/controller/python/chip/clusters/Objects.py index 10c18f63966ba1..56ca9d2f2fbd76 100644 --- a/src/controller/python/chip/clusters/Objects.py +++ b/src/controller/python/chip/clusters/Objects.py @@ -9504,8 +9504,8 @@ def descriptor(cls) -> ClusterObjectDescriptor: Fields = [ ClusterObjectFieldDescriptor(Label="maxNetworks", Tag=0x00000000, Type=uint), ClusterObjectFieldDescriptor(Label="networks", Tag=0x00000001, Type=typing.List[NetworkCommissioning.Structs.NetworkInfo]), - ClusterObjectFieldDescriptor(Label="scanMaxTimeSeconds", Tag=0x00000002, Type=uint), - ClusterObjectFieldDescriptor(Label="connectMaxTimeSeconds", Tag=0x00000003, Type=uint), + ClusterObjectFieldDescriptor(Label="scanMaxTimeSeconds", Tag=0x00000002, Type=typing.Optional[uint]), + ClusterObjectFieldDescriptor(Label="connectMaxTimeSeconds", Tag=0x00000003, Type=typing.Optional[uint]), ClusterObjectFieldDescriptor(Label="interfaceEnabled", Tag=0x00000004, Type=bool), ClusterObjectFieldDescriptor(Label="lastNetworkingStatus", Tag=0x00000005, Type=typing.Union[Nullable, NetworkCommissioning.Enums.NetworkCommissioningStatus]), ClusterObjectFieldDescriptor(Label="lastNetworkID", Tag=0x00000006, Type=typing.Union[Nullable, bytes]), @@ -9519,8 +9519,8 @@ def descriptor(cls) -> ClusterObjectDescriptor: maxNetworks: 'uint' = None networks: 'typing.List[NetworkCommissioning.Structs.NetworkInfo]' = None - scanMaxTimeSeconds: 'uint' = None - connectMaxTimeSeconds: 'uint' = None + scanMaxTimeSeconds: 'typing.Optional[uint]' = None + connectMaxTimeSeconds: 'typing.Optional[uint]' = None interfaceEnabled: 'bool' = None lastNetworkingStatus: 'typing.Union[Nullable, NetworkCommissioning.Enums.NetworkCommissioningStatus]' = None lastNetworkID: 'typing.Union[Nullable, bytes]' = None @@ -9580,7 +9580,7 @@ def descriptor(cls) -> ClusterObjectDescriptor: ClusterObjectFieldDescriptor(Label="networkName", Tag=2, Type=str), ClusterObjectFieldDescriptor(Label="channel", Tag=3, Type=uint), ClusterObjectFieldDescriptor(Label="version", Tag=4, Type=uint), - ClusterObjectFieldDescriptor(Label="extendedAddress", Tag=5, Type=uint), + ClusterObjectFieldDescriptor(Label="extendedAddress", Tag=5, Type=bytes), ClusterObjectFieldDescriptor(Label="rssi", Tag=6, Type=int), ClusterObjectFieldDescriptor(Label="lqi", Tag=7, Type=uint), ]) @@ -9590,7 +9590,7 @@ def descriptor(cls) -> ClusterObjectDescriptor: networkName: 'str' = "" channel: 'uint' = 0 version: 'uint' = 0 - extendedAddress: 'uint' = 0 + extendedAddress: 'bytes' = b"" rssi: 'int' = 0 lqi: 'uint' = 0 @@ -9628,11 +9628,11 @@ class ScanNetworks(ClusterCommand): def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields = [ - ClusterObjectFieldDescriptor(Label="ssid", Tag=0, Type=bytes), + ClusterObjectFieldDescriptor(Label="ssid", Tag=0, Type=typing.Union[None, Nullable, bytes]), ClusterObjectFieldDescriptor(Label="breadcrumb", Tag=1, Type=typing.Optional[uint]), ]) - ssid: 'bytes' = b"" + ssid: 'typing.Union[None, Nullable, bytes]' = None breadcrumb: 'typing.Optional[uint]' = None @dataclass @@ -9646,13 +9646,13 @@ def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields = [ ClusterObjectFieldDescriptor(Label="networkingStatus", Tag=0, Type=NetworkCommissioning.Enums.NetworkCommissioningStatus), - ClusterObjectFieldDescriptor(Label="debugText", Tag=1, Type=str), + ClusterObjectFieldDescriptor(Label="debugText", Tag=1, Type=typing.Optional[str]), ClusterObjectFieldDescriptor(Label="wiFiScanResults", Tag=2, Type=typing.Optional[typing.List[NetworkCommissioning.Structs.WiFiInterfaceScanResult]]), ClusterObjectFieldDescriptor(Label="threadScanResults", Tag=3, Type=typing.Optional[typing.List[NetworkCommissioning.Structs.ThreadInterfaceScanResult]]), ]) networkingStatus: 'NetworkCommissioning.Enums.NetworkCommissioningStatus' = 0 - debugText: 'str' = "" + debugText: 'typing.Optional[str]' = None wiFiScanResults: 'typing.Optional[typing.List[NetworkCommissioning.Structs.WiFiInterfaceScanResult]]' = None threadScanResults: 'typing.Optional[typing.List[NetworkCommissioning.Structs.ThreadInterfaceScanResult]]' = None @@ -9756,13 +9756,13 @@ def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields = [ ClusterObjectFieldDescriptor(Label="networkingStatus", Tag=0, Type=NetworkCommissioning.Enums.NetworkCommissioningStatus), - ClusterObjectFieldDescriptor(Label="debugText", Tag=1, Type=str), - ClusterObjectFieldDescriptor(Label="errorValue", Tag=2, Type=int), + ClusterObjectFieldDescriptor(Label="debugText", Tag=1, Type=typing.Optional[str]), + ClusterObjectFieldDescriptor(Label="errorValue", Tag=2, Type=typing.Union[Nullable, int]), ]) networkingStatus: 'NetworkCommissioning.Enums.NetworkCommissioningStatus' = 0 - debugText: 'str' = "" - errorValue: 'int' = 0 + debugText: 'typing.Optional[str]' = None + errorValue: 'typing.Union[Nullable, int]' = NullValue @dataclass class ReorderNetwork(ClusterCommand): @@ -9829,9 +9829,9 @@ def attribute_id(cls) -> int: @ChipUtility.classproperty def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=uint) + return ClusterObjectFieldDescriptor(Type=typing.Optional[uint]) - value: 'uint' = 0 + value: 'typing.Optional[uint]' = None @dataclass class ConnectMaxTimeSeconds(ClusterAttributeDescriptor): @@ -9845,9 +9845,9 @@ def attribute_id(cls) -> int: @ChipUtility.classproperty def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=uint) + return ClusterObjectFieldDescriptor(Type=typing.Optional[uint]) - value: 'uint' = 0 + value: 'typing.Optional[uint]' = None @dataclass class InterfaceEnabled(ClusterAttributeDescriptor): diff --git a/src/darwin/Framework/CHIP/zap-generated/CHIPCallbackBridge.mm b/src/darwin/Framework/CHIP/zap-generated/CHIPCallbackBridge.mm index 1f2e36e9248a4c..0c8a88e8f1fb7f 100644 --- a/src/darwin/Framework/CHIP/zap-generated/CHIPCallbackBridge.mm +++ b/src/darwin/Framework/CHIP/zap-generated/CHIPCallbackBridge.mm @@ -11055,12 +11055,20 @@ response.networkingStatus = [NSNumber numberWithUnsignedChar:chip::to_underlying(data.networkingStatus)]; } { - response.debugText = [[NSString alloc] initWithBytes:data.debugText.data() - length:data.debugText.size() - encoding:NSUTF8StringEncoding]; + if (data.debugText.HasValue()) { + response.debugText = [[NSString alloc] initWithBytes:data.debugText.Value().data() + length:data.debugText.Value().size() + encoding:NSUTF8StringEncoding]; + } else { + response.debugText = nil; + } } { - response.errorValue = [NSNumber numberWithInt:data.errorValue]; + if (data.errorValue.IsNull()) { + response.errorValue = nil; + } else { + response.errorValue = [NSNumber numberWithInt:data.errorValue.Value()]; + } } DispatchSuccess(context, response); }; @@ -11099,9 +11107,13 @@ response.networkingStatus = [NSNumber numberWithUnsignedChar:chip::to_underlying(data.networkingStatus)]; } { - response.debugText = [[NSString alloc] initWithBytes:data.debugText.data() - length:data.debugText.size() - encoding:NSUTF8StringEncoding]; + if (data.debugText.HasValue()) { + response.debugText = [[NSString alloc] initWithBytes:data.debugText.Value().data() + length:data.debugText.Value().size() + encoding:NSUTF8StringEncoding]; + } else { + response.debugText = nil; + } } { if (data.wiFiScanResults.HasValue()) { @@ -11112,7 +11124,7 @@ auto & entry_1 = iter_1.GetValue(); CHIPNetworkCommissioningClusterWiFiInterfaceScanResult * newElement_1; newElement_1 = [CHIPNetworkCommissioningClusterWiFiInterfaceScanResult new]; - newElement_1.security = [NSNumber numberWithUnsignedChar:entry_1.security]; + newElement_1.security = [NSNumber numberWithUnsignedChar:entry_1.security.Raw()]; newElement_1.ssid = [NSData dataWithBytes:entry_1.ssid.data() length:entry_1.ssid.size()]; newElement_1.bssid = [NSData dataWithBytes:entry_1.bssid.data() length:entry_1.bssid.size()]; newElement_1.channel = [NSNumber numberWithUnsignedShort:entry_1.channel]; @@ -11140,14 +11152,15 @@ auto & entry_1 = iter_1.GetValue(); CHIPNetworkCommissioningClusterThreadInterfaceScanResult * newElement_1; newElement_1 = [CHIPNetworkCommissioningClusterThreadInterfaceScanResult new]; - newElement_1.panId = [NSNumber numberWithUnsignedLongLong:entry_1.panId]; + newElement_1.panId = [NSNumber numberWithUnsignedShort:entry_1.panId]; newElement_1.extendedPanId = [NSNumber numberWithUnsignedLongLong:entry_1.extendedPanId]; newElement_1.networkName = [[NSString alloc] initWithBytes:entry_1.networkName.data() length:entry_1.networkName.size() encoding:NSUTF8StringEncoding]; newElement_1.channel = [NSNumber numberWithUnsignedShort:entry_1.channel]; newElement_1.version = [NSNumber numberWithUnsignedChar:entry_1.version]; - newElement_1.extendedAddress = [NSNumber numberWithUnsignedLongLong:entry_1.extendedAddress]; + newElement_1.extendedAddress = [NSData dataWithBytes:entry_1.extendedAddress.data() + length:entry_1.extendedAddress.size()]; newElement_1.rssi = [NSNumber numberWithChar:entry_1.rssi]; newElement_1.lqi = [NSNumber numberWithUnsignedChar:entry_1.lqi]; [array_1 addObject:newElement_1]; diff --git a/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.h b/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.h index b6f15187e4216a..f4956798b2a470 100644 --- a/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.h +++ b/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.h @@ -7414,7 +7414,7 @@ NS_ASSUME_NONNULL_BEGIN - (void)reorderNetworkWithParams:(CHIPNetworkCommissioningClusterReorderNetworkParams *)params completionHandler:(void (^)(CHIPNetworkCommissioningClusterNetworkConfigResponseParams * _Nullable data, NSError * _Nullable error))completionHandler; -- (void)scanNetworksWithParams:(CHIPNetworkCommissioningClusterScanNetworksParams *)params +- (void)scanNetworksWithParams:(CHIPNetworkCommissioningClusterScanNetworksParams * _Nullable)params completionHandler:(void (^)(CHIPNetworkCommissioningClusterScanNetworksResponseParams * _Nullable data, NSError * _Nullable error))completionHandler; @@ -15268,6 +15268,14 @@ typedef NS_OPTIONS(uint32_t, CHIPNetworkCommissioningFeature) { CHIPNetworkCommissioningFeatureEthernetNetworkInterface = 0x4, }; +typedef NS_OPTIONS(uint8_t, CHIPNetworkCommissioningWiFiSecurity) { + CHIPNetworkCommissioningWiFiSecurityUnencrypted = 0x1, + CHIPNetworkCommissioningWiFiSecurityWepPersonal = 0x2, + CHIPNetworkCommissioningWiFiSecurityWpaPersonal = 0x4, + CHIPNetworkCommissioningWiFiSecurityWpa2Personal = 0x8, + CHIPNetworkCommissioningWiFiSecurityWpa3Personal = 0x10, +}; + typedef NS_ENUM(uint8_t, CHIPDiagnosticLogsLogsIntent) { CHIPDiagnosticLogsLogsIntentEndUserSupport = 0x00, CHIPDiagnosticLogsLogsIntentNetworkDiag = 0x01, diff --git a/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.mm b/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.mm index a095162a939012..da315870956269 100644 --- a/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.mm +++ b/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.mm @@ -27571,16 +27571,26 @@ new CHIPNetworkCommissioningClusterNetworkConfigResponseCallbackBridge( }); } -- (void)scanNetworksWithParams:(CHIPNetworkCommissioningClusterScanNetworksParams *)params +- (void)scanNetworksWithParams:(CHIPNetworkCommissioningClusterScanNetworksParams * _Nullable)params completionHandler:(void (^)(CHIPNetworkCommissioningClusterScanNetworksResponseParams * _Nullable data, NSError * _Nullable error))completionHandler { ListFreer listFreer; NetworkCommissioning::Commands::ScanNetworks::Type request; - request.ssid = [self asByteSpan:params.ssid]; - if (params.breadcrumb != nil) { - auto & definedValue_0 = request.breadcrumb.Emplace(); - definedValue_0 = params.breadcrumb.unsignedLongLongValue; + if (params != nil) { + if (params.ssid != nil) { + auto & definedValue_0 = request.ssid.Emplace(); + if (params.ssid == nil) { + definedValue_0.SetNull(); + } else { + auto & nonNullValue_1 = definedValue_0.SetNonNull(); + nonNullValue_1 = [self asByteSpan:params.ssid]; + } + } + if (params.breadcrumb != nil) { + auto & definedValue_0 = request.breadcrumb.Emplace(); + definedValue_0 = params.breadcrumb.unsignedLongLongValue; + } } new CHIPNetworkCommissioningClusterScanNetworksResponseCallbackBridge( diff --git a/src/darwin/Framework/CHIP/zap-generated/CHIPCommandPayloadsObjc.h b/src/darwin/Framework/CHIP/zap-generated/CHIPCommandPayloadsObjc.h index 8d032b94e97daf..77d639f6c88c70 100644 --- a/src/darwin/Framework/CHIP/zap-generated/CHIPCommandPayloadsObjc.h +++ b/src/darwin/Framework/CHIP/zap-generated/CHIPCommandPayloadsObjc.h @@ -646,14 +646,14 @@ NS_ASSUME_NONNULL_BEGIN @end @interface CHIPNetworkCommissioningClusterScanNetworksParams : NSObject -@property (strong, nonatomic) NSData * _Nonnull ssid; +@property (strong, nonatomic) NSData * _Nullable ssid; @property (strong, nonatomic) NSNumber * _Nullable breadcrumb; - (instancetype)init; @end @interface CHIPNetworkCommissioningClusterScanNetworksResponseParams : NSObject @property (strong, nonatomic) NSNumber * _Nonnull networkingStatus; -@property (strong, nonatomic) NSString * _Nonnull debugText; +@property (strong, nonatomic) NSString * _Nullable debugText; @property (strong, nonatomic) NSArray * _Nullable wiFiScanResults; @property (strong, nonatomic) NSArray * _Nullable threadScanResults; - (instancetype)init; @@ -693,8 +693,8 @@ NS_ASSUME_NONNULL_BEGIN @interface CHIPNetworkCommissioningClusterConnectNetworkResponseParams : NSObject @property (strong, nonatomic) NSNumber * _Nonnull networkingStatus; -@property (strong, nonatomic) NSString * _Nonnull debugText; -@property (strong, nonatomic) NSNumber * _Nonnull errorValue; +@property (strong, nonatomic) NSString * _Nullable debugText; +@property (strong, nonatomic) NSNumber * _Nullable errorValue; - (instancetype)init; @end diff --git a/src/darwin/Framework/CHIP/zap-generated/CHIPCommandPayloadsObjc.mm b/src/darwin/Framework/CHIP/zap-generated/CHIPCommandPayloadsObjc.mm index de04eee0a372fc..8cda13bd8c9e72 100644 --- a/src/darwin/Framework/CHIP/zap-generated/CHIPCommandPayloadsObjc.mm +++ b/src/darwin/Framework/CHIP/zap-generated/CHIPCommandPayloadsObjc.mm @@ -1359,7 +1359,7 @@ - (instancetype)init { if (self = [super init]) { - _ssid = [NSData data]; + _ssid = nil; _breadcrumb = nil; } @@ -1374,7 +1374,7 @@ - (instancetype)init _networkingStatus = @(0); - _debugText = @""; + _debugText = nil; _wiFiScanResults = nil; @@ -1460,9 +1460,9 @@ - (instancetype)init _networkingStatus = @(0); - _debugText = @""; + _debugText = nil; - _errorValue = @(0); + _errorValue = nil; } return self; } diff --git a/src/darwin/Framework/CHIP/zap-generated/CHIPStructsObjc.h b/src/darwin/Framework/CHIP/zap-generated/CHIPStructsObjc.h index d3a758250b858d..c6d41af3dd1b59 100644 --- a/src/darwin/Framework/CHIP/zap-generated/CHIPStructsObjc.h +++ b/src/darwin/Framework/CHIP/zap-generated/CHIPStructsObjc.h @@ -152,7 +152,7 @@ NS_ASSUME_NONNULL_BEGIN @property (strong, nonatomic) NSString * _Nonnull networkName; @property (strong, nonatomic) NSNumber * _Nonnull channel; @property (strong, nonatomic) NSNumber * _Nonnull version; -@property (strong, nonatomic) NSNumber * _Nonnull extendedAddress; +@property (strong, nonatomic) NSData * _Nonnull extendedAddress; @property (strong, nonatomic) NSNumber * _Nonnull rssi; @property (strong, nonatomic) NSNumber * _Nonnull lqi; - (instancetype)init; diff --git a/src/darwin/Framework/CHIP/zap-generated/CHIPStructsObjc.mm b/src/darwin/Framework/CHIP/zap-generated/CHIPStructsObjc.mm index 28257d240eb56e..e9152a1ac909d7 100644 --- a/src/darwin/Framework/CHIP/zap-generated/CHIPStructsObjc.mm +++ b/src/darwin/Framework/CHIP/zap-generated/CHIPStructsObjc.mm @@ -297,7 +297,7 @@ - (instancetype)init _version = @(0); - _extendedAddress = @(0); + _extendedAddress = [NSData data]; _rssi = @(0); diff --git a/src/include/platform/NetworkCommissioning.h b/src/include/platform/NetworkCommissioning.h index 8a91874b2e19aa..25d0fc72434d5d 100644 --- a/src/include/platform/NetworkCommissioning.h +++ b/src/include/platform/NetworkCommissioning.h @@ -114,10 +114,19 @@ struct Network static_assert(sizeof(Network::networkID) <= std::numeric_limits::max(), "Max length of networkID ssid exceeds the limit of networkIDLen field"); +enum class WiFiSecurity : uint8_t +{ + kUnencrypted = 0x1, + kWepPersonal = 0x2, + kWpaPersonal = 0x4, + kWpa2Personal = 0x8, + kWpa3Personal = 0x10, +}; + struct WiFiScanResponse { public: - uint8_t security; + chip::BitFlags security; uint8_t ssid[DeviceLayer::Internal::kMaxWiFiSSIDLength]; uint8_t ssidLen; uint8_t bssid[6]; @@ -131,7 +140,7 @@ static_assert(sizeof(WiFiScanResponse::ssid) <= std::numeric_limits } // copy the available information into WiFiScanResponse struct, which will be copied to the result to be sent - item.security = mpScanResults[mIternum].security; + item.security.SetRaw(mpScanResults[mIternum].security); item.ssidLen = mpScanResults[mIternum].SSID.len; item.channel = mpScanResults[mIternum].channel; item.wiFiBand = chip::DeviceLayer::NetworkCommissioning::WiFiBand::k2g4; diff --git a/src/platform/EFR32/NetworkCommissioningWiFiDriver.cpp b/src/platform/EFR32/NetworkCommissioningWiFiDriver.cpp index e742e8d612e250..4d1708200e34d6 100644 --- a/src/platform/EFR32/NetworkCommissioningWiFiDriver.cpp +++ b/src/platform/EFR32/NetworkCommissioningWiFiDriver.cpp @@ -237,10 +237,10 @@ void SlWiFiDriver::OnScanWiFiNetworkDone(wfx_wifi_scan_result_t * aScanResult) { NetworkCommissioning::WiFiScanResponse scanResponse = { 0 }; - scanResponse.security = GetInstance().ConvertSecuritytype(aScanResult->security); - scanResponse.channel = aScanResult->chan; - scanResponse.rssi = aScanResult->rssi; - scanResponse.ssidLen = strnlen(aScanResult->ssid, DeviceLayer::Internal::kMaxWiFiSSIDLength); + scanResponse.security.SetRaw(GetInstance().ConvertSecuritytype(aScanResult->security)); + scanResponse.channel = aScanResult->chan; + scanResponse.rssi = aScanResult->rssi; + scanResponse.ssidLen = strnlen(aScanResult->ssid, DeviceLayer::Internal::kMaxWiFiSSIDLength); memcpy(scanResponse.ssid, aScanResult->ssid, scanResponse.ssidLen); memcpy(scanResponse.bssid, aScanResult->bssid, sizeof(scanResponse.bssid)); diff --git a/src/platform/EFR32/NetworkCommissioningWiFiDriver.h b/src/platform/EFR32/NetworkCommissioningWiFiDriver.h index 773e8454f55b04..99b650f01f89a2 100644 --- a/src/platform/EFR32/NetworkCommissioningWiFiDriver.h +++ b/src/platform/EFR32/NetworkCommissioningWiFiDriver.h @@ -42,7 +42,7 @@ constexpr uint8_t kWiFiConnectNetworkTimeoutSeconds = 20; // return false; // } -// item.security = mpScanResults[mIternum].authmode; +// item.security.SetRaw(mpScanResults[mIternum].authmode); // item.ssidLen = // strnlen(reinterpret_cast(mpScanResults[mIternum].ssid), // chip::DeviceLayer::Internal::kMaxWiFiSSIDLength); diff --git a/src/platform/ESP32/NetworkCommissioningDriver.h b/src/platform/ESP32/NetworkCommissioningDriver.h index e40a39dfbae5ca..f150959f1a30b5 100644 --- a/src/platform/ESP32/NetworkCommissioningDriver.h +++ b/src/platform/ESP32/NetworkCommissioningDriver.h @@ -40,7 +40,7 @@ class ESPScanResponseIterator : public Iterator return false; } - item.security = mpScanResults[mIternum].authmode; + item.security.SetRaw(mpScanResults[mIternum].authmode); item.ssidLen = strnlen(reinterpret_cast(mpScanResults[mIternum].ssid), chip::DeviceLayer::Internal::kMaxWiFiSSIDLength); item.channel = mpScanResults[mIternum].primary; diff --git a/src/platform/Linux/ConnectivityManagerImpl.cpp b/src/platform/Linux/ConnectivityManagerImpl.cpp index a801e310a07efc..9ffa845859be11 100644 --- a/src/platform/Linux/ConnectivityManagerImpl.cpp +++ b/src/platform/Linux/ConnectivityManagerImpl.cpp @@ -1641,7 +1641,7 @@ bool ConnectivityManagerImpl::_GetBssInfo(const gchar * bssPath, NetworkCommissi auto bandInfo = GetBandAndChannelFromFrequency(frequency); result.wiFiBand = bandInfo.first; result.channel = bandInfo.second; - result.security = GetNetworkSecurityType(bssProxy); + result.security.SetRaw(GetNetworkSecurityType(bssProxy)); return true; } diff --git a/src/platform/P6/NetworkCommissioningDriver.h b/src/platform/P6/NetworkCommissioningDriver.h index 15d46fcff48487..3fdda4ca7ca332 100644 --- a/src/platform/P6/NetworkCommissioningDriver.h +++ b/src/platform/P6/NetworkCommissioningDriver.h @@ -42,7 +42,7 @@ class P6ScanResponseIterator : public Iterator return false; } - item.security = mpScanResults[mIternum].security; + item.security.SetRaw(mpScanResults[mIternum].security); item.ssidLen = strnlen(reinterpret_cast(mpScanResults[mIternum].SSID), chip::DeviceLayer::Internal::kMaxWiFiSSIDLength); item.channel = mpScanResults[mIternum].channel; diff --git a/src/platform/bouffalolab/BL602/NetworkCommissioningDriver.h b/src/platform/bouffalolab/BL602/NetworkCommissioningDriver.h index 5ce9ecc82c4862..f1e9bbd6f36016 100644 --- a/src/platform/bouffalolab/BL602/NetworkCommissioningDriver.h +++ b/src/platform/bouffalolab/BL602/NetworkCommissioningDriver.h @@ -21,7 +21,7 @@ namespace chip { namespace DeviceLayer { namespace NetworkCommissioning { -//#if CHIP_DEVICE_CONFIG_ENABLE_WIFI +// #if CHIP_DEVICE_CONFIG_ENABLE_WIFI namespace { constexpr uint8_t kMaxWiFiNetworks = 1; constexpr uint8_t kWiFiScanNetworksTimeOutSeconds = 10; @@ -41,7 +41,7 @@ class BLScanResponseIterator : public Iterator } #if 0 - item.security = mpScanResults[mIternum].authmode; + item.security.SetRaw(mpScanResults[mIternum].authmode); item.ssidLen = strnlen(reinterpret_cast(mpScanResults[mIternum].ssid), chip::DeviceLayer::Internal::kMaxWiFiSSIDLength); item.channel = mpScanResults[mIternum].primary; @@ -131,7 +131,7 @@ class BLWiFiDriver final : public WiFiDriver ConnectCallback * mpConnectCallback; NetworkStatusChangeCallback * mpStatusChangeCallback = nullptr; }; -//#endif // CHIP_DEVICE_CONFIG_ENABLE_WIFI +// #endif // CHIP_DEVICE_CONFIG_ENABLE_WIFI } // namespace NetworkCommissioning } // namespace DeviceLayer diff --git a/src/platform/mbed/NetworkCommissioningDriver.h b/src/platform/mbed/NetworkCommissioningDriver.h index c72b654954923e..31f28c04d7a105 100644 --- a/src/platform/mbed/NetworkCommissioningDriver.h +++ b/src/platform/mbed/NetworkCommissioningDriver.h @@ -46,7 +46,7 @@ class MbedScanResponseIterator : public Iterator return false; } - item.security = mScanResults[mIternum].get_security(); + item.security.SetRaw(mScanResults[mIternum].get_security()); item.ssidLen = strnlen(reinterpret_cast(mScanResults[mIternum].get_ssid()), chip::DeviceLayer::Internal::kMaxWiFiSSIDLength); item.channel = mScanResults[mIternum].get_channel(); diff --git a/zzz_generated/app-common/app-common/zap-generated/af-structs.h b/zzz_generated/app-common/app-common/zap-generated/af-structs.h index fa90936d96ad5f..a1c8a053485763 100644 --- a/zzz_generated/app-common/app-common/zap-generated/af-structs.h +++ b/zzz_generated/app-common/app-common/zap-generated/af-structs.h @@ -542,12 +542,12 @@ typedef struct _TestListStructOctet // Struct for ThreadInterfaceScanResult typedef struct _ThreadInterfaceScanResult { - uint64_t PanId; + uint16_t PanId; uint64_t ExtendedPanId; chip::CharSpan NetworkName; uint16_t Channel; uint8_t Version; - uint64_t ExtendedAddress; + chip::ByteSpan ExtendedAddress; int8_t RSSI; uint8_t LQI; } ThreadInterfaceScanResult; diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-enums.h b/zzz_generated/app-common/app-common/zap-generated/cluster-enums.h index 8143c3ba3653b4..0e2f5027438f21 100644 --- a/zzz_generated/app-common/app-common/zap-generated/cluster-enums.h +++ b/zzz_generated/app-common/app-common/zap-generated/cluster-enums.h @@ -620,6 +620,16 @@ enum class NetworkCommissioningFeature : uint32_t kThreadNetworkInterface = 0x2, kEthernetNetworkInterface = 0x4, }; + +// Bitmap for WiFiSecurity +enum class WiFiSecurity : uint8_t +{ + kUnencrypted = 0x1, + kWepPersonal = 0x2, + kWpaPersonal = 0x4, + kWpa2Personal = 0x8, + kWpa3Personal = 0x10, +}; } // namespace NetworkCommissioning namespace DiagnosticLogs { diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h index 09654141b74cfd..30e7150c004ab6 100644 --- a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h +++ b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h @@ -10717,14 +10717,14 @@ enum class Fields struct Type { public: - uint64_t panId = static_cast(0); + uint16_t panId = static_cast(0); uint64_t extendedPanId = static_cast(0); chip::CharSpan networkName; - uint16_t channel = static_cast(0); - uint8_t version = static_cast(0); - uint64_t extendedAddress = static_cast(0); - int8_t rssi = static_cast(0); - uint8_t lqi = static_cast(0); + uint16_t channel = static_cast(0); + uint8_t version = static_cast(0); + chip::ByteSpan extendedAddress; + int8_t rssi = static_cast(0); + uint8_t lqi = static_cast(0); CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -10750,7 +10750,7 @@ enum class Fields struct Type { public: - uint8_t security = static_cast(0); + chip::BitFlags security = static_cast>(0); chip::ByteSpan ssid; chip::ByteSpan bssid; uint16_t channel = static_cast(0); @@ -10834,7 +10834,7 @@ struct Type static constexpr CommandId GetCommandId() { return Commands::ScanNetworks::Id; } static constexpr ClusterId GetClusterId() { return Clusters::NetworkCommissioning::Id; } - chip::ByteSpan ssid; + Optional> ssid; Optional breadcrumb; CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; @@ -10850,7 +10850,7 @@ struct DecodableType static constexpr CommandId GetCommandId() { return Commands::ScanNetworks::Id; } static constexpr ClusterId GetClusterId() { return Clusters::NetworkCommissioning::Id; } - chip::ByteSpan ssid; + Optional> ssid; Optional breadcrumb; CHIP_ERROR Decode(TLV::TLVReader & reader); }; @@ -10872,7 +10872,7 @@ struct Type static constexpr ClusterId GetClusterId() { return Clusters::NetworkCommissioning::Id; } NetworkCommissioningStatus networkingStatus = static_cast(0); - chip::CharSpan debugText; + Optional debugText; Optional> wiFiScanResults; Optional> threadScanResults; @@ -10890,7 +10890,7 @@ struct DecodableType static constexpr ClusterId GetClusterId() { return Clusters::NetworkCommissioning::Id; } NetworkCommissioningStatus networkingStatus = static_cast(0); - chip::CharSpan debugText; + Optional debugText; Optional> wiFiScanResults; Optional> threadScanResults; CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -11093,8 +11093,8 @@ struct Type static constexpr ClusterId GetClusterId() { return Clusters::NetworkCommissioning::Id; } NetworkCommissioningStatus networkingStatus = static_cast(0); - chip::CharSpan debugText; - int32_t errorValue = static_cast(0); + Optional debugText; + DataModel::Nullable errorValue; CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; @@ -11110,8 +11110,8 @@ struct DecodableType static constexpr ClusterId GetClusterId() { return Clusters::NetworkCommissioning::Id; } NetworkCommissioningStatus networkingStatus = static_cast(0); - chip::CharSpan debugText; - int32_t errorValue = static_cast(0); + Optional debugText; + DataModel::Nullable errorValue; CHIP_ERROR Decode(TLV::TLVReader & reader); }; }; // namespace ConnectNetworkResponse