Skip to content

Commit

Permalink
[NWPROV] Fix spec compliance issues (#17038)
Browse files Browse the repository at this point in the history
* Fix spec compliance of network commissioning cluster

* Update existing platform code

* Run Codegen
  • Loading branch information
erjiaqing authored Apr 5, 2022
1 parent dcca243 commit fae3888
Show file tree
Hide file tree
Showing 45 changed files with 655 additions and 371 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand All @@ -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;
}

Expand Down Expand Up @@ -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;
}
Expand All @@ -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;
Expand Down
30 changes: 19 additions & 11 deletions examples/bridge-app/bridge-common/bridge-app.matter
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand All @@ -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;
}

Expand Down Expand Up @@ -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;
}
Expand All @@ -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;
Expand Down
30 changes: 19 additions & 11 deletions examples/door-lock-app/door-lock-common/door-lock-app.matter
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand All @@ -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;
}

Expand Down Expand Up @@ -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;
}
Expand All @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand All @@ -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;
}

Expand Down Expand Up @@ -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;
}
Expand All @@ -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;
Expand Down
30 changes: 19 additions & 11 deletions examples/lighting-app/lighting-common/lighting-app.matter
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand All @@ -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;
}

Expand Down Expand Up @@ -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;
}
Expand All @@ -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;
Expand Down
Loading

0 comments on commit fae3888

Please sign in to comment.