Skip to content
代码片段 群组 项目
未验证 提交 c2ae75e6 编辑于 作者: paulr34's avatar paulr34 提交者: GitHub
浏览文件

Endpoint Composition - Adding helper which has a NULL placeholder + tests (#1259)

* fixing helper to have a NULL placeholder and adding tests
上级 6d437059
No related branches found
标签 v2024.02.06-nightly
无相关合并请求
...@@ -100,11 +100,15 @@ function endpoint_fixed_profile_id_array(options) { ...@@ -100,11 +100,15 @@ function endpoint_fixed_profile_id_array(options) {
* @returns C array including the { } brackets * @returns C array including the { } brackets
*/ */
function endpoint_fixed_parent_id_array(options) { function endpoint_fixed_parent_id_array(options) {
return ( let parentIds = []
'{ ' + this.endpoints.forEach((ep) => {
this.endpoints.map((ep) => ep.parentEndpointIdentifier).join(', ') + if (ep.parentEndpointIdentifier == null) {
' }' parentIds.push('NULL')
) } else {
parentIds.push(ep.parentEndpointIdentifier)
}
})
return '{ ' + parentIds.join(', ') + ' }'
} }
/** /**
......
...@@ -158,6 +158,7 @@ test( ...@@ -158,6 +158,7 @@ test(
expect(ept).toContain( expect(ept).toContain(
'#define FIXED_PROFILE_IDS { 0x0103, 0x0103, 0x0103, 0x0103 }' '#define FIXED_PROFILE_IDS { 0x0103, 0x0103, 0x0103, 0x0103 }'
) )
expect(ept).toContain('#define FIXED_PARENT_IDS { NULL, 0, 1, NULL }')
expect(ept).toContain( expect(ept).toContain(
'#define FIXED_DEVICE_TYPES {{0x00000016,1},{0x00000100,1},{0x00000100,1},{0x0000F002,1}}' '#define FIXED_DEVICE_TYPES {{0x00000016,1},{0x00000100,1},{0x00000100,1},{0x0000F002,1}}'
) )
...@@ -264,6 +265,7 @@ test( ...@@ -264,6 +265,7 @@ test(
expect(ept).toContain( expect(ept).toContain(
'#define FIXED_PROFILE_IDS { 0x0103, 0x0103, 0x0103, 0x0103 }' '#define FIXED_PROFILE_IDS { 0x0103, 0x0103, 0x0103, 0x0103 }'
) )
expect(ept).toContain('#define FIXED_PARENT_IDS { NULL, NULL, NULL, NULL }')
expect(ept).toContain( expect(ept).toContain(
'#define FIXED_DEVICE_TYPES {{0x00000016,1},{0x00000100,1},{0x00000100,1},{0x0000F002,1}}' '#define FIXED_DEVICE_TYPES {{0x00000016,1},{0x00000100,1},{0x00000100,1},{0x0000F002,1}}'
) )
......
...@@ -98,6 +98,9 @@ static_assert(ATTRIBUTE_LARGEST <= CHIP_CONFIG_MAX_ATTRIBUTE_STORE_ELEMENT_SIZE, ...@@ -98,6 +98,9 @@ static_assert(ATTRIBUTE_LARGEST <= CHIP_CONFIG_MAX_ATTRIBUTE_STORE_ELEMENT_SIZE,
// Array of profile ids // Array of profile ids
#define FIXED_PROFILE_IDS {{endpoint_fixed_profile_id_array}} #define FIXED_PROFILE_IDS {{endpoint_fixed_profile_id_array}}
// Array of parent endpoint ids
#define FIXED_PARENT_IDS {{endpoint_fixed_parent_id_array}}
// Array of device types // Array of device types
#define FIXED_DEVICE_TYPES {{endpoint_fixed_device_type_array}} #define FIXED_DEVICE_TYPES {{endpoint_fixed_device_type_array}}
......
...@@ -101,6 +101,9 @@ static_assert(ATTRIBUTE_LARGEST <= CHIP_CONFIG_MAX_ATTRIBUTE_STORE_ELEMENT_SIZE, ...@@ -101,6 +101,9 @@ static_assert(ATTRIBUTE_LARGEST <= CHIP_CONFIG_MAX_ATTRIBUTE_STORE_ELEMENT_SIZE,
// Array of profile ids // Array of profile ids
#define FIXED_PROFILE_IDS {{endpoint_fixed_profile_id_array}} #define FIXED_PROFILE_IDS {{endpoint_fixed_profile_id_array}}
/ Array of parent endpoint ids
#define FIXED_PARENT_IDS {{endpoint_fixed_parent_id_array}}
// Array of device types // Array of device types
#define FIXED_DEVICE_TYPES {{endpoint_fixed_device_type_array}} #define FIXED_DEVICE_TYPES {{endpoint_fixed_device_type_array}}
......
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册