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
2f74adb5
Commit
2f74adb5
authored
Sep 30, 2020
by
陈伟灿
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'yjq' into 'master'
Yjq See merge request chenweican/k-sdk!32
parents
c1141a95
2a4c6f81
Changes
49
Show whitespace changes
Inline
Side-by-side
Showing
49 changed files
with
3031 additions
and
2159 deletions
+3031
-2159
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
+46
-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
platform/zigbee/app/builder/Z3GatewayHost/cli.c
platform/zigbee/app/builder/Z3GatewayHost/cli.c
+3
-3
platform/zigbee/app/builder/Z3GatewayHost/enums.h
platform/zigbee/app/builder/Z3GatewayHost/enums.h
+1
-1
platform/zigbee/app/builder/Z3GatewayHost/rpc_api/src/rpc_interface_parse.c
...p/builder/Z3GatewayHost/rpc_api/src/rpc_interface_parse.c
+1
-1
platform/zigbee/app/builder/Z3GatewayHost/yjq_ezsp.c
platform/zigbee/app/builder/Z3GatewayHost/yjq_ezsp.c
+5
-23
platform/zigbee/platform/base/hal/micro/unix/host/micro.c
platform/zigbee/platform/base/hal/micro/unix/host/micro.c
+3
-3
platform/zigbee/protocol/zigbee/app/ezsp-host/ash/ash-host-ui.c
...rm/zigbee/protocol/zigbee/app/ezsp-host/ash/ash-host-ui.c
+173
-172
platform/zigbee/protocol/zigbee/app/ezsp-host/ash/ash-host-ui.h
...rm/zigbee/protocol/zigbee/app/ezsp-host/ash/ash-host-ui.h
+25
-25
platform/zigbee/protocol/zigbee/app/ezsp-host/ezsp-host-io.c
platform/zigbee/protocol/zigbee/app/ezsp-host/ezsp-host-io.c
+1
-0
platform/zigbee/protocol/zigbee/app/ezsp-host/ezsp-host-ui.c
platform/zigbee/protocol/zigbee/app/ezsp-host/ezsp-host-ui.c
+14
-14
platform/zigbee/protocol/zigbee/app/framework/include/af-types.h
...m/zigbee/protocol/zigbee/app/framework/include/af-types.h
+61
-61
platform/zigbee/protocol/zigbee/app/framework/plugin-host/gateway/backchannel-support.c
...e/app/framework/plugin-host/gateway/backchannel-support.c
+122
-122
platform/zigbee/protocol/zigbee/app/framework/plugin-host/gateway/gateway-support.c
...igbee/app/framework/plugin-host/gateway/gateway-support.c
+30
-30
platform/zigbee/protocol/zigbee/app/framework/plugin-host/gateway/gateway-support.h
...igbee/app/framework/plugin-host/gateway/gateway-support.h
+4
-4
platform/zigbee/protocol/zigbee/app/framework/plugin/ota-common/ota-cli.h
...protocol/zigbee/app/framework/plugin/ota-common/ota-cli.h
+1
-1
platform/zigbee/protocol/zigbee/app/framework/plugin/ota-common/ota-common.c
...tocol/zigbee/app/framework/plugin/ota-common/ota-common.c
+9
-9
platform/zigbee/protocol/zigbee/app/framework/plugin/ota-server-policy/ota-server-policy.c
...pp/framework/plugin/ota-server-policy/ota-server-policy.c
+202
-197
platform/zigbee/protocol/zigbee/app/framework/plugin/ota-server/ota-server-cli.c
...l/zigbee/app/framework/plugin/ota-server/ota-server-cli.c
+2
-2
platform/zigbee/protocol/zigbee/app/framework/plugin/ota-server/ota-server-dynamic-block-period.c
...ework/plugin/ota-server/ota-server-dynamic-block-period.c
+7
-7
platform/zigbee/protocol/zigbee/app/framework/plugin/ota-server/ota-server-page-request.c
...app/framework/plugin/ota-server/ota-server-page-request.c
+4
-4
platform/zigbee/protocol/zigbee/app/framework/plugin/ota-server/ota-server.c
...tocol/zigbee/app/framework/plugin/ota-server/ota-server.c
+399
-352
platform/zigbee/protocol/zigbee/app/framework/plugin/ota-storage-common/ota-storage-common-cli.c
...mework/plugin/ota-storage-common/ota-storage-common-cli.c
+2
-2
platform/zigbee/protocol/zigbee/app/framework/plugin/ota-storage-common/ota-storage-common.c
.../framework/plugin/ota-storage-common/ota-storage-common.c
+15
-15
platform/zigbee/protocol/zigbee/app/framework/plugin/ota-storage-common/ota-storage.h
...bee/app/framework/plugin/ota-storage-common/ota-storage.h
+9
-9
platform/zigbee/protocol/zigbee/app/framework/plugin/ota-storage-posix-filesystem/ota-storage-linux.c
...k/plugin/ota-storage-posix-filesystem/ota-storage-linux.c
+1033
-1041
platform/zigbee/protocol/zigbee/app/framework/plugin/ota-storage-posix-filesystem/ota-storage-linux.h
...k/plugin/ota-storage-posix-filesystem/ota-storage-linux.h
+6
-6
platform/zigbee/protocol/zigbee/app/framework/security/af-security-common.c
...otocol/zigbee/app/framework/security/af-security-common.c
+1
-1
platform/zigbee/protocol/zigbee/app/framework/util/af-main-host.c
.../zigbee/protocol/zigbee/app/framework/util/af-main-host.c
+5
-9
No files found.
platform/zigbee/app/builder/Z3GatewayHost/ZB/dev_config_table/dev_map_table.json
0 → 100644
View file @
2f74adb5
{
"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 @
2f74adb5
{
"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 @
2f74adb5
{
"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 @
2f74adb5
{
"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 @
2f74adb5
{
"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 @
2f74adb5
{
"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 @
2f74adb5
{
"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 @
2f74adb5
{
"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 @
2f74adb5
{
"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 @
2f74adb5
{
"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 @
2f74adb5
{
"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 @
2f74adb5
{
"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 @
2f74adb5
{
"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 @
2f74adb5
...
@@ -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 @
2f74adb5
...
@@ -156,6 +156,9 @@ void emberAfPluginDeviceTableDeviceLeftCallback(EmberEUI64 nodeEui64)
...
@@ -156,6 +156,9 @@ void emberAfPluginDeviceTableDeviceLeftCallback(EmberEUI64 nodeEui64)
rpc_printfJSON
(
"left"
,
nodeJson
);
rpc_printfJSON
(
"left"
,
nodeJson
);
kk_msg_report_dev_leave
(
deviceTable
[
deviceTableIndex
].
eui64
);
kk_msg_report_dev_leave
(
deviceTable
[
deviceTableIndex
].
eui64
);
kk_device_table_delete
(
deviceTable
[
deviceTableIndex
].
eui64
);
kk_device_db_delete
(
deviceTable
[
deviceTableIndex
].
eui64
);
}
}
...
@@ -331,20 +334,24 @@ void kk_load_dev_map_table(void)
...
@@ -331,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
);
...
@@ -524,7 +531,7 @@ bool kk_device_config_exist_check(const char *productCode)
...
@@ -524,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
;
...
@@ -552,6 +559,7 @@ bool kk_device_config_add(const char *productCode,const char *identity,uint8_t e
...
@@ -552,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
);
...
@@ -601,6 +609,7 @@ bool kk_device_config_add(const char *productCode,const char *identity,uint8_t e
...
@@ -601,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
);
...
@@ -705,13 +714,15 @@ kk_dev_config_item_extra_data * kk_find_extra_data(EmberNodeId node,const char *
...
@@ -705,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
;
...
@@ -730,7 +741,7 @@ void kk_add_dev_config_map_table_to_list(cJSON * root,const char *productCode)
...
@@ -730,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
);
...
@@ -771,20 +782,30 @@ void kk_add_dev_config_map_table_to_list(cJSON * root,const char *productCode)
...
@@ -771,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
);
...
@@ -878,6 +899,7 @@ void kk_device_config_map_print(void)
...
@@ -878,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 @
2f74adb5
...
@@ -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 @
2f74adb5
...
@@ -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 @
2f74adb5
...
@@ -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 @
2f74adb5
...
@@ -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 @
2f74adb5
...
@@ -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 @
2f74adb5
...
@@ -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 @
2f74adb5
...
@@ -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
[];
...
...
platform/zigbee/app/builder/Z3GatewayHost/cli.c
View file @
2f74adb5
platform/zigbee/app/builder/Z3GatewayHost/enums.h
View file @
2f74adb5
platform/zigbee/app/builder/Z3GatewayHost/rpc_api/src/rpc_interface_parse.c
View file @
2f74adb5
...
@@ -266,7 +266,7 @@ int _init_param(struct jrpc_server *server) {
...
@@ -266,7 +266,7 @@ int _init_param(struct jrpc_server *server) {
//kk_zlog_init("paltform");
//kk_zlog_init("paltform");
printf
(
"getenv
\r\n
"
);
printf
(
"getenv
\r\n
"
);
char
*
debug_level_env
=
getenv
(
"
HOME
"
);
char
*
debug_level_env
=
getenv
(
"
JRPC_DEBUG
"
);
printf
(
"getenv(JRPC_DEBUG):%s
\n
"
,
server
->
debug_level
);
printf
(
"getenv(JRPC_DEBUG):%s
\n
"
,
server
->
debug_level
);
if
(
debug_level_env
==
NULL
)
if
(
debug_level_env
==
NULL
)
server
->
debug_level
=
0
;
server
->
debug_level
=
0
;
...
...
platform/zigbee/app/builder/Z3GatewayHost/yjq_ezsp.c
View file @
2f74adb5
...
@@ -89,6 +89,8 @@ void kk_read_ncp_configuration_without_memory_allocation(void)
...
@@ -89,6 +89,8 @@ void kk_read_ncp_configuration_without_memory_allocation(void)
extern
void
kk_print_network_info
(
void
);
extern
void
kk_print_network_info
(
void
);
extern
void
test_123
(
int
val
);
extern
void
test_123
(
int
val
);
extern
void
kk_ota_test111
();
extern
void
kk_ota_test123123123
();
void
kk_message_process
(
char
*
messageString
)
void
kk_message_process
(
char
*
messageString
)
{
{
...
@@ -111,30 +113,10 @@ void kk_message_process(char *messageString)
...
@@ -111,30 +113,10 @@ void kk_message_process(char *messageString)
}
}
if
(
MEMCOMPARE
(
messageString
,
"AT+TEST1
\r\n
"
,
len
)
==
0
){
if
(
MEMCOMPARE
(
messageString
,
"AT+TEST1
\r\n
"
,
len
)
==
0
){
uint16_t
h
;
kk_ota_test123123123
();
unsigned
char
s
,
l
;
RGB_to_HSL
(
100
,
150
,
200
,
&
h
,
&
s
,
&
l
);
emberAfAppPrintln
(
"%d,%d,%d"
,
h
,
s
,
l
);
emberAfAppPrintln
(
"%d,%d,%d"
,
h
*
254
/
360
,
s
*
254
/
100
,
l
);
kk_device_table_s
*
dev
=
kk_device_find_by_node
(
0x5996
);
dev
->
manage
.
dev
.
ColorLighting
.
color
.
HSL
.
L
=
l
;
zclLevel_MoveToLevel
(
0x5996
,
1
,
l
,
0
,
NULL
,
NULL
);
zclColorControlMovetohueandsat
(
0x5996
,
1
,
h
*
254
/
360
,
s
*
254
/
100
,
0
,
0
,
0
,
0
);
emberAfAppPrint
(
"AT+TEST1
\r\n
"
);
}
}
if
(
MEMCOMPARE
(
messageString
,
"AT+TEST2
\r\n
"
,
len
)
==
0
){
if
(
MEMCOMPARE
(
messageString
,
"AT+TEST
\r\n
"
,
len
)
==
0
){
uint16_t
h
;
kk_ota_test111
();
unsigned
char
s
,
l
;
RGB_to_HSL
(
20
,
24
,
22
,
&
h
,
&
s
,
&
l
);
emberAfAppPrintln
(
"%d,%d,%d"
,
h
,
s
,
l
);
emberAfAppPrintln
(
"%d,%d,%d"
,
h
*
254
/
360
,
s
*
254
/
100
,
l
);
kk_device_table_s
*
dev
=
kk_device_find_by_node
(
0x5996
);
dev
->
manage
.
dev
.
ColorLighting
.
color
.
HSL
.
L
=
l
;
zclLevel_MoveToLevel
(
0x5996
,
1
,
l
,
0
,
NULL
,
NULL
);
zclColorControlMovetohueandsat
(
0x5996
,
1
,
h
*
254
/
360
,
s
*
254
/
100
,
0
,
0
,
0
,
0
);
emberAfAppPrint
(
"AT+TEST2
\r\n
"
);
}
}
}
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
...
...
platform/zigbee/platform/base/hal/micro/unix/host/micro.c
View file @
2f74adb5
platform/zigbee/protocol/zigbee/app/ezsp-host/ash/ash-host-ui.c
View file @
2f74adb5
...
@@ -36,6 +36,7 @@
...
@@ -36,6 +36,7 @@
static
const
char
options
[]
=
"b:f:hv::i:n:o:p:r:s:t:x:"
;
static
const
char
options
[]
=
"b:f:hv::i:n:o:p:r:s:t:x:"
;
bool
checkSerialPort
(
const
char
*
portString
);
bool
checkSerialPort
(
const
char
*
portString
);
bool
ezspInternalProcessCommandOptions
(
int
argc
,
char
*
argv
[],
char
*
errStr
)
bool
ezspInternalProcessCommandOptions
(
int
argc
,
char
*
argv
[],
char
*
errStr
)
{
{
int
c
;
int
c
;
...
@@ -137,7 +138,7 @@ bool ezspInternalProcessCommandOptions(int argc, char *argv[], char *errStr)
...
@@ -137,7 +138,7 @@ bool ezspInternalProcessCommandOptions(int argc, char *argv[], char *errStr)
devport
[
5
]
=
'\0'
;
devport
[
5
]
=
'\0'
;
if
(
strncmp
(
devport
,
port
,
5
)
==
0
)
{
if
(
strncmp
(
devport
,
port
,
5
)
==
0
)
{
strncat
(
devport
,
port
+
5
,
ASH_PORT_LEN
-
5
-
1
);
strncat
(
devport
,
port
+
5
,
ASH_PORT_LEN
-
5
-
1
);
#ifdef __CYGWIN__
#ifdef __CYGWIN__
}
else
if
(
((
strncmp
(
"COM"
,
port
,
3
)
==
0
)
}
else
if
(
((
strncmp
(
"COM"
,
port
,
3
)
==
0
)
||
(
strncmp
(
"com"
,
port
,
3
)
==
0
)
)
||
(
strncmp
(
"com"
,
port
,
3
)
==
0
)
)
&&
(
sscanf
(
port
+
3
,
"%hhu"
,
&
portnum
)
==
1
)
&&
(
sscanf
(
port
+
3
,
"%hhu"
,
&
portnum
)
==
1
)
...
@@ -145,10 +146,10 @@ bool ezspInternalProcessCommandOptions(int argc, char *argv[], char *errStr)
...
@@ -145,10 +146,10 @@ bool ezspInternalProcessCommandOptions(int argc, char *argv[], char *errStr)
snprintf
(
devport
,
ASH_PORT_LEN
,
"/dev/ttyS%hhu"
,
portnum
-
1
);
snprintf
(
devport
,
ASH_PORT_LEN
,
"/dev/ttyS%hhu"
,
portnum
-
1
);
}
else
if
(
(
sscanf
(
port
,
"%hhu"
,
&
portnum
)
==
1
)
&&
portnum
)
{
}
else
if
(
(
sscanf
(
port
,
"%hhu"
,
&
portnum
)
==
1
)
&&
portnum
)
{
snprintf
(
devport
,
ASH_PORT_LEN
,
"/dev/ttyS%hhu"
,
portnum
-
1
);
snprintf
(
devport
,
ASH_PORT_LEN
,
"/dev/ttyS%hhu"
,
portnum
-
1
);
#else
#else
}
else
if
(
sscanf
(
port
,
"%hhu"
,
&
portnum
)
==
1
)
{
}
else
if
(
sscanf
(
port
,
"%hhu"
,
&
portnum
)
==
1
)
{
snprintf
(
devport
,
ASH_PORT_LEN
,
"/dev/ttyS%hhu"
,
portnum
);
snprintf
(
devport
,
ASH_PORT_LEN
,
"/dev/ttyS%hhu"
,
portnum
);
#endif
#endif
}
else
{
}
else
{
strncat
(
devport
,
port
,
ASH_PORT_LEN
-
1
);
strncat
(
devport
,
port
,
ASH_PORT_LEN
-
1
);
}
}
...
...
platform/zigbee/protocol/zigbee/app/ezsp-host/ash/ash-host-ui.h
View file @
2f74adb5
platform/zigbee/protocol/zigbee/app/ezsp-host/ezsp-host-io.c
View file @
2f74adb5
...
@@ -559,6 +559,7 @@ bool ezspSerialPortRegisterCallback(EzspSerialPortCallbackFunction callback)
...
@@ -559,6 +559,7 @@ bool ezspSerialPortRegisterCallback(EzspSerialPortCallbackFunction callback)
void
ezspSerialWriteByte
(
uint8_t
byte
)
void
ezspSerialWriteByte
(
uint8_t
byte
)
{
{
BUMP_HOST_COUNTER
(
txBytes
);
BUMP_HOST_COUNTER
(
txBytes
);
#ifdef IO_LOG
#ifdef IO_LOG
{
{
...
...
platform/zigbee/protocol/zigbee/app/ezsp-host/ezsp-host-ui.c
View file @
2f74adb5
platform/zigbee/protocol/zigbee/app/framework/include/af-types.h
View file @
2f74adb5
platform/zigbee/protocol/zigbee/app/framework/plugin-host/gateway/backchannel-support.c
View file @
2f74adb5
platform/zigbee/protocol/zigbee/app/framework/plugin-host/gateway/gateway-support.c
View file @
2f74adb5
platform/zigbee/protocol/zigbee/app/framework/plugin-host/gateway/gateway-support.h
View file @
2f74adb5
platform/zigbee/protocol/zigbee/app/framework/plugin/ota-common/ota-cli.h
View file @
2f74adb5
platform/zigbee/protocol/zigbee/app/framework/plugin/ota-common/ota-common.c
View file @
2f74adb5
platform/zigbee/protocol/zigbee/app/framework/plugin/ota-server-policy/ota-server-policy.c
View file @
2f74adb5
...
@@ -226,11 +226,13 @@ uint8_t emberAfOtaServerQueryCallback(const EmberAfOtaImageId* currentImageId,
...
@@ -226,11 +226,13 @@ uint8_t emberAfOtaServerQueryCallback(const EmberAfOtaImageId* currentImageId,
// We only perform a check if both the query and the
// We only perform a check if both the query and the
// file have hardware version(s). If one or the other doesn't
// file have hardware version(s). If one or the other doesn't
// have them, we assume a match is still possible.
// have them, we assume a match is still possible.
otaPrintln
(
"[OTA]2222,hardwareVersion=%d"
,
hardwareVersion
);
if
(
hardwareVersion
)
{
if
(
hardwareVersion
)
{
EmberAfOtaHeader
header
;
EmberAfOtaHeader
header
;
emberAfOtaStorageGetFullHeaderCallback
(
nextUpgradeImageId
,
emberAfOtaStorageGetFullHeaderCallback
(
nextUpgradeImageId
,
&
header
);
&
header
);
if
(
header
.
fieldControl
&
HARDWARE_VERSIONS_PRESENT_MASK
)
{
if
(
header
.
fieldControl
&
HARDWARE_VERSIONS_PRESENT_MASK
)
{
otaPrintln
(
"[OTA]3333"
);
if
(
*
hardwareVersion
<
header
.
minimumHardwareVersion
if
(
*
hardwareVersion
<
header
.
minimumHardwareVersion
||
header
.
maximumHardwareVersion
<
*
hardwareVersion
)
{
||
header
.
maximumHardwareVersion
<
*
hardwareVersion
)
{
otaPrintln
(
"Hardware version 0x%02X does not fall within the min (0x%02X) and max (0x%02X) hardware versions in the file."
,
otaPrintln
(
"Hardware version 0x%02X does not fall within the min (0x%02X) and max (0x%02X) hardware versions in the file."
,
...
@@ -246,16 +248,19 @@ uint8_t emberAfOtaServerQueryCallback(const EmberAfOtaImageId* currentImageId,
...
@@ -246,16 +248,19 @@ uint8_t emberAfOtaServerQueryCallback(const EmberAfOtaImageId* currentImageId,
// as a potential upgrade candidate because the hardware is out
// as a potential upgrade candidate because the hardware is out
// of range.
// of range.
if
(
!
hardwareVersionMismatch
)
{
if
(
!
hardwareVersionMismatch
)
{
otaPrintln
(
"[OTA]4444,%x,%x"
,
nextUpgradeImageId
->
firmwareVersion
,
currentImageId
->
firmwareVersion
);
status
=
(
determineNextSoftwareVersion
(
nextUpgradeImageId
->
firmwareVersion
,
status
=
(
determineNextSoftwareVersion
(
nextUpgradeImageId
->
firmwareVersion
,
currentImageId
->
firmwareVersion
)
currentImageId
->
firmwareVersion
)
?
EMBER_ZCL_STATUS_SUCCESS
?
EMBER_ZCL_STATUS_SUCCESS
:
EMBER_ZCL_STATUS_NO_IMAGE_AVAILABLE
);
:
EMBER_ZCL_STATUS_NO_IMAGE_AVAILABLE
);
otaPrintln
(
"[OTA]555,status=%x"
,
status
);
if
(
status
==
EMBER_ZCL_STATUS_SUCCESS
)
{
if
(
status
==
EMBER_ZCL_STATUS_SUCCESS
)
{
otaPrintln
(
"Next fw version is: 0x%4X"
,
otaPrintln
(
"Next fw version is: 0x%4X"
,
nextUpgradeImageId
->
firmwareVersion
);
nextUpgradeImageId
->
firmwareVersion
);
}
}
}
}
}
}
otaPrintln
(
"[OTA]11111"
);
return
status
;
return
status
;
}
}
...
...
platform/zigbee/protocol/zigbee/app/framework/plugin/ota-server/ota-server-cli.c
View file @
2f74adb5
platform/zigbee/protocol/zigbee/app/framework/plugin/ota-server/ota-server-dynamic-block-period.c
View file @
2f74adb5
platform/zigbee/protocol/zigbee/app/framework/plugin/ota-server/ota-server-page-request.c
View file @
2f74adb5
platform/zigbee/protocol/zigbee/app/framework/plugin/ota-server/ota-server.c
View file @
2f74adb5
...
@@ -571,6 +571,54 @@ void emberAfOtaServerSendUpgradeCommandCallback(EmberNodeId dest,
...
@@ -571,6 +571,54 @@ void emberAfOtaServerSendUpgradeCommandCallback(EmberNodeId dest,
}
}
}
}
void
kk_ota_test123123123
()
{
EmberAfOtaImageId
id
;
id
.
manufacturerId
=
0x1268
;
id
.
imageTypeId
=
0x2904
;
id
.
firmwareVersion
=
15
;
emberAfOtaServerSendImageNotifyCallback
(
0xffff
,
1
,
0x03
,
0
,
&
id
);
}
void
kk_ota_test111
()
{
/*zclBufferSetup(ZCL_CLUSTER_SPECIFIC_COMMAND | ZCL_FRAME_CONTROL_SERVER_TO_CLIENT|ZCL_DISABLE_DEFAULT_RESPONSE_MASK, \
(ZCL_OTA_BOOTLOAD_CLUSTER_ID), \
(ZCL_IMAGE_NOTIFY_COMMAND_ID));
zclBufferAddByte(0x03);
zclBufferAddByte(0x00);
zclBufferAddWord(0x1234);
zclBufferAddWord(0x5678);
zclBufferAddInt32(0x11223344);
rpcSendCommand(0xffff,1,1,false);
emberAfCorePrintln("[kk_ota_test111] \r\n");*/
emberAfCorePrintln
(
"[kk_ota_test111]
\r\n
"
);
static
int
cnt
;
EmberAfOtaImageId
id
=
emberAfOtaStorageIteratorFirstCallback
();
cnt
=
0
;
do
{
emberAfCorePrintln
(
"**********%d********
\r\n
"
,
++
cnt
);
emberAfCorePrintln
(
"manufacturerId=0x%4X
\r\n
"
,
id
.
manufacturerId
);
emberAfCorePrintln
(
"imageTypeId=0x%4X
\r\n
"
,
id
.
imageTypeId
);
emberAfCorePrintln
(
"firmwareVersion=0x%8X
\r\n
"
,
id
.
firmwareVersion
);
id
=
emberAfOtaStorageIteratorNextCallback
();
}
while
(
emberAfIsOtaImageIdValid
(
&
id
));
}
static
int
s_ota_server_init
=
0
;
static
int
s_ota_server_init
=
0
;
EmberAfOtaImageId
kk_get_imageId
(
char
*
filename
){
EmberAfOtaImageId
kk_get_imageId
(
char
*
filename
){
...
@@ -589,7 +637,6 @@ EmberAfOtaImageId kk_get_imageId(char* filename){
...
@@ -589,7 +637,6 @@ EmberAfOtaImageId kk_get_imageId(char* filename){
return
emberAfInvalidImageId
;
return
emberAfInvalidImageId
;
}
}
void
kk_ota_notify
(
char
*
filepath
){
void
kk_ota_notify
(
char
*
filepath
){
if
(
s_ota_server_init
==
0
){
if
(
s_ota_server_init
==
0
){
s_ota_server_init
=
1
;
s_ota_server_init
=
1
;
...
...
platform/zigbee/protocol/zigbee/app/framework/plugin/ota-storage-common/ota-storage-common-cli.c
View file @
2f74adb5
platform/zigbee/protocol/zigbee/app/framework/plugin/ota-storage-common/ota-storage-common.c
View file @
2f74adb5
platform/zigbee/protocol/zigbee/app/framework/plugin/ota-storage-common/ota-storage.h
View file @
2f74adb5
...
@@ -63,11 +63,11 @@
...
@@ -63,11 +63,11 @@
#define INVALID_EUI64 { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }
#define INVALID_EUI64 { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }
#define INVALID_OTA_IMAGE_ID \
#define INVALID_OTA_IMAGE_ID \
{ INVALID_MANUFACTURER_ID, \
{ INVALID_MANUFACTURER_ID, \
INVALID_DEVICE_ID, \
INVALID_DEVICE_ID, \
INVALID_FIRMWARE_VERSION, \
INVALID_FIRMWARE_VERSION, \
INVALID_EUI64, \
INVALID_EUI64, \
}
}
#define INVALID_SLOT (uint32_t)-1
#define INVALID_SLOT (uint32_t)-1
...
...
platform/zigbee/protocol/zigbee/app/framework/plugin/ota-storage-posix-filesystem/ota-storage-linux.c
View file @
2f74adb5
...
@@ -170,9 +170,9 @@ static OtaImage* iterator = NULL;
...
@@ -170,9 +170,9 @@ static OtaImage* iterator = NULL;
#endif
#endif
static
EmAfOtaStorageLinuxConfig
config
=
{
static
EmAfOtaStorageLinuxConfig
config
=
{
fals
e
,
// memoryDebug
tru
e
,
// memoryDebug
fals
e
,
// fileDebug
tru
e
,
// fileDebug
fals
e
,
// fieldDebug
tru
e
,
// fieldDebug
true
,
// ignoreFilesWithUnderscorePrefix
true
,
// ignoreFilesWithUnderscorePrefix
true
,
// printFileDiscoveryOrRemoval
true
,
// printFileDiscoveryOrRemoval
NULL
,
// fileAddedHandler
NULL
,
// fileAddedHandler
...
@@ -863,13 +863,6 @@ static void printHeaderInfo(const EmberAfOtaHeader* header)
...
@@ -863,13 +863,6 @@ static void printHeaderInfo(const EmberAfOtaHeader* header)
if
(
!
config
.
printFileDiscoveryOrRemoval
)
{
if
(
!
config
.
printFileDiscoveryOrRemoval
)
{
return
;
return
;
}
}
// printf(" Header Version: 0x%04X\n",
// header->headerVersion);
// printf(" Header Length: 0x%04X\n",
// header->headerLength);
// printf(" Field Control: 0x%04X\n",
// header->fieldControl);
note
(
" Manufacturer ID: 0x%04X
\n
"
,
note
(
" Manufacturer ID: 0x%04X
\n
"
,
header
->
manufacturerId
);
header
->
manufacturerId
);
note
(
" Image Type ID: 0x%04X
\n
"
,
note
(
" Image Type ID: 0x%04X
\n
"
,
...
@@ -878,7 +871,6 @@ static void printHeaderInfo(const EmberAfOtaHeader* header)
...
@@ -878,7 +871,6 @@ static void printHeaderInfo(const EmberAfOtaHeader* header)
header
->
firmwareVersion
);
header
->
firmwareVersion
);
note
(
" Header String: %s
\n
"
,
note
(
" Header String: %s
\n
"
,
header
->
headerString
);
header
->
headerString
);
// printf("\n");
}
}
static
OtaImage
*
addImageFileToList
(
const
char
*
filename
,
static
OtaImage
*
addImageFileToList
(
const
char
*
filename
,
...
...
platform/zigbee/protocol/zigbee/app/framework/plugin/ota-storage-posix-filesystem/ota-storage-linux.h
View file @
2f74adb5
platform/zigbee/protocol/zigbee/app/framework/security/af-security-common.c
View file @
2f74adb5
platform/zigbee/protocol/zigbee/app/framework/util/af-main-host.c
View file @
2f74adb5
...
@@ -545,16 +545,12 @@ int emberAfMain(MAIN_FUNCTION_PARAMETERS)
...
@@ -545,16 +545,12 @@ int emberAfMain(MAIN_FUNCTION_PARAMETERS)
halInit
();
halInit
();
INTERRUPTS_ON
();
// Safe to enable interrupts at this point
INTERRUPTS_ON
();
// Safe to enable interrupts at this point
{
int
returnCode
;
int
returnCode
;
if
(
emberAfMainStartCallback
(
&
returnCode
,
if
(
emberAfMainStartCallback
(
&
returnCode
,
APP_FRAMEWORK_MAIN_ARGUMENTS
))
{
//get serial port info
APP_FRAMEWORK_MAIN_ARGUMENTS
))
{
//get serial port info
return
returnCode
;
return
returnCode
;
}
}
}
kk_print
(
"*******************123****************
\r\n
"
);
kk_print_info
(
"
\r\n
-----hello world![%s:%s]-----
\r\n
"
,
__DATE__
,
__TIME__
);
kk_print_version
();
emberSerialInit
(
APP_SERIAL
,
BAUD_RATE
,
PARITY_NONE
,
1
);
//fock child process
emberSerialInit
(
APP_SERIAL
,
BAUD_RATE
,
PARITY_NONE
,
1
);
//fock child process
...
...
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