From ebacff870b0b0085ba48e058858f25f1b2fc063a Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Tue, 1 Feb 2022 11:43:24 -0500 Subject: [PATCH] Stop generating command and attribute lists for client clusters. These are not used for anything in Matter and are just taking up space. --- .../generator/helper-endpointconfig.js | 7 +++++++ test/endpoint-config.test.js | 8 +------- test/tokens.test.js | 20 ------------------- 3 files changed, 8 insertions(+), 27 deletions(-) diff --git a/src-electron/generator/helper-endpointconfig.js b/src-electron/generator/helper-endpointconfig.js index 3eff203b79..88821aeb60 100644 --- a/src-electron/generator/helper-endpointconfig.js +++ b/src-electron/generator/helper-endpointconfig.js @@ -820,6 +820,13 @@ function endpoint_config(options) { ept.clusters = clusters // Put 'clusters' into endpoint let ps = [] clusters.forEach((cl) => { + // No client-side attributes or commands (at least for + // endpoint_config purposes) in Matter. + if (cl.side == dbEnum.side.client) { + cl.attributes = [] + cl.commands = [] + return + } ps.push( queryEndpoint .selectEndpointClusterAttributes( diff --git a/test/endpoint-config.test.js b/test/endpoint-config.test.js index 923144102b..f855e4e623 100644 --- a/test/endpoint-config.test.js +++ b/test/endpoint-config.test.js @@ -208,12 +208,6 @@ test( ) expect(epc).toContain('#define FIXED_ENDPOINT_TYPES { 0, 1, 2 }') expect(epc).toContain('#define GENERATED_DEFAULTS_COUNT (12)') - expect(epc).toContain( - '{ ZAP_REPORT_DIRECTION(REPORTED), 0x002A, 0x00000701, 0x00000002, ZAP_CLUSTER_MASK(CLIENT), 0x0000, {{ 2, 12, 4 }} }' - ) - expect(epc).toContain( - '{ ZAP_REPORT_DIRECTION(REPORTED), 0x002A, 0x00000701, 0x00000003, ZAP_CLUSTER_MASK(CLIENT), 0x0000, {{ 3, 13, 6 }} }' - ) expect(epc).toContain( `17, 'T', 'e', 's', 't', ' ', 'm', 'a', 'n', 'u', 'f', 'a', 'c', 't', 'u', 'r', 'e', 'r',` ) @@ -225,7 +219,7 @@ test( cnt++ } }) - expect(cnt).toBe(76) + expect(cnt).toBe(72) expect(epc).toContain('#define EMBER_AF_MANUFACTURER_CODE 0x1002') expect(epc).toContain('#define EMBER_AF_DEFAULT_RESPONSE_POLICY_ALWAYS') }, diff --git a/test/tokens.test.js b/test/tokens.test.js index 64f6f49dac..dd4be24a7f 100644 --- a/test/tokens.test.js +++ b/test/tokens.test.js @@ -197,7 +197,6 @@ test( // Check token IDs expect(header).toContain('(NVM3KEY_DOMAIN_ZIGBEE | 0xB000)') - expect(header).toContain('(NVM3KEY_DOMAIN_ZIGBEE | 0xB008)') expect(header).not.toContain('(NVM3KEY_DOMAIN_ZIGBEE | 0xB009)') // DEFINETYPES @@ -213,8 +212,6 @@ test( expect(header).toContain('uint16_t tokType_color_control_remaining_time;') - expect(header).toContain('typedef uint8_t tokType_reporting_status_client;') - // DEFINETOKENS expect(header).toContain( @@ -293,18 +290,10 @@ test( 'halCommonGetToken((tokType_application_version *)ptr, TOKEN_APPLICATION_VERSION_7);' ) - expect(header).toContain( - 'halCommonGetToken((tokType_reporting_status_client *)ptr, TOKEN_REPORTING_STATUS_CLIENT_7);' - ) - expect(header).toContain( 'emberAfWriteServerAttribute(1, ZCL_BASIC_CLUSTER_ID, ZCL_APPLICATION_VERSION_ATTRIBUTE_ID, (uint8_t*)ptr, ZCL_INT8U_ATTRIBUTE_TYPE);' ) - expect(header).toContain( - 'emberAfWriteClientAttribute(1, ZCL_THERMOSTAT_CLUSTER_ID, ZCL_REPORTING_STATUS_CLIENT_ATTRIBUTE_ID, (uint8_t*)ptr, ZCL_ENUM8_ATTRIBUTE_TYPE);' - ) - // GENERATED_TOKEN_SAVER expect(header).toContain('if ( 0x0000 == clusterId )') @@ -325,15 +314,6 @@ test( 'halCommonSetToken(TOKEN_HW_VERSION_SINGLETON, data); }' ) - expect(header).toContain('if ( 0x0201 == clusterId )') - expect(header).toContain( - 'if ( 0xFFFE == metadata->attributeId && 0x0000 == emberAfGetMfgCode(metadata) && emberAfAttributeIsClient(metadata) )' - ) - - expect(header).toContain( - 'halCommonSetToken(TOKEN_REPORTING_STATUS_CLIENT_7, data);' - ) - expect(header).toContain('if ( 1 == endpoint )') expect(header).not.toContain('if ( 2 == endpoint )') expect(header).toContain('if ( 7 == endpoint )')