diff --git a/examples/air-purifier-app/air-purifier-common/air-purifier-app.matter b/examples/air-purifier-app/air-purifier-common/air-purifier-app.matter index 6afbc96ec4e430..51a9dc6a155f1b 100644 --- a/examples/air-purifier-app/air-purifier-common/air-purifier-app.matter +++ b/examples/air-purifier-app/air-purifier-common/air-purifier-app.matter @@ -208,18 +208,18 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } -struct LocationDescriptorStruct { - char_string<128> locationName = 0; - nullable int16s floorNumber = 1; - nullable AreaTypeTag areaType = 2; -} - struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; optional nullable TestGlobalEnum myEnum = 2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/air-quality-sensor-app/air-quality-sensor-common/air-quality-sensor-app.matter b/examples/air-quality-sensor-app/air-quality-sensor-common/air-quality-sensor-app.matter index 80a93e41155b95..443a5d95056da8 100644 --- a/examples/air-quality-sensor-app/air-quality-sensor-common/air-quality-sensor-app.matter +++ b/examples/air-quality-sensor-app/air-quality-sensor-common/air-quality-sensor-app.matter @@ -208,18 +208,18 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } -struct LocationDescriptorStruct { - char_string<128> locationName = 0; - nullable int16s floorNumber = 1; - nullable AreaTypeTag areaType = 2; -} - struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; optional nullable TestGlobalEnum myEnum = 2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; 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 2b4fb13c868d48..867da750b2a628 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 @@ -208,18 +208,18 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } -struct LocationDescriptorStruct { - char_string<128> locationName = 0; - nullable int16s floorNumber = 1; - nullable AreaTypeTag areaType = 2; -} - struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; optional nullable TestGlobalEnum myEnum = 2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.matter b/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.matter index 1f56b0d6f7f746..86f4335fe6c883 100644 --- a/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.matter +++ b/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.matter @@ -208,18 +208,18 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } -struct LocationDescriptorStruct { - char_string<128> locationName = 0; - nullable int16s floorNumber = 1; - nullable AreaTypeTag areaType = 2; -} - struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; optional nullable TestGlobalEnum myEnum = 2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/bridge-app/bridge-common/bridge-app.matter b/examples/bridge-app/bridge-common/bridge-app.matter index 62fa99efa49f6f..ef70beb4fa8001 100644 --- a/examples/bridge-app/bridge-common/bridge-app.matter +++ b/examples/bridge-app/bridge-common/bridge-app.matter @@ -208,18 +208,18 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } -struct LocationDescriptorStruct { - char_string<128> locationName = 0; - nullable int16s floorNumber = 1; - nullable AreaTypeTag areaType = 2; -} - struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; optional nullable TestGlobalEnum myEnum = 2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/chef/devices/noip_rootnode_dimmablelight_bCwGYSDpoe.matter b/examples/chef/devices/noip_rootnode_dimmablelight_bCwGYSDpoe.matter index c2fdc613ff9eee..865ab9946a28d8 100644 --- a/examples/chef/devices/noip_rootnode_dimmablelight_bCwGYSDpoe.matter +++ b/examples/chef/devices/noip_rootnode_dimmablelight_bCwGYSDpoe.matter @@ -208,18 +208,18 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } -struct LocationDescriptorStruct { - char_string<128> locationName = 0; - nullable int16s floorNumber = 1; - nullable AreaTypeTag areaType = 2; -} - struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; optional nullable TestGlobalEnum myEnum = 2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/chef/devices/rootnode_airpurifier_73a6fe2651.matter b/examples/chef/devices/rootnode_airpurifier_73a6fe2651.matter index 6b6d2a9133839e..c9620818b035e2 100644 --- a/examples/chef/devices/rootnode_airpurifier_73a6fe2651.matter +++ b/examples/chef/devices/rootnode_airpurifier_73a6fe2651.matter @@ -208,18 +208,18 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } -struct LocationDescriptorStruct { - char_string<128> locationName = 0; - nullable int16s floorNumber = 1; - nullable AreaTypeTag areaType = 2; -} - struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; optional nullable TestGlobalEnum myEnum = 2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/chef/devices/rootnode_airpurifier_airqualitysensor_temperaturesensor_humiditysensor_thermostat_56de3d5f45.matter b/examples/chef/devices/rootnode_airpurifier_airqualitysensor_temperaturesensor_humiditysensor_thermostat_56de3d5f45.matter index 4e21ce7185ece0..7c84e33077f67a 100644 --- a/examples/chef/devices/rootnode_airpurifier_airqualitysensor_temperaturesensor_humiditysensor_thermostat_56de3d5f45.matter +++ b/examples/chef/devices/rootnode_airpurifier_airqualitysensor_temperaturesensor_humiditysensor_thermostat_56de3d5f45.matter @@ -208,18 +208,18 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } -struct LocationDescriptorStruct { - char_string<128> locationName = 0; - nullable int16s floorNumber = 1; - nullable AreaTypeTag areaType = 2; -} - struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; optional nullable TestGlobalEnum myEnum = 2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/chef/devices/rootnode_airqualitysensor_e63187f6c9.matter b/examples/chef/devices/rootnode_airqualitysensor_e63187f6c9.matter index fb5fd600d280a5..d5cd9f968e9cae 100644 --- a/examples/chef/devices/rootnode_airqualitysensor_e63187f6c9.matter +++ b/examples/chef/devices/rootnode_airqualitysensor_e63187f6c9.matter @@ -208,18 +208,18 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } -struct LocationDescriptorStruct { - char_string<128> locationName = 0; - nullable int16s floorNumber = 1; - nullable AreaTypeTag areaType = 2; -} - struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; optional nullable TestGlobalEnum myEnum = 2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/chef/devices/rootnode_basicvideoplayer_0ff86e943b.matter b/examples/chef/devices/rootnode_basicvideoplayer_0ff86e943b.matter index e93e6a668dbd62..b0e6cb0dcb99f5 100644 --- a/examples/chef/devices/rootnode_basicvideoplayer_0ff86e943b.matter +++ b/examples/chef/devices/rootnode_basicvideoplayer_0ff86e943b.matter @@ -208,18 +208,18 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } -struct LocationDescriptorStruct { - char_string<128> locationName = 0; - nullable int16s floorNumber = 1; - nullable AreaTypeTag areaType = 2; -} - struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; optional nullable TestGlobalEnum myEnum = 2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/chef/devices/rootnode_colortemperaturelight_hbUnzYVeyn.matter b/examples/chef/devices/rootnode_colortemperaturelight_hbUnzYVeyn.matter index 8da8f1d4472762..c09d170fcfb211 100644 --- a/examples/chef/devices/rootnode_colortemperaturelight_hbUnzYVeyn.matter +++ b/examples/chef/devices/rootnode_colortemperaturelight_hbUnzYVeyn.matter @@ -208,18 +208,18 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } -struct LocationDescriptorStruct { - char_string<128> locationName = 0; - nullable int16s floorNumber = 1; - nullable AreaTypeTag areaType = 2; -} - struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; optional nullable TestGlobalEnum myEnum = 2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/chef/devices/rootnode_contactsensor_27f76aeaf5.matter b/examples/chef/devices/rootnode_contactsensor_27f76aeaf5.matter index 4a2f72084620e4..752331d2934dde 100644 --- a/examples/chef/devices/rootnode_contactsensor_27f76aeaf5.matter +++ b/examples/chef/devices/rootnode_contactsensor_27f76aeaf5.matter @@ -208,18 +208,18 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } -struct LocationDescriptorStruct { - char_string<128> locationName = 0; - nullable int16s floorNumber = 1; - nullable AreaTypeTag areaType = 2; -} - struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; optional nullable TestGlobalEnum myEnum = 2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/chef/devices/rootnode_contactsensor_lFAGG1bfRO.matter b/examples/chef/devices/rootnode_contactsensor_lFAGG1bfRO.matter index 23672407e7c886..bd37aa7ee5435e 100644 --- a/examples/chef/devices/rootnode_contactsensor_lFAGG1bfRO.matter +++ b/examples/chef/devices/rootnode_contactsensor_lFAGG1bfRO.matter @@ -208,18 +208,18 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } -struct LocationDescriptorStruct { - char_string<128> locationName = 0; - nullable int16s floorNumber = 1; - nullable AreaTypeTag areaType = 2; -} - struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; optional nullable TestGlobalEnum myEnum = 2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/chef/devices/rootnode_dimmablelight_bCwGYSDpoe.matter b/examples/chef/devices/rootnode_dimmablelight_bCwGYSDpoe.matter index a32b134d6383c0..0c139383678084 100644 --- a/examples/chef/devices/rootnode_dimmablelight_bCwGYSDpoe.matter +++ b/examples/chef/devices/rootnode_dimmablelight_bCwGYSDpoe.matter @@ -208,18 +208,18 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } -struct LocationDescriptorStruct { - char_string<128> locationName = 0; - nullable int16s floorNumber = 1; - nullable AreaTypeTag areaType = 2; -} - struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; optional nullable TestGlobalEnum myEnum = 2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/chef/devices/rootnode_dimmablepluginunit_f8a9a0b9d4.matter b/examples/chef/devices/rootnode_dimmablepluginunit_f8a9a0b9d4.matter index 64dd2192d29af0..7c1c3356948605 100644 --- a/examples/chef/devices/rootnode_dimmablepluginunit_f8a9a0b9d4.matter +++ b/examples/chef/devices/rootnode_dimmablepluginunit_f8a9a0b9d4.matter @@ -208,18 +208,18 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } -struct LocationDescriptorStruct { - char_string<128> locationName = 0; - nullable int16s floorNumber = 1; - nullable AreaTypeTag areaType = 2; -} - struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; optional nullable TestGlobalEnum myEnum = 2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/chef/devices/rootnode_dishwasher_cc105034fe.matter b/examples/chef/devices/rootnode_dishwasher_cc105034fe.matter index 95af5647dd9d27..be4001d1e49b03 100644 --- a/examples/chef/devices/rootnode_dishwasher_cc105034fe.matter +++ b/examples/chef/devices/rootnode_dishwasher_cc105034fe.matter @@ -208,18 +208,18 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } -struct LocationDescriptorStruct { - char_string<128> locationName = 0; - nullable int16s floorNumber = 1; - nullable AreaTypeTag areaType = 2; -} - struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; optional nullable TestGlobalEnum myEnum = 2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/chef/devices/rootnode_doorlock_aNKYAreMXE.matter b/examples/chef/devices/rootnode_doorlock_aNKYAreMXE.matter index 219f899194ff5b..a8233afe90b6c4 100644 --- a/examples/chef/devices/rootnode_doorlock_aNKYAreMXE.matter +++ b/examples/chef/devices/rootnode_doorlock_aNKYAreMXE.matter @@ -208,18 +208,18 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } -struct LocationDescriptorStruct { - char_string<128> locationName = 0; - nullable int16s floorNumber = 1; - nullable AreaTypeTag areaType = 2; -} - struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; optional nullable TestGlobalEnum myEnum = 2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/chef/devices/rootnode_extendedcolorlight_8lcaaYJVAa.matter b/examples/chef/devices/rootnode_extendedcolorlight_8lcaaYJVAa.matter index d846e358a907f9..27473072e657c0 100644 --- a/examples/chef/devices/rootnode_extendedcolorlight_8lcaaYJVAa.matter +++ b/examples/chef/devices/rootnode_extendedcolorlight_8lcaaYJVAa.matter @@ -208,18 +208,18 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } -struct LocationDescriptorStruct { - char_string<128> locationName = 0; - nullable int16s floorNumber = 1; - nullable AreaTypeTag areaType = 2; -} - struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; optional nullable TestGlobalEnum myEnum = 2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/chef/devices/rootnode_fan_7N2TobIlOX.matter b/examples/chef/devices/rootnode_fan_7N2TobIlOX.matter index 493b69632f19ec..1cb3ba2c5a63a8 100644 --- a/examples/chef/devices/rootnode_fan_7N2TobIlOX.matter +++ b/examples/chef/devices/rootnode_fan_7N2TobIlOX.matter @@ -208,18 +208,18 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } -struct LocationDescriptorStruct { - char_string<128> locationName = 0; - nullable int16s floorNumber = 1; - nullable AreaTypeTag areaType = 2; -} - struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; optional nullable TestGlobalEnum myEnum = 2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/chef/devices/rootnode_flowsensor_1zVxHedlaV.matter b/examples/chef/devices/rootnode_flowsensor_1zVxHedlaV.matter index 3df145b311d69a..8b4d4046f3b36f 100644 --- a/examples/chef/devices/rootnode_flowsensor_1zVxHedlaV.matter +++ b/examples/chef/devices/rootnode_flowsensor_1zVxHedlaV.matter @@ -208,18 +208,18 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } -struct LocationDescriptorStruct { - char_string<128> locationName = 0; - nullable int16s floorNumber = 1; - nullable AreaTypeTag areaType = 2; -} - struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; optional nullable TestGlobalEnum myEnum = 2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/chef/devices/rootnode_genericswitch_2dfff6e516.matter b/examples/chef/devices/rootnode_genericswitch_2dfff6e516.matter index 7f7fecc0fad4fc..07a8e8ee7de63b 100644 --- a/examples/chef/devices/rootnode_genericswitch_2dfff6e516.matter +++ b/examples/chef/devices/rootnode_genericswitch_2dfff6e516.matter @@ -208,18 +208,18 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } -struct LocationDescriptorStruct { - char_string<128> locationName = 0; - nullable int16s floorNumber = 1; - nullable AreaTypeTag areaType = 2; -} - struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; optional nullable TestGlobalEnum myEnum = 2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/chef/devices/rootnode_genericswitch_9866e35d0b.matter b/examples/chef/devices/rootnode_genericswitch_9866e35d0b.matter index 25c5cb83071c67..204c7b2d7abf43 100644 --- a/examples/chef/devices/rootnode_genericswitch_9866e35d0b.matter +++ b/examples/chef/devices/rootnode_genericswitch_9866e35d0b.matter @@ -208,18 +208,18 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } -struct LocationDescriptorStruct { - char_string<128> locationName = 0; - nullable int16s floorNumber = 1; - nullable AreaTypeTag areaType = 2; -} - struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; optional nullable TestGlobalEnum myEnum = 2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/chef/devices/rootnode_heatingcoolingunit_ncdGai1E5a.matter b/examples/chef/devices/rootnode_heatingcoolingunit_ncdGai1E5a.matter index 5bff3298a54008..208ddcea79b1bf 100644 --- a/examples/chef/devices/rootnode_heatingcoolingunit_ncdGai1E5a.matter +++ b/examples/chef/devices/rootnode_heatingcoolingunit_ncdGai1E5a.matter @@ -208,18 +208,18 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } -struct LocationDescriptorStruct { - char_string<128> locationName = 0; - nullable int16s floorNumber = 1; - nullable AreaTypeTag areaType = 2; -} - struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; optional nullable TestGlobalEnum myEnum = 2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/chef/devices/rootnode_humiditysensor_Xyj4gda6Hb.matter b/examples/chef/devices/rootnode_humiditysensor_Xyj4gda6Hb.matter index 3a533a80b03adc..1aca96ae1e7824 100644 --- a/examples/chef/devices/rootnode_humiditysensor_Xyj4gda6Hb.matter +++ b/examples/chef/devices/rootnode_humiditysensor_Xyj4gda6Hb.matter @@ -208,18 +208,18 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } -struct LocationDescriptorStruct { - char_string<128> locationName = 0; - nullable int16s floorNumber = 1; - nullable AreaTypeTag areaType = 2; -} - struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; optional nullable TestGlobalEnum myEnum = 2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/chef/devices/rootnode_laundrywasher_fb10d238c8.matter b/examples/chef/devices/rootnode_laundrywasher_fb10d238c8.matter index 85e0b196fdda71..5be2b0c409d982 100644 --- a/examples/chef/devices/rootnode_laundrywasher_fb10d238c8.matter +++ b/examples/chef/devices/rootnode_laundrywasher_fb10d238c8.matter @@ -208,18 +208,18 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } -struct LocationDescriptorStruct { - char_string<128> locationName = 0; - nullable int16s floorNumber = 1; - nullable AreaTypeTag areaType = 2; -} - struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; optional nullable TestGlobalEnum myEnum = 2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/chef/devices/rootnode_lightsensor_lZQycTFcJK.matter b/examples/chef/devices/rootnode_lightsensor_lZQycTFcJK.matter index 02be0be6f65ad5..aab7ae74ee127b 100644 --- a/examples/chef/devices/rootnode_lightsensor_lZQycTFcJK.matter +++ b/examples/chef/devices/rootnode_lightsensor_lZQycTFcJK.matter @@ -208,18 +208,18 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } -struct LocationDescriptorStruct { - char_string<128> locationName = 0; - nullable int16s floorNumber = 1; - nullable AreaTypeTag areaType = 2; -} - struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; optional nullable TestGlobalEnum myEnum = 2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/chef/devices/rootnode_occupancysensor_iHyVgifZuo.matter b/examples/chef/devices/rootnode_occupancysensor_iHyVgifZuo.matter index 40a115b86c3be8..6dc939d3aa2592 100644 --- a/examples/chef/devices/rootnode_occupancysensor_iHyVgifZuo.matter +++ b/examples/chef/devices/rootnode_occupancysensor_iHyVgifZuo.matter @@ -208,18 +208,18 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } -struct LocationDescriptorStruct { - char_string<128> locationName = 0; - nullable int16s floorNumber = 1; - nullable AreaTypeTag areaType = 2; -} - struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; optional nullable TestGlobalEnum myEnum = 2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/chef/devices/rootnode_onofflight_bbs1b7IaOV.matter b/examples/chef/devices/rootnode_onofflight_bbs1b7IaOV.matter index 6906c4f30ebbae..e58601388e94bd 100644 --- a/examples/chef/devices/rootnode_onofflight_bbs1b7IaOV.matter +++ b/examples/chef/devices/rootnode_onofflight_bbs1b7IaOV.matter @@ -208,18 +208,18 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } -struct LocationDescriptorStruct { - char_string<128> locationName = 0; - nullable int16s floorNumber = 1; - nullable AreaTypeTag areaType = 2; -} - struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; optional nullable TestGlobalEnum myEnum = 2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/chef/devices/rootnode_onofflight_samplemei.matter b/examples/chef/devices/rootnode_onofflight_samplemei.matter index e374d50abab6e9..65a0c490f23a0d 100644 --- a/examples/chef/devices/rootnode_onofflight_samplemei.matter +++ b/examples/chef/devices/rootnode_onofflight_samplemei.matter @@ -208,18 +208,18 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } -struct LocationDescriptorStruct { - char_string<128> locationName = 0; - nullable int16s floorNumber = 1; - nullable AreaTypeTag areaType = 2; -} - struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; optional nullable TestGlobalEnum myEnum = 2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/chef/devices/rootnode_onofflightswitch_FsPlMr090Q.matter b/examples/chef/devices/rootnode_onofflightswitch_FsPlMr090Q.matter index 4ece174e50db4c..88462157a1c691 100644 --- a/examples/chef/devices/rootnode_onofflightswitch_FsPlMr090Q.matter +++ b/examples/chef/devices/rootnode_onofflightswitch_FsPlMr090Q.matter @@ -208,18 +208,18 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } -struct LocationDescriptorStruct { - char_string<128> locationName = 0; - nullable int16s floorNumber = 1; - nullable AreaTypeTag areaType = 2; -} - struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; optional nullable TestGlobalEnum myEnum = 2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/chef/devices/rootnode_onoffpluginunit_Wtf8ss5EBY.matter b/examples/chef/devices/rootnode_onoffpluginunit_Wtf8ss5EBY.matter index a5e61ac7fe7406..7f7d67cedfdf1c 100644 --- a/examples/chef/devices/rootnode_onoffpluginunit_Wtf8ss5EBY.matter +++ b/examples/chef/devices/rootnode_onoffpluginunit_Wtf8ss5EBY.matter @@ -208,18 +208,18 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } -struct LocationDescriptorStruct { - char_string<128> locationName = 0; - nullable int16s floorNumber = 1; - nullable AreaTypeTag areaType = 2; -} - struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; optional nullable TestGlobalEnum myEnum = 2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/chef/devices/rootnode_pressuresensor_s0qC9wLH4k.matter b/examples/chef/devices/rootnode_pressuresensor_s0qC9wLH4k.matter index 327132ea97cf51..92f14706269c2d 100644 --- a/examples/chef/devices/rootnode_pressuresensor_s0qC9wLH4k.matter +++ b/examples/chef/devices/rootnode_pressuresensor_s0qC9wLH4k.matter @@ -208,18 +208,18 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } -struct LocationDescriptorStruct { - char_string<128> locationName = 0; - nullable int16s floorNumber = 1; - nullable AreaTypeTag areaType = 2; -} - struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; optional nullable TestGlobalEnum myEnum = 2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/chef/devices/rootnode_pump_5f904818cc.matter b/examples/chef/devices/rootnode_pump_5f904818cc.matter index 6c7e8d6ad9f128..bd34fc60d32c57 100644 --- a/examples/chef/devices/rootnode_pump_5f904818cc.matter +++ b/examples/chef/devices/rootnode_pump_5f904818cc.matter @@ -208,18 +208,18 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } -struct LocationDescriptorStruct { - char_string<128> locationName = 0; - nullable int16s floorNumber = 1; - nullable AreaTypeTag areaType = 2; -} - struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; optional nullable TestGlobalEnum myEnum = 2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/chef/devices/rootnode_pump_a811bb33a0.matter b/examples/chef/devices/rootnode_pump_a811bb33a0.matter index 9fb13cb006fd90..bc1c5228dade49 100644 --- a/examples/chef/devices/rootnode_pump_a811bb33a0.matter +++ b/examples/chef/devices/rootnode_pump_a811bb33a0.matter @@ -208,18 +208,18 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } -struct LocationDescriptorStruct { - char_string<128> locationName = 0; - nullable int16s floorNumber = 1; - nullable AreaTypeTag areaType = 2; -} - struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; optional nullable TestGlobalEnum myEnum = 2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/chef/devices/rootnode_refrigerator_temperaturecontrolledcabinet_temperaturecontrolledcabinet_ffdb696680.matter b/examples/chef/devices/rootnode_refrigerator_temperaturecontrolledcabinet_temperaturecontrolledcabinet_ffdb696680.matter index 5743a39e49847a..f68d7bf2aaefb0 100644 --- a/examples/chef/devices/rootnode_refrigerator_temperaturecontrolledcabinet_temperaturecontrolledcabinet_ffdb696680.matter +++ b/examples/chef/devices/rootnode_refrigerator_temperaturecontrolledcabinet_temperaturecontrolledcabinet_ffdb696680.matter @@ -208,18 +208,18 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } -struct LocationDescriptorStruct { - char_string<128> locationName = 0; - nullable int16s floorNumber = 1; - nullable AreaTypeTag areaType = 2; -} - struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; optional nullable TestGlobalEnum myEnum = 2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/chef/devices/rootnode_roboticvacuumcleaner_1807ff0c49.matter b/examples/chef/devices/rootnode_roboticvacuumcleaner_1807ff0c49.matter index dd9fe887bef6a4..6f88dc303da772 100644 --- a/examples/chef/devices/rootnode_roboticvacuumcleaner_1807ff0c49.matter +++ b/examples/chef/devices/rootnode_roboticvacuumcleaner_1807ff0c49.matter @@ -208,18 +208,18 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } -struct LocationDescriptorStruct { - char_string<128> locationName = 0; - nullable int16s floorNumber = 1; - nullable AreaTypeTag areaType = 2; -} - struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; optional nullable TestGlobalEnum myEnum = 2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/chef/devices/rootnode_roomairconditioner_9cf3607804.matter b/examples/chef/devices/rootnode_roomairconditioner_9cf3607804.matter index c3ef68e5e97da5..d6e843c5937189 100644 --- a/examples/chef/devices/rootnode_roomairconditioner_9cf3607804.matter +++ b/examples/chef/devices/rootnode_roomairconditioner_9cf3607804.matter @@ -208,18 +208,18 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } -struct LocationDescriptorStruct { - char_string<128> locationName = 0; - nullable int16s floorNumber = 1; - nullable AreaTypeTag areaType = 2; -} - struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; optional nullable TestGlobalEnum myEnum = 2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/chef/devices/rootnode_smokecoalarm_686fe0dcb8.matter b/examples/chef/devices/rootnode_smokecoalarm_686fe0dcb8.matter index 671339d987c1a0..9354126302295d 100644 --- a/examples/chef/devices/rootnode_smokecoalarm_686fe0dcb8.matter +++ b/examples/chef/devices/rootnode_smokecoalarm_686fe0dcb8.matter @@ -208,18 +208,18 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } -struct LocationDescriptorStruct { - char_string<128> locationName = 0; - nullable int16s floorNumber = 1; - nullable AreaTypeTag areaType = 2; -} - struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; optional nullable TestGlobalEnum myEnum = 2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/chef/devices/rootnode_speaker_RpzeXdimqA.matter b/examples/chef/devices/rootnode_speaker_RpzeXdimqA.matter index 148afd99364923..bdad38f829a821 100644 --- a/examples/chef/devices/rootnode_speaker_RpzeXdimqA.matter +++ b/examples/chef/devices/rootnode_speaker_RpzeXdimqA.matter @@ -208,18 +208,18 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } -struct LocationDescriptorStruct { - char_string<128> locationName = 0; - nullable int16s floorNumber = 1; - nullable AreaTypeTag areaType = 2; -} - struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; optional nullable TestGlobalEnum myEnum = 2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/chef/devices/rootnode_temperaturesensor_Qy1zkNW7c3.matter b/examples/chef/devices/rootnode_temperaturesensor_Qy1zkNW7c3.matter index bcb7f16079e3e2..cb7eaa21e153a2 100644 --- a/examples/chef/devices/rootnode_temperaturesensor_Qy1zkNW7c3.matter +++ b/examples/chef/devices/rootnode_temperaturesensor_Qy1zkNW7c3.matter @@ -208,18 +208,18 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } -struct LocationDescriptorStruct { - char_string<128> locationName = 0; - nullable int16s floorNumber = 1; - nullable AreaTypeTag areaType = 2; -} - struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; optional nullable TestGlobalEnum myEnum = 2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/chef/devices/rootnode_thermostat_bm3fb8dhYi.matter b/examples/chef/devices/rootnode_thermostat_bm3fb8dhYi.matter index 43f4bc7dace6bd..c65191a9e0b508 100644 --- a/examples/chef/devices/rootnode_thermostat_bm3fb8dhYi.matter +++ b/examples/chef/devices/rootnode_thermostat_bm3fb8dhYi.matter @@ -208,18 +208,18 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } -struct LocationDescriptorStruct { - char_string<128> locationName = 0; - nullable int16s floorNumber = 1; - nullable AreaTypeTag areaType = 2; -} - struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; optional nullable TestGlobalEnum myEnum = 2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/chef/devices/rootnode_windowcovering_RLCxaGi9Yx.matter b/examples/chef/devices/rootnode_windowcovering_RLCxaGi9Yx.matter index 4dfbfbc41b8d9f..737c351984bb64 100644 --- a/examples/chef/devices/rootnode_windowcovering_RLCxaGi9Yx.matter +++ b/examples/chef/devices/rootnode_windowcovering_RLCxaGi9Yx.matter @@ -208,18 +208,18 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } -struct LocationDescriptorStruct { - char_string<128> locationName = 0; - nullable int16s floorNumber = 1; - nullable AreaTypeTag areaType = 2; -} - struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; optional nullable TestGlobalEnum myEnum = 2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/chip-tool/commands/common/RemoteDataModelLogger.cpp b/examples/chip-tool/commands/common/RemoteDataModelLogger.cpp index 294673512882b3..3c6342752a0a61 100644 --- a/examples/chip-tool/commands/common/RemoteDataModelLogger.cpp +++ b/examples/chip-tool/commands/common/RemoteDataModelLogger.cpp @@ -160,8 +160,7 @@ CHIP_ERROR LogErrorAsJSON(const CHIP_ERROR & error) VerifyOrReturnError(gDelegate != nullptr, CHIP_NO_ERROR); Json::Value value; - chip::app::StatusIB status; - status.InitFromChipError(error); + chip::app::StatusIB status(error); return LogError(value, status); } diff --git a/examples/contact-sensor-app/contact-sensor-common/contact-sensor-app.matter b/examples/contact-sensor-app/contact-sensor-common/contact-sensor-app.matter index c25e9c9f5b8757..f721aa58e0fe15 100644 --- a/examples/contact-sensor-app/contact-sensor-common/contact-sensor-app.matter +++ b/examples/contact-sensor-app/contact-sensor-common/contact-sensor-app.matter @@ -208,18 +208,18 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } -struct LocationDescriptorStruct { - char_string<128> locationName = 0; - nullable int16s floorNumber = 1; - nullable AreaTypeTag areaType = 2; -} - struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; optional nullable TestGlobalEnum myEnum = 2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/contact-sensor-app/nxp/zap-lit/contact-sensor-app.matter b/examples/contact-sensor-app/nxp/zap-lit/contact-sensor-app.matter index efad0754f083a8..fb2cf8f8289734 100644 --- a/examples/contact-sensor-app/nxp/zap-lit/contact-sensor-app.matter +++ b/examples/contact-sensor-app/nxp/zap-lit/contact-sensor-app.matter @@ -208,18 +208,18 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } -struct LocationDescriptorStruct { - char_string<128> locationName = 0; - nullable int16s floorNumber = 1; - nullable AreaTypeTag areaType = 2; -} - struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; optional nullable TestGlobalEnum myEnum = 2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/contact-sensor-app/nxp/zap-sit/contact-sensor-app.matter b/examples/contact-sensor-app/nxp/zap-sit/contact-sensor-app.matter index 9afa33bd3ea3d8..21f793caedee04 100644 --- a/examples/contact-sensor-app/nxp/zap-sit/contact-sensor-app.matter +++ b/examples/contact-sensor-app/nxp/zap-sit/contact-sensor-app.matter @@ -208,18 +208,18 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } -struct LocationDescriptorStruct { - char_string<128> locationName = 0; - nullable int16s floorNumber = 1; - nullable AreaTypeTag areaType = 2; -} - struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; optional nullable TestGlobalEnum myEnum = 2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/dishwasher-app/dishwasher-common/dishwasher-app.matter b/examples/dishwasher-app/dishwasher-common/dishwasher-app.matter index cb9872e9e66045..e5027342d1edb2 100644 --- a/examples/dishwasher-app/dishwasher-common/dishwasher-app.matter +++ b/examples/dishwasher-app/dishwasher-common/dishwasher-app.matter @@ -208,18 +208,18 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } -struct LocationDescriptorStruct { - char_string<128> locationName = 0; - nullable int16s floorNumber = 1; - nullable AreaTypeTag areaType = 2; -} - struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; optional nullable TestGlobalEnum myEnum = 2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/energy-management-app/energy-management-common/energy-management-app.matter b/examples/energy-management-app/energy-management-common/energy-management-app.matter index e9b0971aff8299..2b081f13a3827e 100644 --- a/examples/energy-management-app/energy-management-common/energy-management-app.matter +++ b/examples/energy-management-app/energy-management-common/energy-management-app.matter @@ -208,18 +208,18 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } -struct LocationDescriptorStruct { - char_string<128> locationName = 0; - nullable int16s floorNumber = 1; - nullable AreaTypeTag areaType = 2; -} - struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; optional nullable TestGlobalEnum myEnum = 2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/fabric-admin/commands/common/RemoteDataModelLogger.cpp b/examples/fabric-admin/commands/common/RemoteDataModelLogger.cpp index 6334d42506d53f..0e51a1503ea3e1 100644 --- a/examples/fabric-admin/commands/common/RemoteDataModelLogger.cpp +++ b/examples/fabric-admin/commands/common/RemoteDataModelLogger.cpp @@ -160,8 +160,7 @@ CHIP_ERROR LogErrorAsJSON(const CHIP_ERROR & error) VerifyOrReturnError(gDelegate != nullptr, CHIP_NO_ERROR); Json::Value value; - chip::app::StatusIB status; - status.InitFromChipError(error); + chip::app::StatusIB status(error); return LogError(value, status); } diff --git a/examples/fabric-bridge-app/fabric-bridge-common/fabric-bridge-app.matter b/examples/fabric-bridge-app/fabric-bridge-common/fabric-bridge-app.matter index db107fcf5bac43..33e1d992b677b1 100644 --- a/examples/fabric-bridge-app/fabric-bridge-common/fabric-bridge-app.matter +++ b/examples/fabric-bridge-app/fabric-bridge-common/fabric-bridge-app.matter @@ -208,18 +208,18 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } -struct LocationDescriptorStruct { - char_string<128> locationName = 0; - nullable int16s floorNumber = 1; - nullable AreaTypeTag areaType = 2; -} - struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; optional nullable TestGlobalEnum myEnum = 2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/laundry-washer-app/nxp/zap/laundry-washer-app.matter b/examples/laundry-washer-app/nxp/zap/laundry-washer-app.matter index fd62482a477bcc..b204bae6345a2d 100644 --- a/examples/laundry-washer-app/nxp/zap/laundry-washer-app.matter +++ b/examples/laundry-washer-app/nxp/zap/laundry-washer-app.matter @@ -208,18 +208,18 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } -struct LocationDescriptorStruct { - char_string<128> locationName = 0; - nullable int16s floorNumber = 1; - nullable AreaTypeTag areaType = 2; -} - struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; optional nullable TestGlobalEnum myEnum = 2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; 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 3dbb78723e7e09..1f2c3728b3098d 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 @@ -208,18 +208,18 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } -struct LocationDescriptorStruct { - char_string<128> locationName = 0; - nullable int16s floorNumber = 1; - nullable AreaTypeTag areaType = 2; -} - struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; optional nullable TestGlobalEnum myEnum = 2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/light-switch-app/qpg/zap/switch.matter b/examples/light-switch-app/qpg/zap/switch.matter index 3b4bce66e4e99d..a8a28edb2fbcf0 100644 --- a/examples/light-switch-app/qpg/zap/switch.matter +++ b/examples/light-switch-app/qpg/zap/switch.matter @@ -208,18 +208,18 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } -struct LocationDescriptorStruct { - char_string<128> locationName = 0; - nullable int16s floorNumber = 1; - nullable AreaTypeTag areaType = 2; -} - struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; optional nullable TestGlobalEnum myEnum = 2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/lighting-app/bouffalolab/data_model/lighting-app-ethernet.matter b/examples/lighting-app/bouffalolab/data_model/lighting-app-ethernet.matter index 95ec4192b1d0eb..f60a0c186bda97 100644 --- a/examples/lighting-app/bouffalolab/data_model/lighting-app-ethernet.matter +++ b/examples/lighting-app/bouffalolab/data_model/lighting-app-ethernet.matter @@ -208,18 +208,18 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } -struct LocationDescriptorStruct { - char_string<128> locationName = 0; - nullable int16s floorNumber = 1; - nullable AreaTypeTag areaType = 2; -} - struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; optional nullable TestGlobalEnum myEnum = 2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/lighting-app/bouffalolab/data_model/lighting-app-thread.matter b/examples/lighting-app/bouffalolab/data_model/lighting-app-thread.matter index aaf03062417f4e..eddf3d467b282c 100644 --- a/examples/lighting-app/bouffalolab/data_model/lighting-app-thread.matter +++ b/examples/lighting-app/bouffalolab/data_model/lighting-app-thread.matter @@ -208,18 +208,18 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } -struct LocationDescriptorStruct { - char_string<128> locationName = 0; - nullable int16s floorNumber = 1; - nullable AreaTypeTag areaType = 2; -} - struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; optional nullable TestGlobalEnum myEnum = 2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/lighting-app/bouffalolab/data_model/lighting-app-wifi.matter b/examples/lighting-app/bouffalolab/data_model/lighting-app-wifi.matter index c2e58783befefb..b65db2f043639c 100644 --- a/examples/lighting-app/bouffalolab/data_model/lighting-app-wifi.matter +++ b/examples/lighting-app/bouffalolab/data_model/lighting-app-wifi.matter @@ -208,18 +208,18 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } -struct LocationDescriptorStruct { - char_string<128> locationName = 0; - nullable int16s floorNumber = 1; - nullable AreaTypeTag areaType = 2; -} - struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; optional nullable TestGlobalEnum myEnum = 2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/lighting-app/lighting-common/lighting-app.matter b/examples/lighting-app/lighting-common/lighting-app.matter index 9f1ed514fcd5ca..13c3138eb22676 100644 --- a/examples/lighting-app/lighting-common/lighting-app.matter +++ b/examples/lighting-app/lighting-common/lighting-app.matter @@ -208,18 +208,18 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } -struct LocationDescriptorStruct { - char_string<128> locationName = 0; - nullable int16s floorNumber = 1; - nullable AreaTypeTag areaType = 2; -} - struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; optional nullable TestGlobalEnum myEnum = 2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/lighting-app/nxp/zap/lighting-on-off.matter b/examples/lighting-app/nxp/zap/lighting-on-off.matter index 4fb8cc0cb2effc..d4e0e18bc3e985 100644 --- a/examples/lighting-app/nxp/zap/lighting-on-off.matter +++ b/examples/lighting-app/nxp/zap/lighting-on-off.matter @@ -208,18 +208,18 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } -struct LocationDescriptorStruct { - char_string<128> locationName = 0; - nullable int16s floorNumber = 1; - nullable AreaTypeTag areaType = 2; -} - struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; optional nullable TestGlobalEnum myEnum = 2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/lighting-app/qpg/zap/light.matter b/examples/lighting-app/qpg/zap/light.matter index 9897f1b594cf81..652c45f6d83c71 100644 --- a/examples/lighting-app/qpg/zap/light.matter +++ b/examples/lighting-app/qpg/zap/light.matter @@ -208,18 +208,18 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } -struct LocationDescriptorStruct { - char_string<128> locationName = 0; - nullable int16s floorNumber = 1; - nullable AreaTypeTag areaType = 2; -} - struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; optional nullable TestGlobalEnum myEnum = 2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/lighting-app/silabs/data_model/lighting-thread-app.matter b/examples/lighting-app/silabs/data_model/lighting-thread-app.matter index 2fcf8a6f8c714d..b7d967d3c5ef0e 100644 --- a/examples/lighting-app/silabs/data_model/lighting-thread-app.matter +++ b/examples/lighting-app/silabs/data_model/lighting-thread-app.matter @@ -208,18 +208,18 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } -struct LocationDescriptorStruct { - char_string<128> locationName = 0; - nullable int16s floorNumber = 1; - nullable AreaTypeTag areaType = 2; -} - struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; optional nullable TestGlobalEnum myEnum = 2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/lighting-app/silabs/data_model/lighting-wifi-app.matter b/examples/lighting-app/silabs/data_model/lighting-wifi-app.matter index 0b6601b5fdb135..b1cd1c94be474a 100644 --- a/examples/lighting-app/silabs/data_model/lighting-wifi-app.matter +++ b/examples/lighting-app/silabs/data_model/lighting-wifi-app.matter @@ -208,18 +208,18 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } -struct LocationDescriptorStruct { - char_string<128> locationName = 0; - nullable int16s floorNumber = 1; - nullable AreaTypeTag areaType = 2; -} - struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; optional nullable TestGlobalEnum myEnum = 2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/lit-icd-app/lit-icd-common/lit-icd-server-app.matter b/examples/lit-icd-app/lit-icd-common/lit-icd-server-app.matter index a2f535b3a30a8f..f4c9fa01731c7c 100644 --- a/examples/lit-icd-app/lit-icd-common/lit-icd-server-app.matter +++ b/examples/lit-icd-app/lit-icd-common/lit-icd-server-app.matter @@ -208,18 +208,18 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } -struct LocationDescriptorStruct { - char_string<128> locationName = 0; - nullable int16s floorNumber = 1; - nullable AreaTypeTag areaType = 2; -} - struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; optional nullable TestGlobalEnum myEnum = 2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/lock-app/lock-common/lock-app.matter b/examples/lock-app/lock-common/lock-app.matter index 8a259619dce5a6..50c416a2a937cf 100644 --- a/examples/lock-app/lock-common/lock-app.matter +++ b/examples/lock-app/lock-common/lock-app.matter @@ -208,18 +208,18 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } -struct LocationDescriptorStruct { - char_string<128> locationName = 0; - nullable int16s floorNumber = 1; - nullable AreaTypeTag areaType = 2; -} - struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; optional nullable TestGlobalEnum myEnum = 2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/lock-app/nxp/zap/lock-app.matter b/examples/lock-app/nxp/zap/lock-app.matter index 97d6e3ae443c38..a8d2d9fd5eb230 100644 --- a/examples/lock-app/nxp/zap/lock-app.matter +++ b/examples/lock-app/nxp/zap/lock-app.matter @@ -208,18 +208,18 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } -struct LocationDescriptorStruct { - char_string<128> locationName = 0; - nullable int16s floorNumber = 1; - nullable AreaTypeTag areaType = 2; -} - struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; optional nullable TestGlobalEnum myEnum = 2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/lock-app/qpg/zap/lock.matter b/examples/lock-app/qpg/zap/lock.matter index 4bc5c6657d6574..d3f76e4f719b5e 100644 --- a/examples/lock-app/qpg/zap/lock.matter +++ b/examples/lock-app/qpg/zap/lock.matter @@ -208,18 +208,18 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } -struct LocationDescriptorStruct { - char_string<128> locationName = 0; - nullable int16s floorNumber = 1; - nullable AreaTypeTag areaType = 2; -} - struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; optional nullable TestGlobalEnum myEnum = 2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; 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 7633792300c4dd..38e6f51ee4d1de 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,18 +208,18 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } -struct LocationDescriptorStruct { - char_string<128> locationName = 0; - nullable int16s floorNumber = 1; - nullable AreaTypeTag areaType = 2; -} - struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; optional nullable TestGlobalEnum myEnum = 2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + /** The Access Control Cluster exposes a data model view of a Node's Access Control List (ACL), which codifies the rules used to manage and enforce Access Control for the Node's endpoints and their associated diff --git a/examples/microwave-oven-app/microwave-oven-common/microwave-oven-app.matter b/examples/microwave-oven-app/microwave-oven-common/microwave-oven-app.matter index 10eec889dee3bd..36df5a7a835c5f 100644 --- a/examples/microwave-oven-app/microwave-oven-common/microwave-oven-app.matter +++ b/examples/microwave-oven-app/microwave-oven-common/microwave-oven-app.matter @@ -208,18 +208,18 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } -struct LocationDescriptorStruct { - char_string<128> locationName = 0; - nullable int16s floorNumber = 1; - nullable AreaTypeTag areaType = 2; -} - struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; optional nullable TestGlobalEnum myEnum = 2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/network-manager-app/network-manager-common/network-manager-app.matter b/examples/network-manager-app/network-manager-common/network-manager-app.matter index 152f81961ba5f6..d3a951ddc9f624 100644 --- a/examples/network-manager-app/network-manager-common/network-manager-app.matter +++ b/examples/network-manager-app/network-manager-common/network-manager-app.matter @@ -208,18 +208,18 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } -struct LocationDescriptorStruct { - char_string<128> locationName = 0; - nullable int16s floorNumber = 1; - nullable AreaTypeTag areaType = 2; -} - struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; optional nullable TestGlobalEnum myEnum = 2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; 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 e030d276cf954c..8b290cc5796e1a 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 @@ -208,18 +208,18 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } -struct LocationDescriptorStruct { - char_string<128> locationName = 0; - nullable int16s floorNumber = 1; - nullable AreaTypeTag areaType = 2; -} - struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; optional nullable TestGlobalEnum myEnum = 2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + /** The Descriptor Cluster is meant to replace the support from the Zigbee Device Object (ZDO) for describing a node, its endpoints and clusters. */ cluster Descriptor = 29 { revision 2; 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 4d46808ccc9756..eb1703c55b85b1 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 @@ -208,18 +208,18 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } -struct LocationDescriptorStruct { - char_string<128> locationName = 0; - nullable int16s floorNumber = 1; - nullable AreaTypeTag areaType = 2; -} - struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; optional nullable TestGlobalEnum myEnum = 2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/placeholder/linux/apps/app1/config.matter b/examples/placeholder/linux/apps/app1/config.matter index 0592ef4e90ff49..44c2750954c902 100644 --- a/examples/placeholder/linux/apps/app1/config.matter +++ b/examples/placeholder/linux/apps/app1/config.matter @@ -208,18 +208,18 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } -struct LocationDescriptorStruct { - char_string<128> locationName = 0; - nullable int16s floorNumber = 1; - nullable AreaTypeTag areaType = 2; -} - struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; optional nullable TestGlobalEnum myEnum = 2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/placeholder/linux/apps/app2/config.matter b/examples/placeholder/linux/apps/app2/config.matter index 807c80a0099157..2d1d39836a51c7 100644 --- a/examples/placeholder/linux/apps/app2/config.matter +++ b/examples/placeholder/linux/apps/app2/config.matter @@ -208,18 +208,18 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } -struct LocationDescriptorStruct { - char_string<128> locationName = 0; - nullable int16s floorNumber = 1; - nullable AreaTypeTag areaType = 2; -} - struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; optional nullable TestGlobalEnum myEnum = 2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/pump-app/pump-common/pump-app.matter b/examples/pump-app/pump-common/pump-app.matter index d6a3bd98a27dcb..172582ef4d1234 100644 --- a/examples/pump-app/pump-common/pump-app.matter +++ b/examples/pump-app/pump-common/pump-app.matter @@ -208,18 +208,18 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } -struct LocationDescriptorStruct { - char_string<128> locationName = 0; - nullable int16s floorNumber = 1; - nullable AreaTypeTag areaType = 2; -} - struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; optional nullable TestGlobalEnum myEnum = 2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/pump-app/silabs/data_model/pump-thread-app.matter b/examples/pump-app/silabs/data_model/pump-thread-app.matter index d933e5fed1bca3..dae1ee04e0f3ac 100644 --- a/examples/pump-app/silabs/data_model/pump-thread-app.matter +++ b/examples/pump-app/silabs/data_model/pump-thread-app.matter @@ -208,18 +208,18 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } -struct LocationDescriptorStruct { - char_string<128> locationName = 0; - nullable int16s floorNumber = 1; - nullable AreaTypeTag areaType = 2; -} - struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; optional nullable TestGlobalEnum myEnum = 2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/pump-app/silabs/data_model/pump-wifi-app.matter b/examples/pump-app/silabs/data_model/pump-wifi-app.matter index d933e5fed1bca3..dae1ee04e0f3ac 100644 --- a/examples/pump-app/silabs/data_model/pump-wifi-app.matter +++ b/examples/pump-app/silabs/data_model/pump-wifi-app.matter @@ -208,18 +208,18 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } -struct LocationDescriptorStruct { - char_string<128> locationName = 0; - nullable int16s floorNumber = 1; - nullable AreaTypeTag areaType = 2; -} - struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; optional nullable TestGlobalEnum myEnum = 2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; 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 b65fb7a3151a26..8f5ae594b044f4 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 @@ -208,18 +208,18 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } -struct LocationDescriptorStruct { - char_string<128> locationName = 0; - nullable int16s floorNumber = 1; - nullable AreaTypeTag areaType = 2; -} - struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; optional nullable TestGlobalEnum myEnum = 2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/refrigerator-app/refrigerator-common/refrigerator-app.matter b/examples/refrigerator-app/refrigerator-common/refrigerator-app.matter index 3b6ed201671901..3208239c974fa1 100644 --- a/examples/refrigerator-app/refrigerator-common/refrigerator-app.matter +++ b/examples/refrigerator-app/refrigerator-common/refrigerator-app.matter @@ -208,18 +208,18 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } -struct LocationDescriptorStruct { - char_string<128> locationName = 0; - nullable int16s floorNumber = 1; - nullable AreaTypeTag areaType = 2; -} - struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; optional nullable TestGlobalEnum myEnum = 2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + /** The Descriptor Cluster is meant to replace the support from the Zigbee Device Object (ZDO) for describing a node, its endpoints and clusters. */ cluster Descriptor = 29 { revision 2; diff --git a/examples/rvc-app/rvc-common/rvc-app.matter b/examples/rvc-app/rvc-common/rvc-app.matter index e619edae8f0b29..56eebaae7cded7 100644 --- a/examples/rvc-app/rvc-common/rvc-app.matter +++ b/examples/rvc-app/rvc-common/rvc-app.matter @@ -208,18 +208,18 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } -struct LocationDescriptorStruct { - char_string<128> locationName = 0; - nullable int16s floorNumber = 1; - nullable AreaTypeTag areaType = 2; -} - struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; optional nullable TestGlobalEnum myEnum = 2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/smoke-co-alarm-app/smoke-co-alarm-common/smoke-co-alarm-app.matter b/examples/smoke-co-alarm-app/smoke-co-alarm-common/smoke-co-alarm-app.matter index cc9ddb1cce00cb..cb192d1fa9ff1c 100644 --- a/examples/smoke-co-alarm-app/smoke-co-alarm-common/smoke-co-alarm-app.matter +++ b/examples/smoke-co-alarm-app/smoke-co-alarm-common/smoke-co-alarm-app.matter @@ -208,18 +208,18 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } -struct LocationDescriptorStruct { - char_string<128> locationName = 0; - nullable int16s floorNumber = 1; - nullable AreaTypeTag areaType = 2; -} - struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; optional nullable TestGlobalEnum myEnum = 2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/temperature-measurement-app/temperature-measurement-common/temperature-measurement.matter b/examples/temperature-measurement-app/temperature-measurement-common/temperature-measurement.matter index 409b11d68bcd9c..c755a48de0f189 100644 --- a/examples/temperature-measurement-app/temperature-measurement-common/temperature-measurement.matter +++ b/examples/temperature-measurement-app/temperature-measurement-common/temperature-measurement.matter @@ -208,18 +208,18 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } -struct LocationDescriptorStruct { - char_string<128> locationName = 0; - nullable int16s floorNumber = 1; - nullable AreaTypeTag areaType = 2; -} - struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; optional nullable TestGlobalEnum myEnum = 2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + /** The Descriptor Cluster is meant to replace the support from the Zigbee Device Object (ZDO) for describing a node, its endpoints and clusters. */ cluster Descriptor = 29 { revision 2; diff --git a/examples/thermostat/nxp/zap/thermostat_matter_thread.matter b/examples/thermostat/nxp/zap/thermostat_matter_thread.matter index 1a3c1a76fa99ee..7b115dff3c7889 100644 --- a/examples/thermostat/nxp/zap/thermostat_matter_thread.matter +++ b/examples/thermostat/nxp/zap/thermostat_matter_thread.matter @@ -208,18 +208,18 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } -struct LocationDescriptorStruct { - char_string<128> locationName = 0; - nullable int16s floorNumber = 1; - nullable AreaTypeTag areaType = 2; -} - struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; optional nullable TestGlobalEnum myEnum = 2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/thermostat/nxp/zap/thermostat_matter_wifi.matter b/examples/thermostat/nxp/zap/thermostat_matter_wifi.matter index 1c787b7cc99803..2c4aaa2b37cd0a 100644 --- a/examples/thermostat/nxp/zap/thermostat_matter_wifi.matter +++ b/examples/thermostat/nxp/zap/thermostat_matter_wifi.matter @@ -208,18 +208,18 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } -struct LocationDescriptorStruct { - char_string<128> locationName = 0; - nullable int16s floorNumber = 1; - nullable AreaTypeTag areaType = 2; -} - struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; optional nullable TestGlobalEnum myEnum = 2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/thermostat/qpg/zap/thermostaticRadiatorValve.matter b/examples/thermostat/qpg/zap/thermostaticRadiatorValve.matter index ad0b9a109cad4f..9b7760d25744d2 100644 --- a/examples/thermostat/qpg/zap/thermostaticRadiatorValve.matter +++ b/examples/thermostat/qpg/zap/thermostaticRadiatorValve.matter @@ -208,18 +208,18 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } -struct LocationDescriptorStruct { - char_string<128> locationName = 0; - nullable int16s floorNumber = 1; - nullable AreaTypeTag areaType = 2; -} - struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; optional nullable TestGlobalEnum myEnum = 2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/thermostat/thermostat-common/thermostat.matter b/examples/thermostat/thermostat-common/thermostat.matter index abf0b4419ec713..1b8698f61b894b 100644 --- a/examples/thermostat/thermostat-common/thermostat.matter +++ b/examples/thermostat/thermostat-common/thermostat.matter @@ -208,18 +208,18 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } -struct LocationDescriptorStruct { - char_string<128> locationName = 0; - nullable int16s floorNumber = 1; - nullable AreaTypeTag areaType = 2; -} - struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; optional nullable TestGlobalEnum myEnum = 2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/tv-app/tv-common/tv-app.matter b/examples/tv-app/tv-common/tv-app.matter index 71f8dd019590ad..02ef8118fa74df 100644 --- a/examples/tv-app/tv-common/tv-app.matter +++ b/examples/tv-app/tv-common/tv-app.matter @@ -208,18 +208,18 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } -struct LocationDescriptorStruct { - char_string<128> locationName = 0; - nullable int16s floorNumber = 1; - nullable AreaTypeTag areaType = 2; -} - struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; optional nullable TestGlobalEnum myEnum = 2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + /** Attributes and commands for switching devices between 'On' and 'Off' states. */ cluster OnOff = 6 { revision 6; 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 bae4ecfd37ea49..0f42ef74d2fb94 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 @@ -208,18 +208,18 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } -struct LocationDescriptorStruct { - char_string<128> locationName = 0; - nullable int16s floorNumber = 1; - nullable AreaTypeTag areaType = 2; -} - struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; optional nullable TestGlobalEnum myEnum = 2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/virtual-device-app/virtual-device-common/virtual-device-app.matter b/examples/virtual-device-app/virtual-device-common/virtual-device-app.matter index fc651825cce654..7cc780ba68436e 100644 --- a/examples/virtual-device-app/virtual-device-common/virtual-device-app.matter +++ b/examples/virtual-device-app/virtual-device-common/virtual-device-app.matter @@ -208,18 +208,18 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } -struct LocationDescriptorStruct { - char_string<128> locationName = 0; - nullable int16s floorNumber = 1; - nullable AreaTypeTag areaType = 2; -} - struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; optional nullable TestGlobalEnum myEnum = 2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/window-app/common/window-app.matter b/examples/window-app/common/window-app.matter index 7037e2ed4540e8..446a3fb3f64e80 100644 --- a/examples/window-app/common/window-app.matter +++ b/examples/window-app/common/window-app.matter @@ -208,18 +208,18 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } -struct LocationDescriptorStruct { - char_string<128> locationName = 0; - nullable int16s floorNumber = 1; - nullable AreaTypeTag areaType = 2; -} - struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; optional nullable TestGlobalEnum myEnum = 2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/src/app/CommandSender.h b/src/app/CommandSender.h index 489c6aa9cd2965..ba98c7178a5c83 100644 --- a/src/app/CommandSender.h +++ b/src/app/CommandSender.h @@ -100,8 +100,8 @@ class CommandSender final : public Messaging::ExchangeDelegate * - CHIP_ERROR_TIMEOUT: A response was not received within the expected response timeout. * - CHIP_ERROR_*TLV*: A malformed, non-compliant response was received from the server. * - CHIP_ERROR encapsulating a StatusIB: If we got a non-path-specific - * status response from the server. In that case, - * StatusIB::InitFromChipError can be used to extract the status. + * status response from the server. In that case, constructing + * a StatusIB from the error can be used to extract the status. * - CHIP_ERROR*: All other cases. */ CHIP_ERROR error; diff --git a/src/app/CommandSenderLegacyCallback.h b/src/app/CommandSenderLegacyCallback.h index f6c63c1fd96292..2645dcbdee58df 100644 --- a/src/app/CommandSenderLegacyCallback.h +++ b/src/app/CommandSenderLegacyCallback.h @@ -65,8 +65,8 @@ class CommandSenderLegacyCallback * - CHIP_ERROR_TIMEOUT: A response was not received within the expected response timeout. * - CHIP_ERROR_*TLV*: A malformed, non-compliant response was received from the server. * - CHIP_ERROR encapsulating a StatusIB: If we got a non-path-specific or path-specific - * status response from the server. In that case, - * StatusIB::InitFromChipError can be used to extract the status. + * status response from the server. In that case, constructing a + * StatusIB from the error can be used to extract the status. * - Note: a CommandSender using `CommandSender::Callback` only supports sending * a single InvokeRequest. As a result, only one path-specific error is expected * to ever be sent to the OnError callback. diff --git a/src/app/MessageDef/StatusIB.cpp b/src/app/MessageDef/StatusIB.cpp index 55fec8b92661de..d612f549aeeae1 100644 --- a/src/app/MessageDef/StatusIB.cpp +++ b/src/app/MessageDef/StatusIB.cpp @@ -149,7 +149,7 @@ CHIP_ERROR StatusIB::ToChipError() const return ChipError(ChipError::SdkPart::kIMGlobalStatus, to_underlying(mStatus)); } -void StatusIB::InitFromChipError(CHIP_ERROR aError) +StatusIB::StatusIB(CHIP_ERROR aError) { if (aError.IsPart(ChipError::SdkPart::kIMClusterStatus)) { @@ -204,8 +204,7 @@ bool FormatStatusIBError(char * buf, uint16_t bufSize, CHIP_ERROR err) constexpr size_t formattedSize = max(sizeof(generalFormat) + statusNameMaxLength, sizeof(clusterFormat)); char formattedString[formattedSize]; - StatusIB status; - status.InitFromChipError(err); + StatusIB status(err); if (status.mClusterStatus.HasValue()) { snprintf(formattedString, formattedSize, clusterFormat, status.mClusterStatus.Value()); diff --git a/src/app/MessageDef/StatusIB.h b/src/app/MessageDef/StatusIB.h index 08137045ffcd7b..291a68c7fd295d 100644 --- a/src/app/MessageDef/StatusIB.h +++ b/src/app/MessageDef/StatusIB.h @@ -60,7 +60,7 @@ struct StatusIB } } - explicit StatusIB(CHIP_ERROR error) { InitFromChipError(error); } + explicit StatusIB(CHIP_ERROR error); enum class Tag : uint8_t { @@ -105,13 +105,6 @@ struct StatusIB */ CHIP_ERROR ToChipError() const; - /** - * Extract a CHIP_ERROR into this StatusIB. If IsIMStatus() is false for - * the error, this might do a best-effort attempt to come up with a - * corresponding StatusIB, defaulting to a generic Status::Failure. - */ - void InitFromChipError(CHIP_ERROR aError); - /** * Test whether this status is a success. */ diff --git a/src/app/ReadClient.h b/src/app/ReadClient.h index 9bfb628b47e252..57852499c6ccbf 100644 --- a/src/app/ReadClient.h +++ b/src/app/ReadClient.h @@ -195,8 +195,8 @@ class ReadClient : public Messaging::ExchangeDelegate * - CHIP_ERROR_TIMEOUT: A response was not received within the expected response timeout. * - CHIP_ERROR_*TLV*: A malformed, non-compliant response was received from the server. * - CHIP_ERROR encapsulating a StatusIB: If we got a non-path-specific - * status response from the server. In that case, - * StatusIB::InitFromChipError can be used to extract the status. + * status response from the server. In that case, constructing + * a StatusIB from the error can be used to extract the status. * - CHIP_ERROR*: All other cases. * * This object MUST continue to exist after this call is completed. The application shall wait until it diff --git a/src/app/TimedRequest.h b/src/app/TimedRequest.h index edfe1d78cf8b6a..729c1266b4d401 100644 --- a/src/app/TimedRequest.h +++ b/src/app/TimedRequest.h @@ -38,8 +38,8 @@ class TimedRequest // but came in after we sent a timed request). // // If the response is a failure StatusResponse, its status will be - // encapsulated in the CHIP_ERROR this returns. In that case, - // StatusIB::InitFromChipError can be used to extract the status. + // encapsulated in the CHIP_ERROR this returns. In that case, constructing + // a StatusIB from the error can be used to extract the status. static CHIP_ERROR HandleResponse(const PayloadHeader & aPayloadHeader, System::PacketBufferHandle && aPayload); }; diff --git a/src/app/WriteClient.h b/src/app/WriteClient.h index b4d803981be3d8..b056d238bf7e6e 100644 --- a/src/app/WriteClient.h +++ b/src/app/WriteClient.h @@ -88,8 +88,8 @@ class WriteClient : public Messaging::ExchangeDelegate * - CHIP_ERROR_TIMEOUT: A response was not received within the expected response timeout. * - CHIP_ERROR_*TLV*: A malformed, non-compliant response was received from the server. * - CHIP_ERROR encapsulating a StatusIB: If we got a non-path-specific - * status response from the server. In that case, - * StatusIB::InitFromChipError can be used to extract the status. + * status response from the server. In that case, constructing + * a StatusIB from the error can be used to extract the status. * - CHIP_ERROR*: All other cases. * * The WriteClient object MUST continue to exist after this call is completed. The application shall wait until it diff --git a/src/app/codegen-data-model-provider/CodegenDataModelProvider.cpp b/src/app/codegen-data-model-provider/CodegenDataModelProvider.cpp index e3b9823efeef9a..cea75c8d0c1ccc 100644 --- a/src/app/codegen-data-model-provider/CodegenDataModelProvider.cpp +++ b/src/app/codegen-data-model-provider/CodegenDataModelProvider.cpp @@ -229,8 +229,8 @@ bool CodegenDataModelProvider::EmberCommandListIterator::Exists(const CommandId return (*mCurrentHint == toCheck); } -CHIP_ERROR CodegenDataModelProvider::Invoke(const DataModel::InvokeRequest & request, TLV::TLVReader & input_arguments, - CommandHandler * handler) +DataModel::ActionReturnStatus CodegenDataModelProvider::Invoke(const DataModel::InvokeRequest & request, + TLV::TLVReader & input_arguments, CommandHandler * handler) { // TODO: CommandHandlerInterface support is currently // residing in InteractionModelEngine itself. We may want to separate this out diff --git a/src/app/codegen-data-model-provider/CodegenDataModelProvider.h b/src/app/codegen-data-model-provider/CodegenDataModelProvider.h index 21dc0cc87e1a31..b486b953976328 100644 --- a/src/app/codegen-data-model-provider/CodegenDataModelProvider.h +++ b/src/app/codegen-data-model-provider/CodegenDataModelProvider.h @@ -16,6 +16,7 @@ */ #pragma once +#include "app/data-model-provider/ActionReturnStatus.h" #include #include @@ -68,10 +69,12 @@ class CodegenDataModelProvider : public chip::app::DataModel::Provider /// Generic model implementations CHIP_ERROR Shutdown() override { return CHIP_NO_ERROR; } - CHIP_ERROR ReadAttribute(const DataModel::ReadAttributeRequest & request, AttributeValueEncoder & encoder) override; - CHIP_ERROR WriteAttribute(const DataModel::WriteAttributeRequest & request, AttributeValueDecoder & decoder) override; - CHIP_ERROR Invoke(const DataModel::InvokeRequest & request, chip::TLV::TLVReader & input_arguments, - CommandHandler * handler) override; + DataModel::ActionReturnStatus ReadAttribute(const DataModel::ReadAttributeRequest & request, + AttributeValueEncoder & encoder) override; + DataModel::ActionReturnStatus WriteAttribute(const DataModel::WriteAttributeRequest & request, + AttributeValueDecoder & decoder) override; + DataModel::ActionReturnStatus Invoke(const DataModel::InvokeRequest & request, chip::TLV::TLVReader & input_arguments, + CommandHandler * handler) override; /// attribute tree iteration EndpointId FirstEndpoint() override; diff --git a/src/app/codegen-data-model-provider/CodegenDataModelProvider_Read.cpp b/src/app/codegen-data-model-provider/CodegenDataModelProvider_Read.cpp index d27d18964dccf7..6ff4b730812d16 100644 --- a/src/app/codegen-data-model-provider/CodegenDataModelProvider_Read.cpp +++ b/src/app/codegen-data-model-provider/CodegenDataModelProvider_Read.cpp @@ -47,7 +47,9 @@ namespace chip { namespace app { namespace { + using namespace chip::app::Compatibility::Internal; +using Protocols::InteractionModel::Status; /// Attempts to read via an attribute access interface (AAI) /// @@ -258,7 +260,8 @@ CHIP_ERROR EncodeEmberValue(ByteSpan data, const EmberAfAttributeMetadata * meta /// - validate ACL (only for non-internal requests) /// - Try to read attribute via the AttributeAccessInterface /// - Try to read the value from ember RAM storage -CHIP_ERROR CodegenDataModelProvider::ReadAttribute(const DataModel::ReadAttributeRequest & request, AttributeValueEncoder & encoder) +DataModel::ActionReturnStatus CodegenDataModelProvider::ReadAttribute(const DataModel::ReadAttributeRequest & request, + AttributeValueEncoder & encoder) { ChipLogDetail(DataManagement, "Reading attribute: Cluster=" ChipLogFormatMEI " Endpoint=0x%x AttributeId=" ChipLogFormatMEI " (expanded=%d)", @@ -290,12 +293,12 @@ CHIP_ERROR CodegenDataModelProvider::ReadAttribute(const DataModel::ReadAttribut auto metadata = Ember::FindAttributeMetadata(request.path); // Explicit failure in finding a suitable metadata - if (const CHIP_ERROR * err = std::get_if(&metadata)) + if (const Status * status = std::get_if(&metadata)) { - VerifyOrDie((*err == CHIP_IM_GLOBAL_STATUS(UnsupportedEndpoint)) || // - (*err == CHIP_IM_GLOBAL_STATUS(UnsupportedCluster)) || // - (*err == CHIP_IM_GLOBAL_STATUS(UnsupportedAttribute))); - return *err; + VerifyOrDie((*status == Status::UnsupportedEndpoint) || // + (*status == Status::UnsupportedCluster) || // + (*status == Status::UnsupportedAttribute)); + return *status; } // Read via AAI diff --git a/src/app/codegen-data-model-provider/CodegenDataModelProvider_Write.cpp b/src/app/codegen-data-model-provider/CodegenDataModelProvider_Write.cpp index 962355e8e47b08..925d5cce61bc87 100644 --- a/src/app/codegen-data-model-provider/CodegenDataModelProvider_Write.cpp +++ b/src/app/codegen-data-model-provider/CodegenDataModelProvider_Write.cpp @@ -43,6 +43,7 @@ namespace app { namespace { using namespace chip::app::Compatibility::Internal; +using Protocols::InteractionModel::Status; /// Attempts to write via an attribute access interface (AAI) /// @@ -266,8 +267,8 @@ CHIP_ERROR DecodeValueIntoEmberBuffer(AttributeValueDecoder & decoder, const Emb } // namespace -CHIP_ERROR CodegenDataModelProvider::WriteAttribute(const DataModel::WriteAttributeRequest & request, - AttributeValueDecoder & decoder) +DataModel::ActionReturnStatus CodegenDataModelProvider::WriteAttribute(const DataModel::WriteAttributeRequest & request, + AttributeValueDecoder & decoder) { ChipLogDetail(DataManagement, "Writing attribute: Cluster=" ChipLogFormatMEI " Endpoint=0x%x AttributeId=" ChipLogFormatMEI, ChipLogValueMEI(request.path.mClusterId), request.path.mEndpointId, ChipLogValueMEI(request.path.mAttributeId)); @@ -275,7 +276,7 @@ CHIP_ERROR CodegenDataModelProvider::WriteAttribute(const DataModel::WriteAttrib // ACL check for non-internal requests if (!request.operationFlags.Has(DataModel::OperationFlags::kInternal)) { - ReturnErrorCodeIf(!request.subjectDescriptor.has_value(), CHIP_IM_GLOBAL_STATUS(UnsupportedAccess)); + ReturnErrorCodeIf(!request.subjectDescriptor.has_value(), Status::UnsupportedAccess); Access::RequestPath requestPath{ .cluster = request.path.mClusterId, .endpoint = request.path.mEndpointId }; CHIP_ERROR err = Access::GetAccessControl().Check(*request.subjectDescriptor, requestPath, @@ -286,18 +287,19 @@ CHIP_ERROR CodegenDataModelProvider::WriteAttribute(const DataModel::WriteAttrib ReturnErrorCodeIf(err != CHIP_ERROR_ACCESS_DENIED, err); // TODO: when wildcard/group writes are supported, handle them to discard rather than fail with status - return CHIP_IM_GLOBAL_STATUS(UnsupportedAccess); + return Status::UnsupportedAccess; } } auto metadata = Ember::FindAttributeMetadata(request.path); - if (const CHIP_ERROR * err = std::get_if(&metadata)) + // Explicit failure in finding a suitable metadata + if (const Status * status = std::get_if(&metadata)) { - VerifyOrDie((*err == CHIP_IM_GLOBAL_STATUS(UnsupportedEndpoint)) || // - (*err == CHIP_IM_GLOBAL_STATUS(UnsupportedCluster)) || // - (*err == CHIP_IM_GLOBAL_STATUS(UnsupportedAttribute))); - return *err; + VerifyOrDie((*status == Status::UnsupportedEndpoint) || // + (*status == Status::UnsupportedCluster) || // + (*status == Status::UnsupportedAttribute)); + return *status; } const EmberAfAttributeMetadata ** attributeMetadata = std::get_if(&metadata); @@ -316,15 +318,15 @@ CHIP_ERROR CodegenDataModelProvider::WriteAttribute(const DataModel::WriteAttrib // Internal is allowed to bypass timed writes and read-only. if (!request.operationFlags.Has(DataModel::OperationFlags::kInternal)) { - VerifyOrReturnError(!isReadOnly, CHIP_IM_GLOBAL_STATUS(UnsupportedWrite)); + VerifyOrReturnError(!isReadOnly, Status::UnsupportedWrite); VerifyOrReturnError(!(*attributeMetadata)->MustUseTimedWrite() || request.writeFlags.Has(DataModel::WriteFlags::kTimed), - CHIP_IM_GLOBAL_STATUS(NeedsTimedInteraction)); + Status::NeedsTimedInteraction); } // Extra check: internal requests can bypass the read only check, however global attributes // have no underlying storage, so write still cannot be done - VerifyOrReturnError(attributeMetadata != nullptr, CHIP_IM_GLOBAL_STATUS(UnsupportedWrite)); + VerifyOrReturnError(attributeMetadata != nullptr, Status::UnsupportedWrite); if (request.path.mDataVersion.HasValue()) { @@ -333,14 +335,14 @@ CHIP_ERROR CodegenDataModelProvider::WriteAttribute(const DataModel::WriteAttrib { ChipLogError(DataManagement, "Unable to get cluster info for Endpoint 0x%x, Cluster " ChipLogFormatMEI, request.path.mEndpointId, ChipLogValueMEI(request.path.mClusterId)); - return CHIP_IM_GLOBAL_STATUS(DataVersionMismatch); + return Status::DataVersionMismatch; } if (request.path.mDataVersion.Value() != clusterInfo->dataVersion) { ChipLogError(DataManagement, "Write Version mismatch for Endpoint 0x%x, Cluster " ChipLogFormatMEI, request.path.mEndpointId, ChipLogValueMEI(request.path.mClusterId)); - return CHIP_IM_GLOBAL_STATUS(DataVersionMismatch); + return Status::DataVersionMismatch; } } @@ -367,7 +369,7 @@ CHIP_ERROR CodegenDataModelProvider::WriteAttribute(const DataModel::WriteAttrib if (dataBuffer.size() > (*attributeMetadata)->size) { ChipLogDetail(Zcl, "Data to write exceeds the attribute size claimed."); - return CHIP_IM_GLOBAL_STATUS(InvalidValue); + return Status::InvalidValue; } if (request.operationFlags.Has(DataModel::OperationFlags::kInternal)) @@ -386,7 +388,7 @@ CHIP_ERROR CodegenDataModelProvider::WriteAttribute(const DataModel::WriteAttrib if (status != Protocols::InteractionModel::Status::Success) { - return CHIP_ERROR_IM_GLOBAL_STATUS_VALUE(status); + return status; } // TODO: this WILL requre updates diff --git a/src/app/codegen-data-model-provider/EmberMetadata.cpp b/src/app/codegen-data-model-provider/EmberMetadata.cpp index b8d998d29f0b7e..69f9e3e889369c 100644 --- a/src/app/codegen-data-model-provider/EmberMetadata.cpp +++ b/src/app/codegen-data-model-provider/EmberMetadata.cpp @@ -24,9 +24,11 @@ namespace chip { namespace app { namespace Ember { +using Protocols::InteractionModel::Status; + std::variant FindAttributeMetadata(const ConcreteAttributePath & aPath) { @@ -41,8 +43,8 @@ FindAttributeMetadata(const ConcreteAttributePath & aPath) const EmberAfCluster * cluster = emberAfFindServerCluster(aPath.mEndpointId, aPath.mClusterId); if (cluster == nullptr) { - return (emberAfFindEndpointType(aPath.mEndpointId) == nullptr) ? CHIP_IM_GLOBAL_STATUS(UnsupportedEndpoint) - : CHIP_IM_GLOBAL_STATUS(UnsupportedCluster); + return (emberAfFindEndpointType(aPath.mEndpointId) == nullptr) ? Status::UnsupportedEndpoint + : Status::UnsupportedCluster; } return cluster; @@ -57,18 +59,18 @@ FindAttributeMetadata(const ConcreteAttributePath & aPath) const EmberAfEndpointType * type = emberAfFindEndpointType(aPath.mEndpointId); if (type == nullptr) { - return CHIP_IM_GLOBAL_STATUS(UnsupportedEndpoint); + return Status::UnsupportedEndpoint; } const EmberAfCluster * cluster = emberAfFindClusterInType(type, aPath.mClusterId, CLUSTER_MASK_SERVER); if (cluster == nullptr) { - return CHIP_IM_GLOBAL_STATUS(UnsupportedCluster); + return Status::UnsupportedCluster; } // Since we know the attribute is unsupported and the endpoint/cluster are // OK, this is the only option left. - return CHIP_IM_GLOBAL_STATUS(UnsupportedAttribute); + return Status::UnsupportedAttribute; } return metadata; diff --git a/src/app/codegen-data-model-provider/EmberMetadata.h b/src/app/codegen-data-model-provider/EmberMetadata.h index f8f41312f1f7c9..64c0bfe736a25f 100644 --- a/src/app/codegen-data-model-provider/EmberMetadata.h +++ b/src/app/codegen-data-model-provider/EmberMetadata.h @@ -18,6 +18,7 @@ #include #include +#include #include @@ -31,13 +32,13 @@ namespace Ember { /// Possible return values: /// - EmberAfCluster (NEVER null) - Only for GlobalAttributesNotInMetaData /// - EmberAfAttributeMetadata (NEVER null) - if the attribute is known to ember datastore -/// - CHIP_ERROR, only specifically for unknown attributes, may only be one of: -/// - CHIP_IM_GLOBAL_STATUS(UnsupportedEndpoint); -/// - CHIP_IM_GLOBAL_STATUS(UnsupportedCluster); -/// - CHIP_IM_GLOBAL_STATUS(UnsupportedAttribute); -std::variant FindAttributeMetadata(const ConcreteAttributePath & aPath); diff --git a/src/app/codegen-data-model-provider/tests/BUILD.gn b/src/app/codegen-data-model-provider/tests/BUILD.gn index 451a276c0367d2..247685a91a0e7b 100644 --- a/src/app/codegen-data-model-provider/tests/BUILD.gn +++ b/src/app/codegen-data-model-provider/tests/BUILD.gn @@ -57,5 +57,8 @@ chip_test_suite("tests") { cflags = [ "-Wconversion" ] - public_deps = [ ":mock_model" ] + public_deps = [ + ":mock_model", + "${chip_root}/src/app/data-model-provider:string-builder-adapters", + ] } diff --git a/src/app/codegen-data-model-provider/tests/TestCodegenModelViaMocks.cpp b/src/app/codegen-data-model-provider/tests/TestCodegenModelViaMocks.cpp index 947d0aecd9684d..a8862bd9036963 100644 --- a/src/app/codegen-data-model-provider/tests/TestCodegenModelViaMocks.cpp +++ b/src/app/codegen-data-model-provider/tests/TestCodegenModelViaMocks.cpp @@ -19,9 +19,6 @@ #include -#include "app/ConcreteCommandPath.h" -#include - #include #include #include @@ -35,9 +32,12 @@ #include #include #include +#include #include #include +#include #include +#include #include #include #include @@ -58,6 +58,7 @@ #include #include #include +#include using namespace chip; using namespace chip::Test; @@ -65,6 +66,8 @@ using namespace chip::app; using namespace chip::app::DataModel; using namespace chip::app::Clusters::Globals::Attributes; +using chip::Protocols::InteractionModel::Status; + namespace { constexpr FabricIndex kTestFabrixIndex = kMinValidFabricIndex; @@ -787,7 +790,7 @@ void TestEmberScalarTypeWrite(const typename NumericAttributeTraits::WorkingT AttributeValueDecoder decoder = test.DecoderFor(value); // write should succeed - ASSERT_EQ(model.WriteAttribute(test.request, decoder), CHIP_NO_ERROR); + ASSERT_TRUE(model.WriteAttribute(test.request, decoder).IsSuccess()); // Validate data after write chip::ByteSpan writtenData = Test::GetEmberBuffer(); @@ -844,7 +847,7 @@ void TestEmberScalarNullWrite() AttributeValueDecoder decoder = test.DecoderFor(NullableType()); // write should succeed - ASSERT_EQ(model.WriteAttribute(test.request, decoder), CHIP_NO_ERROR); + ASSERT_TRUE(model.WriteAttribute(test.request, decoder).IsSuccess()); // Validate data after write chip::ByteSpan writtenData = Test::GetEmberBuffer(); @@ -1298,7 +1301,7 @@ TEST(TestCodegenModelViaMocks, EmberAttributeReadAclDeny) ConcreteAttributePath(kMockEndpoint1, MockClusterId(1), MockAttributeId(10))); std::unique_ptr encoder = testRequest.StartEncoding(&model); - ASSERT_EQ(model.ReadAttribute(testRequest.request, *encoder), CHIP_IM_GLOBAL_STATUS(UnsupportedAccess)); + ASSERT_EQ(model.ReadAttribute(testRequest.request, *encoder), Status::UnsupportedAccess); } TEST(TestCodegenModelViaMocks, ReadForInvalidGlobalAttributePath) @@ -1311,14 +1314,14 @@ TEST(TestCodegenModelViaMocks, ReadForInvalidGlobalAttributePath) TestReadRequest testRequest(kAdminSubjectDescriptor, ConcreteAttributePath(kEndpointIdThatIsMissing, MockClusterId(1), AttributeList::Id)); std::unique_ptr encoder = testRequest.StartEncoding(&model); - ASSERT_EQ(model.ReadAttribute(testRequest.request, *encoder), CHIP_IM_GLOBAL_STATUS(UnsupportedEndpoint)); + ASSERT_EQ(model.ReadAttribute(testRequest.request, *encoder), Status::UnsupportedEndpoint); } { TestReadRequest testRequest(kAdminSubjectDescriptor, ConcreteAttributePath(kMockEndpoint1, kInvalidClusterId, AttributeList::Id)); std::unique_ptr encoder = testRequest.StartEncoding(&model); - ASSERT_EQ(model.ReadAttribute(testRequest.request, *encoder), CHIP_IM_GLOBAL_STATUS(UnsupportedCluster)); + ASSERT_EQ(model.ReadAttribute(testRequest.request, *encoder), Status::UnsupportedCluster); } } @@ -1334,7 +1337,7 @@ TEST(TestCodegenModelViaMocks, EmberAttributeInvalidRead) ConcreteAttributePath(kMockEndpoint1, MockClusterId(1), MockAttributeId(10))); std::unique_ptr encoder = testRequest.StartEncoding(&model); - ASSERT_EQ(model.ReadAttribute(testRequest.request, *encoder), CHIP_IM_GLOBAL_STATUS(UnsupportedAttribute)); + ASSERT_EQ(model.ReadAttribute(testRequest.request, *encoder), Status::UnsupportedAttribute); } // Invalid cluster @@ -1343,7 +1346,7 @@ TEST(TestCodegenModelViaMocks, EmberAttributeInvalidRead) ConcreteAttributePath(kMockEndpoint1, MockClusterId(100), MockAttributeId(1))); std::unique_ptr encoder = testRequest.StartEncoding(&model); - ASSERT_EQ(model.ReadAttribute(testRequest.request, *encoder), CHIP_IM_GLOBAL_STATUS(UnsupportedCluster)); + ASSERT_EQ(model.ReadAttribute(testRequest.request, *encoder), Status::UnsupportedCluster); } // Invalid endpoint @@ -1352,7 +1355,7 @@ TEST(TestCodegenModelViaMocks, EmberAttributeInvalidRead) ConcreteAttributePath(kEndpointIdThatIsMissing, MockClusterId(1), MockAttributeId(1))); std::unique_ptr encoder = testRequest.StartEncoding(&model); - ASSERT_EQ(model.ReadAttribute(testRequest.request, *encoder), CHIP_IM_GLOBAL_STATUS(UnsupportedEndpoint)); + ASSERT_EQ(model.ReadAttribute(testRequest.request, *encoder), Status::UnsupportedEndpoint); } } @@ -1494,7 +1497,7 @@ TEST(TestCodegenModelViaMocks, EmberAttributeReadErrorReading) // Actual read via an encoder std::unique_ptr encoder = testRequest.StartEncoding(&model); - ASSERT_EQ(model.ReadAttribute(testRequest.request, *encoder), CHIP_IM_GLOBAL_STATUS(Failure)); + ASSERT_EQ(model.ReadAttribute(testRequest.request, *encoder), Status::Failure); } { @@ -1507,7 +1510,7 @@ TEST(TestCodegenModelViaMocks, EmberAttributeReadErrorReading) // Actual read via an encoder std::unique_ptr encoder = testRequest.StartEncoding(&model); - ASSERT_EQ(model.ReadAttribute(testRequest.request, *encoder), CHIP_IM_GLOBAL_STATUS(Busy)); + ASSERT_EQ(model.ReadAttribute(testRequest.request, *encoder), Status::Busy); } // reset things to success to not affect other tests @@ -1994,7 +1997,7 @@ TEST(TestCodegenModelViaMocks, EmberAttributeWriteAclDeny) TestWriteRequest test(kDenySubjectDescriptor, ConcreteDataAttributePath(kMockEndpoint1, MockClusterId(1), MockAttributeId(10))); AttributeValueDecoder decoder = test.DecoderFor(1234); - ASSERT_EQ(model.WriteAttribute(test.request, decoder), CHIP_IM_GLOBAL_STATUS(UnsupportedAccess)); + ASSERT_EQ(model.WriteAttribute(test.request, decoder), Status::UnsupportedAccess); ASSERT_TRUE(model.ChangeListener().DirtyList().empty()); } @@ -2065,7 +2068,7 @@ TEST(TestCodegenModelViaMocks, EmberTestWriteReservedNullPlaceholderToNullable) AttributeValueDecoder decoder = test.DecoderFor(0xFFFFFFFF); // write should fail: we are trying to write null which is out of range - ASSERT_EQ(model.WriteAttribute(test.request, decoder), CHIP_IM_GLOBAL_STATUS(ConstraintError)); + ASSERT_EQ(model.WriteAttribute(test.request, decoder), Status::ConstraintError); } TEST(TestCodegenModelViaMocks, EmberTestWriteOutOfRepresentableRangeOddIntegerNonNullable) @@ -2173,7 +2176,7 @@ TEST(TestCodegenModelViaMocks, EmberAttributeWriteLongStringOutOfBounds) AttributeValueDecoder decoder = test.DecoderFor( "this is a very long string that will be longer than the default attribute size for our mocks"_span); - ASSERT_EQ(model.WriteAttribute(test.request, decoder), CHIP_IM_GLOBAL_STATUS(InvalidValue)); + ASSERT_EQ(model.WriteAttribute(test.request, decoder), Status::InvalidValue); } TEST(TestCodegenModelViaMocks, EmberAttributeWriteLongString) @@ -2292,7 +2295,7 @@ TEST(TestCodegenModelViaMocks, EmberAttributeWriteTimedWrite) TestWriteRequest test(kAdminSubjectDescriptor, ConcreteAttributePath(kMockEndpoint3, MockClusterId(4), kAttributeIdTimedWrite)); AttributeValueDecoder decoder = test.DecoderFor(1234); - ASSERT_EQ(model.WriteAttribute(test.request, decoder), CHIP_IM_GLOBAL_STATUS(NeedsTimedInteraction)); + ASSERT_EQ(model.WriteAttribute(test.request, decoder), Status::NeedsTimedInteraction); // writing as timed should be fine test.request.writeFlags.Set(WriteFlags::kTimed); @@ -2308,7 +2311,7 @@ TEST(TestCodegenModelViaMocks, EmberAttributeWriteReadOnlyAttribute) TestWriteRequest test(kAdminSubjectDescriptor, ConcreteAttributePath(kMockEndpoint3, MockClusterId(4), kAttributeIdReadOnly)); AttributeValueDecoder decoder = test.DecoderFor(1234); - ASSERT_EQ(model.WriteAttribute(test.request, decoder), CHIP_IM_GLOBAL_STATUS(UnsupportedWrite)); + ASSERT_EQ(model.WriteAttribute(test.request, decoder), Status::UnsupportedWrite); // Internal writes bypass the read only requirement test.request.operationFlags.Set(OperationFlags::kInternal); @@ -2335,7 +2338,7 @@ TEST(TestCodegenModelViaMocks, EmberAttributeWriteDataVersion) AttributeValueDecoder decoder = test.DecoderFor(1234); - ASSERT_EQ(model.WriteAttribute(test.request, decoder), CHIP_IM_GLOBAL_STATUS(DataVersionMismatch)); + ASSERT_EQ(model.WriteAttribute(test.request, decoder), Status::DataVersionMismatch); // Write passes if we set the right version for the data test.request.path.mDataVersion = MakeOptional(GetVersion()); @@ -2351,18 +2354,18 @@ TEST(TestCodegenModelViaMocks, WriteToInvalidPath) { TestWriteRequest test(kAdminSubjectDescriptor, ConcreteAttributePath(kInvalidEndpointId, MockClusterId(1234), 1234)); AttributeValueDecoder decoder = test.DecoderFor(1234); - ASSERT_EQ(model.WriteAttribute(test.request, decoder), CHIP_IM_GLOBAL_STATUS(UnsupportedEndpoint)); + ASSERT_EQ(model.WriteAttribute(test.request, decoder), Status::UnsupportedEndpoint); } { TestWriteRequest test(kAdminSubjectDescriptor, ConcreteAttributePath(kMockEndpoint1, MockClusterId(1234), 1234)); AttributeValueDecoder decoder = test.DecoderFor(1234); - ASSERT_EQ(model.WriteAttribute(test.request, decoder), CHIP_IM_GLOBAL_STATUS(UnsupportedCluster)); + ASSERT_EQ(model.WriteAttribute(test.request, decoder), Status::UnsupportedCluster); } { TestWriteRequest test(kAdminSubjectDescriptor, ConcreteAttributePath(kMockEndpoint1, MockClusterId(1), 1234)); AttributeValueDecoder decoder = test.DecoderFor(1234); - ASSERT_EQ(model.WriteAttribute(test.request, decoder), CHIP_IM_GLOBAL_STATUS(UnsupportedAttribute)); + ASSERT_EQ(model.WriteAttribute(test.request, decoder), Status::UnsupportedAttribute); } } @@ -2374,7 +2377,7 @@ TEST(TestCodegenModelViaMocks, WriteToGlobalAttribute) TestWriteRequest test(kAdminSubjectDescriptor, ConcreteAttributePath(kMockEndpoint1, MockClusterId(1), AttributeList::Id)); AttributeValueDecoder decoder = test.DecoderFor(1234); - ASSERT_EQ(model.WriteAttribute(test.request, decoder), CHIP_IM_GLOBAL_STATUS(UnsupportedWrite)); + ASSERT_EQ(model.WriteAttribute(test.request, decoder), Status::UnsupportedWrite); } TEST(TestCodegenModelViaMocks, EmberWriteFailure) @@ -2390,12 +2393,12 @@ TEST(TestCodegenModelViaMocks, EmberWriteFailure) { AttributeValueDecoder decoder = test.DecoderFor(1234); chip::Test::SetEmberReadOutput(Protocols::InteractionModel::Status::Failure); - ASSERT_EQ(model.WriteAttribute(test.request, decoder), CHIP_IM_GLOBAL_STATUS(Failure)); + ASSERT_EQ(model.WriteAttribute(test.request, decoder), Status::Failure); } { AttributeValueDecoder decoder = test.DecoderFor(1234); chip::Test::SetEmberReadOutput(Protocols::InteractionModel::Status::Busy); - ASSERT_EQ(model.WriteAttribute(test.request, decoder), CHIP_IM_GLOBAL_STATUS(Busy)); + ASSERT_EQ(model.WriteAttribute(test.request, decoder), Status::Busy); } // reset things to success to not affect other tests chip::Test::SetEmberReadOutput(ByteSpan()); @@ -2524,6 +2527,6 @@ TEST(TestCodegenModelViaMocks, EmberWriteInvalidDataType) // Embed specifically DOES NOT support structures. // Without AAI, we expect a data type error (translated to failure) - ASSERT_EQ(model.WriteAttribute(test.request, decoder), CHIP_IM_GLOBAL_STATUS(Failure)); + ASSERT_EQ(model.WriteAttribute(test.request, decoder), Status::Failure); ASSERT_TRUE(model.ChangeListener().DirtyList().empty()); } diff --git a/src/app/data-model-provider/ActionReturnStatus.cpp b/src/app/data-model-provider/ActionReturnStatus.cpp new file mode 100644 index 00000000000000..7857246a0e861f --- /dev/null +++ b/src/app/data-model-provider/ActionReturnStatus.cpp @@ -0,0 +1,199 @@ +/* + * Copyright (c) 2024 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#include +#include +#include +#include +#include + +#include + +namespace chip { +namespace app { +namespace DataModel { + +using Protocols::InteractionModel::ClusterStatusCode; +using Protocols::InteractionModel::Status; + +namespace { + +bool StatusIsTheSameAsError(const ClusterStatusCode & status, const CHIP_ERROR & err) +{ + auto cluster_code = status.GetClusterSpecificCode(); + if (!cluster_code.HasValue()) + { + // there exist Status::Success, however that may not be encoded + // as a CHIP_ERROR_IM_GLOBAL_STATUS_VALUE as it is just as well a CHIP_NO_ERROR. + // handle that separately + if ((status.GetStatus() == Status::Success) && (err == CHIP_NO_ERROR)) + { + return true; + } + + return err == CHIP_ERROR_IM_GLOBAL_STATUS_VALUE(status.GetStatus()); + } + + if (status.GetStatus() != Status::Failure) + { + return false; + } + + return err == CHIP_ERROR_IM_CLUSTER_STATUS_VALUE(cluster_code.Value()); +} + +} // namespace + +bool ActionReturnStatus::operator==(const ActionReturnStatus & other) const +{ + if (mReturnStatus == other.mReturnStatus) + { + return true; + } + + const ClusterStatusCode * thisStatus = std::get_if(&mReturnStatus); + const ClusterStatusCode * otherStatus = std::get_if(&other.mReturnStatus); + + const CHIP_ERROR * thisErr = std::get_if(&mReturnStatus); + const CHIP_ERROR * otherErr = std::get_if(&other.mReturnStatus); + + if (thisStatus && otherErr) + { + return StatusIsTheSameAsError(*thisStatus, *otherErr); + } + + if (otherStatus && thisErr) + { + return StatusIsTheSameAsError(*otherStatus, *thisErr); + } + + return false; +} + +CHIP_ERROR ActionReturnStatus::GetUnderlyingError() const +{ + + if (const CHIP_ERROR * err = std::get_if(&mReturnStatus)) + { + return *err; + } + + if (const ClusterStatusCode * status = std::get_if(&mReturnStatus)) + { + if (status->IsSuccess()) + { + return CHIP_NO_ERROR; + } + + chip::Optional code = status->GetClusterSpecificCode(); + + return code.HasValue() ? CHIP_ERROR_IM_CLUSTER_STATUS_VALUE(code.Value()) + : CHIP_ERROR_IM_GLOBAL_STATUS_VALUE(status->GetStatus()); + } + + chipDie(); +} + +ClusterStatusCode ActionReturnStatus::GetStatusCode() const +{ + if (const ClusterStatusCode * status = std::get_if(&mReturnStatus)) + { + return *status; + } + + if (const CHIP_ERROR * err = std::get_if(&mReturnStatus)) + { + return ClusterStatusCode(*err); + } + + // all std::variant cases exhausted + chipDie(); +} + +bool ActionReturnStatus::IsSuccess() const +{ + if (const CHIP_ERROR * err = std::get_if(&mReturnStatus)) + { + return (*err == CHIP_NO_ERROR); + } + + if (const ClusterStatusCode * status = std::get_if(&mReturnStatus)) + { + return status->IsSuccess(); + } + + // all std::variant cases exhausted + chipDie(); +} + +bool ActionReturnStatus::IsOutOfSpaceEncodingResponse() const +{ + if (const CHIP_ERROR * err = std::get_if(&mReturnStatus)) + { + return (*err == CHIP_ERROR_NO_MEMORY) || (*err == CHIP_ERROR_BUFFER_TOO_SMALL); + } + + return false; +} + +const char * ActionReturnStatus::c_str() const +{ + + // Generally size should be sufficient. + // len("Status<123>, Code 255") == 21 (and then 22 for null terminator. We have slack.) + static chip::StringBuilder<32> sFormatBuffer; + + if (const CHIP_ERROR * err = std::get_if(&mReturnStatus)) + { +#if CHIP_CONFIG_ERROR_FORMAT_AS_STRING + return err->Format(); // any length +#else + sFormatBuffer.Reset().AddFormat("%" CHIP_ERROR_FORMAT, err->Format()); + return sFormatBuffer.c_str(); +#endif + } + + if (const ClusterStatusCode * status = std::get_if(&mReturnStatus)) + { +#if CHIP_CONFIG_IM_STATUS_CODE_VERBOSE_FORMAT + sFormatBuffer.AddFormat("%s(%d)", Protocols::InteractionModel::StatusName(status->GetStatus()), + static_cast(status->GetStatus())); +#else + if (status->IsSuccess()) + { + sFormatBuffer.Add("Success"); + } + else + { + sFormatBuffer.AddFormat("Status<%d>", static_cast(status->GetStatus())); + } +#endif + + chip::Optional clusterCode = status->GetClusterSpecificCode(); + if (clusterCode.HasValue()) + { + sFormatBuffer.AddFormat(", Code %d", static_cast(clusterCode.Value())); + } + return sFormatBuffer.c_str(); + } + + // all std::variant cases exhausted + chipDie(); +} + +} // namespace DataModel +} // namespace app +} // namespace chip diff --git a/src/app/data-model-provider/ActionReturnStatus.h b/src/app/data-model-provider/ActionReturnStatus.h new file mode 100644 index 00000000000000..516541483ad068 --- /dev/null +++ b/src/app/data-model-provider/ActionReturnStatus.h @@ -0,0 +1,97 @@ +/* + * Copyright (c) 2024 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#pragma once + +#include +#include +#include + +#include + +namespace chip { +namespace app { +namespace DataModel { + +/// An ActionReturnStatus encodes the result of a read/write/invoke. +/// +/// Generally such actions result in a StatusIB in the interaction model, +/// which is a code (InteractionModel::Status) and may have an associated +/// cluster-specific code. +/// +/// However some actions specifically may return additional information for +/// chunking, hence the existence of this class: +/// +/// - encapsulates a ClusterStatusCode for an actual action result +/// - encapsulates a underlying CHIP_ERROR for reporting purposes +/// - has a way to check for "chunking needed" status. +/// +/// The class is directly constructible from statuses (non-exlicit) to make +/// returning of values easy. +class ActionReturnStatus +{ +public: + ActionReturnStatus(CHIP_ERROR error) : mReturnStatus(error) {} + ActionReturnStatus(Protocols::InteractionModel::Status status) : + mReturnStatus(Protocols::InteractionModel::ClusterStatusCode(status)) + {} + ActionReturnStatus(Protocols::InteractionModel::ClusterStatusCode status) : mReturnStatus(status) {} + + /// Constructs a status code. Either returns the underlying code directly + /// or converts the underlying CHIP_ERROR into a cluster status code. + Protocols::InteractionModel::ClusterStatusCode GetStatusCode() const; + + /// Gets the underlying CHIP_ERROR if it exists, otherwise it will + /// return a CHIP_ERROR corresponding to the underlying return status. + /// + /// Success statusess will result in CHIP_NO_ERROR (i.e. cluster specitic success codes are lost) + CHIP_ERROR GetUnderlyingError() const; + + /// If this is a CHIP_NO_ERROR or a Status::Success + bool IsSuccess() const; + + /// Considers if the underlying error is an error or not (CHIP_NO_ERROR is the only non-erro) + /// or if the underlying statuscode is not an error (success and cluster specific successes + /// are not an error). + bool IsError() const { return !IsSuccess(); } + + /// Checks if the underlying error is an out of space condition (i.e. something that + /// chunking can handle by sending partial list data). + /// + /// Generally this is when the return is based on CHIP_ERROR_NO_MEMORY or CHIP_ERROR_BUFFER_TOO_SMALL + bool IsOutOfSpaceEncodingResponse() const; + + // NOTE: operator== will treat a CHIP_GLOBAL_IM_ERROR and a raw cluster status as equal if the statuses match, + // even though a CHIP_ERROR has some formatting info like file/line + bool operator==(const ActionReturnStatus & other) const; + bool operator!=(const ActionReturnStatus & other) const { return !(*this == other); } + + /// Get the formatted string of this status. + /// + /// NOTE: this is NOT thread safe in the general case, however the safety guarantees + /// are similar to chip::ErrorStr which also assumes a static buffer. + /// + /// Use this in the chip main event loop (and since that is a single thread, + /// there should be no races) + const char * c_str() const; + +private: + std::variant mReturnStatus; +}; + +} // namespace DataModel +} // namespace app +} // namespace chip diff --git a/src/app/data-model-provider/BUILD.gn b/src/app/data-model-provider/BUILD.gn index 5093cce2f4124d..40f34db127d501 100644 --- a/src/app/data-model-provider/BUILD.gn +++ b/src/app/data-model-provider/BUILD.gn @@ -12,10 +12,13 @@ # See the License for the specific language governing permissions and # limitations under the License. import("//build_overrides/chip.gni") +import("//build_overrides/pigweed.gni") source_set("data-model-provider") { sources = [ "ActionContext.h", + "ActionReturnStatus.cpp", + "ActionReturnStatus.h", "Context.h", "EventsGenerator.h", "MetadataTypes.cpp", @@ -40,3 +43,16 @@ source_set("data-model-provider") { "${chip_root}/src/messaging", ] } + +source_set("string-builder-adapters") { + sources = [ + "StringBuilderAdapters.cpp", + "StringBuilderAdapters.h", + ] + + public_deps = [ + ":data-model-provider", + "$dir_pw_string", + "${chip_root}/src/lib/core:string-builder-adapters", + ] +} diff --git a/src/app/data-model-provider/Provider.h b/src/app/data-model-provider/Provider.h index f5d550c806fd89..f38568319eb425 100644 --- a/src/app/data-model-provider/Provider.h +++ b/src/app/data-model-provider/Provider.h @@ -16,6 +16,7 @@ */ #pragma once +#include "lib/core/CHIPError.h" #include #include @@ -23,6 +24,7 @@ #include #include +#include #include #include #include @@ -66,18 +68,12 @@ class Provider : public ProviderMetadataTree /// > Else if reading from the attribute in the path requires a privilege that is not /// granted to access the cluster in the path, then the path SHALL be discarded. /// - /// Return codes: - /// CHIP_ERROR_NO_MEMORY or CHIP_ERROR_BUFFER_TOO_SMALL: + /// Return value notes: + /// ActionReturnStatus::IsOutOfSpaceEncodingResponse /// - Indicates that list encoding had insufficient buffer space to encode elements. /// - encoder::GetState().AllowPartialData() determines if these errors are permanent (no partial /// data allowed) or further encoding can be retried (AllowPartialData true for list encoding) - /// CHIP_IM_GLOBAL_STATUS(code): - /// - error codes that are translatable in IM status codes (otherwise we expect Failure to be reported) - /// - to check for this, CHIP_ERROR provides: - /// - ::IsPart(ChipError::SdkPart::kIMGlobalStatus) -> bool - /// - ::GetSdkCode() -> uint8_t to translate to the actual code - /// other internal falures - virtual CHIP_ERROR ReadAttribute(const ReadAttributeRequest & request, AttributeValueEncoder & encoder) = 0; + virtual ActionReturnStatus ReadAttribute(const ReadAttributeRequest & request, AttributeValueEncoder & encoder) = 0; /// Requests a write of an attribute. /// @@ -89,19 +85,21 @@ class Provider : public ProviderMetadataTree /// - ACL validation (see notes on OperationFlags::kInternal) /// - Validation of readability/writability (also controlled by OperationFlags::kInternal) /// - Validation of timed interaction required (also controlled by OperationFlags::kInternal) - /// - /// Return codes - /// CHIP_IM_GLOBAL_STATUS(code): - /// - error codes that are translatable to specific IM codes - /// - in particular, the following codes are interesting/expected - /// - `UnsupportedWrite` for attempts to write read-only data - /// - `UnsupportedAccess` for ACL failures - /// - `NeedsTimedInteraction` for writes that are not timed however are required to be so - virtual CHIP_ERROR WriteAttribute(const WriteAttributeRequest & request, AttributeValueDecoder & decoder) = 0; + virtual ActionReturnStatus WriteAttribute(const WriteAttributeRequest & request, AttributeValueDecoder & decoder) = 0; /// `handler` is used to send back the reply. - /// - returning a value other than CHIP_NO_ERROR implies an error reply (error and data are mutually exclusive) - virtual CHIP_ERROR Invoke(const InvokeRequest & request, chip::TLV::TLVReader & input_arguments, CommandHandler * handler) = 0; + /// - returning a value other than Success implies an error reply (error and data are mutually exclusive) + /// + /// Returning anything other than CHIP_NO_ERROR or Status::Success (i.e. success without a return code) + /// means that the invoke will be considered to be returning the given path-specific status WITHOUT any data (any data + /// that was sent via CommandHandler is to be rolled back/discarded). + /// + /// This is because only one of the following may be encoded in a response: + /// - data (as CommandDataIB) which is assumed a "response as a success" + /// - status (as a CommandStatusIB) which is considered a final status, usually an error however + /// cluster-specific success statuses also exist. + virtual ActionReturnStatus Invoke(const InvokeRequest & request, chip::TLV::TLVReader & input_arguments, + CommandHandler * handler) = 0; private: InteractionModelContext mContext = { nullptr }; diff --git a/src/app/data-model-provider/StringBuilderAdapters.cpp b/src/app/data-model-provider/StringBuilderAdapters.cpp new file mode 100644 index 00000000000000..93ad9863fc9762 --- /dev/null +++ b/src/app/data-model-provider/StringBuilderAdapters.cpp @@ -0,0 +1,29 @@ +/* + * Copyright (c) 2024 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#include + +#include + +namespace pw { + +template <> +StatusWithSize ToString(const chip::app::DataModel::ActionReturnStatus & status, + pw::span buffer) +{ + return pw::string::Format(buffer, "ActionReturnStatus<%s>", status.c_str()); +} + +} // namespace pw diff --git a/src/app/data-model-provider/StringBuilderAdapters.h b/src/app/data-model-provider/StringBuilderAdapters.h new file mode 100644 index 00000000000000..32da18f43f1681 --- /dev/null +++ b/src/app/data-model-provider/StringBuilderAdapters.h @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2024 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#pragma once + +/// This header includes pigweed stringbuilder adaptations for various chip types. +/// You can see https://pigweed.dev/pw_string/guide.html as a reference. +/// +/// In particular, pigweed code generally looks like: +/// +/// pw::StringBuffer<42> sb; +/// sb << "Here is a value: "; +/// sb << value; +/// +/// Where specific formatters exist for "value". In particular these are used when +/// reporting unit test assertions such as ASSERT_EQ/EXPECT_EQ so if you write code +/// like: +/// +/// ASSERT_EQ(SomeCall(), CHIP_NO_ERROR); +/// +/// On failure without adapters, the objects are reported as "24-byte object at 0x....." +/// which is not as helpful as a full formatted output. + +#include + +#include + +namespace pw { + +template <> +StatusWithSize ToString(const chip::app::DataModel::ActionReturnStatus & status, + pw::span buffer); + +} // namespace pw diff --git a/src/app/data-model-provider/tests/BUILD.gn b/src/app/data-model-provider/tests/BUILD.gn index 23107b9b5b1fd8..9829a2f4622514 100644 --- a/src/app/data-model-provider/tests/BUILD.gn +++ b/src/app/data-model-provider/tests/BUILD.gn @@ -17,12 +17,16 @@ import("${chip_root}/build/chip/chip_test_suite.gni") chip_test_suite("tests") { output_name = "libIMInterfaceTests" - test_sources = [ "TestEventEmitting.cpp" ] + test_sources = [ + "TestActionReturnStatus.cpp", + "TestEventEmitting.cpp", + ] cflags = [ "-Wconversion" ] public_deps = [ "${chip_root}/src/app/data-model-provider", + "${chip_root}/src/app/data-model-provider:string-builder-adapters", "${chip_root}/src/lib/core:string-builder-adapters", ] } diff --git a/src/app/data-model-provider/tests/TestActionReturnStatus.cpp b/src/app/data-model-provider/tests/TestActionReturnStatus.cpp new file mode 100644 index 00000000000000..a194c0838d7d12 --- /dev/null +++ b/src/app/data-model-provider/tests/TestActionReturnStatus.cpp @@ -0,0 +1,113 @@ +/* + * + * Copyright (c) 2024 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "lib/core/CHIPError.h" +#include "protocols/interaction_model/StatusCode.h" +#include "pw_unit_test/framework_backend.h" +#include +#include +#include + +#include + +using chip::app::DataModel::ActionReturnStatus; +using chip::Protocols::InteractionModel::ClusterStatusCode; +using chip::Protocols::InteractionModel::Status; + +TEST(TestActionReturnStatus, TestEquality) +{ + // equality should happen between equivalent statuses and chip_errors + ASSERT_EQ(ActionReturnStatus(Status::UnsupportedRead), Status::UnsupportedRead); + ASSERT_EQ(ActionReturnStatus(Status::UnsupportedWrite), CHIP_IM_GLOBAL_STATUS(UnsupportedWrite)); + + ASSERT_EQ(ActionReturnStatus(CHIP_IM_GLOBAL_STATUS(Busy)), Status::Busy); + ASSERT_EQ(ActionReturnStatus(CHIP_IM_GLOBAL_STATUS(Busy)), CHIP_IM_GLOBAL_STATUS(Busy)); + + ASSERT_EQ(ActionReturnStatus(CHIP_IM_CLUSTER_STATUS(123)), CHIP_IM_CLUSTER_STATUS(123)); + ASSERT_EQ(ActionReturnStatus(ClusterStatusCode::ClusterSpecificFailure(123)), CHIP_IM_CLUSTER_STATUS(123)); + ASSERT_EQ(ActionReturnStatus(ClusterStatusCode::ClusterSpecificFailure(123)), ClusterStatusCode::ClusterSpecificFailure(123)); + ASSERT_EQ(ActionReturnStatus(ClusterStatusCode::ClusterSpecificSuccess(123)), ClusterStatusCode::ClusterSpecificSuccess(123)); + + // Successes (without cluster-specific codes) are equivalent + ASSERT_EQ(ActionReturnStatus(Status::Success), Status::Success); + ASSERT_EQ(ActionReturnStatus(CHIP_NO_ERROR), Status::Success); + ASSERT_EQ(ActionReturnStatus(Status::Success), CHIP_NO_ERROR); + + // status specific success is has more data, so there is no equality (i.e. an action return + // with specific success codes has more data than a simple success) + ASSERT_NE(ActionReturnStatus(ClusterStatusCode::ClusterSpecificSuccess(123)), CHIP_NO_ERROR); + ASSERT_NE(ActionReturnStatus(ClusterStatusCode::ClusterSpecificSuccess(123)), Status::Success); + ASSERT_NE(ActionReturnStatus(CHIP_NO_ERROR), ClusterStatusCode::ClusterSpecificSuccess(123)); + ASSERT_NE(ActionReturnStatus(Status::Success), ClusterStatusCode::ClusterSpecificSuccess(123)); + + // things that are just not equal + ASSERT_NE(ActionReturnStatus(ClusterStatusCode::ClusterSpecificSuccess(11)), ClusterStatusCode::ClusterSpecificSuccess(22)); + ASSERT_NE(ActionReturnStatus(ClusterStatusCode::ClusterSpecificFailure(11)), ClusterStatusCode::ClusterSpecificSuccess(11)); + ASSERT_NE(ActionReturnStatus(ClusterStatusCode::ClusterSpecificFailure(11)), ClusterStatusCode::ClusterSpecificFailure(22)); + ASSERT_NE(ActionReturnStatus(CHIP_NO_ERROR), CHIP_ERROR_NOT_FOUND); + ASSERT_NE(ActionReturnStatus(CHIP_ERROR_INVALID_ARGUMENT), CHIP_ERROR_NOT_FOUND); + ASSERT_NE(ActionReturnStatus(CHIP_ERROR_INVALID_ARGUMENT), CHIP_NO_ERROR); + ASSERT_NE(ActionReturnStatus(CHIP_ERROR_INVALID_ARGUMENT), Status::Success); + ASSERT_NE(ActionReturnStatus(CHIP_ERROR_INVALID_ARGUMENT), Status::UnsupportedRead); + ASSERT_NE(ActionReturnStatus(Status::Success), Status::UnsupportedRead); + ASSERT_NE(ActionReturnStatus(Status::Success), CHIP_ERROR_INVALID_ARGUMENT); + ASSERT_NE(ActionReturnStatus(CHIP_ERROR_NOT_FOUND), Status::Failure); + ASSERT_NE(ActionReturnStatus(Status::Failure), CHIP_NO_ERROR); + ASSERT_NE(ActionReturnStatus(Status::Failure), CHIP_ERROR_INVALID_ARGUMENT); + ASSERT_NE(ActionReturnStatus(Status::Failure), ClusterStatusCode::ClusterSpecificSuccess(1)); + ASSERT_NE(ActionReturnStatus(Status::Failure), ClusterStatusCode::ClusterSpecificFailure(2)); + ASSERT_NE(ActionReturnStatus(ClusterStatusCode::ClusterSpecificSuccess(1)), CHIP_NO_ERROR); + ASSERT_NE(ActionReturnStatus(ClusterStatusCode::ClusterSpecificFailure(2)), CHIP_NO_ERROR); + ASSERT_NE(ActionReturnStatus(ClusterStatusCode::ClusterSpecificSuccess(3)), Status::Failure); + ASSERT_NE(ActionReturnStatus(ClusterStatusCode::ClusterSpecificFailure(4)), Status::Failure); + ASSERT_NE(ActionReturnStatus(ClusterStatusCode::ClusterSpecificSuccess(3)), Status::Success); + ASSERT_NE(ActionReturnStatus(ClusterStatusCode::ClusterSpecificFailure(4)), Status::Success); +} + +TEST(TestActionReturnStatus, TestIsError) +{ + ASSERT_TRUE(ActionReturnStatus(CHIP_IM_CLUSTER_STATUS(123)).IsError()); + ASSERT_TRUE(ActionReturnStatus(CHIP_ERROR_INTERNAL).IsError()); + ASSERT_TRUE(ActionReturnStatus(CHIP_ERROR_NO_MEMORY).IsError()); + ASSERT_TRUE(ActionReturnStatus(Status::UnsupportedRead).IsError()); + ASSERT_TRUE(ActionReturnStatus(ClusterStatusCode::ClusterSpecificFailure(123)).IsError()); + + ASSERT_FALSE(ActionReturnStatus(Status::Success).IsError()); + ASSERT_FALSE(ActionReturnStatus(ClusterStatusCode::ClusterSpecificSuccess(123)).IsError()); + ASSERT_FALSE(ActionReturnStatus(CHIP_NO_ERROR).IsError()); +} + +TEST(TestActionReturnStatus, TestUnderlyingError) +{ + ASSERT_EQ(ActionReturnStatus(ClusterStatusCode::ClusterSpecificFailure(123)).GetUnderlyingError(), CHIP_IM_CLUSTER_STATUS(123)); + ASSERT_EQ(ActionReturnStatus(ClusterStatusCode::ClusterSpecificSuccess(123)).GetUnderlyingError(), CHIP_NO_ERROR); + ASSERT_EQ(ActionReturnStatus(Status::Busy).GetUnderlyingError(), CHIP_IM_GLOBAL_STATUS(Busy)); + ASSERT_EQ(ActionReturnStatus(CHIP_ERROR_INTERNAL).GetUnderlyingError(), CHIP_ERROR_INTERNAL); +} + +TEST(TestActionReturnStatus, TestStatusCode) +{ + ASSERT_EQ(ActionReturnStatus(CHIP_ERROR_INTERNAL).GetStatusCode(), ClusterStatusCode(Status::Failure)); + ASSERT_EQ(ActionReturnStatus(Status::Busy).GetStatusCode(), ClusterStatusCode(Status::Busy)); + ASSERT_EQ(ActionReturnStatus(ClusterStatusCode::ClusterSpecificSuccess(123)).GetStatusCode(), + ClusterStatusCode::ClusterSpecificSuccess(123)); + ASSERT_EQ(ActionReturnStatus(ClusterStatusCode::ClusterSpecificFailure(123)).GetStatusCode(), + ClusterStatusCode::ClusterSpecificFailure(123)); + ASSERT_EQ(ActionReturnStatus(CHIP_IM_CLUSTER_STATUS(0x12)).GetStatusCode(), ClusterStatusCode::ClusterSpecificFailure(0x12)); + ASSERT_EQ(ActionReturnStatus(CHIP_IM_GLOBAL_STATUS(Timeout)).GetStatusCode(), ClusterStatusCode(Status::Timeout)); +} diff --git a/src/app/reporting/Engine.cpp b/src/app/reporting/Engine.cpp index faf76e031e177e..b5621e94bd9f47 100644 --- a/src/app/reporting/Engine.cpp +++ b/src/app/reporting/Engine.cpp @@ -23,6 +23,7 @@ * */ +#include "app/data-model-provider/ActionReturnStatus.h" #include #if CHIP_CONFIG_ENABLE_ICD_SERVER #include // nogncheck @@ -182,15 +183,20 @@ CHIP_ERROR Engine::BuildSingleReportDataAttributeReportIBs(ReportDataMessage::Bu ConcreteReadAttributePath pathForRetrieval(readPath); // Load the saved state from previous encoding session for chunking of one single attribute (list chunking). AttributeEncodeState encodeState = apReadHandler->GetAttributeEncodeState(); - err = Impl::RetrieveClusterData(mpImEngine->GetDataModelProvider(), apReadHandler->GetSubjectDescriptor(), - apReadHandler->IsFabricFiltered(), attributeReportIBs, pathForRetrieval, &encodeState); - if (err != CHIP_NO_ERROR) + DataModel::ActionReturnStatus status = + Impl::RetrieveClusterData(mpImEngine->GetDataModelProvider(), apReadHandler->GetSubjectDescriptor(), + apReadHandler->IsFabricFiltered(), attributeReportIBs, pathForRetrieval, &encodeState); + if (status.IsError()) { + // Operation error set, since this will affect early return or override on status encoding + // it will also be used for error reporting below. + err = status.GetUnderlyingError(); + // If error is not an "out of writer space" error, rollback and encode status. // Otherwise, if partial data allowed, save the encode state. // Otherwise roll back. If we have already encoded some chunks, we are done; otherwise encode status. - if (encodeState.AllowPartialData() && IsOutOfWriterSpaceError(err)) + if (encodeState.AllowPartialData() && status.IsOutOfSpaceEncodingResponse()) { ChipLogDetail(DataManagement, "List does not fit in packet, chunk between list items for clusterId: " ChipLogFormatMEI @@ -210,7 +216,7 @@ CHIP_ERROR Engine::BuildSingleReportDataAttributeReportIBs(ReportDataMessage::Bu attributeReportIBs.Rollback(attributeBackup); apReadHandler->SetAttributeEncodeState(AttributeEncodeState()); - if (!IsOutOfWriterSpaceError(err)) + if (!status.IsOutOfSpaceEncodingResponse()) { ChipLogError(DataManagement, "Fail to retrieve data, roll back and encode status on clusterId: " ChipLogFormatMEI @@ -218,7 +224,7 @@ CHIP_ERROR Engine::BuildSingleReportDataAttributeReportIBs(ReportDataMessage::Bu ChipLogValueMEI(pathForRetrieval.mClusterId), ChipLogValueMEI(pathForRetrieval.mAttributeId), err.Format()); // Try to encode our error as a status response. - err = attributeReportIBs.EncodeAttributeStatus(pathForRetrieval, StatusIB(err)); + err = attributeReportIBs.EncodeAttributeStatus(pathForRetrieval, StatusIB(status.GetStatusCode())); if (err != CHIP_NO_ERROR) { // OK, just roll back again and give up; if we still ran out of space we diff --git a/src/app/reporting/Read-Checked.cpp b/src/app/reporting/Read-Checked.cpp index 3b434d5da5f624..cd821bc67ae4f6 100644 --- a/src/app/reporting/Read-Checked.cpp +++ b/src/app/reporting/Read-Checked.cpp @@ -14,6 +14,8 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +#include "app/data-model-provider/ActionReturnStatus.h" +#include "lib/support/StringBuilder.h" #include #include @@ -26,6 +28,8 @@ namespace reporting { namespace CheckedImpl { namespace { +using DataModel::ActionReturnStatus; + /// Checkpoints and saves the state (including error state) for a /// AttributeReportIBs::Builder class ScopedAttributeReportIBsBuilderState @@ -50,16 +54,16 @@ class ScopedAttributeReportIBsBuilderState } // namespace -CHIP_ERROR RetrieveClusterData(DataModel::Provider * dataModel, const Access::SubjectDescriptor & subjectDescriptor, - bool isFabricFiltered, AttributeReportIBs::Builder & reportBuilder, - const ConcreteReadAttributePath & path, AttributeEncodeState * encoderState) +ActionReturnStatus RetrieveClusterData(DataModel::Provider * dataModel, const Access::SubjectDescriptor & subjectDescriptor, + bool isFabricFiltered, AttributeReportIBs::Builder & reportBuilder, + const ConcreteReadAttributePath & path, AttributeEncodeState * encoderState) { ChipLogDetail(DataManagement, " Cluster %" PRIx32 ", Attribute %" PRIx32 " is dirty", path.mClusterId, path.mAttributeId); DataModelCallbacks::GetInstance()->AttributeOperation(DataModelCallbacks::OperationType::Read, DataModelCallbacks::OperationOrder::Pre, path); - CHIP_ERROR errEmber = CHIP_NO_ERROR; + ActionReturnStatus statusEmber(CHIP_NO_ERROR); uint32_t lengthWrittenEmber = 0; // a copy for DM logic only. Ember changes state directly @@ -68,21 +72,22 @@ CHIP_ERROR RetrieveClusterData(DataModel::Provider * dataModel, const Access::Su { ScopedAttributeReportIBsBuilderState builderState(reportBuilder); // temporary only - errEmber = + statusEmber = EmberImpl::RetrieveClusterData(dataModel, subjectDescriptor, isFabricFiltered, reportBuilder, path, encoderState); lengthWrittenEmber = reportBuilder.GetWriter()->GetLengthWritten(); } - CHIP_ERROR errDM = DataModelImpl::RetrieveClusterData(dataModel, subjectDescriptor, isFabricFiltered, reportBuilder, path, - encoderState != nullptr ? &stateDm : nullptr); + ActionReturnStatus statusDm = DataModelImpl::RetrieveClusterData(dataModel, subjectDescriptor, isFabricFiltered, reportBuilder, + path, encoderState != nullptr ? &stateDm : nullptr); - if (errEmber != errDM) + if (statusEmber != statusDm) { + StringBuilder<128> buffer; // Note log + chipDie instead of VerifyOrDie so that breakpoints (and usage of rr) // is easier to debug. ChipLogError(Test, "Different return codes between ember and DM"); - ChipLogError(Test, " Ember error: %" CHIP_ERROR_FORMAT, errEmber.Format()); - ChipLogError(Test, " DM error: %" CHIP_ERROR_FORMAT, errDM.Format()); + ChipLogError(Test, " Ember status: %s", statusEmber.c_str()); + ChipLogError(Test, " DM status: %s", statusDm.c_str()); // For time-dependent data, we may have size differences here: one data fitting in buffer // while another not, resulting in different errors (success vs out of space). @@ -120,7 +125,7 @@ CHIP_ERROR RetrieveClusterData(DataModel::Provider * dataModel, const Access::Su // For chunked reads, the encoder state MUST be identical (since this is what controls // where chunking resumes). - if ((errEmber == CHIP_ERROR_NO_MEMORY) || (errEmber == CHIP_ERROR_BUFFER_TOO_SMALL)) + if (statusEmber.IsOutOfSpaceEncodingResponse()) { // Encoder state MUST match on partial reads (used by chunking) // specifically ReadViaAccessInterface in ember-compatibility-functions only @@ -151,7 +156,7 @@ CHIP_ERROR RetrieveClusterData(DataModel::Provider * dataModel, const Access::Su DataModelCallbacks::GetInstance()->AttributeOperation(DataModelCallbacks::OperationType::Read, DataModelCallbacks::OperationOrder::Post, path); - return errDM; + return statusDm; } } // namespace CheckedImpl diff --git a/src/app/reporting/Read-Checked.h b/src/app/reporting/Read-Checked.h index 2652d4f98c86d7..742b1e2fef8c3d 100644 --- a/src/app/reporting/Read-Checked.h +++ b/src/app/reporting/Read-Checked.h @@ -16,6 +16,7 @@ */ #pragma once +#include "app/data-model-provider/ActionReturnStatus.h" #include #include #include @@ -27,9 +28,10 @@ namespace app { namespace reporting { namespace CheckedImpl { -CHIP_ERROR RetrieveClusterData(DataModel::Provider * dataModel, const Access::SubjectDescriptor & subjectDescriptor, - bool isFabricFiltered, AttributeReportIBs::Builder & reportBuilder, - const ConcreteReadAttributePath & path, AttributeEncodeState * encoderState); +DataModel::ActionReturnStatus RetrieveClusterData(DataModel::Provider * dataModel, + const Access::SubjectDescriptor & subjectDescriptor, bool isFabricFiltered, + AttributeReportIBs::Builder & reportBuilder, + const ConcreteReadAttributePath & path, AttributeEncodeState * encoderState); } // namespace CheckedImpl } // namespace reporting diff --git a/src/app/reporting/Read-DataModel.cpp b/src/app/reporting/Read-DataModel.cpp index 9364d5c5fde9ce..7df19e2c89ecfc 100644 --- a/src/app/reporting/Read-DataModel.cpp +++ b/src/app/reporting/Read-DataModel.cpp @@ -14,6 +14,8 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +#include "app/data-model-provider/ActionReturnStatus.h" +#include "lib/support/logging/TextOnlyLogging.h" #include #include @@ -24,18 +26,11 @@ namespace chip { namespace app { namespace reporting { namespace DataModelImpl { -namespace { -bool IsOutOfSpaceError(CHIP_ERROR err) -{ - return (err == CHIP_ERROR_NO_MEMORY || err == CHIP_ERROR_BUFFER_TOO_SMALL); -} - -} // namespace - -CHIP_ERROR RetrieveClusterData(DataModel::Provider * dataModel, const Access::SubjectDescriptor & subjectDescriptor, - bool isFabricFiltered, AttributeReportIBs::Builder & reportBuilder, - const ConcreteReadAttributePath & path, AttributeEncodeState * encoderState) +DataModel::ActionReturnStatus RetrieveClusterData(DataModel::Provider * dataModel, + const Access::SubjectDescriptor & subjectDescriptor, bool isFabricFiltered, + AttributeReportIBs::Builder & reportBuilder, + const ConcreteReadAttributePath & path, AttributeEncodeState * encoderState) { // Odd ifdef is to only do this if the `Read-Check` does not do it already. #if !CHIP_CONFIG_USE_EMBER_DATA_MODEL @@ -68,9 +63,10 @@ CHIP_ERROR RetrieveClusterData(DataModel::Provider * dataModel, const Access::Su reportBuilder.Checkpoint(checkpoint); AttributeValueEncoder attributeValueEncoder(reportBuilder, subjectDescriptor, path, version, isFabricFiltered, encoderState); - CHIP_ERROR err = dataModel->ReadAttribute(readRequest, attributeValueEncoder); - if (err == CHIP_NO_ERROR) + DataModel::ActionReturnStatus status = dataModel->ReadAttribute(readRequest, attributeValueEncoder); + + if (status.IsSuccess()) { // Odd ifdef is to only do this if the `Read-Check` does not do it already. #if !CHIP_CONFIG_USE_EMBER_DATA_MODEL @@ -82,12 +78,12 @@ CHIP_ERROR RetrieveClusterData(DataModel::Provider * dataModel, const Access::Su DataModelCallbacks::GetInstance()->AttributeOperation(DataModelCallbacks::OperationType::Read, DataModelCallbacks::OperationOrder::Post, path); #endif // !CHIP_CONFIG_USE_EMBER_DATA_MODEL - return CHIP_NO_ERROR; + return status; } // Encoder state is relevant for errors in case they are retryable. // - // Generally only IsOutOfSpaceError(err) would be retryable, however we save the state + // Generally only out of space encoding errors would be retryable, however we save the state // for all errors in case this is information that is useful (retry or error position). if (encoderState != nullptr) { @@ -97,11 +93,11 @@ CHIP_ERROR RetrieveClusterData(DataModel::Provider * dataModel, const Access::Su // Out of space errors may be chunked data, reporting those cases would be very confusing // as they are not fully errors. Report only others (which presumably are not recoverable // and will be sent to the client as well). - if (!IsOutOfSpaceError(err)) + if (!status.IsOutOfSpaceEncodingResponse()) { - ChipLogError(DataManagement, "Failed to read attribute: %" CHIP_ERROR_FORMAT, err.Format()); + ChipLogError(DataManagement, "Failed to read attribute: %s", status.c_str()); } - return err; + return status; } } // namespace DataModelImpl diff --git a/src/app/reporting/Read-DataModel.h b/src/app/reporting/Read-DataModel.h index 346ebb2340f6d7..3a629e66e398d0 100644 --- a/src/app/reporting/Read-DataModel.h +++ b/src/app/reporting/Read-DataModel.h @@ -16,9 +16,11 @@ */ #pragma once +#include "app/data-model-provider/ActionReturnStatus.h" #include #include #include +#include #include #include @@ -27,9 +29,10 @@ namespace app { namespace reporting { namespace DataModelImpl { -CHIP_ERROR RetrieveClusterData(DataModel::Provider * dataModel, const Access::SubjectDescriptor & subjectDescriptor, - bool isFabricFiltered, AttributeReportIBs::Builder & reportBuilder, - const ConcreteReadAttributePath & path, AttributeEncodeState * encoderState); +DataModel::ActionReturnStatus RetrieveClusterData(DataModel::Provider * dataModel, + const Access::SubjectDescriptor & subjectDescriptor, bool isFabricFiltered, + AttributeReportIBs::Builder & reportBuilder, + const ConcreteReadAttributePath & path, AttributeEncodeState * encoderState); } // namespace DataModelImpl } // namespace reporting diff --git a/src/app/reporting/Read-Ember.cpp b/src/app/reporting/Read-Ember.cpp index 3e9ad543a6e2b4..a7bf1023b3d841 100644 --- a/src/app/reporting/Read-Ember.cpp +++ b/src/app/reporting/Read-Ember.cpp @@ -14,6 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +#include "app/data-model-provider/ActionReturnStatus.h" #include #include @@ -25,9 +26,10 @@ namespace app { namespace reporting { namespace EmberImpl { -CHIP_ERROR RetrieveClusterData(DataModel::Provider * dataModel, const Access::SubjectDescriptor & subjectDescriptor, - bool isFabricFiltered, AttributeReportIBs::Builder & reportBuilder, - const ConcreteReadAttributePath & path, AttributeEncodeState * encoderState) +DataModel::ActionReturnStatus RetrieveClusterData(DataModel::Provider * dataModel, + const Access::SubjectDescriptor & subjectDescriptor, bool isFabricFiltered, + AttributeReportIBs::Builder & reportBuilder, + const ConcreteReadAttributePath & path, AttributeEncodeState * encoderState) { // Odd ifdef is to only do this if the `Read-Check` does not do it already. #if !CHIP_CONFIG_USE_DATA_MODEL_INTERFACE diff --git a/src/app/reporting/Read-Ember.h b/src/app/reporting/Read-Ember.h index 5ff3fff4103dc5..129746baf1f9c8 100644 --- a/src/app/reporting/Read-Ember.h +++ b/src/app/reporting/Read-Ember.h @@ -19,6 +19,7 @@ #include #include #include +#include #include #include @@ -27,9 +28,10 @@ namespace app { namespace reporting { namespace EmberImpl { -CHIP_ERROR RetrieveClusterData(DataModel::Provider * dataModel, const Access::SubjectDescriptor & subjectDescriptor, - bool isFabricFiltered, AttributeReportIBs::Builder & reportBuilder, - const ConcreteReadAttributePath & path, AttributeEncodeState * encoderState); +DataModel::ActionReturnStatus RetrieveClusterData(DataModel::Provider * dataModel, + const Access::SubjectDescriptor & subjectDescriptor, bool isFabricFiltered, + AttributeReportIBs::Builder & reportBuilder, + const ConcreteReadAttributePath & path, AttributeEncodeState * encoderState); } // namespace EmberImpl } // namespace reporting diff --git a/src/app/tests/TestStatusIB.cpp b/src/app/tests/TestStatusIB.cpp index 22806168a9e6da..9234a4f2350210 100644 --- a/src/app/tests/TestStatusIB.cpp +++ b/src/app/tests/TestStatusIB.cpp @@ -46,8 +46,7 @@ class TestStatusIB : public ::testing::Test #define VERIFY_ROUNDTRIP(err, status) \ do \ { \ - StatusIB newStatus; \ - newStatus.InitFromChipError(err); \ + StatusIB newStatus(err); \ EXPECT_EQ(newStatus.mStatus, status.mStatus); \ EXPECT_EQ(newStatus.mClusterStatus, status.mClusterStatus); \ } while (0); @@ -86,16 +85,14 @@ TEST_F(TestStatusIB, TestStatusIBToFromChipError) err = status.ToChipError(); EXPECT_NE(err, CHIP_NO_ERROR); { - StatusIB newStatus; - newStatus.InitFromChipError(err); + StatusIB newStatus(err); EXPECT_EQ(newStatus.mStatus, Status::Failure); EXPECT_EQ(newStatus.mClusterStatus, status.mClusterStatus); } err = CHIP_ERROR_NO_MEMORY; { - StatusIB newStatus; - newStatus.InitFromChipError(err); + StatusIB newStatus(err); EXPECT_EQ(newStatus.mStatus, Status::Failure); EXPECT_FALSE(newStatus.mClusterStatus.HasValue()); } diff --git a/src/app/tests/test-interaction-model-api.cpp b/src/app/tests/test-interaction-model-api.cpp index f626d061c2b107..f483f4b3de88a4 100644 --- a/src/app/tests/test-interaction-model-api.cpp +++ b/src/app/tests/test-interaction-model-api.cpp @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +#include "app/data-model-provider/ActionReturnStatus.h" #include #include @@ -153,7 +154,7 @@ TestImCustomDataModel & TestImCustomDataModel::Instance() return model; } -CHIP_ERROR TestImCustomDataModel::ReadAttribute(const ReadAttributeRequest & request, AttributeValueEncoder & encoder) +ActionReturnStatus TestImCustomDataModel::ReadAttribute(const ReadAttributeRequest & request, AttributeValueEncoder & encoder) { AttributeEncodeState mutableState(&encoder.GetState()); // provide a state copy to start. @@ -167,13 +168,13 @@ CHIP_ERROR TestImCustomDataModel::ReadAttribute(const ReadAttributeRequest & req return err; } -CHIP_ERROR TestImCustomDataModel::WriteAttribute(const WriteAttributeRequest & request, AttributeValueDecoder & decoder) +ActionReturnStatus TestImCustomDataModel::WriteAttribute(const WriteAttributeRequest & request, AttributeValueDecoder & decoder) { return CHIP_ERROR_NOT_IMPLEMENTED; } -CHIP_ERROR TestImCustomDataModel::Invoke(const InvokeRequest & request, chip::TLV::TLVReader & input_arguments, - CommandHandler * handler) +ActionReturnStatus TestImCustomDataModel::Invoke(const InvokeRequest & request, chip::TLV::TLVReader & input_arguments, + CommandHandler * handler) { return CHIP_ERROR_NOT_IMPLEMENTED; } diff --git a/src/app/tests/test-interaction-model-api.h b/src/app/tests/test-interaction-model-api.h index ccaf6514890546..6de6c9c34a2e21 100644 --- a/src/app/tests/test-interaction-model-api.h +++ b/src/app/tests/test-interaction-model-api.h @@ -118,10 +118,12 @@ class TestImCustomDataModel : public DataModel::Provider CHIP_ERROR Shutdown() override { return CHIP_NO_ERROR; } - CHIP_ERROR ReadAttribute(const DataModel::ReadAttributeRequest & request, AttributeValueEncoder & encoder) override; - CHIP_ERROR WriteAttribute(const DataModel::WriteAttributeRequest & request, AttributeValueDecoder & decoder) override; - CHIP_ERROR Invoke(const DataModel::InvokeRequest & request, chip::TLV::TLVReader & input_arguments, - CommandHandler * handler) override; + DataModel::ActionReturnStatus ReadAttribute(const DataModel::ReadAttributeRequest & request, + AttributeValueEncoder & encoder) override; + DataModel::ActionReturnStatus WriteAttribute(const DataModel::WriteAttributeRequest & request, + AttributeValueDecoder & decoder) override; + DataModel::ActionReturnStatus Invoke(const DataModel::InvokeRequest & request, chip::TLV::TLVReader & input_arguments, + CommandHandler * handler) override; EndpointId FirstEndpoint() override; EndpointId NextEndpoint(EndpointId before) override; diff --git a/src/controller/TypedReadCallback.h b/src/controller/TypedReadCallback.h index 000b5d51d522ce..f65b4f2168bff7 100644 --- a/src/controller/TypedReadCallback.h +++ b/src/controller/TypedReadCallback.h @@ -43,8 +43,8 @@ namespace Controller { * encapsulate a StatusIB). This could be a path-specific error or it * could be a general error for the entire request; the distinction is not * that important, because we only have one path involved. If the - * CHIP_ERROR encapsulates a StatusIB, StatusIB::InitFromChipError can be - * used to extract the status. + * CHIP_ERROR encapsulates a StatusIB, constructing a StatusIB from it will + * extract the status. */ template class TypedReadAttributeCallback final : public app::ReadClient::Callback diff --git a/src/controller/data_model/controller-clusters.matter b/src/controller/data_model/controller-clusters.matter index 827e4e7ae084b5..54752ea0be20ea 100644 --- a/src/controller/data_model/controller-clusters.matter +++ b/src/controller/data_model/controller-clusters.matter @@ -208,18 +208,18 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } -struct LocationDescriptorStruct { - char_string<128> locationName = 0; - nullable int16s floorNumber = 1; - nullable AreaTypeTag areaType = 2; -} - struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; optional nullable TestGlobalEnum myEnum = 2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/src/controller/python/chip/clusters/Objects.py b/src/controller/python/chip/clusters/Objects.py index 57211812f30b96..1a110f1bc09b74 100644 --- a/src/controller/python/chip/clusters/Objects.py +++ b/src/controller/python/chip/clusters/Objects.py @@ -267,34 +267,34 @@ class TestGlobalBitmap(IntFlag): class Structs: @dataclass - class LocationDescriptorStruct(ClusterObject): + class TestGlobalStruct(ClusterObject): @ChipUtility.classproperty def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields=[ - ClusterObjectFieldDescriptor(Label="locationName", Tag=0, Type=str), - ClusterObjectFieldDescriptor(Label="floorNumber", Tag=1, Type=typing.Union[Nullable, int]), - ClusterObjectFieldDescriptor(Label="areaType", Tag=2, Type=typing.Union[Nullable, Globals.Enums.AreaTypeTag]), + ClusterObjectFieldDescriptor(Label="name", Tag=0, Type=str), + ClusterObjectFieldDescriptor(Label="myBitmap", Tag=1, Type=typing.Union[Nullable, uint]), + ClusterObjectFieldDescriptor(Label="myEnum", Tag=2, Type=typing.Union[None, Nullable, Globals.Enums.TestGlobalEnum]), ]) - locationName: 'str' = "" - floorNumber: 'typing.Union[Nullable, int]' = NullValue - areaType: 'typing.Union[Nullable, Globals.Enums.AreaTypeTag]' = NullValue + name: 'str' = "" + myBitmap: 'typing.Union[Nullable, uint]' = NullValue + myEnum: 'typing.Union[None, Nullable, Globals.Enums.TestGlobalEnum]' = None @dataclass - class TestGlobalStruct(ClusterObject): + class LocationDescriptorStruct(ClusterObject): @ChipUtility.classproperty def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields=[ - ClusterObjectFieldDescriptor(Label="name", Tag=0, Type=str), - ClusterObjectFieldDescriptor(Label="myBitmap", Tag=1, Type=typing.Union[Nullable, uint]), - ClusterObjectFieldDescriptor(Label="myEnum", Tag=2, Type=typing.Union[None, Nullable, Globals.Enums.TestGlobalEnum]), + ClusterObjectFieldDescriptor(Label="locationName", Tag=0, Type=str), + ClusterObjectFieldDescriptor(Label="floorNumber", Tag=1, Type=typing.Union[Nullable, int]), + ClusterObjectFieldDescriptor(Label="areaType", Tag=2, Type=typing.Union[Nullable, Globals.Enums.AreaTypeTag]), ]) - name: 'str' = "" - myBitmap: 'typing.Union[Nullable, uint]' = NullValue - myEnum: 'typing.Union[None, Nullable, Globals.Enums.TestGlobalEnum]' = None + locationName: 'str' = "" + floorNumber: 'typing.Union[Nullable, int]' = NullValue + areaType: 'typing.Union[Nullable, Globals.Enums.AreaTypeTag]' = NullValue diff --git a/src/controller/tests/data_model/DataModelFixtures.cpp b/src/controller/tests/data_model/DataModelFixtures.cpp index ff22f2063e6e62..05fa16b956bb0c 100644 --- a/src/controller/tests/data_model/DataModelFixtures.cpp +++ b/src/controller/tests/data_model/DataModelFixtures.cpp @@ -17,6 +17,7 @@ */ #include "DataModelFixtures.h" +#include "app/data-model-provider/ActionReturnStatus.h" #include #include @@ -491,7 +492,7 @@ CustomDataModel & CustomDataModel::Instance() return model; } -CHIP_ERROR CustomDataModel::ReadAttribute(const ReadAttributeRequest & request, AttributeValueEncoder & encoder) +ActionReturnStatus CustomDataModel::ReadAttribute(const ReadAttributeRequest & request, AttributeValueEncoder & encoder) { AttributeEncodeState mutableState(&encoder.GetState()); // provide a state copy to start. @@ -519,12 +520,13 @@ CHIP_ERROR CustomDataModel::ReadAttribute(const ReadAttributeRequest & request, return err; } -CHIP_ERROR CustomDataModel::WriteAttribute(const WriteAttributeRequest & request, AttributeValueDecoder & decoder) +ActionReturnStatus CustomDataModel::WriteAttribute(const WriteAttributeRequest & request, AttributeValueDecoder & decoder) { return CHIP_ERROR_NOT_IMPLEMENTED; } -CHIP_ERROR CustomDataModel::Invoke(const InvokeRequest & request, chip::TLV::TLVReader & input_arguments, CommandHandler * handler) +ActionReturnStatus CustomDataModel::Invoke(const InvokeRequest & request, chip::TLV::TLVReader & input_arguments, + CommandHandler * handler) { return CHIP_ERROR_NOT_IMPLEMENTED; } diff --git a/src/controller/tests/data_model/DataModelFixtures.h b/src/controller/tests/data_model/DataModelFixtures.h index a36e905c23ce41..cfb2edf5db83f3 100644 --- a/src/controller/tests/data_model/DataModelFixtures.h +++ b/src/controller/tests/data_model/DataModelFixtures.h @@ -115,10 +115,12 @@ class CustomDataModel : public DataModel::Provider CHIP_ERROR Shutdown() override { return CHIP_NO_ERROR; } - CHIP_ERROR ReadAttribute(const DataModel::ReadAttributeRequest & request, AttributeValueEncoder & encoder) override; - CHIP_ERROR WriteAttribute(const DataModel::WriteAttributeRequest & request, AttributeValueDecoder & decoder) override; - CHIP_ERROR Invoke(const DataModel::InvokeRequest & request, chip::TLV::TLVReader & input_arguments, - CommandHandler * handler) override; + DataModel::ActionReturnStatus ReadAttribute(const DataModel::ReadAttributeRequest & request, + AttributeValueEncoder & encoder) override; + DataModel::ActionReturnStatus WriteAttribute(const DataModel::WriteAttributeRequest & request, + AttributeValueDecoder & decoder) override; + DataModel::ActionReturnStatus Invoke(const DataModel::InvokeRequest & request, chip::TLV::TLVReader & input_arguments, + CommandHandler * handler) override; EndpointId FirstEndpoint() override; EndpointId NextEndpoint(EndpointId before) override; diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h index 3d9aa95d0c2cd8..6535195be109c9 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h @@ -19,13 +19,6 @@ NS_ASSUME_NONNULL_BEGIN -MTR_PROVISIONALLY_AVAILABLE -@interface MTRDataTypeLocationDescriptorStruct : NSObject -@property (nonatomic, copy) NSString * _Nonnull locationName MTR_PROVISIONALLY_AVAILABLE; -@property (nonatomic, copy) NSNumber * _Nullable floorNumber MTR_PROVISIONALLY_AVAILABLE; -@property (nonatomic, copy) NSNumber * _Nullable areaType MTR_PROVISIONALLY_AVAILABLE; -@end - MTR_PROVISIONALLY_AVAILABLE @interface MTRDataTypeTestGlobalStruct : NSObject @property (nonatomic, copy) NSString * _Nonnull name MTR_PROVISIONALLY_AVAILABLE; @@ -33,6 +26,13 @@ MTR_PROVISIONALLY_AVAILABLE @property (nonatomic, copy) NSNumber * _Nullable myEnum MTR_PROVISIONALLY_AVAILABLE; @end +MTR_PROVISIONALLY_AVAILABLE +@interface MTRDataTypeLocationDescriptorStruct : NSObject +@property (nonatomic, copy) NSString * _Nonnull locationName MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nullable floorNumber MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nullable areaType MTR_PROVISIONALLY_AVAILABLE; +@end + MTR_AVAILABLE(ios(16.2), macos(13.1), watchos(9.2), tvos(16.2)) @interface MTRDescriptorClusterDeviceTypeStruct : NSObject @property (nonatomic, copy) NSNumber * _Nonnull deviceType MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)); diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm index 2cd6c479c1d9f5..6cafc8a4b50270 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm @@ -19,67 +19,67 @@ NS_ASSUME_NONNULL_BEGIN -@implementation MTRDataTypeLocationDescriptorStruct +@implementation MTRDataTypeTestGlobalStruct - (instancetype)init { if (self = [super init]) { - _locationName = @""; + _name = @""; - _floorNumber = nil; + _myBitmap = nil; - _areaType = nil; + _myEnum = nil; } return self; } - (id)copyWithZone:(NSZone * _Nullable)zone { - auto other = [[MTRDataTypeLocationDescriptorStruct alloc] init]; + auto other = [[MTRDataTypeTestGlobalStruct alloc] init]; - other.locationName = self.locationName; - other.floorNumber = self.floorNumber; - other.areaType = self.areaType; + other.name = self.name; + other.myBitmap = self.myBitmap; + other.myEnum = self.myEnum; return other; } - (NSString *)description { - NSString * descriptionString = [NSString stringWithFormat:@"<%@: locationName:%@; floorNumber:%@; areaType:%@; >", NSStringFromClass([self class]), _locationName, _floorNumber, _areaType]; + NSString * descriptionString = [NSString stringWithFormat:@"<%@: name:%@; myBitmap:%@; myEnum:%@; >", NSStringFromClass([self class]), _name, _myBitmap, _myEnum]; return descriptionString; } @end -@implementation MTRDataTypeTestGlobalStruct +@implementation MTRDataTypeLocationDescriptorStruct - (instancetype)init { if (self = [super init]) { - _name = @""; + _locationName = @""; - _myBitmap = nil; + _floorNumber = nil; - _myEnum = nil; + _areaType = nil; } return self; } - (id)copyWithZone:(NSZone * _Nullable)zone { - auto other = [[MTRDataTypeTestGlobalStruct alloc] init]; + auto other = [[MTRDataTypeLocationDescriptorStruct alloc] init]; - other.name = self.name; - other.myBitmap = self.myBitmap; - other.myEnum = self.myEnum; + other.locationName = self.locationName; + other.floorNumber = self.floorNumber; + other.areaType = self.areaType; return other; } - (NSString *)description { - NSString * descriptionString = [NSString stringWithFormat:@"<%@: name:%@; myBitmap:%@; myEnum:%@; >", NSStringFromClass([self class]), _name, _myBitmap, _myEnum]; + NSString * descriptionString = [NSString stringWithFormat:@"<%@: locationName:%@; floorNumber:%@; areaType:%@; >", NSStringFromClass([self class]), _locationName, _floorNumber, _areaType]; return descriptionString; } diff --git a/src/lib/core/CHIPError.h b/src/lib/core/CHIPError.h index 23d83d868ea3df..84b0de1a47f3ba 100644 --- a/src/lib/core/CHIPError.h +++ b/src/lib/core/CHIPError.h @@ -453,6 +453,16 @@ using CHIP_ERROR = ::chip::ChipError; // #define CHIP_IM_CLUSTER_STATUS(type) CHIP_SDK_ERROR(::chip::ChipError::SdkPart::kIMClusterStatus, type) +// Defines a runtime-value for a chip-error that contains a cluster-specific error status. +// Must not be used with cluster-specific success status codes. +#if CHIP_CONFIG_ERROR_SOURCE +#define CHIP_ERROR_IM_CLUSTER_STATUS_VALUE(status_value) \ + ::chip::ChipError(::chip::ChipError::SdkPart::kIMClusterStatus, status_value, __FILE__, __LINE__) +#else +#define CHIP_ERROR_IM_CLUSTER_STATUS_VALUE(status_value) \ + ::chip::ChipError(::chip::ChipError::SdkPart::kIMClusterStatus, status_value) +#endif // CHIP_CONFIG_ERROR_SOURCE + // clang-format off /** diff --git a/src/protocols/interaction_model/StatusCode.cpp b/src/protocols/interaction_model/StatusCode.cpp index 36e1274f4e6c1e..b91817a0290e4a 100644 --- a/src/protocols/interaction_model/StatusCode.cpp +++ b/src/protocols/interaction_model/StatusCode.cpp @@ -37,6 +37,30 @@ const char * StatusName(Status status) return "Unallocated"; } #endif // CHIP_CONFIG_IM_STATUS_CODE_VERBOSE_FORMAT +// +ClusterStatusCode::ClusterStatusCode(CHIP_ERROR err) +{ + if (err.IsPart(ChipError::SdkPart::kIMClusterStatus)) + { + mStatus = Status::Failure; + mClusterSpecificCode = chip::MakeOptional(err.GetSdkCode()); + return; + } + + if (err == CHIP_NO_ERROR) + { + mStatus = Status::Success; + return; + } + + if (err.IsPart(ChipError::SdkPart::kIMGlobalStatus)) + { + mStatus = static_cast(err.GetSdkCode()); + return; + } + + mStatus = Status::Failure; +} } // namespace InteractionModel } // namespace Protocols diff --git a/src/protocols/interaction_model/StatusCode.h b/src/protocols/interaction_model/StatusCode.h index 9326c86653759c..b30ef95ea2d1e2 100644 --- a/src/protocols/interaction_model/StatusCode.h +++ b/src/protocols/interaction_model/StatusCode.h @@ -68,6 +68,7 @@ class ClusterStatusCode { public: explicit ClusterStatusCode(Status status) : mStatus(status) {} + explicit ClusterStatusCode(CHIP_ERROR err); // We only have simple copyable members, so we should be trivially copyable. ClusterStatusCode(const ClusterStatusCode & other) = default; diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp index d6a95147f59785..b725407b284118 100644 --- a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp +++ b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp @@ -510,13 +510,13 @@ namespace Globals { // Global structs namespace Structs { -namespace LocationDescriptorStruct { +namespace TestGlobalStruct { CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const { DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; - encoder.Encode(to_underlying(Fields::kLocationName), locationName); - encoder.Encode(to_underlying(Fields::kFloorNumber), floorNumber); - encoder.Encode(to_underlying(Fields::kAreaType), areaType); + encoder.Encode(to_underlying(Fields::kName), name); + encoder.Encode(to_underlying(Fields::kMyBitmap), myBitmap); + encoder.Encode(to_underlying(Fields::kMyEnum), myEnum); return encoder.Finalize(); } @@ -534,17 +534,17 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) CHIP_ERROR err = CHIP_NO_ERROR; const uint8_t __context_tag = std::get(__element); - if (__context_tag == to_underlying(Fields::kLocationName)) + if (__context_tag == to_underlying(Fields::kName)) { - err = DataModel::Decode(reader, locationName); + err = DataModel::Decode(reader, name); } - else if (__context_tag == to_underlying(Fields::kFloorNumber)) + else if (__context_tag == to_underlying(Fields::kMyBitmap)) { - err = DataModel::Decode(reader, floorNumber); + err = DataModel::Decode(reader, myBitmap); } - else if (__context_tag == to_underlying(Fields::kAreaType)) + else if (__context_tag == to_underlying(Fields::kMyEnum)) { - err = DataModel::Decode(reader, areaType); + err = DataModel::Decode(reader, myEnum); } else { @@ -554,15 +554,15 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) } } -} // namespace LocationDescriptorStruct +} // namespace TestGlobalStruct -namespace TestGlobalStruct { +namespace LocationDescriptorStruct { CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const { DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; - encoder.Encode(to_underlying(Fields::kName), name); - encoder.Encode(to_underlying(Fields::kMyBitmap), myBitmap); - encoder.Encode(to_underlying(Fields::kMyEnum), myEnum); + encoder.Encode(to_underlying(Fields::kLocationName), locationName); + encoder.Encode(to_underlying(Fields::kFloorNumber), floorNumber); + encoder.Encode(to_underlying(Fields::kAreaType), areaType); return encoder.Finalize(); } @@ -580,17 +580,17 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) CHIP_ERROR err = CHIP_NO_ERROR; const uint8_t __context_tag = std::get(__element); - if (__context_tag == to_underlying(Fields::kName)) + if (__context_tag == to_underlying(Fields::kLocationName)) { - err = DataModel::Decode(reader, name); + err = DataModel::Decode(reader, locationName); } - else if (__context_tag == to_underlying(Fields::kMyBitmap)) + else if (__context_tag == to_underlying(Fields::kFloorNumber)) { - err = DataModel::Decode(reader, myBitmap); + err = DataModel::Decode(reader, floorNumber); } - else if (__context_tag == to_underlying(Fields::kMyEnum)) + else if (__context_tag == to_underlying(Fields::kAreaType)) { - err = DataModel::Decode(reader, myEnum); + err = DataModel::Decode(reader, areaType); } else { @@ -600,7 +600,7 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) } } -} // namespace TestGlobalStruct +} // namespace LocationDescriptorStruct } // namespace Structs } // namespace Globals 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 c5bca7bea6fc21..7ecd2334890ad8 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 @@ -298,20 +298,20 @@ namespace Globals { // Global structs. namespace Structs { -namespace LocationDescriptorStruct { +namespace TestGlobalStruct { enum class Fields : uint8_t { - kLocationName = 0, - kFloorNumber = 1, - kAreaType = 2, + kName = 0, + kMyBitmap = 1, + kMyEnum = 2, }; struct Type { public: - chip::CharSpan locationName; - DataModel::Nullable floorNumber; - DataModel::Nullable areaType; + chip::CharSpan name; + DataModel::Nullable> myBitmap; + Optional> myEnum; CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -322,22 +322,22 @@ struct Type using DecodableType = Type; -} // namespace LocationDescriptorStruct +} // namespace TestGlobalStruct -namespace TestGlobalStruct { +namespace LocationDescriptorStruct { enum class Fields : uint8_t { - kName = 0, - kMyBitmap = 1, - kMyEnum = 2, + kLocationName = 0, + kFloorNumber = 1, + kAreaType = 2, }; struct Type { public: - chip::CharSpan name; - DataModel::Nullable> myBitmap; - Optional> myEnum; + chip::CharSpan locationName; + DataModel::Nullable floorNumber; + DataModel::Nullable areaType; CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -348,7 +348,7 @@ struct Type using DecodableType = Type; -} // namespace TestGlobalStruct +} // namespace LocationDescriptorStruct } // namespace Structs