Skip to content

Commit

Permalink
[TV App] Enable missing attributes (#8120)
Browse files Browse the repository at this point in the history
* Enabling missing attributes as current media input on TV app

* Adding tests for code changes

* Generating the code using ZAP script

* Restyle fix

* Enable attributes on all-clusters app so tests can pass
  • Loading branch information
lazarkov authored Jul 7, 2021
1 parent 3d5171c commit 4fad969
Show file tree
Hide file tree
Showing 18 changed files with 1,059 additions and 80 deletions.
60 changes: 60 additions & 0 deletions examples/all-clusters-app/all-clusters-common/all-clusters-app.zap
Original file line number Diff line number Diff line change
Expand Up @@ -12119,6 +12119,21 @@
"maxInterval": 65344,
"reportableChange": 0
},
{
"name": "current media input",
"code": 1,
"mfgCode": null,
"side": "server",
"included": 1,
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
"defaultValue": "0x00",
"reportable": 0,
"minInterval": 0,
"maxInterval": 65344,
"reportableChange": 0
},
{
"name": "cluster revision",
"code": 65533,
Expand Down Expand Up @@ -12450,6 +12465,21 @@
"maxInterval": 65344,
"reportableChange": 0
},
{
"name": "current audio output",
"code": 1,
"mfgCode": null,
"side": "server",
"included": 1,
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
"defaultValue": "0x00",
"reportable": 0,
"minInterval": 0,
"maxInterval": 65344,
"reportableChange": 0
},
{
"name": "cluster revision",
"code": 65533,
Expand Down Expand Up @@ -12535,6 +12565,36 @@
"maxInterval": 65344,
"reportableChange": 0
},
{
"name": "catalog vendor id",
"code": 1,
"mfgCode": null,
"side": "server",
"included": 1,
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
"defaultValue": "0x00",
"reportable": 0,
"minInterval": 0,
"maxInterval": 65344,
"reportableChange": 0
},
{
"name": "application id",
"code": 2,
"mfgCode": null,
"side": "server",
"included": 1,
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
"defaultValue": "0x00",
"reportable": 0,
"minInterval": 0,
"maxInterval": 65344,
"reportableChange": 0
},
{
"name": "cluster revision",
"code": 65533,
Expand Down
36 changes: 20 additions & 16 deletions examples/all-clusters-app/all-clusters-common/gen/endpoint_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -1809,7 +1809,7 @@

#define ZAP_ATTRIBUTE_MASK(mask) ATTRIBUTE_MASK_##mask
// This is an array of EmberAfAttributeMetadata structures.
#define GENERATED_ATTRIBUTE_COUNT 363
#define GENERATED_ATTRIBUTE_COUNT 367
#define GENERATED_ATTRIBUTES \
{ \
\
Expand Down Expand Up @@ -2216,6 +2216,7 @@
\
/* Endpoint: 1, Cluster: Media Input (server) */ \
{ 0x0000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(6470) }, /* media input list */ \
{ 0x0001, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* current media input */ \
{ 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* cluster revision */ \
\
/* Endpoint: 1, Cluster: Low Power (server) */ \
Expand All @@ -2231,10 +2232,13 @@
\
/* Endpoint: 1, Cluster: Audio Output (server) */ \
{ 0x0000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(7232) }, /* audio output list */ \
{ 0x0001, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* current audio output */ \
{ 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* cluster revision */ \
\
/* Endpoint: 1, Cluster: Application Launcher (server) */ \
{ 0x0000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(7486) }, /* application launcher list */ \
{ 0x0001, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* catalog vendor id */ \
{ 0x0002, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* application id */ \
{ 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* cluster revision */ \
\
/* Endpoint: 1, Cluster: Application Basic (server) */ \
Expand Down Expand Up @@ -2510,46 +2514,46 @@
0x0506, ZAP_ATTRIBUTE_INDEX(302), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \
}, /* Endpoint: 1, Cluster: Media Playback (server) */ \
{ \
0x0507, ZAP_ATTRIBUTE_INDEX(303), 2, 256, ZAP_CLUSTER_MASK(SERVER), NULL \
0x0507, ZAP_ATTRIBUTE_INDEX(303), 3, 257, ZAP_CLUSTER_MASK(SERVER), NULL \
}, /* Endpoint: 1, Cluster: Media Input (server) */ \
{ \
0x0508, ZAP_ATTRIBUTE_INDEX(305), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \
0x0508, ZAP_ATTRIBUTE_INDEX(306), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \
}, /* Endpoint: 1, Cluster: Low Power (server) */ \
{ \
0x0509, ZAP_ATTRIBUTE_INDEX(306), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \
0x0509, ZAP_ATTRIBUTE_INDEX(307), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \
}, /* Endpoint: 1, Cluster: Keypad Input (server) */ \
{ \
0x050A, ZAP_ATTRIBUTE_INDEX(307), 3, 510, ZAP_CLUSTER_MASK(SERVER), NULL \
0x050A, ZAP_ATTRIBUTE_INDEX(308), 3, 510, ZAP_CLUSTER_MASK(SERVER), NULL \
}, /* Endpoint: 1, Cluster: Content Launcher (server) */ \
{ \
0x050B, ZAP_ATTRIBUTE_INDEX(310), 2, 256, ZAP_CLUSTER_MASK(SERVER), NULL \
0x050B, ZAP_ATTRIBUTE_INDEX(311), 3, 257, ZAP_CLUSTER_MASK(SERVER), NULL \
}, /* Endpoint: 1, Cluster: Audio Output (server) */ \
{ \
0x050C, ZAP_ATTRIBUTE_INDEX(312), 2, 256, ZAP_CLUSTER_MASK(SERVER), NULL \
0x050C, ZAP_ATTRIBUTE_INDEX(314), 4, 258, ZAP_CLUSTER_MASK(SERVER), NULL \
}, /* Endpoint: 1, Cluster: Application Launcher (server) */ \
{ \
0x050D, ZAP_ATTRIBUTE_INDEX(314), 8, 105, ZAP_CLUSTER_MASK(SERVER), NULL \
0x050D, ZAP_ATTRIBUTE_INDEX(318), 8, 105, ZAP_CLUSTER_MASK(SERVER), NULL \
}, /* Endpoint: 1, Cluster: Application Basic (server) */ \
{ \
0x050E, ZAP_ATTRIBUTE_INDEX(322), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \
0x050E, ZAP_ATTRIBUTE_INDEX(326), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \
}, /* Endpoint: 1, Cluster: Account Login (server) */ \
{ \
0x050F, ZAP_ATTRIBUTE_INDEX(323), 21, 1579, ZAP_CLUSTER_MASK(SERVER), NULL \
0x050F, ZAP_ATTRIBUTE_INDEX(327), 21, 1579, ZAP_CLUSTER_MASK(SERVER), NULL \
}, /* Endpoint: 1, Cluster: Test Cluster (server) */ \
{ \
0x0B04, ZAP_ATTRIBUTE_INDEX(344), 12, 28, ZAP_CLUSTER_MASK(SERVER), NULL \
0x0B04, ZAP_ATTRIBUTE_INDEX(348), 12, 28, ZAP_CLUSTER_MASK(SERVER), NULL \
}, /* Endpoint: 1, Cluster: Electrical Measurement (server) */ \
{ \
0xF000, ZAP_ATTRIBUTE_INDEX(356), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \
0xF000, ZAP_ATTRIBUTE_INDEX(360), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \
}, /* Endpoint: 1, Cluster: Binding (server) */ \
{ 0x0006, \
ZAP_ATTRIBUTE_INDEX(357), \
ZAP_ATTRIBUTE_INDEX(361), \
2, \
3, \
ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \
chipFuncArrayOnOffServer }, /* Endpoint: 2, Cluster: On/off (server) */ \
{ 0x0406, \
ZAP_ATTRIBUTE_INDEX(359), \
ZAP_ATTRIBUTE_INDEX(363), \
4, \
5, \
ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \
Expand All @@ -2561,7 +2565,7 @@
// This is an array of EmberAfEndpointType structures.
#define GENERATED_ENDPOINT_TYPES \
{ \
{ ZAP_CLUSTER_INDEX(0), 15, 3560 }, { ZAP_CLUSTER_INDEX(15), 37, 6238 }, { ZAP_CLUSTER_INDEX(52), 2, 8 }, \
{ ZAP_CLUSTER_INDEX(0), 15, 3560 }, { ZAP_CLUSTER_INDEX(15), 37, 6242 }, { ZAP_CLUSTER_INDEX(52), 2, 8 }, \
}

// Largest attribute size is needed for various buffers
Expand All @@ -2571,7 +2575,7 @@
#define ATTRIBUTE_SINGLETONS_SIZE (1497)

// Total size of attribute storage
#define ATTRIBUTE_MAX_SIZE (9806)
#define ATTRIBUTE_MAX_SIZE (9810)

// Number of fixed endpoints
#define FIXED_ENDPOINT_COUNT (3)
Expand Down
Loading

0 comments on commit 4fad969

Please sign in to comment.