Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
K
k-sdk
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
陈伟灿
k-sdk
Commits
2a4c6f81
Commit
2a4c6f81
authored
Sep 30, 2020
by
尹佳钦
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增对IAS Zone的物模型支持
parent
e5cd9e56
Changes
22
Show whitespace changes
Inline
Side-by-side
Showing
22 changed files
with
890 additions
and
45 deletions
+890
-45
platform/zigbee/app/builder/Z3GatewayHost/ZB/dev_config_table/dev_map_table.json
...lder/Z3GatewayHost/ZB/dev_config_table/dev_map_table.json
+217
-0
platform/zigbee/app/builder/Z3GatewayHost/ZB/dev_config_table/device_1008.json
...uilder/Z3GatewayHost/ZB/dev_config_table/device_1008.json
+39
-0
platform/zigbee/app/builder/Z3GatewayHost/ZB/dev_config_table/device_1012.json
...uilder/Z3GatewayHost/ZB/dev_config_table/device_1012.json
+39
-0
platform/zigbee/app/builder/Z3GatewayHost/ZB/dev_config_table/device_1015.json
...uilder/Z3GatewayHost/ZB/dev_config_table/device_1015.json
+39
-0
platform/zigbee/app/builder/Z3GatewayHost/ZB/dev_config_table/device_1020.json
...uilder/Z3GatewayHost/ZB/dev_config_table/device_1020.json
+39
-0
platform/zigbee/app/builder/Z3GatewayHost/ZB/dev_config_table/device_1023.json
...uilder/Z3GatewayHost/ZB/dev_config_table/device_1023.json
+39
-0
platform/zigbee/app/builder/Z3GatewayHost/ZB/dev_config_table/device_1024.json
...uilder/Z3GatewayHost/ZB/dev_config_table/device_1024.json
+39
-0
platform/zigbee/app/builder/Z3GatewayHost/ZB/dev_config_table/device_1035.json
...uilder/Z3GatewayHost/ZB/dev_config_table/device_1035.json
+39
-0
platform/zigbee/app/builder/Z3GatewayHost/ZB/dev_config_table/device_135.json
...builder/Z3GatewayHost/ZB/dev_config_table/device_135.json
+39
-0
platform/zigbee/app/builder/Z3GatewayHost/ZB/dev_config_table/device_140.json
...builder/Z3GatewayHost/ZB/dev_config_table/device_140.json
+39
-0
platform/zigbee/app/builder/Z3GatewayHost/ZB/dev_config_table/device_141.json
...builder/Z3GatewayHost/ZB/dev_config_table/device_141.json
+39
-0
platform/zigbee/app/builder/Z3GatewayHost/ZB/dev_config_table/device_26.json
.../builder/Z3GatewayHost/ZB/dev_config_table/device_26.json
+39
-0
platform/zigbee/app/builder/Z3GatewayHost/ZB/dev_config_table/device_27.json
.../builder/Z3GatewayHost/ZB/dev_config_table/device_27.json
+39
-0
platform/zigbee/app/builder/Z3GatewayHost/ZB/dev_map_table.json
...rm/zigbee/app/builder/Z3GatewayHost/ZB/dev_map_table.json
+1
-1
platform/zigbee/app/builder/Z3GatewayHost/ZB/kk_device_manager.c
...m/zigbee/app/builder/Z3GatewayHost/ZB/kk_device_manager.c
+43
-24
platform/zigbee/app/builder/Z3GatewayHost/ZB/kk_device_manager.h
...m/zigbee/app/builder/Z3GatewayHost/ZB/kk_device_manager.h
+2
-1
platform/zigbee/app/builder/Z3GatewayHost/ZB/kk_device_table_db.c
.../zigbee/app/builder/Z3GatewayHost/ZB/kk_device_table_db.c
+1
-1
platform/zigbee/app/builder/Z3GatewayHost/ZB/kk_msg_report.c
platform/zigbee/app/builder/Z3GatewayHost/ZB/kk_msg_report.c
+6
-0
platform/zigbee/app/builder/Z3GatewayHost/ZB/kk_msg_report.h
platform/zigbee/app/builder/Z3GatewayHost/ZB/kk_msg_report.h
+7
-0
platform/zigbee/app/builder/Z3GatewayHost/ZB/kk_tsl_property_report.c
...bee/app/builder/Z3GatewayHost/ZB/kk_tsl_property_report.c
+136
-18
platform/zigbee/app/builder/Z3GatewayHost/ZB/kk_tsl_property_report.h
...bee/app/builder/Z3GatewayHost/ZB/kk_tsl_property_report.h
+7
-0
platform/zigbee/app/builder/Z3GatewayHost/ZB/kk_zigbee_api.h
platform/zigbee/app/builder/Z3GatewayHost/ZB/kk_zigbee_api.h
+2
-0
No files found.
platform/zigbee/app/builder/Z3GatewayHost/ZB/dev_config_table/dev_map_table.json
0 → 100644
View file @
2a4c6f81
{
"mapTable"
:
[
{
"modleId"
:
"00068611"
,
"productCode"
:
"3001"
,
"productName"
:
"星辰系列.白色零火线单路灯控面板Z3S(KONKE)"
},{
"modleId"
:
"00068612"
,
"productCode"
:
"3002"
,
"productName"
:
"星辰系列.白色零火线双路灯控面板Z3S(KONKE)"
},{
"modleId"
:
"00068613"
,
"productCode"
:
"3003"
,
"productName"
:
"星辰系列.白色零火线三路灯控面板Z3S(KONKE)"
},{
"modleId"
:
"00048611"
,
"productCode"
:
"3004"
,
"productName"
:
"星辰系列.白色零火线情景面板Z3S(KONKE)"
},{
"modleId"
:
"00038611"
,
"productCode"
:
"3005"
,
"productName"
:
"星辰系列.白色零火线单路窗帘面板Z3S(KONKE)"
},{
"modleId"
:
"00038612"
,
"productCode"
:
"3006"
,
"productName"
:
"星辰系列.白色零火线双路窗帘面板Z3S(KONKE)"
},{
"modleId"
:
"00038613"
,
"productCode"
:
"3007"
,
"productName"
:
"星辰系列·白色干触点单路窗帘面板Z3S(KONKE)"
},{
"modleId"
:
"00038614"
,
"productCode"
:
"3008"
,
"productName"
:
"星辰系列·白色干触点双路窗帘面板Z3S(KONKE)"
},{
"modleId"
:
"00068601"
,
"productCode"
:
"3009"
,
"productName"
:
"铂金系列.白色零火线单路灯控面板Z3S(KONKE)"
},{
"modleId"
:
"00068602"
,
"productCode"
:
"3010"
,
"productName"
:
"铂金系列.白色零火线双路灯控面板Z3S(KONKE)"
},{
"modleId"
:
"00068603"
,
"productCode"
:
"3011"
,
"productName"
:
"铂金系列.白色零火线三路灯控面板Z3S(KONKE)"
},{
"modleId"
:
"00038601"
,
"productCode"
:
"3012"
,
"productName"
:
"铂金系列.白色零火线窗帘面板Z3S(KONKE)"
},{
"modleId"
:
"00048601"
,
"productCode"
:
"3013"
,
"productName"
:
"铂金系列.白色零火线情景面板Z3S(KONKE)"
},{
"modleId"
:
"00048602"
,
"productCode"
:
"3014"
,
"productName"
:
"铂金系列.白色快捷面板Z3S(KONKE)"
},{
"modleId"
:
"0402812C"
,
"productCode"
:
"3016"
,
"productName"
:
"铂金系列.白色紧急呼叫按钮Z3S(KONKE)"
},{
"modleId"
:
"0402802C"
,
"productCode"
:
"3015"
,
"productName"
:
"铂金系列.白色零火线SOS紧急呼叫面板Z3S(KONKE)"
},{
"modleId"
:
"00038603"
,
"productCode"
:
"3017"
,
"productName"
:
"铂金系列.白色零火线推窗器面板Z3S(KONKE)"
},{
"modleId"
:
"01018601"
,
"productCode"
:
"3018"
,
"productName"
:
"铂金系列.白色零火线调光面板Z3S(KONKE)"
},{
"modleId"
:
"3019"
,
"productCode"
:
"00518610"
,
"productName"
:
"铂金系列.白色10A智能插座Z3S(KONKE)"
},{
"modleId"
:
"00518616"
,
"productCode"
:
"3020"
,
"productName"
:
"铂金系列.白色16A智能插座Z3S(KONKE)"
},{
"modleId"
:
"00038602"
,
"productCode"
:
"3021"
,
"productName"
:
"铂金系列·白色干触点窗帘面板Z3S(安心加)"
},{
"modleId"
:
"00068621"
,
"productCode"
:
"3022"
,
"productName"
:
"肖邦系列.白色零火线单路灯控面板Z3S(KONKE)"
},{
"modleId"
:
"00068622"
,
"productCode"
:
"3023"
,
"productName"
:
"肖邦系列.白色零火线双路灯控面板Z3S(KONKE)"
},{
"modleId"
:
"00068623"
,
"productCode"
:
"3024"
,
"productName"
:
"肖邦系列.白色零火线三路灯控面板Z3S(KONKE)"
},{
"modleId"
:
"00048621"
,
"productCode"
:
"3025"
,
"productName"
:
"肖邦系列.白色零火线情景面板Z3S(KONKE)"
},{
"modleId"
:
"00038621"
,
"productCode"
:
"3026"
,
"productName"
:
"肖邦系列.白色零火线单路窗帘面板Z3S(KONKE)"
},{
"modleId"
:
"00038622"
,
"productCode"
:
"3027"
,
"productName"
:
"肖邦系列.白色零火线双路窗帘面板Z3S(KONKE)"
},{
"modleId"
:
"00518620"
,
"productCode"
:
"3037"
,
"productName"
:
"肖邦系列.白色10A智能插座Z3S(KONKE)"
},{
"modleId"
:
"00518626"
,
"productCode"
:
"3038"
,
"productName"
:
"肖邦系列.白色16A智能插座Z3S(KONKE)"
},{
"modleId"
:
"0402002A"
,
"productCode"
:
"3039"
,
"productName"
:
"水浸传感器-HZB30S版(KONKE)"
},{
"modleId"
:
"0402002B"
,
"productCode"
:
"3040"
,
"productName"
:
"燃气报警器-HZ3S版(KONKE)"
},{
"modleId"
:
"04020028"
,
"productCode"
:
"3041"
,
"productName"
:
"烟雾报警器-HZ3S版(KONKE)"
},{
"modleId"
:
"3041"
,
"productCode"
:
"3080"
,
"productName"
:
"燃气报警器-豪恩版(iHORN)"
},{
"modleId"
:
"3050"
,
"productCode"
:
"3081"
,
"productName"
:
"烟雾报警器-豪恩版(iHORN)"
},{
"modleId"
:
"3043"
,
"productCode"
:
"0402010D"
,
"productName"
:
"红外幕帘探测器HZ3S版(KONKE)"
},{
"modleId"
:
"03020001"
,
"productCode"
:
"3076"
,
"productName"
:
"环境传感器KZ3S(KONKE)"
},{
"modleId"
:
"00510001"
,
"productCode"
:
"3046"
,
"productName"
:
"KIT系列.白色快捷情景按钮"
},{
"modleId"
:
"03020000"
,
"productCode"
:
"3048"
,
"productName"
:
"KIT系列.白色温湿度传感器"
},{
"modleId"
:
"0402000D"
,
"productCode"
:
"1035"
,
"productName"
:
"KIT系列.白色人体传感器"
},{
"modleId"
:
"04020015"
,
"productCode"
:
"3050"
,
"productName"
:
"KIT系列.白色门窗传感器"
},{
"modleId"
:
"04021015"
,
"productCode"
:
"3051"
,
"productName"
:
"邦德系列.白色门窗传感器(KONKE)"
},{
"modleId"
:
"0402102C"
,
"productCode"
:
"3054"
,
"productName"
:
"邦德系列.白色SOS按钮(KONKE)"
},{
"modleId"
:
"0402102A"
,
"productCode"
:
"3055"
,
"productName"
:
"邦德系列.白色水浸传感器(KONKE)"
},{
"modleId"
:
"00040002"
,
"productCode"
:
"3056"
,
"productName"
:
"邦德系列.白色快捷按键(KONKE)"
},{
"modleId"
:
"04031225"
,
"productCode"
:
"3057"
,
"productName"
:
"邦德系列.白色声光传感器(KONKE)"
},{
"modleId"
:
"02020000"
,
"productCode"
:
"3067"
,
"productName"
:
"智能窗帘电机Z3S(KONKE)(说明:杜亚款)"
},{
"modleId"
:
"02020001"
,
"productCode"
:
"3068"
,
"productName"
:
"威刚系列.智能窗帘电机Z3S(KONKE)(说明:威士达款)"
},{
"modleId"
:
"01000002"
,
"productCode"
:
"3069"
,
"productName"
:
"双路智能灯控模块Z3S(KONKE)"
},{
"modleId"
:
"04028301"
,
"productCode"
:
"3070"
,
"productName"
:
"传感器模块Z3S(KONKE)"
},{
"modleId"
:
"03300001"
,
"productCode"
:
"3071"
,
"productName"
:
"智能水阀控制器Z3S(KONKE)"
},{
"modleId"
:
"03310001"
,
"productCode"
:
"3072"
,
"productName"
:
"智能燃气机械臂控制器Z3S(KONKE)"
},{
"modleId"
:
"01020001"
,
"productCode"
:
"3073"
,
"productName"
:
"幻彩灯带控制器Z3S(KONKE)"
},{
"modleId"
:
"00648631"
,
"productCode"
:
"3077"
,
"productName"
:
"多功能面板(亚运村临时项目)"
}
]
}
platform/zigbee/app/builder/Z3GatewayHost/ZB/dev_config_table/device_1008.json
0 → 100644
View file @
2a4c6f81
{
"productCode"
:
"1008"
,
"config"
:[
{
"identity"
:
"SosState"
,
"endpoint"
:
1
,
"cluster"
:
"0x0500"
,
"attribute"
:
"0x0002"
,
"iasStatusMask"
:
"0x0001"
,
"reportFunc"
:
"kk_tsl_report_iasZoneStatus"
,
"controlFunc"
:
""
},{
"identity"
:
"Battery"
,
"endpoint"
:
1
,
"cluster"
:
"0x0001"
,
"attribute"
:
"0x0021"
,
"iasStatusMask"
:
"0x0008"
,
"reportFunc"
:
"kk_tsl_report_battery"
,
"controlFunc"
:
""
},{
"identity"
:
"sosAlarm"
,
"endpoint"
:
1
,
"cluster"
:
"0x0500"
,
"attribute"
:
"0x0002"
,
"iasStatusMask"
:
"0x0001"
,
"reportFunc"
:
""
,
"controlFunc"
:
""
},{
"identity"
:
"batteryAlarm"
,
"endpoint"
:
1
,
"cluster"
:
"0x0500"
,
"attribute"
:
"0x0002"
,
"iasStatusMask"
:
"0x0008"
,
"reportFunc"
:
""
,
"controlFunc"
:
""
}
]
}
\ No newline at end of file
platform/zigbee/app/builder/Z3GatewayHost/ZB/dev_config_table/device_1012.json
0 → 100644
View file @
2a4c6f81
{
"productCode"
:
"1012"
,
"config"
:[
{
"identity"
:
"SosState"
,
"endpoint"
:
1
,
"cluster"
:
"0x0500"
,
"attribute"
:
"0x0002"
,
"iasStatusMask"
:
"0x0001"
,
"reportFunc"
:
"kk_tsl_report_iasZoneStatus"
,
"controlFunc"
:
""
},{
"identity"
:
"Battery"
,
"endpoint"
:
1
,
"cluster"
:
"0x0001"
,
"attribute"
:
"0x0021"
,
"iasStatusMask"
:
"0x0008"
,
"reportFunc"
:
"kk_tsl_report_battery"
,
"controlFunc"
:
""
},{
"identity"
:
"sosAlarm"
,
"endpoint"
:
1
,
"cluster"
:
"0x0500"
,
"attribute"
:
"0x0002"
,
"iasStatusMask"
:
"0x0001"
,
"reportFunc"
:
""
,
"controlFunc"
:
""
},{
"identity"
:
"batteryAlarm"
,
"endpoint"
:
1
,
"cluster"
:
"0x0500"
,
"attribute"
:
"0x0002"
,
"iasStatusMask"
:
"0x0008"
,
"reportFunc"
:
""
,
"controlFunc"
:
""
}
]
}
\ No newline at end of file
platform/zigbee/app/builder/Z3GatewayHost/ZB/dev_config_table/device_1015.json
0 → 100644
View file @
2a4c6f81
{
"productCode"
:
"1015"
,
"config"
:[
{
"identity"
:
"GasSensorState"
,
"endpoint"
:
1
,
"cluster"
:
"0x0500"
,
"attribute"
:
"0x0002"
,
"iasStatusMask"
:
"0x0001"
,
"reportFunc"
:
"kk_tsl_report_iasZoneStatus"
,
"controlFunc"
:
""
},{
"identity"
:
"Battery"
,
"endpoint"
:
1
,
"cluster"
:
"0x0001"
,
"attribute"
:
"0x0021"
,
"iasStatusMask"
:
"0x0008"
,
"reportFunc"
:
"kk_tsl_report_battery"
,
"controlFunc"
:
""
},{
"identity"
:
"gasAlarm"
,
"endpoint"
:
1
,
"cluster"
:
"0x0500"
,
"attribute"
:
"0x0002"
,
"iasStatusMask"
:
"0x0001"
,
"reportFunc"
:
""
,
"controlFunc"
:
""
},{
"identity"
:
"batteryAlarm"
,
"endpoint"
:
1
,
"cluster"
:
"0x0500"
,
"attribute"
:
"0x0002"
,
"iasStatusMask"
:
"0x0008"
,
"reportFunc"
:
""
,
"controlFunc"
:
""
}
]
}
\ No newline at end of file
platform/zigbee/app/builder/Z3GatewayHost/ZB/dev_config_table/device_1020.json
0 → 100644
View file @
2a4c6f81
{
"productCode"
:
"1008"
,
"config"
:[
{
"identity"
:
"SosState"
,
"endpoint"
:
1
,
"cluster"
:
"0x0500"
,
"attribute"
:
"0x0002"
,
"iasStatusMask"
:
"0x0001"
,
"reportFunc"
:
"kk_tsl_report_iasZoneStatus"
,
"controlFunc"
:
""
},{
"identity"
:
"Battery"
,
"endpoint"
:
1
,
"cluster"
:
"0x0001"
,
"attribute"
:
"0x0021"
,
"iasStatusMask"
:
"0x0008"
,
"reportFunc"
:
"kk_tsl_report_battery"
,
"controlFunc"
:
""
},{
"identity"
:
"sosAlarm"
,
"endpoint"
:
1
,
"cluster"
:
"0x0500"
,
"attribute"
:
"0x0002"
,
"iasStatusMask"
:
"0x0001"
,
"reportFunc"
:
""
,
"controlFunc"
:
""
},{
"identity"
:
"batteryAlarm"
,
"endpoint"
:
1
,
"cluster"
:
"0x0500"
,
"attribute"
:
"0x0002"
,
"iasStatusMask"
:
"0x0008"
,
"reportFunc"
:
""
,
"controlFunc"
:
""
}
]
}
\ No newline at end of file
platform/zigbee/app/builder/Z3GatewayHost/ZB/dev_config_table/device_1023.json
0 → 100644
View file @
2a4c6f81
{
"productCode"
:
"1023"
,
"config"
:[
{
"identity"
:
"ContactState"
,
"endpoint"
:
1
,
"cluster"
:
"0x0500"
,
"attribute"
:
"0x0002"
,
"iasStatusMask"
:
"0x0001"
,
"reportFunc"
:
"kk_tsl_report_iasZoneStatus"
,
"controlFunc"
:
""
},{
"identity"
:
"Battery"
,
"endpoint"
:
1
,
"cluster"
:
"0x0001"
,
"attribute"
:
"0x0021"
,
"iasStatusMask"
:
"0x0008"
,
"reportFunc"
:
"kk_tsl_report_battery"
,
"controlFunc"
:
""
},{
"identity"
:
"contactAlarm"
,
"endpoint"
:
1
,
"cluster"
:
"0x0500"
,
"attribute"
:
"0x0002"
,
"iasStatusMask"
:
"0x0001"
,
"reportFunc"
:
""
,
"controlFunc"
:
""
},{
"identity"
:
"batteryAlarm"
,
"endpoint"
:
1
,
"cluster"
:
"0x0500"
,
"attribute"
:
"0x0002"
,
"iasStatusMask"
:
"0x0008"
,
"reportFunc"
:
""
,
"controlFunc"
:
""
}
]
}
\ No newline at end of file
platform/zigbee/app/builder/Z3GatewayHost/ZB/dev_config_table/device_1024.json
0 → 100644
View file @
2a4c6f81
{
"productCode"
:
"1024"
,
"config"
:[
{
"identity"
:
"WaterSensorState"
,
"endpoint"
:
1
,
"cluster"
:
"0x0500"
,
"attribute"
:
"0x0002"
,
"iasStatusMask"
:
"0x0001"
,
"reportFunc"
:
"kk_tsl_report_iasZoneStatus"
,
"controlFunc"
:
""
},{
"identity"
:
"Battery"
,
"endpoint"
:
1
,
"cluster"
:
"0x0001"
,
"attribute"
:
"0x0021"
,
"iasStatusMask"
:
"0x0008"
,
"reportFunc"
:
"kk_tsl_report_battery"
,
"controlFunc"
:
""
},{
"identity"
:
"waterAlarm"
,
"endpoint"
:
1
,
"cluster"
:
"0x0500"
,
"attribute"
:
"0x0002"
,
"iasStatusMask"
:
"0x0001"
,
"reportFunc"
:
""
,
"controlFunc"
:
""
},{
"identity"
:
"batteryAlarm"
,
"endpoint"
:
1
,
"cluster"
:
"0x0500"
,
"attribute"
:
"0x0002"
,
"iasStatusMask"
:
"0x0008"
,
"reportFunc"
:
""
,
"controlFunc"
:
""
}
]
}
\ No newline at end of file
platform/zigbee/app/builder/Z3GatewayHost/ZB/dev_config_table/device_1035.json
0 → 100644
View file @
2a4c6f81
{
"productCode"
:
"1035"
,
"config"
:[
{
"identity"
:
"MotionAlarmState"
,
"endpoint"
:
1
,
"cluster"
:
"0x0500"
,
"attribute"
:
"0x0002"
,
"iasStatusMask"
:
"0x0001"
,
"reportFunc"
:
"kk_tsl_report_iasZoneStatus"
,
"controlFunc"
:
""
},{
"identity"
:
"Battery"
,
"endpoint"
:
1
,
"cluster"
:
"0x0001"
,
"attribute"
:
"0x0021"
,
"iasStatusMask"
:
"0x0008"
,
"reportFunc"
:
"kk_tsl_report_battery"
,
"controlFunc"
:
""
},{
"identity"
:
"motionAlarm"
,
"endpoint"
:
1
,
"cluster"
:
"0x0500"
,
"attribute"
:
"0x0002"
,
"iasStatusMask"
:
"0x0001"
,
"reportFunc"
:
""
,
"controlFunc"
:
""
},{
"identity"
:
"batteryAlarm"
,
"endpoint"
:
1
,
"cluster"
:
"0x0500"
,
"attribute"
:
"0x0002"
,
"iasStatusMask"
:
"0x0008"
,
"reportFunc"
:
""
,
"controlFunc"
:
""
}
]
}
\ No newline at end of file
platform/zigbee/app/builder/Z3GatewayHost/ZB/dev_config_table/device_135.json
0 → 100644
View file @
2a4c6f81
{
"productCode"
:
"135"
,
"config"
:[
{
"identity"
:
"ContactState"
,
"endpoint"
:
1
,
"cluster"
:
"0x0500"
,
"attribute"
:
"0x0002"
,
"iasStatusMask"
:
"0x0001"
,
"reportFunc"
:
"kk_tsl_report_iasZoneStatus"
,
"controlFunc"
:
""
},{
"identity"
:
"Battery"
,
"endpoint"
:
1
,
"cluster"
:
"0x0001"
,
"attribute"
:
"0x0021"
,
"iasStatusMask"
:
"0x0008"
,
"reportFunc"
:
"kk_tsl_report_battery"
,
"controlFunc"
:
""
},{
"identity"
:
"contactAlarm"
,
"endpoint"
:
1
,
"cluster"
:
"0x0500"
,
"attribute"
:
"0x0002"
,
"iasStatusMask"
:
"0x0001"
,
"reportFunc"
:
""
,
"controlFunc"
:
""
},{
"identity"
:
"batteryAlarm"
,
"endpoint"
:
1
,
"cluster"
:
"0x0500"
,
"attribute"
:
"0x0002"
,
"iasStatusMask"
:
"0x0008"
,
"reportFunc"
:
""
,
"controlFunc"
:
""
}
]
}
\ No newline at end of file
platform/zigbee/app/builder/Z3GatewayHost/ZB/dev_config_table/device_140.json
0 → 100644
View file @
2a4c6f81
{
"productCode"
:
"140"
,
"config"
:[
{
"identity"
:
"SmokeSensorState"
,
"endpoint"
:
1
,
"cluster"
:
"0x0500"
,
"attribute"
:
"0x0002"
,
"iasStatusMask"
:
"0x0001"
,
"reportFunc"
:
"kk_tsl_report_iasZoneStatus"
,
"controlFunc"
:
""
},{
"identity"
:
"Battery"
,
"endpoint"
:
1
,
"cluster"
:
"0x0001"
,
"attribute"
:
"0x0021"
,
"iasStatusMask"
:
"0x0008"
,
"reportFunc"
:
"kk_tsl_report_battery"
,
"controlFunc"
:
""
},{
"identity"
:
"smokeAlarm"
,
"endpoint"
:
1
,
"cluster"
:
"0x0500"
,
"attribute"
:
"0x0002"
,
"iasStatusMask"
:
"0x0001"
,
"reportFunc"
:
""
,
"controlFunc"
:
""
},{
"identity"
:
"batteryAlarm"
,
"endpoint"
:
1
,
"cluster"
:
"0x0500"
,
"attribute"
:
"0x0002"
,
"iasStatusMask"
:
"0x0008"
,
"reportFunc"
:
""
,
"controlFunc"
:
""
}
]
}
\ No newline at end of file
platform/zigbee/app/builder/Z3GatewayHost/ZB/dev_config_table/device_141.json
0 → 100644
View file @
2a4c6f81
{
"productCode"
:
"141"
,
"config"
:[
{
"identity"
:
"GasSensorState"
,
"endpoint"
:
1
,
"cluster"
:
"0x0500"
,
"attribute"
:
"0x0002"
,
"iasStatusMask"
:
"0x0001"
,
"reportFunc"
:
"kk_tsl_report_iasZoneStatus"
,
"controlFunc"
:
""
},{
"identity"
:
"Battery"
,
"endpoint"
:
1
,
"cluster"
:
"0x0001"
,
"attribute"
:
"0x0021"
,
"iasStatusMask"
:
"0x0008"
,
"reportFunc"
:
"kk_tsl_report_battery"
,
"controlFunc"
:
""
},{
"identity"
:
"gasAlarm"
,
"endpoint"
:
1
,
"cluster"
:
"0x0500"
,
"attribute"
:
"0x0002"
,
"iasStatusMask"
:
"0x0001"
,
"reportFunc"
:
""
,
"controlFunc"
:
""
},{
"identity"
:
"batteryAlarm"
,
"endpoint"
:
1
,
"cluster"
:
"0x0500"
,
"attribute"
:
"0x0002"
,
"iasStatusMask"
:
"0x0008"
,
"reportFunc"
:
""
,
"controlFunc"
:
""
}
]
}
\ No newline at end of file
platform/zigbee/app/builder/Z3GatewayHost/ZB/dev_config_table/device_26.json
0 → 100644
View file @
2a4c6f81
{
"productCode"
:
"26"
,
"config"
:[
{
"identity"
:
"MotionAlarmState"
,
"endpoint"
:
1
,
"cluster"
:
"0x0500"
,
"attribute"
:
"0x0002"
,
"iasStatusMask"
:
"0x0001"
,
"reportFunc"
:
"kk_tsl_report_iasZoneStatus"
,
"controlFunc"
:
""
},{
"identity"
:
"Battery"
,
"endpoint"
:
1
,
"cluster"
:
"0x0001"
,
"attribute"
:
"0x0021"
,
"iasStatusMask"
:
"0x0008"
,
"reportFunc"
:
"kk_tsl_report_battery"
,
"controlFunc"
:
""
},{
"identity"
:
"motionAlarm"
,
"endpoint"
:
1
,
"cluster"
:
"0x0500"
,
"attribute"
:
"0x0002"
,
"iasStatusMask"
:
"0x0001"
,
"reportFunc"
:
""
,
"controlFunc"
:
""
},{
"identity"
:
"batteryAlarm"
,
"endpoint"
:
1
,
"cluster"
:
"0x0500"
,
"attribute"
:
"0x0002"
,
"iasStatusMask"
:
"0x0008"
,
"reportFunc"
:
""
,
"controlFunc"
:
""
}
]
}
\ No newline at end of file
platform/zigbee/app/builder/Z3GatewayHost/ZB/dev_config_table/device_27.json
0 → 100644
View file @
2a4c6f81
{
"productCode"
:
"27"
,
"config"
:[
{
"identity"
:
"SmokeSensorState"
,
"endpoint"
:
1
,
"cluster"
:
"0x0500"
,
"attribute"
:
"0x0002"
,
"iasStatusMask"
:
"0x0001"
,
"reportFunc"
:
"kk_tsl_report_iasZoneStatus"
,
"controlFunc"
:
""
},{
"identity"
:
"Battery"
,
"endpoint"
:
1
,
"cluster"
:
"0x0001"
,
"attribute"
:
"0x0021"
,
"iasStatusMask"
:
"0x0008"
,
"reportFunc"
:
"kk_tsl_report_battery"
,
"controlFunc"
:
""
},{
"identity"
:
"smokeAlarm"
,
"endpoint"
:
1
,
"cluster"
:
"0x0500"
,
"attribute"
:
"0x0002"
,
"iasStatusMask"
:
"0x0001"
,
"reportFunc"
:
""
,
"controlFunc"
:
""
},{
"identity"
:
"batteryAlarm"
,
"endpoint"
:
1
,
"cluster"
:
"0x0500"
,
"attribute"
:
"0x0002"
,
"iasStatusMask"
:
"0x0008"
,
"reportFunc"
:
""
,
"controlFunc"
:
""
}
]
}
\ No newline at end of file
platform/zigbee/app/builder/Z3GatewayHost/ZB/dev_map_table.json
View file @
2a4c6f81
...
@@ -154,7 +154,7 @@
...
@@ -154,7 +154,7 @@
"productName"
:
"KIT系列.白色温湿度传感器"
"productName"
:
"KIT系列.白色温湿度传感器"
},{
},{
"modleId"
:
"0402000D"
,
"modleId"
:
"0402000D"
,
"productCode"
:
"
3049
"
,
"productCode"
:
"
1035
"
,
"productName"
:
"KIT系列.白色人体传感器"
"productName"
:
"KIT系列.白色人体传感器"
},{
},{
"modleId"
:
"04020015"
,
"modleId"
:
"04020015"
,
...
...
platform/zigbee/app/builder/Z3GatewayHost/ZB/kk_device_manager.c
View file @
2a4c6f81
...
@@ -334,20 +334,24 @@ void kk_load_dev_map_table(void)
...
@@ -334,20 +334,24 @@ void kk_load_dev_map_table(void)
{
{
int
len
;
int
len
;
int
bufferSize
;
int
bufferSize
;
int
fd
=
open
(
KK_DEVICE_MAP_TABLE_FILE
,
O_RDONLY
);
int
fd
=
open
(
KK_DEVICE_MAP_TABLE_FILE
,
O_RDONLY
);
if
(
fd
<
0
){
UTIL_LOG_ERR
(
"can not open %s,fd=%d!!!
\n
"
,
KK_DEVICE_MAP_TABLE_FILE
,
fd
);
return
;
}
struct
stat
statbuff
;
struct
stat
statbuff
;
stat
(
KK_DEVICE_MAP_TABLE_FILE
,
&
statbuff
);
stat
(
KK_DEVICE_MAP_TABLE_FILE
,
&
statbuff
);
bufferSize
=
statbuff
.
st_size
+
128
;
bufferSize
=
statbuff
.
st_size
+
128
;
uint8_t
*
buffer
=
(
uint8_t
*
)
malloc
(
bufferSize
);
uint8_t
*
buffer
=
(
uint8_t
*
)
malloc
(
bufferSize
);
memset
(
buffer
,
0
,
bufferSize
);
memset
(
buffer
,
0
,
bufferSize
);
;
UTIL_LOG_INFO
(
"
\n
***************load device map table***************
\n
"
);
UTIL_LOG_INFO
(
"
\n
***************load device map table***************
\n
"
);
if
(
fd
<
0
){
free
(
buffer
);
UTIL_LOG_ERR
(
"can not open %s,fd=%d!!!
\n
"
,
KK_DEVICE_MAP_TABLE_FILE
,
fd
);
return
;
}
len
=
read
(
fd
,
buffer
,
bufferSize
);
len
=
read
(
fd
,
buffer
,
bufferSize
);
if
(
len
<
0
){
if
(
len
<
0
){
free
(
buffer
);
free
(
buffer
);
...
@@ -527,7 +531,7 @@ bool kk_device_config_exist_check(const char *productCode)
...
@@ -527,7 +531,7 @@ bool kk_device_config_exist_check(const char *productCode)
return
false
;
return
false
;
}
}
bool
kk_device_config_add
(
const
char
*
productCode
,
const
char
*
identity
,
uint8_t
ep
,
uint16_t
clu
,
uint16_t
attr
,
const
char
*
reportFuncName
,
const
char
*
controlFuncName
)
bool
kk_device_config_add
(
const
char
*
productCode
,
const
char
*
identity
,
uint8_t
ep
,
uint16_t
clu
,
uint16_t
attr
,
uint16_t
mask
,
const
char
*
reportFuncName
,
const
char
*
controlFuncName
)
{
{
int
len
;
int
len
;
kk_dev_config_map
*
ptr
,
*
pre
,
*
pTemp
;
kk_dev_config_map
*
ptr
,
*
pre
,
*
pTemp
;
...
@@ -555,6 +559,7 @@ bool kk_device_config_add(const char *productCode,const char *identity,uint8_t e
...
@@ -555,6 +559,7 @@ bool kk_device_config_add(const char *productCode,const char *identity,uint8_t e
ptr
->
item
.
endpoint
=
ep
;
ptr
->
item
.
endpoint
=
ep
;
ptr
->
item
.
cluster
=
clu
;
ptr
->
item
.
cluster
=
clu
;
ptr
->
item
.
attribute
=
attr
;
ptr
->
item
.
attribute
=
attr
;
ptr
->
item
.
iasZoneStatusMask
=
mask
;
len
=
strlen
(
reportFuncName
);
len
=
strlen
(
reportFuncName
);
ptr
->
item
.
reportFuncName
=
(
char
*
)
malloc
(
len
+
1
);
ptr
->
item
.
reportFuncName
=
(
char
*
)
malloc
(
len
+
1
);
...
@@ -604,6 +609,7 @@ bool kk_device_config_add(const char *productCode,const char *identity,uint8_t e
...
@@ -604,6 +609,7 @@ bool kk_device_config_add(const char *productCode,const char *identity,uint8_t e
newItem
->
endpoint
=
ep
;
newItem
->
endpoint
=
ep
;
newItem
->
cluster
=
clu
;
newItem
->
cluster
=
clu
;
newItem
->
attribute
=
attr
;
newItem
->
attribute
=
attr
;
newItem
->
iasZoneStatusMask
=
mask
;
len
=
strlen
(
reportFuncName
);
len
=
strlen
(
reportFuncName
);
newItem
->
reportFuncName
=
(
char
*
)
malloc
(
len
+
1
);
newItem
->
reportFuncName
=
(
char
*
)
malloc
(
len
+
1
);
...
@@ -708,13 +714,15 @@ kk_dev_config_item_extra_data * kk_find_extra_data(EmberNodeId node,const char *
...
@@ -708,13 +714,15 @@ kk_dev_config_item_extra_data * kk_find_extra_data(EmberNodeId node,const char *
}
}
void
kk_add_dev_config_map_table_to_list
(
cJSON
*
root
,
const
char
*
productCode
)
void
kk_add_dev_config_map_table_to_list
(
cJSON
*
root
,
const
char
*
productCode
)
{
{
uint8_t
ep
;
uint8_t
ep
=
0
;
uint16_t
clu
;
uint16_t
clu
=
0
;
uint16_t
attr
;
uint16_t
attr
=
0
;
uint16_t
mask
=
0
;
int
i
,
j
,
len
,
size
,
extraSize
;
int
i
,
j
,
len
,
size
,
extraSize
;
cJSON
*
item
,
*
identity
;
cJSON
*
item
,
*
identity
;
cJSON
*
endpoint
,
*
cluster
,
*
attribute
,
*
reportFuncName
,
*
controlFuncName
;
cJSON
*
endpoint
,
*
cluster
,
*
attribute
,
*
reportFuncName
,
*
controlFuncName
;
cJSON
*
extraRoot
,
*
extraData
,
*
extraDataItem
;
cJSON
*
extraRoot
,
*
extraData
,
*
extraDataItem
;
cJSON
*
iasZoneStatusMask
;
cJSON
*
table
=
rpc_cJSON_GetObjectItem
(
root
,
KK_DEVICE_CONFIG_MAP_TABLE_ARRAY_IDENTIFY
);
cJSON
*
table
=
rpc_cJSON_GetObjectItem
(
root
,
KK_DEVICE_CONFIG_MAP_TABLE_ARRAY_IDENTIFY
);
kk_dev_config_item_extra_data
*
pData
=
NULL
,
*
ptr
=
NULL
;
kk_dev_config_item_extra_data
*
pData
=
NULL
,
*
ptr
=
NULL
;
...
@@ -733,7 +741,7 @@ void kk_add_dev_config_map_table_to_list(cJSON * root,const char *productCode)
...
@@ -733,7 +741,7 @@ void kk_add_dev_config_map_table_to_list(cJSON * root,const char *productCode)
attribute
=
cJSON_GetObjectItem
(
item
,
"attribute"
);
attribute
=
cJSON_GetObjectItem
(
item
,
"attribute"
);
reportFuncName
=
cJSON_GetObjectItem
(
item
,
"reportFunc"
);
reportFuncName
=
cJSON_GetObjectItem
(
item
,
"reportFunc"
);
controlFuncName
=
cJSON_GetObjectItem
(
item
,
"controlFunc"
);
controlFuncName
=
cJSON_GetObjectItem
(
item
,
"controlFunc"
);
iasZoneStatusMask
=
cJSON_GetObjectItem
(
item
,
"iasStatusMask"
);
extraRoot
=
cJSON_GetObjectItem
(
item
,
KK_DEVICE_CONFIG_MAP_TABLE_EXTRA_DATA_IDENTIFY
);
extraRoot
=
cJSON_GetObjectItem
(
item
,
KK_DEVICE_CONFIG_MAP_TABLE_EXTRA_DATA_IDENTIFY
);
if
(
extraRoot
!=
NULL
){
if
(
extraRoot
!=
NULL
){
extraSize
=
rpc_cJSON_GetArraySize
(
extraRoot
);
extraSize
=
rpc_cJSON_GetArraySize
(
extraRoot
);
...
@@ -774,20 +782,30 @@ void kk_add_dev_config_map_table_to_list(cJSON * root,const char *productCode)
...
@@ -774,20 +782,30 @@ void kk_add_dev_config_map_table_to_list(cJSON * root,const char *productCode)
ep
=
endpoint
->
valueint
;
ep
=
endpoint
->
valueint
;
if
(
cluster
!=
NULL
){
len
=
strlen
(
cluster
->
valuestring
);
len
=
strlen
(
cluster
->
valuestring
);
if
(
len
>=
4
){
if
(
len
>=
4
){
clu
=
rpc_get_u16
(
&
cluster
->
valuestring
[
len
-
4
]);
clu
=
rpc_get_u16
(
&
cluster
->
valuestring
[
len
-
4
]);
}
else
{
}
else
{
continue
;
continue
;
}
}
}
if
(
attribute
!=
NULL
){
len
=
strlen
(
attribute
->
valuestring
);
len
=
strlen
(
attribute
->
valuestring
);
if
(
len
>=
4
){
if
(
len
>=
4
){
attr
=
rpc_get_u16
(
&
attribute
->
valuestring
[
len
-
4
]);
attr
=
rpc_get_u16
(
&
attribute
->
valuestring
[
len
-
4
]);
}
else
{
}
else
{
continue
;
continue
;
}
}
}
kk_device_config_add
(
productCode
,
identity
->
valuestring
,
ep
,
clu
,
attr
,
reportFuncName
->
valuestring
,
controlFuncName
->
valuestring
);
if
(
clu
==
ZCL_IAS_ZONE_CLUSTER_ID
&&
attr
==
ZCL_ZONE_STATUS_ATTRIBUTE_ID
){
if
(
iasZoneStatusMask
!=
NULL
){
len
=
strlen
(
iasZoneStatusMask
->
valuestring
);
mask
=
rpc_get_u16
(
&
iasZoneStatusMask
->
valuestring
[
len
-
4
]);
}
}
kk_device_config_add
(
productCode
,
identity
->
valuestring
,
ep
,
clu
,
attr
,
mask
,
reportFuncName
->
valuestring
,
controlFuncName
->
valuestring
);
kk_append_extra_data_to_list
(
productCode
,
pData
);
kk_append_extra_data_to_list
(
productCode
,
pData
);
...
@@ -881,6 +899,7 @@ void kk_device_config_map_print(void)
...
@@ -881,6 +899,7 @@ void kk_device_config_map_print(void)
emberAfCorePrintln
(
"endpoint:%d
\n
"
,
item
->
endpoint
);
emberAfCorePrintln
(
"endpoint:%d
\n
"
,
item
->
endpoint
);
emberAfCorePrintln
(
"cluster:0x%04X
\n
"
,
item
->
cluster
);
emberAfCorePrintln
(
"cluster:0x%04X
\n
"
,
item
->
cluster
);
emberAfCorePrintln
(
"attribute:0x%04X
\n
"
,
item
->
attribute
);
emberAfCorePrintln
(
"attribute:0x%04X
\n
"
,
item
->
attribute
);
emberAfCorePrintln
(
"iasZoneStatusMask:0x%04X
\n
"
,
item
->
iasZoneStatusMask
);
emberAfCorePrintln
(
"reportFunc:%s
\n
"
,
item
->
reportFuncName
);
emberAfCorePrintln
(
"reportFunc:%s
\n
"
,
item
->
reportFuncName
);
emberAfCorePrintln
(
"controlFunc:%s
\n
"
,
item
->
controlFuncName
);
emberAfCorePrintln
(
"controlFunc:%s
\n
"
,
item
->
controlFuncName
);
extra
=
item
->
data
;
extra
=
item
->
data
;
...
...
platform/zigbee/app/builder/Z3GatewayHost/ZB/kk_device_manager.h
View file @
2a4c6f81
...
@@ -14,7 +14,7 @@
...
@@ -14,7 +14,7 @@
#define KK_MAX_READ_MODLE_ID_COUNT 30
#define KK_MAX_READ_MODLE_ID_COUNT 30
#define KK_NETWORK_PARAMETER_TX_POWER 10
#define KK_NETWORK_PARAMETER_TX_POWER 10
#define KK_NETWORK_PARAMETER_CHANNEL
0x0B
#define KK_NETWORK_PARAMETER_CHANNEL
15
#define KK_EP(x) (x)
#define KK_EP(x) (x)
#define KK_DUMMY_EP KK_EP(0)
#define KK_DUMMY_EP KK_EP(0)
...
@@ -61,6 +61,7 @@ typedef struct kk_dev_config_item{
...
@@ -61,6 +61,7 @@ typedef struct kk_dev_config_item{
kk_rpc_set
*
controlFunc
;
kk_rpc_set
*
controlFunc
;
uint8_t
endpoint
;
uint8_t
endpoint
;
uint16_t
cluster
;
uint16_t
cluster
;
uint16_t
iasZoneStatusMask
;
uint16_t
attribute
;
uint16_t
attribute
;
kk_dev_config_item_extra_data
*
data
;
kk_dev_config_item_extra_data
*
data
;
struct
kk_dev_config_item
*
next
;
struct
kk_dev_config_item
*
next
;
...
...
platform/zigbee/app/builder/Z3GatewayHost/ZB/kk_device_table_db.c
View file @
2a4c6f81
...
@@ -52,7 +52,6 @@ void kk_print_device_table(void)
...
@@ -52,7 +52,6 @@ void kk_print_device_table(void)
ptr
=
ptr
->
next
;
ptr
=
ptr
->
next
;
}
}
}
}
static
kk_device_table_s
*
kk_device_table_create
()
static
kk_device_table_s
*
kk_device_table_create
()
{
{
...
@@ -532,6 +531,7 @@ void emberAfPluginDeviceTableInitialized(void)
...
@@ -532,6 +531,7 @@ void emberAfPluginDeviceTableInitialized(void)
{
{
kk_device_db_load
();
kk_device_db_load
();
kk_print_device_table
();
kk_print_device_table
();
kk_load_dev_map_table
();
kk_load_dev_map_table
();
kk_device_map_print
();
kk_device_map_print
();
kk_device_config_load_from_db
();
kk_device_config_load_from_db
();
...
...
platform/zigbee/app/builder/Z3GatewayHost/ZB/kk_msg_report.c
View file @
2a4c6f81
...
@@ -64,6 +64,12 @@ void kk_msg_report_property(cJSON *data,EmberEUI64 mac)
...
@@ -64,6 +64,12 @@ void kk_msg_report_property(cJSON *data,EmberEUI64 mac)
{
{
kk_msg_report
(
data
,
KK_REPORT_ATTRIBUTE_TYPE
,
KK_REPORT_ATTRIBUTE_METHOD
,
mac
);
kk_msg_report
(
data
,
KK_REPORT_ATTRIBUTE_TYPE
,
KK_REPORT_ATTRIBUTE_METHOD
,
mac
);
}
}
void
kk_msg_report_alarm
(
cJSON
*
data
,
EmberEUI64
mac
)
{
kk_msg_report
(
data
,
KK_REPORT_ALARM_TYPE
,
KK_REPORT_ALARM_METHOD
,
mac
);
}
void
kk_msg_report_dev_joined
(
EmberEUI64
mac
,
const
char
*
productCode
)
void
kk_msg_report_dev_joined
(
EmberEUI64
mac
,
const
char
*
productCode
)
{
{
...
...
platform/zigbee/app/builder/Z3GatewayHost/ZB/kk_msg_report.h
View file @
2a4c6f81
...
@@ -15,6 +15,11 @@
...
@@ -15,6 +15,11 @@
#define KK_REPORT_DEVICE_LEAVE_METHOD "thing.topo.delete"
#define KK_REPORT_DEVICE_LEAVE_METHOD "thing.topo.delete"
#define KK_REPORT_DEVICE_BATCH_LEAVE_METHOD "thing.topo.batchDelete"
#define KK_REPORT_DEVICE_BATCH_LEAVE_METHOD "thing.topo.batchDelete"
#define KK_REPORT_ALARM_METHOD "thing.event.alarm.post"
#define KK_REPORT_ATTRIBUTE_METHOD "thing.event.property.post"
#define KK_REPORT_ATTRIBUTE_METHOD "thing.event.property.post"
#define KK_READ_ATTRIBUTE_METHOD "thing.service.property.get"
#define KK_READ_ATTRIBUTE_METHOD "thing.service.property.get"
...
@@ -23,6 +28,7 @@
...
@@ -23,6 +28,7 @@
#define KK_REPORT_DEVICE_LEFT_TYPE "/thing/topo/delete"
#define KK_REPORT_DEVICE_LEFT_TYPE "/thing/topo/delete"
#define KK_REPORT_DEVICE_BATCH_LEFT_TYPE "/thing/topo/batch_delete"
#define KK_REPORT_DEVICE_BATCH_LEFT_TYPE "/thing/topo/batch_delete"
#define KK_REPORT_ATTRIBUTE_TYPE "/thing/event/property/post"
#define KK_REPORT_ATTRIBUTE_TYPE "/thing/event/property/post"
#define KK_REPORT_ALARM_TYPE "/thing/event/alarm/post"
#define GW2CCU_PROTOCOL "tcp"
#define GW2CCU_PROTOCOL "tcp"
...
@@ -35,6 +41,7 @@ int kk_sendData2CCU(char* data, int len);
...
@@ -35,6 +41,7 @@ int kk_sendData2CCU(char* data, int len);
void
kk_msg_report_dev_leave
(
EmberEUI64
mac
);
void
kk_msg_report_dev_leave
(
EmberEUI64
mac
);
void
kk_msg_report_dev_joined
(
EmberEUI64
mac
,
const
char
*
productCode
);
void
kk_msg_report_dev_joined
(
EmberEUI64
mac
,
const
char
*
productCode
);
void
kk_msg_report_property
(
cJSON
*
data
,
EmberEUI64
mac
);
void
kk_msg_report_property
(
cJSON
*
data
,
EmberEUI64
mac
);
void
kk_msg_report_alarm
(
cJSON
*
data
,
EmberEUI64
mac
);
...
...
platform/zigbee/app/builder/Z3GatewayHost/ZB/kk_tsl_property_report.c
View file @
2a4c6f81
...
@@ -75,14 +75,34 @@ static int kk_tsl_report(EmberEUI64 mac,uint8_t EP,int status,uint16_t clusterId
...
@@ -75,14 +75,34 @@ static int kk_tsl_report(EmberEUI64 mac,uint8_t EP,int status,uint16_t clusterId
if
(
dev_info
==
NULL
){
if
(
dev_info
==
NULL
){
return
tsl_rpt_err
;
return
tsl_rpt_err
;
}
}
item
=
&
dev_info
->
item
;
item
=
&
dev_info
->
item
;
if
(
clusterId
==
ZCL_IAS_ZONE_CLUSTER_ID
&&
attributeId
==
ZCL_ZONE_STATUS_ATTRIBUTE_ID
){
while
(
item
!=
NULL
){
if
(
EP
==
item
->
endpoint
&&
clusterId
==
item
->
cluster
&&
attributeId
==
item
->
attribute
){
{
if
(
item
->
iasZoneStatusMask
!=
0
){
root_tmp
=
kk_check_identify
(
Identify
,
root
,
index
,
status
);
if
(
root_tmp
!=
NULL
){
kk_rpc_report_status
(
root_tmp
,
mac
);
}
else
{
status
=
((
status
&
0xffff
)
&
item
->
iasZoneStatusMask
)
?
1
:
0
;
rpc_cJSON_AddNumberToObject
(
root
,
Identify
,
status
);
kk_msg_report_property
(
root
,
mac
);
}
}
}
}
item
=
item
->
next
;
}
}
else
{
while
(
item
!=
NULL
){
while
(
item
!=
NULL
){
if
(
EP
==
item
->
endpoint
&&
if
(
EP
==
item
->
endpoint
&&
clusterId
==
item
->
cluster
&&
clusterId
==
item
->
cluster
&&
attributeId
==
item
->
attribute
){
attributeId
==
item
->
attribute
){
Identify
=
item
->
identity
;
Identify
=
item
->
identity
;
break
;
break
;
}
}
item
=
item
->
next
;
item
=
item
->
next
;
...
@@ -92,15 +112,65 @@ static int kk_tsl_report(EmberEUI64 mac,uint8_t EP,int status,uint16_t clusterId
...
@@ -92,15 +112,65 @@ static int kk_tsl_report(EmberEUI64 mac,uint8_t EP,int status,uint16_t clusterId
kk_rpc_report_status
(
root_tmp
,
mac
);
kk_rpc_report_status
(
root_tmp
,
mac
);
}
}
else
{
else
{
if
(
clusterId
==
ZCL_BASIC_CLUSTER_ID
&&
attributeId
==
ZCL_BATTERY_PERCENTAGE_REMAINING_ATTRIBUTE_ID
){
double
battery
=
(
double
)
status
*
0
.
5
;
char
batteryStr
[
32
];
sprintf
(
batteryStr
,
"f"
,
battery
);
rpc_cJSON_AddStringToObject
(
root
,
Identify
,
batteryStr
);
}
else
{
rpc_cJSON_AddNumberToObject
(
root
,
Identify
,
status
);
rpc_cJSON_AddNumberToObject
(
root
,
Identify
,
status
);
kk_msg_report_property
(
root
,
mac
);
}
kk_msg_report_property
(
root
,
mac
);
}
}
}
return
tsl_rpt_success
;
return
tsl_rpt_success
;
}
}
//typedef int(*kk_rpc_report)(EmberEUI64 eui64,uint8_t EP,EmberAfClusterId clusterId,EmberAfAttributeId attributeId,uint8_t dataType,uint8_t len,uint8_t *data);
//typedef int(*kk_rpc_report)(EmberEUI64 eui64,uint8_t EP,EmberAfClusterId clusterId,EmberAfAttributeId attributeId,uint8_t dataType,uint8_t len,uint8_t *data);
void
kk_tsl_report_alarm
(
EmberEUI64
eui64
,
uint16_t
zoneStatus
,
uint8_t
extendedStatus
,
uint8_t
zoneId
,
uint16_t
delay
)
{
cJSON
*
root
;
kk_device_table_s
*
dev
=
NULL
;
kk_dev_config_map
*
dev_info
=
NULL
;
kk_dev_config_item
*
item
=
NULL
;
kk_rpc_report
func
;
UTIL_LOG_INFO
(
"
\n
********************kk_tsl_report_alarm********************
\n
"
);
dev
=
kk_device_find_by_mac
(
eui64
);
if
(
dev
==
NULL
){
printf
(
"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
\n
"
);
return
;
}
dev_info
=
kk_device_config_find
(
dev
->
productCode
);
if
(
dev_info
==
NULL
){
printf
(
"&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&,%s
\n
"
,
dev
->
productCode
);
return
;
}
item
=
&
dev_info
->
item
;
while
(
item
!=
NULL
){
printf
(
"&&&&&&&&&&&&&&&&&&&&&&
\n
"
);
if
(
item
->
cluster
==
ZCL_IAS_ZONE_CLUSTER_ID
&&
item
->
attribute
==
ZCL_ZONE_STATUS_ATTRIBUTE_ID
&&
item
->
iasZoneStatusMask
!=
0
&&
item
->
reportFunc
==
NULL
){
printf
(
"!!!!!!!!!!!!
\n
"
);
root
=
rpc_cJSON_CreateObject
();
rpc_cJSON_AddNumberToObject
(
root
,
item
->
identity
,(
zoneStatus
&
item
->
iasZoneStatusMask
)
?
1
:
0
);
kk_msg_report_alarm
(
root
,
eui64
);
}
item
=
item
->
next
;
printf
(
"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
\n
"
);
}
}
void
kk_tsl_report_attribute
(
EmberEUI64
eui64
,
void
kk_tsl_report_attribute
(
EmberEUI64
eui64
,
uint8_t
EP
,
uint8_t
EP
,
...
@@ -439,3 +509,51 @@ int kk_tsl_report_colorControl_RGB(EmberEUI64 eui64,uint8_t EP,EmberAfClusterId
...
@@ -439,3 +509,51 @@ int kk_tsl_report_colorControl_RGB(EmberEUI64 eui64,uint8_t EP,EmberAfClusterId
int
kk_tsl_report_iasZoneStatus
(
EmberEUI64
eui64
,
uint8_t
EP
,
EmberAfClusterId
clusterId
,
EmberAfAttributeId
attributeId
,
uint8_t
dataType
,
uint8_t
len
,
uint8_t
*
data
)
{
uint16_t
value
;
kk_device_table_s
*
dev
;
UTIL_LOG_INFO
(
"[tsl report:kk_tsl_report_iasZoneStatus] value:%d
\n
"
,
value
);
dev
=
kk_device_find_by_mac
(
eui64
);
if
(
dev
==
NULL
){
return
tsl_rpt_err
;
}
if
(
dataType
==
ZCL_BITMAP16_ATTRIBUTE_TYPE
){
if
(
len
==
2
){
value
=
KK_GET_U16
(
data
);
kk_tsl_report
(
eui64
,
EP
,
value
,
clusterId
,
attributeId
);
return
tsl_rpt_success
;
}
}
return
tsl_rpt_err
;
}
int
kk_tsl_report_battery
(
EmberEUI64
eui64
,
uint8_t
EP
,
EmberAfClusterId
clusterId
,
EmberAfAttributeId
attributeId
,
uint8_t
dataType
,
uint8_t
len
,
uint8_t
*
data
)
{
uint8_t
value
=
data
[
0
];
kk_device_table_s
*
dev
;
UTIL_LOG_INFO
(
"[tsl report:kk_tsl_report_battery] value:%d
\n
"
,
value
);
dev
=
kk_device_find_by_mac
(
eui64
);
if
(
dev
==
NULL
){
return
tsl_rpt_err
;
}
if
(
dataType
==
ZCL_INT8U_ATTRIBUTE_TYPE
){
if
(
len
==
1
){
kk_tsl_report
(
eui64
,
EP
,
value
,
clusterId
,
attributeId
);
return
tsl_rpt_success
;
}
}
return
tsl_rpt_err
;
}
platform/zigbee/app/builder/Z3GatewayHost/ZB/kk_tsl_property_report.h
View file @
2a4c6f81
...
@@ -19,6 +19,11 @@ void kk_tsl_report_attribute(EmberEUI64 eui64,
...
@@ -19,6 +19,11 @@ void kk_tsl_report_attribute(EmberEUI64 eui64,
uint8_t
dataType
,
uint8_t
dataType
,
uint8_t
len
,
uint8_t
len
,
uint8_t
*
data
);
uint8_t
*
data
);
void
kk_tsl_report_alarm
(
EmberEUI64
eui64
,
uint16_t
zoneStatus
,
uint8_t
extendedStatus
,
uint8_t
zoneId
,
uint16_t
delay
);
int
kk_tsl_report_global_onoff
(
EmberEUI64
eui64
,
uint8_t
EP
,
EmberAfClusterId
clusterId
,
EmberAfAttributeId
attributeId
,
uint8_t
dataType
,
uint8_t
len
,
uint8_t
*
data
);
int
kk_tsl_report_global_onoff
(
EmberEUI64
eui64
,
uint8_t
EP
,
EmberAfClusterId
clusterId
,
EmberAfAttributeId
attributeId
,
uint8_t
dataType
,
uint8_t
len
,
uint8_t
*
data
);
...
@@ -45,6 +50,8 @@ int kk_tsl_report_colorControl_RGB(EmberEUI64 eui64,uint8_t EP,EmberAfClusterId
...
@@ -45,6 +50,8 @@ int kk_tsl_report_colorControl_RGB(EmberEUI64 eui64,uint8_t EP,EmberAfClusterId
int
kk_tsl_report_iasZoneStatus
(
EmberEUI64
eui64
,
uint8_t
EP
,
EmberAfClusterId
clusterId
,
EmberAfAttributeId
attributeId
,
uint8_t
dataType
,
uint8_t
len
,
uint8_t
*
data
);
int
kk_tsl_report_battery
(
EmberEUI64
eui64
,
uint8_t
EP
,
EmberAfClusterId
clusterId
,
EmberAfAttributeId
attributeId
,
uint8_t
dataType
,
uint8_t
len
,
uint8_t
*
data
);
...
...
platform/zigbee/app/builder/Z3GatewayHost/ZB/kk_zigbee_api.h
View file @
2a4c6f81
...
@@ -34,6 +34,8 @@ void kk_rpc_test(void);
...
@@ -34,6 +34,8 @@ void kk_rpc_test(void);
{
"kk_tsl_report_global_onoff"
,
kk_tsl_report_global_onoff
},
\
{
"kk_tsl_report_global_onoff"
,
kk_tsl_report_global_onoff
},
\
{
"kk_tsl_report_colorControl_Brightness"
,
kk_tsl_report_colorControl_Brightness
},
\
{
"kk_tsl_report_colorControl_Brightness"
,
kk_tsl_report_colorControl_Brightness
},
\
{
"kk_tsl_report_colorControl_RGB"
,
kk_tsl_report_colorControl_RGB
},
\
{
"kk_tsl_report_colorControl_RGB"
,
kk_tsl_report_colorControl_RGB
},
\
{
"kk_tsl_report_iasZoneStatus"
,
kk_tsl_report_iasZoneStatus
},
\
{
"kk_tsl_report_battery"
,
kk_tsl_report_battery
},
\
}
}
kk_rpc_set_api_s
kk_rpc_set_api
[];
kk_rpc_set_api_s
kk_rpc_set_api
[];
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment