Skip to content

Commit

Permalink
Expose array size limit in IDL where size limit seems intentional (pr…
Browse files Browse the repository at this point in the history
…oject-chip#13699)

* Expose array size limit in IDL where size limit seems intentional

* Only use sizes for strings and place it together with the data type

* Remove if_valid_list_size usage

* ZAP regen

* Fix removal of list sizes - had an extra maxLength remaining, now removed

* Add unless check in structure member for string size. Not that no output diff

* Add size info for attribute string types as well
  • Loading branch information
andy31415 authored and selissia committed Jan 28, 2022
1 parent 7398ce1 commit 9b2949d
Show file tree
Hide file tree
Showing 20 changed files with 461 additions and 449 deletions.
112 changes: 56 additions & 56 deletions examples/all-clusters-app/all-clusters-common/all-clusters-app.matter
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
// It is for view/code review purposes only.

struct LabelStruct {
CHAR_STRING label = 0;
CHAR_STRING value = 1;
CHAR_STRING<16> label = 0;
CHAR_STRING<16> value = 1;
}

server cluster AccessControl = 31 {
Expand Down Expand Up @@ -43,7 +43,7 @@ server cluster AccessControl = 31 {

struct ExtensionEntry {
fabric_idx fabricIndex = 0;
OCTET_STRING data = 1;
OCTET_STRING<254> data = 1;
}

info event AccessControlEntryChanged = 0 {
Expand Down Expand Up @@ -115,12 +115,12 @@ server cluster ApplicationBasic = 1293 {
kActiveVisibleNotFocus = 3;
}

readonly attribute char_string vendorName = 0;
readonly attribute char_string<32> vendorName = 0;
readonly attribute int16u vendorId = 1;
readonly attribute char_string applicationName = 2;
readonly attribute char_string<32> applicationName = 2;
readonly attribute int16u productId = 3;
readonly attribute ApplicationStatusEnum applicationStatus = 5;
readonly attribute char_string applicationVersion = 6;
readonly attribute char_string<32> applicationVersion = 6;
readonly attribute vendor_id allowedVendorList[] = 7;
readonly global attribute int16u clusterRevision = 65533;
}
Expand Down Expand Up @@ -154,7 +154,7 @@ server cluster AudioOutput = 1291 {
struct OutputInfo {
INT8U index = 0;
OutputTypeEnum outputType = 1;
CHAR_STRING name = 2;
CHAR_STRING<32> name = 2;
}

readonly attribute OutputInfo audioOutputList[] = 0;
Expand Down Expand Up @@ -193,24 +193,24 @@ server cluster Basic = 40 {
}

readonly attribute int16u interactionModelVersion = 0;
readonly attribute char_string vendorName = 1;
readonly attribute char_string<32> vendorName = 1;
readonly attribute vendor_id vendorID = 2;
readonly attribute char_string productName = 3;
readonly attribute char_string<32> productName = 3;
readonly attribute int16u productID = 4;
attribute char_string nodeLabel = 5;
attribute char_string location = 6;
attribute char_string<32> nodeLabel = 5;
attribute char_string<2> location = 6;
readonly attribute int16u hardwareVersion = 7;
readonly attribute char_string hardwareVersionString = 8;
readonly attribute char_string<64> hardwareVersionString = 8;
readonly attribute int32u softwareVersion = 9;
readonly attribute char_string softwareVersionString = 10;
readonly attribute char_string manufacturingDate = 11;
readonly attribute char_string partNumber = 12;
readonly attribute long_char_string productURL = 13;
readonly attribute char_string productLabel = 14;
readonly attribute char_string serialNumber = 15;
readonly attribute char_string<64> softwareVersionString = 10;
readonly attribute char_string<16> manufacturingDate = 11;
readonly attribute char_string<32> partNumber = 12;
readonly attribute long_char_string<256> productURL = 13;
readonly attribute char_string<64> productLabel = 14;
readonly attribute char_string<32> serialNumber = 15;
attribute boolean localConfigDisabled = 16;
readonly attribute boolean reachable = 17;
readonly attribute char_string uniqueID = 18;
readonly attribute char_string<32> uniqueID = 18;
readonly global attribute int16u clusterRevision = 65533;

command MfgSpecificPing(): DefaultSuccess = 0;
Expand Down Expand Up @@ -284,7 +284,7 @@ server cluster BridgedActions = 37 {

struct ActionStruct {
INT16U actionID = 0;
CHAR_STRING name = 1;
CHAR_STRING<32> name = 1;
ActionTypeEnum type = 2;
INT16U endpointListID = 3;
INT16U supportedCommands = 4;
Expand All @@ -293,7 +293,7 @@ server cluster BridgedActions = 37 {

struct EndpointListStruct {
INT16U endpointListID = 0;
CHAR_STRING name = 1;
CHAR_STRING<32> name = 1;
EndpointListTypeEnum type = 2;
ENDPOINT_NO endpoints[] = 3;
}
Expand All @@ -313,7 +313,7 @@ server cluster BridgedActions = 37 {

readonly attribute ActionStruct actionList[] = 0;
readonly attribute EndpointListStruct endpointList[] = 1;
readonly attribute long_char_string setupUrl = 2;
readonly attribute long_char_string<512> setupUrl = 2;
readonly global attribute int16u clusterRevision = 65533;
}

Expand All @@ -334,9 +334,9 @@ server cluster Channel = 1284 {
struct ChannelInfo {
INT16U majorNumber = 0;
INT16U minorNumber = 1;
CHAR_STRING name = 2;
CHAR_STRING callSign = 3;
CHAR_STRING affiliateCallSign = 4;
CHAR_STRING<32> name = 2;
CHAR_STRING<32> callSign = 3;
CHAR_STRING<32> affiliateCallSign = 4;
}

readonly attribute ChannelInfo channelList[] = 0;
Expand Down Expand Up @@ -396,7 +396,7 @@ server cluster ColorControl = 768 {
readonly attribute int16u currentX = 3;
readonly attribute int16u currentY = 4;
readonly attribute enum8 driftCompensation = 5;
readonly attribute char_string compensationText = 6;
readonly attribute char_string<254> compensationText = 6;
readonly attribute int16u colorTemperature = 7;
readonly attribute enum8 colorMode = 8;
attribute bitmap8 colorControlOptions = 15;
Expand Down Expand Up @@ -976,7 +976,7 @@ server cluster DoorLock = 257 {
readonly attribute int8u maxPINCodeLength = 23;
readonly attribute int8u minPINCodeLength = 24;
readonly attribute bitmap8 credentialRulesSupport = 27;
attribute char_string language = 33;
attribute char_string<3> language = 33;
attribute int32u autoRelockTime = 35;
attribute int8u soundVolume = 36;
attribute DlOperatingMode operatingMode = 37;
Expand Down Expand Up @@ -1233,11 +1233,11 @@ server cluster GeneralDiagnostics = 51 {
}

struct NetworkInterfaceType {
CHAR_STRING name = 0;
CHAR_STRING<32> name = 0;
BOOLEAN fabricConnected = 1;
BOOLEAN offPremiseServicesReachableIPv4 = 2;
BOOLEAN offPremiseServicesReachableIPv6 = 3;
OCTET_STRING hardwareAddress = 4;
OCTET_STRING<8> hardwareAddress = 4;
InterfaceType type = 5;
}

Expand Down Expand Up @@ -1287,17 +1287,17 @@ server cluster GroupKeyManagement = 63 {
INT16U fabricIndex = 0;
INT16U groupId = 1;
INT16U endpoints[] = 2;
CHAR_STRING groupName = 3;
CHAR_STRING<16> groupName = 3;
}

struct GroupKeySet {
INT16U groupKeySetID = 0;
GroupKeySecurityPolicy securityPolicy = 1;
OCTET_STRING epochKey0 = 2;
OCTET_STRING<16> epochKey0 = 2;
INT64U epochStartTime0 = 3;
OCTET_STRING epochKey1 = 4;
OCTET_STRING<16> epochKey1 = 4;
INT64U epochStartTime1 = 5;
OCTET_STRING epochKey2 = 6;
OCTET_STRING<16> epochKey2 = 6;
INT64U epochStartTime2 = 7;
}

Expand Down Expand Up @@ -1687,7 +1687,7 @@ server cluster LevelControl = 8 {
}

server cluster LocalizationConfiguration = 43 {
attribute char_string activeLocale = 1;
attribute char_string<35> activeLocale = 1;
readonly attribute CHAR_STRING supportedLocales[] = 2;
}

Expand Down Expand Up @@ -1716,8 +1716,8 @@ server cluster MediaInput = 1287 {
struct InputInfo {
INT8U index = 0;
InputTypeEnum inputType = 1;
CHAR_STRING name = 2;
CHAR_STRING description = 3;
CHAR_STRING<32> name = 2;
CHAR_STRING<32> description = 3;
}

readonly attribute InputInfo mediaInputList[] = 0;
Expand Down Expand Up @@ -1753,7 +1753,7 @@ server cluster MediaPlayback = 1286 {

server cluster ModeSelect = 80 {
struct ModeOptionStruct {
CHAR_STRING label = 0;
CHAR_STRING<32> label = 0;
INT8U mode = 1;
INT32U semanticTag = 2;
}
Expand All @@ -1762,7 +1762,7 @@ server cluster ModeSelect = 80 {
readonly attribute ModeOptionStruct supportedModes[] = 1;
attribute int8u onMode = 2;
readonly attribute int8u startUpMode = 3;
readonly attribute char_string description = 4;
readonly attribute char_string<32> description = 4;
readonly global attribute int16u clusterRevision = 65533;

request struct ChangeToModeRequest {
Expand Down Expand Up @@ -1828,7 +1828,7 @@ server cluster NetworkCommissioning = 49 {
readonly attribute int8u connectMaxTimeSeconds = 3;
attribute boolean interfaceEnabled = 4;
readonly attribute NetworkCommissioningStatus lastNetworkingStatus = 5;
readonly attribute octet_string lastNetworkID = 6;
readonly attribute octet_string<32> lastNetworkID = 6;
readonly attribute int32u lastConnectErrorValue = 7;
readonly global attribute bitmap32 featureMap = 65532;
readonly global attribute int16u clusterRevision = 65533;
Expand Down Expand Up @@ -2092,11 +2092,11 @@ server cluster OperationalCredentials = 62 {

struct FabricDescriptor {
fabric_idx fabricIndex = 0;
OCTET_STRING rootPublicKey = 1;
OCTET_STRING<65> rootPublicKey = 1;
INT16U vendorId = 2;
FABRIC_ID fabricId = 3;
NODE_ID nodeId = 4;
CHAR_STRING label = 5;
CHAR_STRING<32> label = 5;
}

readonly attribute NOCStruct NOCs[] = 0;
Expand Down Expand Up @@ -2182,7 +2182,7 @@ server cluster OperationalCredentials = 62 {
server cluster PowerSource = 47 {
readonly attribute enum8 status = 0;
readonly attribute int8u order = 1;
readonly attribute char_string description = 2;
readonly attribute char_string<60> description = 2;
readonly attribute int32u batteryVoltage = 11;
readonly attribute int8u batteryPercentRemaining = 12;
readonly attribute int32u batteryTimeRemaining = 13;
Expand Down Expand Up @@ -2412,7 +2412,7 @@ server cluster Scenes = 5 {
server cluster SoftwareDiagnostics = 52 {
struct ThreadMetrics {
INT64U id = 0;
CHAR_STRING name = 1;
CHAR_STRING<8> name = 1;
INT32U stackFreeCurrent = 2;
INT32U stackFreeMinimum = 3;
INT32U stackSize = 4;
Expand Down Expand Up @@ -2479,7 +2479,7 @@ server cluster TargetNavigator = 1285 {

struct TargetInfo {
INT8U identifier = 0;
CHAR_STRING name = 1;
CHAR_STRING<32> name = 1;
}

readonly attribute TargetInfo targetNavigatorList[] = 0;
Expand All @@ -2505,7 +2505,7 @@ server cluster TestCluster = 1295 {

struct TestListStructOctet {
INT64U fabricIndex = 0;
OCTET_STRING operationalCert = 1;
OCTET_STRING<32> operationalCert = 1;
}

struct NullablesAndOptionalsStruct {
Expand Down Expand Up @@ -2584,13 +2584,13 @@ server cluster TestCluster = 1295 {
attribute enum16 enum16 = 22;
attribute single floatSingle = 23;
attribute double floatDouble = 24;
attribute octet_string octetString = 25;
attribute octet_string<10> octetString = 25;
attribute INT8U listInt8u[] = 26;
attribute OCTET_STRING listOctetString[] = 27;
attribute TestListStructOctet listStructOctetString[] = 28;
attribute long_octet_string longOctetString = 29;
attribute char_string charString = 30;
attribute long_char_string longCharString = 31;
attribute long_octet_string<1000> longOctetString = 29;
attribute char_string<10> charString = 30;
attribute long_char_string<1000> longCharString = 31;
attribute epoch_us epochUs = 32;
attribute epoch_s epochS = 33;
attribute vendor_id vendorId = 34;
Expand Down Expand Up @@ -2628,8 +2628,8 @@ server cluster TestCluster = 1295 {
attribute enum16 nullableEnum16 = 32790;
attribute single nullableFloatSingle = 32791;
attribute double nullableFloatDouble = 32792;
attribute octet_string nullableOctetString = 32793;
attribute char_string nullableCharString = 32798;
attribute octet_string<10> nullableOctetString = 32793;
attribute char_string<10> nullableCharString = 32798;
attribute SimpleEnum nullableEnumAttr = 32804;
attribute SimpleStruct nullableStruct = 32805;
attribute int8u nullableRangeRestrictedInt8u = 32806;
Expand Down Expand Up @@ -2859,10 +2859,10 @@ server cluster ThreadNetworkDiagnostics = 53 {

readonly attribute int16u channel = 0;
readonly attribute enum8 routingRole = 1;
readonly attribute octet_string networkName = 2;
readonly attribute octet_string<16> networkName = 2;
readonly attribute int16u panId = 3;
readonly attribute int64u extendedPanId = 4;
readonly attribute octet_string meshLocalPrefix = 5;
readonly attribute octet_string<17> meshLocalPrefix = 5;
readonly attribute int64u overrunCount = 6;
readonly attribute NeighborTable neighborTableList[] = 7;
readonly attribute RouteTable routeTableList[] = 8;
Expand Down Expand Up @@ -2917,7 +2917,7 @@ server cluster ThreadNetworkDiagnostics = 53 {
readonly attribute int64u pendingTimestamp = 57;
readonly attribute int32u delay = 58;
readonly attribute SecurityPolicy securityPolicy[] = 59;
readonly attribute octet_string channelMask = 60;
readonly attribute octet_string<4> channelMask = 60;
readonly attribute OperationalDatasetComponents operationalDatasetComponents[] = 61;
readonly attribute NetworkFault activeNetworkFaultsList[] = 62;
readonly global attribute bitmap32 featureMap = 65532;
Expand All @@ -2932,7 +2932,7 @@ server cluster UserLabel = 65 {
}

server cluster WakeOnLan = 1283 {
readonly attribute char_string wakeOnLanMacAddress = 0;
readonly attribute char_string<32> wakeOnLanMacAddress = 0;
readonly global attribute int16u clusterRevision = 65533;
}

Expand Down Expand Up @@ -2980,7 +2980,7 @@ server cluster WiFiNetworkDiagnostics = 54 {
WiFiConnectionStatus connectionStatus = 0;
}

readonly attribute octet_string bssid = 0;
readonly attribute octet_string<6> bssid = 0;
readonly attribute enum8 securityType = 1;
readonly attribute enum8 wiFiVersion = 2;
readonly attribute int16u channelNumber = 3;
Expand Down
Loading

0 comments on commit 9b2949d

Please sign in to comment.