Skip to content
代码片段 群组 项目
提交 c1e0c87c 编辑于 作者: Timotej Ecimovic's avatar Timotej Ecimovic
浏览文件

Add more unit test files to deal with the events stuff.

上级 f15e612e
No related branches found
No related tags found
无相关合并请求
......@@ -31,7 +31,7 @@ const types = require('../src-electron/util/types.js')
const bin = require('../src-electron/util/bin.js')
let db
const templateCount = 14
const templateCount = testUtil.testTemplateCount
const genTimeout = 3000
const testFile = path.join(__dirname, 'resource/three-endpoint-device.zap')
let sessionId
......
......@@ -166,6 +166,16 @@
"name": "ZCL human readable strings",
"output": "zap-print.h"
},
{
"path": "zap-event.h.zapt",
"name": "Generated events header",
"output": "zap-event.h"
},
{
"path": "zap-event.c.zapt",
"name": "Generated events",
"output": "zap-event.c"
},
{
"path": "zap-tokens.zapt",
"name": "ZCL tokens",
......
{{#all_user_clusters}}
{{#if (is_enabled enabled)}}
{{#template_options category="tick_events"}}
{{#if (is_lowercase_equal (concatenate ../name ../side) optionLabel)~}}
WEAK(void {{optionCode}}(uint8_t enpoint))
{
}
{{/if}}
{{/template_options}}
{{/if}}
{{/all_user_clusters}}
{{#all_user_clusters}}
{{#if (is_enabled enabled)}}
{{#template_options category="generic_events"}}
{{#if (is_lowercase_equal (concatenate ../name ../side) optionLabel)~}}
WEAK(void {{optionCode}}EndpointEventHandler(uint8_t enpoint))
{
}
{{/if}}
{{/template_options}}
{{/if}}
{{/all_user_clusters}}
{{#user_endpoint_types}}
{{#user_clusters}}
{{#if (is_enabled enabled)}}
{{#template_options category="tick_events"}}
{{#if (is_lowercase_equal (concatenate ../name ../side) optionLabel)~}}
sl_zigbee_event_t {{optionCode}}Event{{endpoint_type_identifier ../../endpointTypeId}}; \
{{/if}}
{{/template_options}}
{{/if}}
{{/user_clusters}}
{{/user_endpoint_types}}
{{#all_user_clusters}}
{{#template_options category="generic_events"}}
{{#if (is_lowercase_equal (concatenate ../name ../side) optionLabel)~}}
sl_zigbee_event_t {{optionCode}}EndpointEvents[{{user_endpoint_count_by_cluster ../id ../side}}]; \
{{/if}}
{{/template_options}}
{{/all_user_clusters}}
#define EMBER_AF_GENERATED_UC_EVENTS_INIT \
{{#all_user_clusters}}
{{#if (is_enabled enabled)}}
{{#template_options category="tick_events"}}
{{#if (is_lowercase_equal (concatenate ../name ../side) optionLabel)~}}
extern void {{optionCode}}(uint8_t enpoint); \
{{/if}}
{{/template_options}}
{{/if}}
{{/all_user_clusters}}
{{#user_endpoint_types}}
{{#user_clusters}}
{{#if (is_enabled enabled)}}
{{#template_options category="tick_events"}}
{{#if (is_lowercase_equal (concatenate ../name ../side) optionLabel)~}}
sl_zigbee_endpoint_event_init(&{{optionCode}}Event{{endpoint_type_identifier ../../endpointTypeId}}, (void *){{optionCode}}, {{endpoint_type_identifier ../../endpointTypeId}}); \
{{/if}}
{{/template_options}}
{{/if}}
{{/user_clusters}}
{{/user_endpoint_types}}
{{#all_user_clusters}}
{{#if (is_enabled enabled)}}
{{#template_options category="generic_events"}}
{{#if (is_lowercase_equal (concatenate ../name ../side) optionLabel)~}}
extern void {{optionCode}}EndpointEventHandler(uint8_t enpoint); \
{{/if}}
{{/template_options}}
{{/if}}
{{/all_user_clusters}}
{{#user_endpoint_types}}
{{#user_clusters}}
{{#if (is_enabled enabled)}}
{{#template_options category="generic_events"}}
{{#if (is_lowercase_equal (concatenate ../name ../side) optionLabel)~}}
sl_zigbee_endpoint_event_init(&{{optionCode}}EndpointEvents[{{endpoint_type_index ../../endpointTypeId}}], (void *){{optionCode}}EndpointEventHandler, {{endpoint_type_identifier ../../endpointTypeId}}); \
{{/if}}
{{/template_options}}
{{/if}}
{{/user_clusters}}
{{/user_endpoint_types}}
// sl_zigbee_event_context_t structs used to populate the sli_zigbee_app_event_context table
#define EMBER_AF_GENERATED_UC_EVENT_CONTEXT \
{{#user_endpoint_types}}
{{#user_clusters}}
{{#if (is_enabled enabled)}}
{{#template_options category="tick_events"}}
{{#if (is_lowercase_equal (concatenate ../name ../side) optionLabel)~}}
{ {{endpoint_type_identifier ../../endpointTypeId}}, {{asHex ../code}}, {{#if (is_client ../side)}}true{{else}}false{{/if}}, EMBER_AF_LONG_POLL, EMBER_AF_OK_TO_SLEEP, &{{optionCode}}Event{{endpoint_type_identifier ../../endpointTypeId}} }, \
{{/if}}
{{/template_options}}
{{/if}}
{{/user_clusters}}
{{/user_endpoint_types}}
......@@ -32,7 +32,7 @@ const importJs = require('../src-electron/importexport/import.js')
const testUtil = require('./test-util.js')
let db
const templateCount = 14
const templateCount = testUtil.testTemplateCount
const genTimeout = 8000
const testFile = path.join(__dirname, 'resource/generation-test-file-1.zap')
......
......@@ -30,7 +30,7 @@ const dbEnum = require('../src-shared/db-enum.js')
const zapHelper = require('../src-electron/generator/helper-zap.js')
let db
const templateCount = 14
const templateCount = testUtil.testTemplateCount
let zclContext
let ctx
......
......@@ -56,3 +56,5 @@ exports.totalAttributeCount = 3430
exports.totalClusterCommandCount = 602
exports.totalServerAttributeCount = 2954
exports.totalSpecCount = 39
exports.testTemplateCount = 16
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册