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
64166551
Commit
64166551
authored
Sep 04, 2020
by
尹佳钦
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
根据modle id 识别设备
parent
87d2de68
Changes
15
Show whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
481 additions
and
469 deletions
+481
-469
platform/zigbee/app/builder/Z3GatewayHost/Makefile
platform/zigbee/app/builder/Z3GatewayHost/Makefile
+1
-0
platform/zigbee/app/builder/Z3GatewayHost/Z3GatewayHost.h
platform/zigbee/app/builder/Z3GatewayHost/Z3GatewayHost.h
+4
-0
platform/zigbee/app/builder/Z3GatewayHost/ZB/kk_device_manager.c
...m/zigbee/app/builder/Z3GatewayHost/ZB/kk_device_manager.c
+272
-67
platform/zigbee/app/builder/Z3GatewayHost/ZB/kk_device_manager.h
...m/zigbee/app/builder/Z3GatewayHost/ZB/kk_device_manager.h
+17
-3
platform/zigbee/app/builder/Z3GatewayHost/ZB/kk_product_code.c
...orm/zigbee/app/builder/Z3GatewayHost/ZB/kk_product_code.c
+109
-43
platform/zigbee/app/builder/Z3GatewayHost/ZB/kk_product_code.h
...orm/zigbee/app/builder/Z3GatewayHost/ZB/kk_product_code.h
+3
-131
platform/zigbee/app/builder/Z3GatewayHost/kk_test.c
platform/zigbee/app/builder/Z3GatewayHost/kk_test.c
+36
-29
platform/zigbee/app/builder/Z3GatewayHost/kk_test.h
platform/zigbee/app/builder/Z3GatewayHost/kk_test.h
+1
-0
platform/zigbee/app/builder/Z3GatewayHost/kk_tsl_zigbee_map.c
...form/zigbee/app/builder/Z3GatewayHost/kk_tsl_zigbee_map.c
+1
-0
platform/zigbee/app/builder/Z3GatewayHost/rpc_api/inc/rpc_interface_parse.h
...p/builder/Z3GatewayHost/rpc_api/inc/rpc_interface_parse.h
+1
-0
platform/zigbee/app/builder/Z3GatewayHost/rpc_api/src/rpc_interface_parse.c
...p/builder/Z3GatewayHost/rpc_api/src/rpc_interface_parse.c
+30
-73
platform/zigbee/app/builder/Z3GatewayHost/rpc_api/src/rpc_onoff.c
.../zigbee/app/builder/Z3GatewayHost/rpc_api/src/rpc_onoff.c
+0
-114
platform/zigbee/app/builder/Z3GatewayHost/yjq_ezsp.c
platform/zigbee/app/builder/Z3GatewayHost/yjq_ezsp.c
+2
-2
platform/zigbee/protocol/zigbee/app/framework/plugin/ias-zone-client/ias-zone-client.c
...ee/app/framework/plugin/ias-zone-client/ias-zone-client.c
+3
-0
platform/zigbee/protocol/zigbee/app/framework/util/af-main-host.c
.../zigbee/protocol/zigbee/app/framework/util/af-main-host.c
+1
-7
No files found.
platform/zigbee/app/builder/Z3GatewayHost/Makefile
View file @
64166551
...
@@ -282,6 +282,7 @@ APPLICATION_FILES= \
...
@@ -282,6 +282,7 @@ APPLICATION_FILES= \
./ZB/kk_device_manager.c
\
./ZB/kk_device_manager.c
\
./ZB/kk_product_code.c
\
./ZB/kk_product_code.c
\
./ZB/kk_device_control.c
\
./ZB/kk_device_control.c
\
./ZB/kk_zigbee_api.c
\
./kk_test.c
\
./kk_test.c
\
./kk_sub_tsl.c
\
./kk_sub_tsl.c
\
./kk_tsl_zigbee_map.c
\
./kk_tsl_zigbee_map.c
\
...
...
platform/zigbee/app/builder/Z3GatewayHost/Z3GatewayHost.h
View file @
64166551
...
@@ -223,6 +223,10 @@
...
@@ -223,6 +223,10 @@
// Individual areas
// Individual areas
#define EMBER_AF_PRINT_CORE 0x0001
#define EMBER_AF_PRINT_CORE 0x0001
#define EMBER_AF_PRINT_APP 0x0002
#define EMBER_AF_PRINT_APP 0x0002
#define EMBER_AF_PRINT_DEBUG 0x0002
#define EMBER_AF_PRINT_SECURITY 0x0004
#define EMBER_AF_PRINT_SECURITY 0x0004
#define EMBER_AF_PRINT_ATTRIBUTES 0x0008
#define EMBER_AF_PRINT_ATTRIBUTES 0x0008
#define EMBER_AF_PRINT_OTA_BOOTLOAD_CLUSTER 0x0010
#define EMBER_AF_PRINT_OTA_BOOTLOAD_CLUSTER 0x0010
...
...
platform/zigbee/app/builder/Z3GatewayHost/ZB/kk_device_manager.c
View file @
64166551
...
@@ -6,12 +6,12 @@
...
@@ -6,12 +6,12 @@
*************************************************************************************/
*************************************************************************************/
#define KK_GP_EP 242
#define KK_GP_EP 242
static
int
kk_get_device_ep_number
(
EmberEUI64
mac
,
uint8_t
*
buffer
,
uint8_t
maxLen
,
bool
*
over
);
kk_device_table_s
*
kk_zb_device_table
=
NULL
;
kk_device_table_s
*
kk_zb_device_table
=
NULL
;
static
void
kk_device_table_save
(
void
);
static
void
kk_device_table_load
(
void
);
void
kk_print_device_table
(
void
)
void
kk_print_device_table
(
void
)
{
{
...
@@ -24,18 +24,15 @@ void kk_print_device_table(void)
...
@@ -24,18 +24,15 @@ void kk_print_device_table(void)
emberAfAppPrint
(
"
\n
MAC = "
);
emberAfAppPrint
(
"
\n
MAC = "
);
emberAfPrintBigEndianEui64
(
ptr
->
mac
);
emberAfPrintBigEndianEui64
(
ptr
->
mac
);
emberAfAppPrint
(
"
\n
productCode = %s"
,(
ptr
->
productCode
!=
NULL
)
?
ptr
->
productCode
:
"unknow"
);
emberAfAppPrint
(
"
\n
productCode = %s"
,(
ptr
->
productCode
!=
NULL
)
?
ptr
->
productCode
:
"unknow"
);
emberAfAppPrint
(
"
\n
EP Number = %d"
,
ptr
->
epNumber
);
emberAfAppPrint
(
"
\n
identifyCnt = %d"
,
ptr
->
identifyCnt
);
for
(
i
=
0
;
i
<
ptr
->
epNumber
;
i
++
){
if
(
i
==
0
)
emberAfAppPrint
(
"
\n
EP="
);
emberAfAppPrint
(
"%d "
,
ptr
->
epValue
[
i
]);
}
ptr
=
ptr
->
next
;
ptr
=
ptr
->
next
;
}
}
}
}
static
kk_device_table_s
*
kk_device_table_create
()
static
kk_device_table_s
*
kk_device_table_create
()
{
{
emberAfCorePrintln
(
"
[KK device table] create
!"
);
emberAfCorePrintln
(
"
\n
[KK device table] add
!"
);
kk_device_table_s
*
node
=
(
kk_device_table_s
*
)
malloc
(
sizeof
(
kk_device_table_s
));
kk_device_table_s
*
node
=
(
kk_device_table_s
*
)
malloc
(
sizeof
(
kk_device_table_s
));
...
@@ -61,15 +58,14 @@ static kk_device_table_s *kk_device_table_find_next_empty()
...
@@ -61,15 +58,14 @@ static kk_device_table_s *kk_device_table_find_next_empty()
}
}
}
}
static
void
kk_device_fill
(
kk_device_table_s
*
ptr
,
EmberEUI64
mac
,
uint8_t
epNum
,
uint8_t
*
epVal
,
char
*
productCode
)
static
void
kk_device_fill
(
kk_device_table_s
*
ptr
,
EmberEUI64
mac
,
EmberNodeId
nodeId
,
char
*
productCode
,
uint16_t
deviceId
)
{
{
emberAfPrintBigEndianEui64
(
mac
);
memcpy
(
ptr
->
mac
,
mac
,
sizeof
(
EmberEUI64
));
memcpy
(
ptr
->
mac
,
mac
,
sizeof
(
EmberEUI64
));
ptr
->
epNumber
=
epNum
;
ptr
->
nodeId
=
nodeId
;
ptr
->
epValue
=
(
uint8_t
*
)
malloc
(
epNum
);
ptr
->
deviceId
=
deviceId
;
memcpy
(
ptr
->
epValue
,
epVal
,
epNum
);
ptr
->
productCode
=
productCode
;
ptr
->
identifyCnt
=
KK_MAX_READ_MODLE_ID_COUNT
;
ptr
->
productCode
=
productCode
;
}
}
kk_device_table_s
*
kk_device_find_by_mac
(
EmberEUI64
mac
)
kk_device_table_s
*
kk_device_find_by_mac
(
EmberEUI64
mac
)
...
@@ -84,6 +80,20 @@ kk_device_table_s * kk_device_find_by_mac(EmberEUI64 mac)
...
@@ -84,6 +80,20 @@ kk_device_table_s * kk_device_find_by_mac(EmberEUI64 mac)
}
}
return
NULL
;
return
NULL
;
}
}
kk_device_table_s
*
kk_device_find_by_node
(
EmberNodeId
node
)
{
kk_device_table_s
*
ptr
=
kk_zb_device_table
;
while
(
ptr
!=
NULL
){
if
(
ptr
->
nodeId
==
node
){
return
ptr
;
}
ptr
=
ptr
->
next
;
}
return
NULL
;
}
bool
kk_device_find_by_mac11111
(
EmberEUI64
mac
)
bool
kk_device_find_by_mac11111
(
EmberEUI64
mac
)
{
{
kk_device_table_s
*
ptr
=
kk_zb_device_table
;
kk_device_table_s
*
ptr
=
kk_zb_device_table
;
...
@@ -97,16 +107,26 @@ bool kk_device_find_by_mac11111(EmberEUI64 mac)
...
@@ -97,16 +107,26 @@ bool kk_device_find_by_mac11111(EmberEUI64 mac)
return
false
;
return
false
;
}
}
void
kk_device_table_add
(
EmberEUI64
mac
,
uint8_t
epNum
,
uint8_t
*
epVal
,
char
*
productCode
)
void
kk_device_table_add
(
EmberEUI64
mac
,
EmberNodeId
nodeId
,
const
char
*
productCode
,
uint16_t
deviceId
)
{
{
kk_device_table_s
*
ptr
=
kk_zb_device_table
;
kk_device_table_s
*
ptr
=
kk_zb_device_table
;
kk_device_table_s
*
newNode
;
kk_device_table_s
*
newNode
;
UTIL_LOG_INFO
(
"
\n
********************kk device table add********************
\n
"
);
emberAfAppPrint
(
"mac:"
);
emberAfPrintBigEndianEui64
(
mac
);
if
(
kk_device_find_by_node
(
nodeId
)
!=
NULL
){
emberAfAppPrintln
(
" is already in device table!!!"
);
return
;
}
emberAfAppPrintln
(
",nodeId:0x%02x,productCode:%s,device id:0x%04x"
,
nodeId
,(
productCode
==
NULL
)
?
"nukown"
:
productCode
,
deviceId
);
if
(
ptr
==
NULL
){
if
(
ptr
==
NULL
){
kk_zb_device_table
=
kk_device_table_create
();
kk_zb_device_table
=
kk_device_table_create
();
ptr
=
kk_zb_device_table
;
ptr
=
kk_zb_device_table
;
kk_device_fill
(
ptr
,
mac
,
epNum
,
epVal
,
productCode
);
kk_device_fill
(
ptr
,
mac
,
nodeId
,
productCode
,
deviceId
);
return
;
return
;
}
}
...
@@ -117,7 +137,7 @@ void kk_device_table_add(EmberEUI64 mac,uint8_t epNum,uint8_t* epVal,char *produ
...
@@ -117,7 +137,7 @@ void kk_device_table_add(EmberEUI64 mac,uint8_t epNum,uint8_t* epVal,char *produ
if
(
newNode
!=
NULL
){
if
(
newNode
!=
NULL
){
ptr
->
next
=
newNode
;
ptr
->
next
=
newNode
;
kk_device_fill
(
newNode
,
mac
,
epNum
,
epVal
,
productCode
);
kk_device_fill
(
newNode
,
mac
,
nodeId
,
productCode
,
deviceId
);
}
}
}
else
{
}
else
{
emberAfCorePrintln
(
"[KK device table] fatal!!!%s"
,
__LINE__
);
emberAfCorePrintln
(
"[KK device table] fatal!!!%s"
,
__LINE__
);
...
@@ -135,7 +155,6 @@ void kk_device_table_delete(EmberEUI64 mac)
...
@@ -135,7 +155,6 @@ void kk_device_table_delete(EmberEUI64 mac)
while
(
ptr
!=
NULL
){
while
(
ptr
!=
NULL
){
if
(
MEMCOMPARE
(
ptr
->
mac
,
mac
,
sizeof
(
EmberEUI64
))
==
0
){
if
(
MEMCOMPARE
(
ptr
->
mac
,
mac
,
sizeof
(
EmberEUI64
))
==
0
){
if
(
ptr
->
next
==
NULL
){
if
(
ptr
->
next
==
NULL
){
free
(
ptr
->
epValue
);
free
(
ptr
);
free
(
ptr
);
kk_zb_device_table
=
NULL
;
kk_zb_device_table
=
NULL
;
emberAfCorePrintln
(
"[KK device table]delete,now is empty !!!"
);
emberAfCorePrintln
(
"[KK device table]delete,now is empty !!!"
);
...
@@ -144,12 +163,12 @@ void kk_device_table_delete(EmberEUI64 mac)
...
@@ -144,12 +163,12 @@ void kk_device_table_delete(EmberEUI64 mac)
if
(
ptr
==
kk_zb_device_table
){
if
(
ptr
==
kk_zb_device_table
){
kk_zb_device_table
=
ptr
->
next
;
kk_zb_device_table
=
ptr
->
next
;
emberAfCorePrintln
(
"[KK device table] delete list header"
);
emberAfCorePrintln
(
"[KK device table] delete list header"
);
free
(
ptr
->
epValue
);
free
(
ptr
);
free
(
ptr
);
return
;
return
;
}
else
{
}
else
{
ptr_temp
->
next
=
ptr
->
next
;
ptr_temp
->
next
=
ptr
->
next
;
free
(
ptr
->
epValue
);
free
(
ptr
);
free
(
ptr
);
emberAfCorePrintln
(
"[KK device table] delete "
);
emberAfCorePrintln
(
"[KK device table] delete "
);
return
;
return
;
...
@@ -161,26 +180,101 @@ void kk_device_table_delete(EmberEUI64 mac)
...
@@ -161,26 +180,101 @@ void kk_device_table_delete(EmberEUI64 mac)
}
}
}
}
static
void
kk_device_table_save
(
void
)
{
FILE
*
fp
;
int
i
;
uint16_t
pLen
;
kk_device_table_s
*
ptr
=
kk_zb_device_table
;
fp
=
fopen
(
"kk_devices.txt"
,
"w"
);
while
(
ptr
!=
NULL
){
for
(
i
=
0
;
i
<
8
;
i
++
)
{
fprintf
(
fp
,
"%x "
,
ptr
->
mac
[
i
]);
}
fprintf
(
fp
,
"%x "
,
ptr
->
nodeId
);
fprintf
(
fp
,
"%x "
,
ptr
->
deviceId
);
if
(
ptr
->
productCode
==
NULL
){
pLen
=
0
;
}
else
{
pLen
=
strlen
(
ptr
->
productCode
);
}
fprintf
(
fp
,
"%x "
,
pLen
);
for
(
i
=
0
;
i
<
pLen
;
i
++
){
fprintf
(
fp
,
"%x "
,
ptr
->
productCode
[
i
]);
}
ptr
=
ptr
->
next
;
}
fclose
(
fp
);
}
static
void
kk_device_table_load
(
void
)
static
void
kk_device_table_load
(
void
)
{
{
int
i
,
flag
;
UTIL_LOG_INFO
(
"
\n
********************kk load device table********************
\n
"
);
uint8_t
epNum
=
0
;
kk_device_table_s
*
p
;
FILE
*
fp
;
EmberAfPluginDeviceTableEntry
*
ptr
=
emberAfDeviceTablePointer
();
int
i
;
uint8_t
EP
[
KK_MAX_SUPPORT_ENDPOINT_NUMBER
]
=
{
0
};
EmberEUI64
mac
;
uint16_t
nodeId
;
//to do:诡异
uint16_t
deviceId
;
uint16_t
len
;
char
pCode
[
33
];
fp
=
fopen
(
"kk_devices.txt"
,
"r"
);
if
(
fp
==
NULL
)
return
;
while
(
feof
(
fp
)
==
false
){
emberAfDebugPrintln
(
"111"
);
for
(
i
=
0
;
i
<
8
;
i
++
)
{
fscanf
(
fp
,
"%x "
,
&
mac
[
i
]);
}
emberAfDebugPrintln
(
"222"
);
fscanf
(
fp
,
"%x"
,
&
nodeId
);
fscanf
(
fp
,
"%x "
,
&
deviceId
);
emberAfDebugPrintln
(
"len=%d"
,
len
);
fscanf
(
fp
,
"%x"
,
&
len
);
for
(
i
=
0
;
i
<
len
;
i
++
){
fscanf
(
fp
,
"%x "
,
&
pCode
[
i
]);
}
pCode
[
i
]
=
0
;
if
(
len
==
0
){
kk_device_table_add
(
mac
,
nodeId
,
NULL
,
deviceId
);
}
else
{
kk_device_table_add
(
mac
,
nodeId
,
pCode
,
deviceId
);
}
emberAfCorePrintln
(
"
\n
-------------kk device table load.-------------
\n
"
);
for
(
i
=
0
;
i
<
EMBER_AF_PLUGIN_DEVICE_TABLE_DEVICE_TABLE_SIZE
;
i
++
)
{
if
(
ptr
[
i
].
state
!=
EMBER_AF_PLUGIN_DEVICE_TABLE_STATE_NULL
&&
ptr
[
i
].
nodeId
!=
EMBER_AF_PLUGIN_DEVICE_TABLE_NULL_NODE_ID
){
p
=
kk_device_find_by_mac
(
ptr
[
i
].
eui64
);
//todo
if
(
p
==
NULL
){
epNum
=
kk_get_device_ep_number
(
ptr
[
i
].
eui64
,
EP
,
KK_MAX_SUPPORT_ENDPOINT_NUMBER
,
NULL
);
kk_device_table_add
(
ptr
[
i
].
eui64
,
epNum
,
EP
,
TEST_PRODUCT_CODE
);
}
}
fclose
(
fp
);
//kk_device_table_add(EmberEUI64 mac,EmberNodeId nodeId,uint8_t epNum,uint8_t* epVal,char *productCode)
//kk_print_device_table();
}
static
const
char
*
kk_match_tsl_productCode
(
const
char
*
modelId
)
{
int
i
;
int
num
=
kk_get_product_code_table_size
();
UTIL_LOG_INFO
(
"device model id:%s
\n
"
,
modelId
);
for
(
i
=
0
;
i
<
num
&&
kk_product_code
[
i
].
modelId
!=
NULL
;
i
++
){
if
(
strstr
(
modelId
,
kk_product_code
[
i
].
modelId
)
!=
NULL
){
UTIL_LOG_INFO
(
"match model id:%s
\n
"
,
kk_product_code
[
i
].
modelId
);
UTIL_LOG_INFO
(
"tsl product code:%s
\n
"
,
kk_product_code
[
i
].
code
);
#ifdef KK_PRODUCT_CODE_STRING_ENABLE
UTIL_LOG_INFO
(
"match product:%s"
,
kk_product_code
[
i
].
name
);
#endif
return
kk_product_code
[
i
].
code
;
}
}
}
}
kk_print_device_table
()
;
return
NULL
;
}
}
////////////////////////////////////////////////////
////////////////////////////////////////////////////
...
@@ -198,9 +292,11 @@ static int kk_match_device_id(uint16_t deviceId)
...
@@ -198,9 +292,11 @@ static int kk_match_device_id(uint16_t deviceId)
if
(
deviceId
==
0xffff
)
return
-
1
;
if
(
deviceId
==
0xffff
)
return
-
1
;
for
(
i
=
0
;
zb_device_id
[
i
].
deviceId
!=
0xffff
;
i
++
){
for
(
i
=
0
;
zb_device_id
[
i
].
deviceId
!=
0xffff
;
i
++
){
if
(
zb_device_id
[
i
].
deviceId
==
deviceId
){
if
(
zb_device_id
[
i
].
deviceId
==
deviceId
){
emberAfDebugPrint
(
"device:"
);
#ifdef ZIGBEE_DEVICE_ID_STRING_ENABLE
#ifdef ZIGBEE_DEVICE_ID_STRING_ENABLE
emberAfDebugPrintln
(
"
[device]
%s"
,
zb_device_id
[
i
].
deviceIdString
);
emberAfDebugPrintln
(
"%s"
,
zb_device_id
[
i
].
deviceIdString
);
#endif
#endif
return
0
;
}
}
}
}
return
-
2
;
return
-
2
;
...
@@ -211,51 +307,146 @@ static int kk_match_product_code(uint16_t deviceId,uint8_t num,uint8_t *ep)
...
@@ -211,51 +307,146 @@ static int kk_match_product_code(uint16_t deviceId,uint8_t num,uint8_t *ep)
}
}
static
int
kk_get_device_ep_number
(
EmberEUI64
mac
,
uint8_t
*
buffer
,
uint8_t
maxLen
,
bool
*
over
)
static
void
kk_device_modle_id_identify
(
EmberNodeId
nodeId
,
uint8_t
status
,
uint8_t
dataType
,
uint8_t
dataSize
,
uint8_t
*
data
)
{
{
uint16_t
i
;
uint8_t
num
=
0
;
kk_device_table_s
*
ptr
=
kk_zb_device_table
;
EmberAfPluginDeviceTableEntry
*
ptr
=
emberAfDeviceTablePointer
();
EmberEUI64
eui64
;
uint8_t
modelID
[
33
]
=
{
0
};
for
(
i
=
0
;
i
<
EMBER_AF_PLUGIN_DEVICE_TABLE_DEVICE_TABLE_SIZE
;
i
++
)
{
while
(
ptr
!=
NULL
){
if
(
MEMCOMPARE
(
ptr
[
i
].
eui64
,
mac
,
sizeof
(
EmberEUI64
))
==
0
&&
if
(
ptr
->
nodeId
==
nodeId
){
ptr
[
i
].
state
!=
EMBER_AF_PLUGIN_DEVICE_TABLE_STATE_NULL
&&
emberAfCorePrintln
(
"[match tsl]node:0x%04X,status:0x%02x,dataType:0x%02x"
,
nodeId
,
status
,
dataType
);
ptr
[
i
].
nodeId
!=
EMBER_AF_PLUGIN_DEVICE_TABLE_NULL_NODE_ID
){
if
(
status
==
EMBER_ZCL_STATUS_SUCCESS
){
//dataType==ZCL_CHAR_STRING_ATTRIBUTE_TYPE
if
(
ptr
[
i
].
endpoint
!=
KK_GP_EP
){
ptr
->
identifyCnt
=
0
;
buffer
[
num
]
=
ptr
[
i
].
endpoint
;
if
(
dataSize
>=
32
){
++
num
;
dataSize
=
32
;
if
(
num
>
maxLen
){
emberAfCorePrintln
(
"[warring]modle id size = %d,max = 32!!!"
);
}
memcpy
(
modelID
,
data
,
dataSize
);
ptr
->
productCode
=
kk_match_tsl_productCode
(
modelID
);
if
(
ptr
->
productCode
!=
NULL
){
if
(
emberAfDeviceTableGetEui64FromNodeId
(
ptr
->
nodeId
,
eui64
)){
kk_rpc_reportDevices
(
eui64
,
ptr
->
productCode
);
}
else
{
UTIL_LOG_WARNING
(
"not find mac from node in device table!!!"
);
}
}
else
{
emberAfCorePrintln
(
"not match tsl!!!"
);
}
}
else
if
(
status
==
EMBER_ZCL_STATUS_UNSUPPORTED_ATTRIBUTE
){
ptr
->
identifyCnt
=
0
;
emberAfCorePrintln
(
"nodeId:0x%04X,unsupport model id attr,CNT=%d"
,
nodeId
,
ptr
->
identifyCnt
);
//to do :zdo leave ???
}
else
{
emberAfCorePrintln
(
"nodeId:0x%04X,read modle id fail,status=0x%x"
,
nodeId
,
status
);
}
return
;
return
;
}
}
ptr
=
ptr
->
next
;
}
}
}
void
kk_read_attr_response
(
EmberNodeId
nodeId
,
uint8_t
ep
,
EmberAfClusterId
cluster
,
EmberAfAttributeId
attribute
,
uint8_t
status
,
uint8_t
dataType
,
uint8_t
dataSize
,
uint8_t
*
data
)
{
emberAfAppPrintln
(
"ep=%d,cluster=0x%04X,attribute=0x%04X"
,
ep
,
cluster
,
attribute
);
if
(
cluster
==
ZCL_BASIC_CLUSTER_ID
){
if
(
attribute
==
ZCL_MODEL_IDENTIFIER_ATTRIBUTE_ID
){
if
(
ep
==
KK_PRIMARY_EP
)
kk_device_modle_id_identify
(
nodeId
,
status
,
dataType
,
dataSize
,
data
);
}
}
}
}
return
num
;
}
void
emberAfPluginDeviceTableNewDeviceCallback
(
EmberEUI64
nodeEui64
)
{
kk_device_joined
(
emberAfDeviceTableGetNodeIdFromEui64
(
nodeEui64
));
}
}
void
kk_d
ispatch_productCode
(
EmberEUI64
mac
)
void
kk_d
evice_joined
(
EmberNodeId
node
)
{
{
uint16_t
deviceTableIndex
=
emberAfDeviceTableGetFirstIndexFromEui64
(
mac
);
EmberEUI64
mac
;
EmberAfPluginDeviceTableEntry
*
deviceTable
=
emberAfDeviceTablePointer
();
uint16_t
deviceId
;
uint16_t
deviceId
=
0xffff
;
uint16_t
deviceTableIndex
;
bool
flag
=
0
;
EmberAfPluginDeviceTableEntry
*
devPtr
;
uint8_t
epNum
=
0
;
uint8_t
EP
[
KK_MAX_SUPPORT_ENDPOINT_NUMBER
]
=
{
0
};
UTIL_LOG_INFO
(
"
\n
********************kk device joined********************
\n
"
);
if
(
deviceTableIndex
!=
EMBER_AF_PLUGIN_DEVICE_TABLE_NULL_INDEX
){
deviceId
=
deviceTable
[
deviceTableIndex
].
deviceId
;
if
(
emberAfDeviceTableGetEui64FromNodeId
(
node
,
mac
)
==
false
){
deviceTableIndex
=
emberAfDeviceTableGetIndexFromNodeId
(
node
);
if
(
deviceTableIndex
!=
0xffff
){
devPtr
=
emberAfDeviceTablePointer
();
kk_add_device_to_table
(
mac
,
node
,
devPtr
[
deviceTableIndex
].
deviceId
);
}
}
}
else
{
emberAfDebugPrintln
(
"[not find 111]"
);
if
(
emberLookupEui64ByNodeId
(
node
,
mac
)
==
EMBER_SUCCESS
){
deviceTableIndex
=
emberAfDeviceTableGetIndexFromNodeId
(
node
);
if
(
deviceTableIndex
!=
0xffff
){
devPtr
=
emberAfDeviceTablePointer
();
kk_add_device_to_table
(
mac
,
node
,
devPtr
[
deviceTableIndex
].
deviceId
);
}
}
else
{
emberAfDebugPrintln
(
"[not find 222]"
);
}
}
}
void
kk_productCode_tick
()
{
kk_device_table_s
*
ptr
=
kk_zb_device_table
;
EmberEUI64
eui64
;
EmberStatus
status
;
if
(
kk_match_device_id
(
deviceId
)
==
0
){
while
(
ptr
!=
NULL
){
epNum
=
kk_get_device_ep_number
(
mac
,
EP
,
KK_MAX_SUPPORT_ENDPOINT_NUMBER
,
&
flag
);
if
(
ptr
->
productCode
==
NULL
){
if
(
flag
==
true
){
if
(
ptr
->
nodeId
!=
0xffff
&&
ptr
->
identifyCnt
!=
0
){
emberAfCorePrintln
(
"[Warring]device ep num= %d,max=%d"
,
epNum
,
KK_MAX_SUPPORT_ENDPOINT_NUMBER
);
status
=
zclGRead
(
ptr
->
nodeId
,
1
,
1
,
false
,
ZCL_BASIC_CLUSTER_ID
,
ZCL_MODEL_IDENTIFIER_ATTRIBUTE_ID
,
true
);
--
ptr
->
identifyCnt
;
emberAfCorePrintln
(
"read model id from node:0x%02x,status=0x%x,cnt=%d"
,
ptr
->
nodeId
,
status
,
ptr
->
identifyCnt
);
}
else
{
emberAfCorePrintln
(
"not find node!"
);
}
}
kk_device_table_add
(
mac
,
epNum
,
EP
,
TEST_PRODUCT_CODE
);
}
ptr
=
ptr
->
next
;
}
}
}
}
//to do:syn kk device table with ember device table
void
kk_add_device_to_table
(
EmberEUI64
mac
,
EmberNodeId
nodeId
,
uint16_t
deviceId
)
{
UTIL_LOG_INFO
(
"
\n
------------------------kk add device------------------------
\n
"
);
emberAfAppPrint
(
"mac:"
);
emberAfPrintBigEndianEui64
(
mac
);
emberAfAppPrintln
(
"
\n
node:0x%04X,device id:0x%04x"
,
nodeId
,
deviceId
);
kk_match_device_id
(
deviceId
);
kk_device_table_add
(
mac
,
nodeId
,
NULL
,
deviceId
);
kk_device_table_save
();
}
...
@@ -263,6 +454,20 @@ void kk_dispatch_productCode(EmberEUI64 mac)
...
@@ -263,6 +454,20 @@ void kk_dispatch_productCode(EmberEUI64 mac)
void
emberAfPluginDeviceTableRejoinDeviceCallback
(
EmberEUI64
nodeEui64
)
{
kk_device_table_s
*
ptr
=
kk_device_find_by_mac
(
nodeEui64
);
if
(
ptr
==
NULL
){
UTIL_LOG_INFO
(
"not in device table!!!"
);
emberAfPrintBigEndianEui64
(
nodeEui64
);
emberAfDebugPrintln
(
""
);
return
;
}
if
(
ptr
->
productCode
!=
NULL
){
kk_rpc_reportDevices
(
nodeEui64
,
ptr
->
productCode
);
}
}
...
...
platform/zigbee/app/builder/Z3GatewayHost/ZB/kk_device_manager.h
View file @
64166551
...
@@ -12,19 +12,33 @@
...
@@ -12,19 +12,33 @@
typedef
struct
kk_device_table_s
{
typedef
struct
kk_device_table_s
{
EmberEUI64
mac
;
EmberEUI64
mac
;
uint8_t
epNumber
;
EmberNodeId
nodeId
;
uint8_t
*
epValue
;
uint16_t
deviceId
;
uint16_t
identifyCnt
;
char
*
productCode
;
char
*
productCode
;
struct
kk_device_table_s
*
next
;
struct
kk_device_table_s
*
next
;
}
kk_device_table_s
;
}
kk_device_table_s
;
#define KK_MAX_SUPPORT_ENDPOINT_NUMBER 32
#define KK_MAX_SUPPORT_ENDPOINT_NUMBER 32
#define KK_MAX_READ_MODLE_ID_COUNT 30
void
kk_print_device_table
(
void
);
void
kk_print_device_table
(
void
);
kk_device_table_s
*
kk_device_find_by_mac
(
EmberEUI64
mac
);
kk_device_table_s
*
kk_device_find_by_mac
(
EmberEUI64
mac
);
void
kk_device_table_add
(
EmberEUI64
mac
,
uint8_t
epNum
,
uint8_t
*
epVal
,
char
*
productCode
);
void
kk_device_table_add
(
EmberEUI64
mac
,
EmberNodeId
nodeId
,
const
char
*
productCode
,
uint16_t
deviceId
);
void
kk_device_table_delete
(
EmberEUI64
mac
);
void
kk_device_table_delete
(
EmberEUI64
mac
);
void
kk_add_device_to_table
(
EmberEUI64
mac
,
EmberNodeId
nodeId
,
uint16_t
deviceId
);
void
kk_productCode_tick
();
void
kk_read_attr_response
(
EmberNodeId
nodeId
,
uint8_t
ep
,
EmberAfClusterId
cluster
,
EmberAfAttributeId
attribute
,
uint8_t
status
,
uint8_t
dataType
,
uint8_t
dataSize
,
uint8_t
*
data
);
...
...
platform/zigbee/app/builder/Z3GatewayHost/ZB/kk_product_code.c
View file @
64166551
...
@@ -12,52 +12,118 @@
...
@@ -12,52 +12,118 @@
#ifdef KK_PRODUCT_CODE_STRING_ENABLE
#ifdef KK_PRODUCT_CODE_STRING_ENABLE
kk_product_code_s
kk_product_code
[]
=
{
kk_product_code_s
kk_product_code
[]
=
{
{
_2EP_ZERO_FIRE_LIGHTING_MODULE_CODE
,
NULL
,
_2EP_ZERO_FIRE_LIGHTING_MODULE_NAME
},
{
"00068611"
,
"3001"
,
"星辰系列.白色零火线单路灯控面板Z3S(KONKE)"
},
{
DOOYA_CURTAIN_MOTOR_CODE
,
DOOYA_CURTAIN_MOTOR_MODEL_ID
,
DOOYA_CURTAIN_MOTOR_NAME
},
{
"00068612"
,
"3002"
,
"星辰系列.白色零火线双路灯控面板Z3S(KONKE)"
},
{
_1EP_ZERO_FIRE_PANEL_CODE
,
NULL
,
_1EP_ZERO_FIRE_PANEL_NAME
},
{
"00068613"
,
"3003"
,
"星辰系列.白色零火线三路灯控面板Z3S(KONKE)"
},
{
_2EP_ZERO_FIRE_PANEL_CODE
,
NULL
,
_2EP_ZERO_FIRE_PANEL_NAME
},
{
"00048611"
,
"3004"
,
"星辰系列.白色零火线情景面板Z3S(KONKE)"
},
{
_3EP_ZERO_FIRE_PANEL_CODE
,
NULL
,
_3EP_ZERO_FIRE_PANE_NAME
},
{
"00038611"
,
"3005"
,
"星辰系列.白色零火线单路窗帘面板Z3S(KONKE)"
},
{
ADJUSTABLE_LIGHT_KNOB_PANEL_CODE
,
NULL
,
ADJUSTABLE_LIGHT_KNOB_PANEL_NAME
},
{
"00038612"
,
"3006"
,
"星辰系列.白色零火线双路窗帘面板Z3S(KONKE)"
},
{
CHOPIN_WALL_OUTLET_10A_CODE
,
CHOPIN_WALL_OUTLET_10A_CODE_NAME_MODEL_ID
,
CHOPIN_WALL_OUTLET_10A_CODE_NAME
},
{
"00038613"
,
"3007"
,
"星辰系列·白色干触点单路窗帘面板Z3S(KONKE)"
},
{
CHOPIN_WALL_OUTLET_16A_CODE
,
CHOPIN_WALL_OUTLET_16A_CODE_NAME_MODEL_ID
,
CHOPIN_WALL_OUTLET_16A_CODE_NAME
},
{
"00038614"
,
"3008"
,
"星辰系列·白色干触点双路窗帘面板Z3S(KONKE)"
},
{
_1EP_STARS_ZERO_FIRE_PANEL_CODE
,
_1EP_STARS_ZERO_FIRE_PANEL_MODEL_ID
,
_1EP_STARS_ZERO_FIRE_PANEL_NAME
},
{
"00068601"
,
"3009"
,
"铂金系列.白色零火线单路灯控面板Z3S(KONKE)"
},
{
_2EP_STARS_ZERO_FIRE_PANEL_CODE
,
_2EP_STARS_ZERO_FIRE_PANEL_MODEL_ID
,
_2EP_STARS_ZERO_FIRE_PANEL_NAME
},
{
"00068602"
,
"3010"
,
"铂金系列.白色零火线双路灯控面板Z3S(KONKE)"
},
{
_3EP_STARS_ZERO_FIRE_PANEL_CODE
,
_3EP_STARS_ZERO_FIRE_PANEL_MODEL_ID
,
_3EP_STARS_ZERO_FIRE_PANEL_NAME
},
{
"00068603"
,
"3011"
,
"铂金系列.白色零火线三路灯控面板Z3S(KONKE)"
},
{
_1EP_CHOPIN_ZERO_FIRE_PANEL_CODE
,
_1EP_CHOPIN_ZERO_FIRE_PANEL_MODEL_ID
,
_1EP_CHOPIN_ZERO_FIRE_PANEL_NAME
},
{
"00038601"
,
"3012"
,
"铂金系列.白色零火线窗帘面板Z3S(KONKE)"
},
{
_2EP_CHOPIN_ZERO_FIRE_PANEL_CODE
,
_2EP_CHOPIN_ZERO_FIRE_PANEL_MODEL_ID
,
_2EP_CHOPIN_ZERO_FIRE_PANEL_NAME
},
{
"00048601"
,
"3013"
,
"铂金系列.白色零火线情景面板Z3S(KONKE)"
},
{
_3EP_CHOPIN_ZERO_FIRE_PANEL_CODE
,
_3EP_CHOPIN_ZERO_FIRE_PANEL_MODEL_ID
,
_3EP_CHOPIN_ZERO_FIRE_PANEL_NAME
},
{
"00048602"
,
"3014"
,
"铂金系列.白色快捷面板Z3S(KONKE)"
},
{
_1EP_CHOPIN_CURTAIN_MOTOR_CODE
,
_1EP_CHOPIN_CURTAIN_MOTOR_MODEL_ID
,
_1EP_CHOPIN_CURTAIN_MOTOR_NAME
},
{
"0402802C"
,
"3015"
,
"铂金系列.白色零火线SOS紧急呼叫面板Z3S(KONKE)"
},
{
_2EP_CHOPIN_CURTAIN_MOTOR_CODE
,
_2EP_CHOPIN_CURTAIN_MOTOR_MODEL_ID
,
_2EP_CHOPIN_CURTAIN_MOTOR_NAME
},
{
"0402812C"
,
"3016"
,
"铂金系列.白色紧急呼叫按钮Z3S(KONKE)"
},
{
_1EP_PLATINUM_SWITCH_CODE
,
_1EP_PLATINUM_SWITCH_MODEL_ID
,
_1EP_PLATINUM_SWITCH_NAME
},
{
"00038603"
,
"3017"
,
"铂金系列.白色零火线推窗器面板Z3S(KONKE)"
},
{
_2EP_PLATINUM_SWITCH_CODE
,
_2EP_PLATINUM_SWITCH_MODEL_ID
,
_2EP_PLATINUM_SWITCH_NAME
},
{
"01018601"
,
"3018"
,
"铂金系列.白色零火线调光面板Z3S(KONKE)"
},
{
_3EP_PLATINUM_SWITCH_CODE
,
_3EP_PLATINUM_SWITCH_MODEL_ID
,
_3EP_PLATINUM_SWITCH_NAME
},
{
"00518610"
,
"3019"
,
"铂金系列.白色10A智能插座Z3S(KONKE)"
},
{
PLATINUM_ACTUATOR_PANEL_CODE
,
NULL
,
PLATINUM_ACTUATOR_PANEL_NAME
},
{
"00518616"
,
"3020"
,
"铂金系列.白色16A智能插座Z3S(KONKE)"
},
{
RGB_LIGHT_CODE
,
RGB_LIGHT_NAME_MODEL_ID
,
RGB_LIGHT_NAME
},
{
"00038602"
,
"3021"
,
"铂金系列·白色干触点窗帘面板Z3S(安心加)"
},
{
"00068621"
,
"3022"
,
"肖邦系列.白色零火线单路灯控面板Z3S(KONKE)"
},
{
"00068622"
,
"3023"
,
"肖邦系列.白色零火线双路灯控面板Z3S(KONKE)"
},
{
"00068623"
,
"3024"
,
"肖邦系列.白色零火线三路灯控面板Z3S(KONKE)"
},
{
"00048621"
,
"3025"
,
"肖邦系列.白色零火线情景面板Z3S(KONKE)"
},
{
"00038621"
,
"3026"
,
"肖邦系列.白色零火线单路窗帘面板Z3S(KONKE)"
},
{
"00038622"
,
"3027"
,
"肖邦系列.白色零火线双路窗帘面板Z3S(KONKE)"
},
{
"00518620"
,
"3037"
,
"肖邦系列.白色10A智能插座Z3S(KONKE)"
},
{
"00518626"
,
"3038"
,
"肖邦系列.白色16A智能插座Z3S(KONKE)"
},
{
"0402002A"
,
"3039"
,
"水浸传感器-HZB30S版(KONKE)"
},
{
"0402002B"
,
"3040"
,
"燃气报警器-HZ3S版(KONKE)"
},
{
"04020028"
,
"3041"
,
"烟雾报警器-HZ3S版(KONKE)"
},
{
"0402010D"
,
"3043"
,
"红外幕帘探测器HZ3S版(KONKE)"
},
{
"03020001"
,
"3076"
,
"环境传感器KZ3S(KONKE)"
},
{
"00510001"
,
"3046"
,
"KIT系列.白色快捷情景按钮"
},
{
"03020000"
,
"3048"
,
"KIT系列.白色温湿度传感器"
},
{
"0402000D"
,
"3049"
,
"KIT系列.白色人体传感器"
},
{
"04020015"
,
"3050"
,
"KIT系列.白色门窗传感器"
},
{
"04021015"
,
"3051"
,
"邦德系列.白色门窗传感器(KONKE)"
},
{
"0402102C"
,
"3054"
,
"邦德系列.白色SOS按钮(KONKE)"
},
{
"0402102A"
,
"3055"
,
"邦德系列.白色水浸传感器(KONKE)"
},
{
"00040002"
,
"3056"
,
"邦德系列.白色快捷按键(KONKE)"
},
{
"04031225"
,
"3057"
,
"邦德系列.白色声光传感器(KONKE)"
},
{
"02020000"
,
"3067"
,
"智能窗帘电机Z3S(KONKE_杜亚款)"
},
{
"02020001"
,
"3068"
,
"威刚系列.智能窗帘电机Z3S(KONKE_威士达款)"
},
{
"01000002"
,
"3069"
,
"双路智能灯控模块Z3S(KONKE)"
},
{
"04028301"
,
"3070"
,
"传感器模块Z3S(KONKE)"
},
{
"03300001"
,
"3071"
,
"智能水阀控制器Z3S(KONKE)"
},
{
"03310001"
,
"3072"
,
"智能燃气机械臂控制器Z3S(KONKE)"
},
{
"01020001"
,
"3073"
,
"幻彩灯带控制器Z3S(KONKE)"
},
{
"00648631"
,
"3077"
,
"多功能面板(亚运村临时项目)"
},
{
NULL
,
NULL
,
NULL
}
{
NULL
,
NULL
,
NULL
}
};
};
#else
#else
kk_product_code_s
kk_product_code
[]
=
{
kk_product_code_s
kk_product_code
[]
=
{
{
_2EP_ZERO_FIRE_LIGHTING_MODULE_CODE
,
NULL
},
{
"00068611"
,
"3001"
},
//"星辰系列.白色零火线单路灯控面板Z3S(KONKE)"
{
DOOYA_CURTAIN_MOTOR_CODE
,
DOOYA_CURTAIN_MOTOR_MODEL_ID
},
{
"00068612"
,
"3002"
},
//"星辰系列.白色零火线双路灯控面板Z3S(KONKE)"
{
_1EP_ZERO_FIRE_PANEL_CODE
,
NULL
},
{
"00068613"
,
"3003"
},
//"星辰系列.白色零火线三路灯控面板Z3S(KONKE)"
{
_2EP_ZERO_FIRE_PANEL_CODE
,
NULL
},
{
"00048611"
,
"3004"
},
//"星辰系列.白色零火线情景面板Z3S(KONKE)"
{
_3EP_ZERO_FIRE_PANEL_CODE
,
NULL
},
{
"00038611"
,
"3005"
},
//"星辰系列.白色零火线单路窗帘面板Z3S(KONKE)"
{
ADJUSTABLE_LIGHT_KNOB_PANEL_CODE
,
NULL
},
{
"00038612"
,
"3006"
},
//"星辰系列.白色零火线双路窗帘面板Z3S(KONKE)"
{
CHOPIN_WALL_OUTLET_10A_CODE
,
CHOPIN_WALL_OUTLET_10A_CODE_NAME_MODEL_ID
},
{
"00038613"
,
"3007"
},
//"星辰系列·白色干触点单路窗帘面板Z3S(KONKE)"
{
CHOPIN_WALL_OUTLET_16A_CODE
,
CHOPIN_WALL_OUTLET_16A_CODE_NAME_MODEL_ID
},
{
"00038614"
,
"3008"
},
//"星辰系列·白色干触点双路窗帘面板Z3S(KONKE)"
{
_1EP_STARS_ZERO_FIRE_PANEL_CODE
,
_1EP_STARS_ZERO_FIRE_PANEL_MODEL_ID
},
{
"00068601"
,
"3009"
},
//"铂金系列.白色零火线单路灯控面板Z3S(KONKE)"
{
_2EP_STARS_ZERO_FIRE_PANEL_CODE
,
_2EP_STARS_ZERO_FIRE_PANEL_MODEL_ID
},
{
"00068602"
,
"3010"
},
//"铂金系列.白色零火线双路灯控面板Z3S(KONKE)"
{
_3EP_STARS_ZERO_FIRE_PANEL_CODE
,
_3EP_STARS_ZERO_FIRE_PANEL_MODEL_ID
},
{
"00068603"
,
"3011"
},
//"铂金系列.白色零火线三路灯控面板Z3S(KONKE)"
{
_1EP_CHOPIN_ZERO_FIRE_PANEL_CODE
,
_1EP_CHOPIN_ZERO_FIRE_PANEL_MODEL_ID
},
{
"00038601"
,
"3012"
},
//"铂金系列.白色零火线窗帘面板Z3S(KONKE)"
{
_2EP_CHOPIN_ZERO_FIRE_PANEL_CODE
,
_2EP_CHOPIN_ZERO_FIRE_PANEL_MODEL_ID
},
{
"00048601"
,
"3013"
},
//"铂金系列.白色零火线情景面板Z3S(KONKE)"
{
_3EP_CHOPIN_ZERO_FIRE_PANEL_CODE
,
_3EP_CHOPIN_ZERO_FIRE_PANEL_MODEL_ID
},
{
"00048602"
,
"3014"
},
//"铂金系列.白色快捷面板Z3S(KONKE)"
{
_1EP_CHOPIN_CURTAIN_MOTOR_CODE
,
_1EP_CHOPIN_CURTAIN_MOTOR_MODEL_ID
},
{
"0402802C"
,
"3015"
},
//"铂金系列.白色零火线SOS紧急呼叫面板Z3S(KONKE)"
{
_2EP_CHOPIN_CURTAIN_MOTOR_CODE
,
_2EP_CHOPIN_CURTAIN_MOTOR_MODEL_ID
},
{
"0402812C"
,
"3016"
},
//"铂金系列.白色紧急呼叫按钮Z3S(KONKE)"
{
_1EP_PLATINUM_SWITCH_CODE
,
_1EP_PLATINUM_SWITCH_MODEL_ID
},
{
"00038603"
,
"3017"
},
//"铂金系列.白色零火线推窗器面板Z3S(KONKE)"
{
_2EP_PLATINUM_SWITCH_CODE
,
_2EP_PLATINUM_SWITCH_MODEL_ID
},
{
"01018601"
,
"3018"
},
//"铂金系列.白色零火线调光面板Z3S(KONKE)"
{
_3EP_PLATINUM_SWITCH_CODE
,
_3EP_PLATINUM_SWITCH_MODEL_ID
},
{
"00518610"
,
"3019"
},
//"铂金系列.白色10A智能插座Z3S(KONKE)"
{
PLATINUM_ACTUATOR_PANEL_CODE
,
NULL
},
{
"00518616"
,
"3020"
},
//"铂金系列.白色16A智能插座Z3S(KONKE)"
{
RGB_LIGHT_CODE
,
RGB_LIGHT_NAME_MODEL_ID
},
{
"00038602"
,
"3021"
},
//"铂金系列·白色干触点窗帘面板Z3S(安心加)"
{
"00068621"
,
"3022"
},
//"肖邦系列.白色零火线单路灯控面板Z3S(KONKE)"
{
"00068622"
,
"3023"
},
//"肖邦系列.白色零火线双路灯控面板Z3S(KONKE)"
{
"00068623"
,
"3024"
},
//"肖邦系列.白色零火线三路灯控面板Z3S(KONKE)"
{
"00048621"
,
"3025"
},
//"肖邦系列.白色零火线情景面板Z3S(KONKE)"
{
"00038621"
,
"3026"
},
//"肖邦系列.白色零火线单路窗帘面板Z3S(KONKE)"
{
"00038622"
,
"3027"
},
//"肖邦系列.白色零火线双路窗帘面板Z3S(KONKE)"
{
"00518620"
,
"3037"
},
//"肖邦系列.白色10A智能插座Z3S(KONKE)"
{
"00518626"
,
"3038"
},
//"肖邦系列.白色16A智能插座Z3S(KONKE)"
{
"0402002A"
,
"3039"
},
//"水浸传感器-HZB30S版(KONKE)"
{
"0402002B"
,
"3040"
},
//"燃气报警器-HZ3S版(KONKE)"
{
"04020028"
,
"3041"
},
//"烟雾报警器-HZ3S版(KONKE)"
{
"0402010D"
,
"3043"
},
//"红外幕帘探测器HZ3S版(KONKE)"
{
"03020001"
,
"3076"
},
//"环境传感器KZ3S(KONKE)"
{
"00510001"
,
"3046"
},
//"KIT系列.白色快捷情景按钮"
{
"03020000"
,
"3048"
},
//"KIT系列.白色温湿度传感器"
{
"0402000D"
,
"3049"
},
//"KIT系列.白色人体传感器"
{
"04020015"
,
"3050"
},
//"KIT系列.白色门窗传感器"
{
"04021015"
,
"3051"
},
//"邦德系列.白色门窗传感器(KONKE)"
{
"0402102C"
,
"3054"
},
//"邦德系列.白色SOS按钮(KONKE)"
{
"0402102A"
,
"3055"
},
//"邦德系列.白色水浸传感器(KONKE)"
{
"00040002"
,
"3056"
},
//"邦德系列.白色快捷按键(KONKE)"
{
"04031225"
,
"3057"
},
//"邦德系列.白色声光传感器(KONKE)"
{
"02020000"
,
"3067"
},
//"智能窗帘电机Z3S(KONKE_杜亚款)"
{
"02020001"
,
"3068"
},
//"威刚系列.智能窗帘电机Z3S(KONKE_威士达款)"
{
"01000002"
,
"3069"
},
//"双路智能灯控模块Z3S(KONKE)"
{
"04028301"
,
"3070"
},
//"传感器模块Z3S(KONKE)"
{
"03300001"
,
"3071"
},
//"智能水阀控制器Z3S(KONKE)"
{
"03310001"
,
"3072"
},
//"智能燃气机械臂控制器Z3S(KONKE)"
{
"01020001"
,
"3073"
},
//"幻彩灯带控制器Z3S(KONKE)"
{
"00648631"
,
"3077"
},
//"多功能面板(亚运村临时项目)"
{
NULL
,
NULL
}
{
NULL
,
NULL
}
};
};
#endif
#endif
int
kk_get_product_code_table_size
(
void
)
{
return
sizeof
(
kk_product_code
)
/
sizeof
(
kk_product_code_s
);
}
\ No newline at end of file
platform/zigbee/app/builder/Z3GatewayHost/ZB/kk_product_code.h
View file @
64166551
...
@@ -9,144 +9,15 @@
...
@@ -9,144 +9,15 @@
#define KK_PRODUCT_CODE_STRING_ENABLE
#define KK_PRODUCT_CODE_STRING_ENABLE
typedef
struct
{
typedef
struct
{
char
*
code
;
char
*
modelId
;
char
*
modelId
;
char
*
code
;
#ifdef KK_PRODUCT_CODE_STRING_ENABLE
#ifdef KK_PRODUCT_CODE_STRING_ENABLE
char
*
name
;
char
*
name
;
#endif
#endif
}
kk_product_code_s
;
}
kk_product_code_s
;
#define _2EP_ZERO_FIRE_LIGHTING_MODULE_CODE "11"
#define DOOYA_CURTAIN_MOTOR_CODE "24"
#define _1EP_ZERO_FIRE_PANEL_CODE "83"
#define _2EP_ZERO_FIRE_PANEL_CODE "84"
#define _3EP_ZERO_FIRE_PANEL_CODE "85"
#define ADJUSTABLE_LIGHT_KNOB_PANEL_CODE "89"
#define CHOPIN_WALL_OUTLET_10A_CODE "90"
#define CHOPIN_WALL_OUTLET_16A_CODE "91"
#define _1EP_STARS_ZERO_FIRE_PANEL_CODE "96"
#define _2EP_STARS_ZERO_FIRE_PANEL_CODE "97"
#define _3EP_STARS_ZERO_FIRE_PANEL_CODE "98"
#define _1EP_CHOPIN_ZERO_FIRE_PANEL_CODE "102"
#define _2EP_CHOPIN_ZERO_FIRE_PANEL_CODE "103"
#define _3EP_CHOPIN_ZERO_FIRE_PANEL_CODE "104"
#define _1EP_CHOPIN_CURTAIN_MOTOR_CODE "105"
#define _2EP_CHOPIN_CURTAIN_MOTOR_CODE "106"
#define _1EP_PLATINUM_SWITCH_CODE "1002"
#define _2EP_PLATINUM_SWITCH_CODE "1003"
#define _3EP_PLATINUM_SWITCH_CODE "1004"
#define PLATINUM_ACTUATOR_PANEL_CODE "1007"
#define RGB_LIGHT_CODE "1022"
#define DOOYA_CURTAIN_MOTOR_MODEL_ID "02020000"
#define CHOPIN_WALL_OUTLET_10A_CODE_NAME_MODEL_ID "00518620"
#define CHOPIN_WALL_OUTLET_16A_CODE_NAME_MODEL_ID "00518626"
#define _1EP_STARS_ZERO_FIRE_PANEL_MODEL_ID "00068611"
#define _2EP_STARS_ZERO_FIRE_PANEL_MODEL_ID "00068612"
#define _3EP_STARS_ZERO_FIRE_PANEL_MODEL_ID "00068613"
#define _1EP_PLATINUM_SWITCH_MODEL_ID "00068601"
#define _2EP_PLATINUM_SWITCH_MODEL_ID "00068602"
#define _3EP_PLATINUM_SWITCH_MODEL_ID "00068603"
#define PLATINUM_ACTUATOR_PANEL_NAME_MODEL_ID "00038603"
#define RGB_LIGHT_NAME_MODEL_ID "01020001"
#define _1EP_CHOPIN_ZERO_FIRE_PANEL_MODEL_ID "00068621"
#define _2EP_CHOPIN_ZERO_FIRE_PANEL_MODEL_ID "00068622"
#define _3EP_CHOPIN_ZERO_FIRE_PANEL_MODEL_ID "00068623"
#define _1EP_CHOPIN_CURTAIN_MOTOR_MODEL_ID "00038621"
#define _2EP_CHOPIN_CURTAIN_MOTOR_MODEL_ID "00038622"
#ifdef KK_PRODUCT_CODE_STRING_ENABLE
#define _2EP_ZERO_FIRE_LIGHTING_MODULE_NAME "两路零火灯光模块"
#define DOOYA_CURTAIN_MOTOR_NAME "智能窗帘电机(杜亚)"
#define _1EP_ZERO_FIRE_PANEL_NAME "一路零火面板(肖邦系列)"
#define _2EP_ZERO_FIRE_PANEL_NAME "两路零火面板(肖邦系列)"
#define _3EP_ZERO_FIRE_PANE_NAME "三路零火面板(肖邦系列)"
#define ADJUSTABLE_LIGHT_KNOB_PANEL_NAME "可调光旋钮面板(肖邦系列)"
#define CHOPIN_WALL_OUTLET_10A_CODE_NAME "入墙插座10A(肖邦系列)"
#define CHOPIN_WALL_OUTLET_16A_CODE_NAME "入墙插座16A(肖邦系列)"
#define _1EP_STARS_ZERO_FIRE_PANEL_NAME "星辰一路零火面板"
#define _2EP_STARS_ZERO_FIRE_PANEL_NAME "星辰两路零火面板"
#define _3EP_STARS_ZERO_FIRE_PANEL_NAME "星辰三路零火面板"
#define _1EP_CHOPIN_ZERO_FIRE_PANEL_NAME "一路零火面板(肖邦系列)定制版"
#define _2EP_CHOPIN_ZERO_FIRE_PANEL_NAME "两路零火面板(肖邦系列)定制版"
#define _3EP_CHOPIN_ZERO_FIRE_PANEL_NAME "三路零火面板(肖邦系列)定制版"
#define _1EP_CHOPIN_CURTAIN_MOTOR_NAME "一路窗帘面板(肖邦系列)定制版"
#define _2EP_CHOPIN_CURTAIN_MOTOR_NAME "两路窗帘面板(肖邦系列)定制版"
#define _1EP_PLATINUM_SWITCH_NAME "铂金系列一路灯控"
#define _2EP_PLATINUM_SWITCH_NAME "铂金系列两路灯控"
#define _3EP_PLATINUM_SWITCH_NAME "铂金系列三路灯控"
#define PLATINUM_ACTUATOR_PANEL_NAME "铂金系列推窗面板"
#define RGB_LIGHT_NAME "RGBW灯带"
#endif
/*
Z3D_IASZONE = 0x04020000, // IAS Zone 设备ID,不表示具体设备
Z3D_IASWD = 0x04030000, // IAS WD 设备ID,不表示具体设备
// 高级别状态指示类设备,APP客户端中显示状态需要和设备实际状态保持高度一致!状态上报不允许丢失,所以需要尝试多次上报!
Z3D_SMARTPLUG = 0x00510000, // 智能插座插座
Z3D_IAS_CONTACT_SWITCH = 0x04020015, // 门磁: IAS Zone device id + device type
Z3D_IAS_FIRE_SENSOR = 0x04020028, // 烟雾传感器: IAS Zone device id + device type
Z3D_IAS_WATER_SENSOR = 0x0402002A, // 水浸传感器: IAS Zone device id + device type
Z3D_IAS_GAS_SENSOR = 0x0402002B, // 气体传感器: IAS Zone device id + device type
Z3D_IAS_WD = 0x04030225, // 标准报警器(声光报警等): IAS WD device id + device type[in IAS Zone]
Z3D_WINDOW_COVERING = 0x02020000, // 窗帘电机(杜亚)
// Serial - 铂金
Z3D_BJSP_S1G = 0x00068601, // 铂金开关面板1路
Z3D_BJSP_S2G = 0x00068602, // 铂金开关面板2路
Z3D_BJSP_S3G = 0x00068603, // 铂金开关面板3路
Z3D_BJPP_C20 = 0x00518610, // 铂金墙插面板10A
Z3D_BJPP_C26 = 0x00518616, // 铂金墙插面板16A
Z3D_BJCP_S1G = 0x00038601, // 铂金窗帘面板1路
Z3D_BJOWP_S1G = 0x00038603, // 铂金一路推窗器面板
Z3D_BJDLP_S1G = 0x01018601, // 铂金调光面板
Z3D_BJSCP_S3G = 0x00048601, // 铂金情景面板(3路)
Z3D_BJQKP_S3G = 0x00048602, // 铂金快捷面板(3路)
Z3D_BJSOS_PANEL = 0X0402802C, // 铂金SOS面板(零火线)
Z3D_BJSOS_BUTTON= 0X0402812C, // 铂金SOS按钮(电池)
// Serial - 星辰
Z3D_XCSP_S1G = 0x00068611, // 星辰开关面板1路
Z3D_XCSP_S2G = 0x00068612, // 星辰开关面板2路
Z3D_XCSP_S3G = 0x00068613, // 星辰开关面板3路
Z3D_XCCP_S1G = 0x00038611, // 星辰窗帘面板1路
Z3D_XCCP_S2G = 0x00038612, // 星辰窗帘面板2路
Z3D_XCSCP_S4G = 0x00048611, // 星辰情景面板(4路)
// Serial - 肖邦
Z3D_XBSP_S1G = 0x00068621, // 肖邦开关面板1路
Z3D_XBSP_S2G = 0x00068622, // 肖邦开关面板2路
Z3D_XBSP_S3G = 0x00068623, // 肖邦开关面板3路
Z3D_XBPP_D20 = 0x00518620, // 肖邦墙插面板10A
Z3D_XBPP_D26 = 0x00518626, // 肖邦墙插面板16A
Z3D_XBCP_S1G = 0x00038621, // 肖邦窗帘面板1路
Z3D_XBCP_S2G = 0x00038622, // 肖邦窗帘面板2路
Z3D_XBSCP_S4G = 0x00048621, // 肖邦情景面板(4路)
Z3D_LMCW_LOCK0 = 0x01018000, // 创维门锁不带指纹
Z3D_LMCW_LOCK1 = 0x01018001, // 创维门锁带指纹
// 低等级状态指示类设备,APP客户端中仅记录历史状态,状态上报允许存在丢失
Z3D_ENVI_SENSOR = 0x03020000, // 温度传感器: Temperature device id + model id,注意控客环境同时存在温度和湿度,为了兼容其他厂家仅有温度的传感,这里设备类型仅使用温度device_id+model_id来确定!
// 动作触发类设备,APP客户端中仅记录历史操作,动作触发上报为实时,且允许存在丢失
Z3D_SWITCH = 0x00510001, // 快捷按钮
Z3D_IAS_MOTION_SENSOR = 0x0402000D, // 移动传感器: IAS Zone device id + device type
Z3D_UNKNOW = 0xFFFFFFFF, // 未知类型
*/
int
kk_get_product_code_table_size
(
void
);
extern
kk_product_code_s
kk_product_code
[];
extern
kk_product_code_s
kk_product_code
[];
...
@@ -173,6 +44,7 @@ extern kk_product_code_s kk_product_code[];
...
@@ -173,6 +44,7 @@ extern kk_product_code_s kk_product_code[];
#endif
#endif
...
...
platform/zigbee/app/builder/Z3GatewayHost/kk_test.c
View file @
64166551
...
@@ -103,22 +103,23 @@ int kk_sendData2CCU(char* data, int len){
...
@@ -103,22 +103,23 @@ int kk_sendData2CCU(char* data, int len){
void
kk_rpc_reportDevices
(
EmberEUI64
mac
)
void
kk_rpc_reportDevices
(
EmberEUI64
mac
,
const
char
*
productCode
)
{
{
cJSON
*
devicesJson
;
cJSON
*
devicesJson
;
EmberEUI64
eui64
;
emberAfGetEui64
(
eui64
);
char
macString
[
19
]
=
{
0
};
char
macString
[
19
]
=
{
0
};
UTIL_LOG_WARNING
(
"report tsl product code:%s
\n
"
,
productCode
);
emberAfPrintBigEndianEui64
(
mac
);
emberAfDebugPrintln
(
""
);
devicesJson
=
rpc_cJSON_CreateObject
();
devicesJson
=
rpc_cJSON_CreateObject
();
rpc_eui64ToString
(
mac
,
macString
);
rpc_eui64ToString
(
mac
,
macString
);
rpc_cJSON_AddStringToObject
(
devicesJson
,
"productCode"
,
TEST_PRODUCT_CODE
);
rpc_cJSON_AddStringToObject
(
devicesJson
,
"productCode"
,
productCode
);
rpc_cJSON_AddStringToObject
(
devicesJson
,
"deviceCode"
,
macString
);
rpc_cJSON_AddStringToObject
(
devicesJson
,
"deviceCode"
,
macString
);
rpc_cJSON_AddStringToObject
(
devicesJson
,
"mac"
,
macString
);
rpc_cJSON_AddStringToObject
(
devicesJson
,
"mac"
,
macString
);
//
//
kk_sub_tsl_add
(
mac
,
TEST_PRODUCT_CODE
);
kk_sub_tsl_add
(
mac
,
productCode
);
kk_rpc_report_devices
(
devicesJson
,
eui64
);
kk_rpc_report_devices
(
devicesJson
,
mac
);
}
}
...
@@ -555,35 +556,34 @@ error_return:
...
@@ -555,35 +556,34 @@ error_return:
void
emberAfPluginDeviceTableNewDeviceCallback
(
EmberEUI64
nodeEui64
)
{
uint16_t
deviceTableIndex
=
emberAfDeviceTableGetFirstIndexFromEui64
(
nodeEui64
);
if
(
deviceTableIndex
==
0xffff
){
kk_print_info
(
"not find item!"
);
return
;
}
EmberAfPluginDeviceTableEntry
*
deviceTable
=
emberAfDeviceTablePointer
();
//cJSON* nodeJson = rpc_reportDeviceState("joined",deviceTable[deviceTableIndex].eui64);
//rpc_printfJSON("joined",nodeJson);
//rpc_send_message(nodeJson,"device joined");
//rpc_add_device(deviceTable[deviceTableIndex].nodeId);
//kk_report_device_s device;
#define KK_NETWORK_PARAMETER_TX_POWER 10
//device.mac = nodeEui64;
#define KK_NETWORK_PARAMETER_CHANNEL 0x0B
//device.AppVersion = 0x10;
void
kk_network_check
(
void
)
//memcpy(device.mac,nodeEui64,EUI64_SIZE);
{
kk_rpc_reportDevices
(
deviceTable
[
deviceTableIndex
].
eui64
);
EmberEUI64
eui64
;
EmberPanId
panId
;
EmberStatus
status
;
if
(
ezspNetworkState
()
!=
EMBER_JOINED_NETWORK
){
emberAfGetEui64
(
eui64
);
panId
=
HIGH_LOW_TO_INT
(
eui64
[
1
],
eui64
[
0
]);
status
=
kk_network_form
(
true
,
panId
,
KK_NETWORK_PARAMETER_TX_POWER
,
KK_NETWORK_PARAMETER_CHANNEL
);
if
(
status
==
EMBER_SUCCESS
){
emberAfAppPrintln
(
"network form success~~~~~~"
);
}
else
{
emberAfAppPrintln
(
"network form fail!!!,status=0x%x"
,
status
);
}
}
else
{
kk_print_network_info
();
}
}
}
int
kk_report_global_onoff_attribute
(
EmberEUI64
eui64
,
uint8_t
EP
,
EmberAfClusterId
clusterId
,
EmberAfAttributeId
attributeId
,
uint8_t
dataType
,
uint8_t
len
,
uint8_t
*
data
)
int
kk_report_global_onoff_attribute
(
EmberEUI64
eui64
,
uint8_t
EP
,
EmberAfClusterId
clusterId
,
EmberAfAttributeId
attributeId
,
uint8_t
dataType
,
uint8_t
len
,
uint8_t
*
data
)
{
{
emberAfAppPrintln
(
"kk_report_global_onoff_attribute"
);
emberAfAppPrintln
(
"kk_report_global_onoff_attribute"
);
...
@@ -643,14 +643,21 @@ int kk_report_windowCovering_position_attribute(EmberEUI64 eui64,uint8_t EP,Embe
...
@@ -643,14 +643,21 @@ int kk_report_windowCovering_position_attribute(EmberEUI64 eui64,uint8_t EP,Embe
return
-
3
;
return
-
3
;
}
}
void
emberAfMainTickCallback
(
void
)
void
emberAfMainTickCallback
(
void
)
{
{
static
int
last_time
;
static
int
last_time
;
int
time
=
halCommonGetInt32uMillisecondTick
();
int
time
=
halCommonGetInt32uMillisecondTick
();
if
((
time
-
last_time
)
>=
3
000
){
if
((
time
-
last_time
)
>=
1
000
){
last_time
=
time
;
last_time
=
time
;
//printf("loop 3 test!\n");
kk_productCode_tick
();
//printf("kk_productCode_tick!\n");
}
}
}
}
...
...
platform/zigbee/app/builder/Z3GatewayHost/kk_test.h
View file @
64166551
...
@@ -7,6 +7,7 @@
...
@@ -7,6 +7,7 @@
#include "com_api.h"
#include "com_api.h"
#include "zb_device_id.h"
#include "zb_device_id.h"
#include "kk_device_manager.h"
#include "kk_device_manager.h"
#include "kk_zigbee_api.h"
#define KK_REPORT_DEVICE_JOINED_TYPE "/thing/topo/add"
#define KK_REPORT_DEVICE_JOINED_TYPE "/thing/topo/add"
#define KK_REPORT_DEVICE_LEFT_TYPE "/thing/topo/delete"
#define KK_REPORT_DEVICE_LEFT_TYPE "/thing/topo/delete"
...
...
platform/zigbee/app/builder/Z3GatewayHost/kk_tsl_zigbee_map.c
View file @
64166551
#include "kk_tsl_zigbee_map.h"
#include "kk_tsl_zigbee_map.h"
#include "kk_test.h"
#include "kk_test.h"
#include "kk_product_code.h"
kk_tsl_zigbee_map_t
g_tsl_zigbee_map
[]
=
{
kk_tsl_zigbee_map_t
g_tsl_zigbee_map
[]
=
{
...
...
platform/zigbee/app/builder/Z3GatewayHost/rpc_api/inc/rpc_interface_parse.h
View file @
64166551
...
@@ -15,6 +15,7 @@ void ipcHandle(void);
...
@@ -15,6 +15,7 @@ void ipcHandle(void);
void
rpc_reportDevices
(
void
);
void
rpc_reportDevices
(
void
);
void
rpc_control_devices
(
cJSON
*
data
,
char
*
method
);
void
rpc_control_devices
(
cJSON
*
data
,
char
*
method
);
cJSON
*
rpc_reportDeviceState
(
char
*
state
,
EmberEUI64
eui64
);
...
...
platform/zigbee/app/builder/Z3GatewayHost/rpc_api/src/rpc_interface_parse.c
View file @
64166551
...
@@ -266,21 +266,7 @@ int _init_param(struct jrpc_server *server) {
...
@@ -266,21 +266,7 @@ int _init_param(struct jrpc_server *server) {
return
0
;
return
0
;
}
}
char
g_mac
[
19
]
=
{
0
};
char
*
kk_get_gw_mac
(){
int
cnt
=
0
;
EmberEUI64
eui64
;
emberAfGetEui64
(
eui64
);
while
(
eui64
[
0
]
==
0
&&
eui64
[
1
]
==
0
&&
eui64
[
2
]
==
0
&&
cnt
++
<
3
){
sleep
(
1
);
}
if
(
eui64
[
0
]
==
0
&&
eui64
[
1
]
==
0
&&
eui64
[
2
]
==
0
){
printf
(
"get gw mac error !!!
\n
"
);
return
NULL
;
}
rpc_eui64ToString
(
eui64
,
g_mac
);
return
g_mac
;
}
int
search_ccu
(
char
devcode
[
33
],
char
ip
[
16
],
int
*
port
){
int
search_ccu
(
char
devcode
[
33
],
char
ip
[
16
],
int
*
port
){
...
@@ -297,13 +283,7 @@ int search_ccu(char devcode[33], char ip[16], int* port){
...
@@ -297,13 +283,7 @@ int search_ccu(char devcode[33], char ip[16], int* port){
struct
sockaddr_in
Addrto
;
struct
sockaddr_in
Addrto
;
struct
sockaddr_in
AddrRev
;
struct
sockaddr_in
AddrRev
;
char
*
macString
=
kk_get_gw_mac
();
sprintf
(
sendMessage
,
sendCmdFmt
,
GW_DEVICE_CODE
,
GW2CCU_PROTOCOL
);
if
(
macString
==
NULL
){
printf
(
"[%s] get mac fail
\n
"
,
__FUNCTION__
);
return
-
1
;
}
sprintf
(
sendMessage
,
sendCmdFmt
,
macString
/*GW_DEVICE_CODE*/
,
GW2CCU_PROTOCOL
);
if
((
sock
=
socket
(
AF_INET
,
SOCK_DGRAM
,
0
))
==
-
1
)
if
((
sock
=
socket
(
AF_INET
,
SOCK_DGRAM
,
0
))
==
-
1
)
{
{
printf
(
"[%s] socket fail
\n
"
,
__FUNCTION__
);
printf
(
"[%s] socket fail
\n
"
,
__FUNCTION__
);
...
@@ -451,12 +431,7 @@ void* _msg_topo_add(){
...
@@ -451,12 +431,7 @@ void* _msg_topo_add(){
char
msgFmt
[]
=
"{
\"
info
\"
:{
\"
msgtype
\"
:
\"
/thing/topo/add
\"
,
\"
productCode
\"
:
\"
%s
\"
,
\"
deviceCode
\"
:
\"
%s
\"
},\
char
msgFmt
[]
=
"{
\"
info
\"
:{
\"
msgtype
\"
:
\"
/thing/topo/add
\"
,
\"
productCode
\"
:
\"
%s
\"
,
\"
deviceCode
\"
:
\"
%s
\"
},\
\"
payload
\"
:{
\"
msgId
\"
:
\"
%d
\"
,
\"
version
\"
:
\"
1.0
\"
,
\"
params
\"
:{
\"
deviceCode
\"
:
\"
%s
\"
,
\"
productCode
\"
:
\"
%s
\"
,
\"
mac
\"
:
\"
%s
\"
}}}"
;
\"
payload
\"
:{
\"
msgId
\"
:
\"
%d
\"
,
\"
version
\"
:
\"
1.0
\"
,
\"
params
\"
:{
\"
deviceCode
\"
:
\"
%s
\"
,
\"
productCode
\"
:
\"
%s
\"
,
\"
mac
\"
:
\"
%s
\"
}}}"
;
char
msg
[
520
]
=
{
0
};
char
msg
[
520
]
=
{
0
};
char
*
macString
=
kk_get_gw_mac
();
sprintf
(
msg
,
msgFmt
,
GW_PRODUCT_CODE
,
GW_DEVICE_CODE
,
1
,
GW_DEVICE_CODE
,
GW_PRODUCT_CODE
,
GW_MAC
);
if
(
macString
==
NULL
){
printf
(
"[%s] get mac fail
\n
"
,
__FUNCTION__
);
return
NULL
;
}
sprintf
(
msg
,
msgFmt
,
GW_PRODUCT_CODE
,
macString
,
1
,
macString
/*GW_DEVICE_CODE*/
,
GW_PRODUCT_CODE
,
macString
);
cJSON
*
msgObj
=
cJSON_Parse
(
msg
);
cJSON
*
msgObj
=
cJSON_Parse
(
msg
);
char
*
outbuf
=
cJSON_Print
(
msgObj
);
char
*
outbuf
=
cJSON_Print
(
msgObj
);
cJSON_Delete
(
msgObj
);
cJSON_Delete
(
msgObj
);
...
@@ -472,14 +447,8 @@ void* _msg_event_property_post(char ip[16], int port){
...
@@ -472,14 +447,8 @@ void* _msg_event_property_post(char ip[16], int port){
\"
time
\"
:1524448722000,
\"
method
\"
:
\"
thing.event.property.post
\"
}\
\"
time
\"
:1524448722000,
\"
method
\"
:
\"
thing.event.property.post
\"
}\
}"
;
}"
;
char
msg
[
620
]
=
{
0
};
char
msg
[
620
]
=
{
0
};
char
*
macString
=
kk_get_gw_mac
();
sprintf
(
msg
,
msgFmt
,
GW_PRODUCT_CODE
,
GW_DEVICE_CODE
,
if
(
macString
==
NULL
){
1
,
0
,
0
,
0
,
"12345"
,
ip
,
GW_MAC
,
port
);
printf
(
"[%s] get mac fail
\n
"
,
__FUNCTION__
);
return
NULL
;
}
sprintf
(
msg
,
msgFmt
,
GW_PRODUCT_CODE
,
macString
/*GW_DEVICE_CODE*/
,
1
,
0
,
0
,
0
,
"12345"
,
ip
,
macString
,
port
);
cJSON
*
msgObj
=
cJSON_Parse
(
msg
);
cJSON
*
msgObj
=
cJSON_Parse
(
msg
);
char
*
outbuf
=
cJSON_Print
(
msgObj
);
char
*
outbuf
=
cJSON_Print
(
msgObj
);
cJSON_Delete
(
msgObj
);
cJSON_Delete
(
msgObj
);
...
@@ -495,16 +464,11 @@ void ipcHandle(void)
...
@@ -495,16 +464,11 @@ void ipcHandle(void)
int
port
=
0
;
int
port
=
0
;
emberAfAppPrint
(
"Thread rpc Interface Parse create
\n
"
);
emberAfAppPrint
(
"Thread rpc Interface Parse create
\n
"
);
search_ccu
(
deviceCode
,
ip
,
&
port
);
search_ccu
(
deviceCode
,
ip
,
&
port
);
char
*
macString
=
kk_get_gw_mac
();
if
(
macString
==
NULL
){
printf
(
"[%s] get mac fail, exit pthread !!!!!!!!!!!!!!!!!
\n
"
,
__FUNCTION__
);
return
;
}
_init_param
(
&
my_server
);
_init_param
(
&
my_server
);
if
(
strcmp
(
GW2CCU_PROTOCOL
,
"tcp"
)
==
0
){
if
(
strcmp
(
GW2CCU_PROTOCOL
,
"tcp"
)
==
0
){
kk_tcp_client_init
(
ip
,
port
,
_cb
);
kk_tcp_client_init
(
ip
,
port
,
_cb
);
}
else
{
}
else
{
kk_ipc_init
(
IPC_PLAT2MID
,
_cb
,
macString
/*GW_DEVICE_CODE*/
,
ip
);
kk_ipc_init
(
IPC_PLAT2MID
,
_cb
,
GW_DEVICE_CODE
,
ip
);
}
}
emberAfAppPrint
(
"sizeof(rpc_table)=%d,sizeof(rpc_table_s)=%d,%d
\n
"
,
sizeof
(
rpc_table
),
sizeof
(
rpc_table_s
),
sizeof
(
rpc_table
)
/
sizeof
(
rpc_table_s
));
emberAfAppPrint
(
"sizeof(rpc_table)=%d,sizeof(rpc_table_s)=%d,%d
\n
"
,
sizeof
(
rpc_table
),
sizeof
(
rpc_table_s
),
sizeof
(
rpc_table
)
/
sizeof
(
rpc_table_s
));
...
@@ -515,11 +479,6 @@ void ipcHandle(void)
...
@@ -515,11 +479,6 @@ void ipcHandle(void)
//send add gw to ccu
//send add gw to ccu
char
*
outbuf
=
_msg_topo_add
();
char
*
outbuf
=
_msg_topo_add
();
if
(
outbuf
==
NULL
){
printf
(
"[%s] topo add msg failed, exit
\n
"
,
__FUNCTION__
);
return
;
}
if
(
strcmp
(
GW2CCU_PROTOCOL
,
"tcp"
)
!=
0
){
if
(
strcmp
(
GW2CCU_PROTOCOL
,
"tcp"
)
!=
0
){
printf
(
"check nanomsg is connect(%d)
\n
"
,
kk_ipc_isconnect
(
IPC_PLAT2MID
));
printf
(
"check nanomsg is connect(%d)
\n
"
,
kk_ipc_isconnect
(
IPC_PLAT2MID
));
}
}
...
@@ -534,14 +493,7 @@ void ipcHandle(void)
...
@@ -534,14 +493,7 @@ void ipcHandle(void)
cnt
++
;
cnt
++
;
if
(
cnt
==
2
){
if
(
cnt
==
2
){
sleep
(
1
);
sleep
(
1
);
char
gwIp
[
17
]
=
{
0
};
char
*
postmsg
=
_msg_event_property_post
(
ip
,
port
);
HAL_Get_IP
(
gwIp
,
NULL
);
char
*
postmsg
=
_msg_event_property_post
(
gwIp
,
port
);
if
(
outbuf
==
NULL
){
printf
(
"[%s] property_post msg failed
\n
"
,
__FUNCTION__
);
continue
;
}
kk_sendData2CCU
(
postmsg
,
strlen
(
postmsg
));
kk_sendData2CCU
(
postmsg
,
strlen
(
postmsg
));
free
(
postmsg
);
free
(
postmsg
);
}
}
...
@@ -701,6 +653,7 @@ bool rpc_ReadAttributesResponseCallback(EmberAfClusterId clusterId,
...
@@ -701,6 +653,7 @@ bool rpc_ReadAttributesResponseCallback(EmberAfClusterId clusterId,
uint8_t
*
bufferTemp
;
uint8_t
*
bufferTemp
;
uint8_t
*
bufferPtr
=
buffer
;
uint8_t
*
bufferPtr
=
buffer
;
uint8_t
i
,
bufferSize
,
typeSize
;
uint8_t
i
,
bufferSize
,
typeSize
;
EmberAfAttributeId
attributeId
;
uint8_t
cnt
=
1
;
uint8_t
cnt
=
1
;
uint8_t
Status
;
uint8_t
Status
;
kk_print_debug
(
"
\n
********************read attributes response callback**********************
\n
"
);
kk_print_debug
(
"
\n
********************read attributes response callback**********************
\n
"
);
...
@@ -735,6 +688,7 @@ bool rpc_ReadAttributesResponseCallback(EmberAfClusterId clusterId,
...
@@ -735,6 +688,7 @@ bool rpc_ReadAttributesResponseCallback(EmberAfClusterId clusterId,
for
(
i
=
0
;
i
<
bufLen
;
)
{
for
(
i
=
0
;
i
<
bufLen
;
)
{
Status
=
bufferPtr
[
2
];
Status
=
bufferPtr
[
2
];
if
(
Status
==
EMBER_ZCL_STATUS_SUCCESS
){
if
(
Status
==
EMBER_ZCL_STATUS_SUCCESS
){
if
(
emberAfIsStringAttributeType
(
bufferPtr
[
3
])){
if
(
emberAfIsStringAttributeType
(
bufferPtr
[
3
])){
bufferSize
=
bufferPtr
[
4
];
bufferSize
=
bufferPtr
[
4
];
...
@@ -760,10 +714,11 @@ bool rpc_ReadAttributesResponseCallback(EmberAfClusterId clusterId,
...
@@ -760,10 +714,11 @@ bool rpc_ReadAttributesResponseCallback(EmberAfClusterId clusterId,
bufferTemp
[
ATTRIBUTE_BUFFER_ATTRIBUTEID_LOW_BITS
],
bufferTemp
[
ATTRIBUTE_BUFFER_ATTRIBUTEID_LOW_BITS
],
bufferTemp
[
ATTRIBUTE_BUFFER_REPORT_DATA_TYPE
]);
bufferTemp
[
ATTRIBUTE_BUFFER_REPORT_DATA_TYPE
]);
attributeId
=
HIGH_LOW_TO_INT
(
bufferTemp
[
ATTRIBUTE_BUFFER_ATTRIBUTEID_HIGH_BITS
],
bufferTemp
[
ATTRIBUTE_BUFFER_ATTRIBUTEID_LOW_BITS
]);
rpc_cJSON_AddStatusToObject
(
item_attr
,
Status
);
rpc_cJSON_AddStatusToObject
(
item_attr
,
Status
);
EmberAfAttributeId
attributeId
=
HIGH_LOW_TO_INT
(
bufferTemp
[
ATTRIBUTE_BUFFER_ATTRIBUTEID_HIGH_BITS
],
bufferTemp
[
ATTRIBUTE_BUFFER_ATTRIBUTEID_LOW_BITS
]);
rpc_cJSON_AddAttributeToObject
(
item_attr
,
attributeId
);
rpc_cJSON_AddAttributeToObject
(
item_attr
,
attributeId
);
rpc_cJSON_AddDataTypeToObject
(
item_attr
,
bufferTemp
[
3
]);
rpc_cJSON_AddDataTypeToObject
(
item_attr
,
bufferTemp
[
3
]);
...
@@ -773,13 +728,28 @@ bool rpc_ReadAttributesResponseCallback(EmberAfClusterId clusterId,
...
@@ -773,13 +728,28 @@ bool rpc_ReadAttributesResponseCallback(EmberAfClusterId clusterId,
uint8_t
*
dataPtr
=
&
bufferTemp
[
ATTRIBUTE_BUFFER_REPORT_DATA_TYPE
+
1
+
1
+
typeSize
];
uint8_t
*
dataPtr
=
&
bufferTemp
[
ATTRIBUTE_BUFFER_REPORT_DATA_TYPE
+
1
+
1
+
typeSize
];
rpc_cJSON_AddDataToObject
(
item_attr
,
dataPtr
,
dataLen
);
rpc_cJSON_AddDataToObject
(
item_attr
,
dataPtr
,
dataLen
);
//rpc_read_response_process_callback(nodeId,ep,clusterId,attributeId,bufferPtr[3],dataLen,dataPtr);
kk_read_attr_response
(
nodeId
,
ep
,
clusterId
,
attributeId
,
EMBER_ZCL_STATUS_SUCCESS
,
bufferPtr
[
3
],
dataLen
,
dataPtr
);
free
(
bufferTemp
);
free
(
bufferTemp
);
}
else
{
}
else
{
rpc_cJSON_AddStatusToObject
(
item_attr
,
Status
);
rpc_cJSON_AddStatusToObject
(
item_attr
,
Status
);
bufferSize
+=
2
;
bufferSize
+=
2
;
emberAfAppPrintln
(
"Status=%d
\n
"
,
Status
);
emberAfAppPrintln
(
"Status=%d
\n
"
,
Status
);
attributeId
=
HIGH_LOW_TO_INT
(
bufferPtr
[
ATTRIBUTE_BUFFER_ATTRIBUTEID_HIGH_BITS
],
bufferPtr
[
ATTRIBUTE_BUFFER_ATTRIBUTEID_LOW_BITS
]);
kk_read_attr_response
(
nodeId
,
ep
,
clusterId
,
attributeId
,
Status
,
0
,
0
,
NULL
);
}
}
i
=
i
+
bufferSize
;
i
=
i
+
bufferSize
;
}
}
...
@@ -791,7 +761,7 @@ bool rpc_ReadAttributesResponseCallback(EmberAfClusterId clusterId,
...
@@ -791,7 +761,7 @@ bool rpc_ReadAttributesResponseCallback(EmberAfClusterId clusterId,
static
cJSON
*
rpc_reportDeviceState
(
char
*
state
,
EmberEUI64
eui64
)
cJSON
*
rpc_reportDeviceState
(
char
*
state
,
EmberEUI64
eui64
)
{
{
char
euiString
[
RPC_EUI64_STRING_LENGTH
]
=
{
0
};
char
euiString
[
RPC_EUI64_STRING_LENGTH
]
=
{
0
};
cJSON
*
stateJSON
;
cJSON
*
stateJSON
;
...
@@ -826,20 +796,7 @@ void emberAfPluginDeviceTableStateChangeCallback(EmberNodeId nodeId,
...
@@ -826,20 +796,7 @@ void emberAfPluginDeviceTableStateChangeCallback(EmberNodeId nodeId,
}
}
void
emberAfPluginDeviceTableRejoinDeviceCallback
(
EmberEUI64
nodeEui64
)
{
uint16_t
deviceTableIndex
=
emberAfDeviceTableGetFirstIndexFromEui64
(
nodeEui64
);
if
(
deviceTableIndex
==
EMBER_AF_PLUGIN_DEVICE_TABLE_NULL_INDEX
){
return
;
}
EmberAfPluginDeviceTableEntry
*
deviceTable
=
emberAfDeviceTablePointer
();
cJSON
*
nodeJson
=
rpc_reportDeviceState
(
"rejoin"
,
deviceTable
[
deviceTableIndex
].
eui64
);
rpc_printfJSON
(
"rejoin"
,
nodeJson
);
//rpc_send_message(nodeJson,"device rejoin");
kk_rpc_reportDevices
(
deviceTable
[
deviceTableIndex
].
eui64
);
}
void
emberAfPluginDeviceTableDeviceLeftCallback
(
EmberEUI64
nodeEui64
)
void
emberAfPluginDeviceTableDeviceLeftCallback
(
EmberEUI64
nodeEui64
)
{
{
...
...
platform/zigbee/app/builder/Z3GatewayHost/rpc_api/src/rpc_onoff.c
View file @
64166551
...
@@ -2,120 +2,6 @@
...
@@ -2,120 +2,6 @@
#include "rpc_onoff.h"
#include "rpc_onoff.h"
EmberStatus
WindowCover_UpOpen
(
uint16_t
node
,
uint8_t
ep
)
{
EmberStatus
status
;
zcl_clu_client_cmd_buffer_setup
(
ZCL_WINDOW_COVERING_CLUSTER_ID
,
ZCL_WINDOW_COVERING_UP_OPEN_COMMAND_ID
);
status
=
rpcSendCommand
(
node
,
1
,
ep
,
false
);
kk_print_debug
(
"[Up/Open]node=0x%02X,ep=%d,status=0x%02X
\n
"
,
node
,
ep
,
status
);
return
status
;
}
EmberStatus
WindowCover_DownClose
(
uint16_t
node
,
uint8_t
ep
)
{
EmberStatus
status
;
zcl_clu_client_cmd_buffer_setup
(
ZCL_WINDOW_COVERING_CLUSTER_ID
,
ZCL_WINDOW_COVERING_DOWN_CLOSE_COMMAND_ID
);
status
=
rpcSendCommand
(
node
,
1
,
ep
,
false
);
kk_print_debug
(
"[Down/Close]node=0x%02X,ep=%d,status=0x%02X
\n
"
,
node
,
ep
,
status
);
return
status
;
}
EmberStatus
WindowCover_Stop
(
uint16_t
node
,
uint8_t
ep
)
{
EmberStatus
status
;
zcl_clu_client_cmd_buffer_setup
(
ZCL_WINDOW_COVERING_CLUSTER_ID
,
ZCL_WINDOW_COVERING_STOP_COMMAND_ID
);
status
=
rpcSendCommand
(
node
,
1
,
ep
,
false
);
kk_print_debug
(
"[Stop]node=0x%02X,ep=%d,status=0x%02X
\n
"
,
node
,
ep
,
status
);
return
status
;
}
EmberStatus
WindowCover_GotoLiftPercentage
(
uint16_t
node
,
uint8_t
ep
,
uint8_t
position
)
{
EmberStatus
status
;
zcl_clu_client_cmd_buffer_setup
(
ZCL_WINDOW_COVERING_CLUSTER_ID
,
ZCL_WINDOW_COVERING_GO_TO_LIFT_PERCENTAGE_COMMAND_ID
);
zclBufferAddByte
(
position
);
status
=
rpcSendCommand
(
node
,
1
,
ep
,
false
);
kk_print_debug
(
"[GotoLiftPercentage]node=0x%02X,ep=%d,status=0x%02X
\n
"
,
node
,
ep
,
status
);
return
status
;
}
EmberStatus
zclOnOff_On
(
uint16_t
node
,
uint8_t
ep
)
{
EmberStatus
status
;
zcl_clu_client_cmd_buffer_setup
(
ZCL_ON_OFF_CLUSTER_ID
,
ZCL_ON_COMMAND_ID
);
status
=
rpcSendCommand
(
node
,
1
,
ep
,
false
);
kk_print_debug
(
"[On]node=0x%02X,ep=%d,status=0x%02X
\n
"
,
node
,
ep
,
status
);
return
status
;
}
EmberStatus
zclOnOff_Off
(
uint16_t
node
,
uint8_t
ep
)
{
EmberStatus
status
;
zcl_clu_client_cmd_buffer_setup
(
ZCL_ON_OFF_CLUSTER_ID
,
ZCL_OFF_COMMAND_ID
);
status
=
rpcSendCommand
(
node
,
1
,
ep
,
false
);
kk_print_debug
(
"[Off]node=0x%02X,ep=%d,status=0x%02X
\n
"
,
node
,
ep
,
status
);
return
status
;
}
EmberStatus
zclOnOff_Toggle
(
uint16_t
node
,
uint8_t
ep
)
{
EmberStatus
status
;
zcl_clu_client_cmd_buffer_setup
(
ZCL_ON_OFF_CLUSTER_ID
,
ZCL_TOGGLE_COMMAND_ID
);
status
=
rpcSendCommand
(
node
,
1
,
ep
,
false
);
kk_print_debug
(
"[Toggle]node=0x%02X,ep=%d,status=0x%02X
\n
"
,
node
,
ep
,
status
);
return
status
;
}
EmberStatus
zclOnOff_OffWithEffect
(
uint16_t
node
,
uint8_t
ep
,
uint8_t
id
,
uint8_t
var
)
{
EmberStatus
status
;
zcl_clu_client_cmd_buffer_setup
(
ZCL_ON_OFF_CLUSTER_ID
,
ZCL_OFF_WITH_EFFECT_COMMAND_ID
);
zclBufferAddByte
(
id
);
zclBufferAddByte
(
var
);
status
=
rpcSendCommand
(
node
,
1
,
ep
,
false
);
kk_print_debug
(
"[off with effect]node=0x%02X,ep=%d,status=0x%02X
\n
"
,
node
,
ep
,
status
);
return
status
;
}
EmberStatus
zclOnOff_OnWithRecallGlobalScene
(
uint16_t
node
,
uint8_t
ep
)
{
EmberStatus
status
;
zcl_clu_client_cmd_buffer_setup
(
ZCL_ON_OFF_CLUSTER_ID
,
ZCL_ON_WITH_RECALL_GLOBAL_SCENE_COMMAND_ID
);
status
=
rpcSendCommand
(
node
,
1
,
ep
,
false
);
kk_print_debug
(
"[On with recall global scene]node=0x%02X,ep=%d,status=0x%02X
\n
"
,
node
,
ep
,
status
);
return
status
;
}
EmberStatus
zclOnOff_OnWithTimedOff
(
uint16_t
node
,
uint8_t
ep
,
uint8_t
Control
,
uint16_t
OnTime
,
uint16_t
OffWaitTime
)
{
EmberStatus
status
;
zcl_clu_client_cmd_buffer_setup
(
ZCL_ON_OFF_CLUSTER_ID
,
ZCL_ON_WITH_TIMED_OFF_COMMAND_ID
);
zclBufferAddByte
(
Control
);
zclBufferAddWord
(
OnTime
);
zclBufferAddWord
(
OffWaitTime
);
status
=
rpcSendCommand
(
node
,
1
,
ep
,
false
);
kk_print_debug
(
"[on with timed off]node=0x%02X,ep=%d,status=0x%02X
\n
"
,
node
,
ep
,
status
);
return
status
;
}
cJSON
*
rpc_zclOnOff_On
(
jrpc_context
*
ctx
,
cJSON
*
params
,
cJSON
*
id
)
cJSON
*
rpc_zclOnOff_On
(
jrpc_context
*
ctx
,
cJSON
*
params
,
cJSON
*
id
)
...
...
platform/zigbee/app/builder/Z3GatewayHost/yjq_ezsp.c
View file @
64166551
...
@@ -87,7 +87,7 @@ void kk_read_ncp_configuration_without_memory_allocation(void)
...
@@ -87,7 +87,7 @@ void kk_read_ncp_configuration_without_memory_allocation(void)
extern
void
kk_print_device_table
(
void
);
extern
void
kk_print_device_table
(
void
);
extern
void
kk_device_table_add
(
EmberEUI64
mac
,
uint8_t
epNum
,
uint8_t
*
epVal
,
char
*
productCode
);
//
extern void kk_device_table_add(EmberEUI64 mac,uint8_t epNum,uint8_t* epVal,char *productCode);
extern
void
kk_device_table_delete
(
EmberEUI64
mac
);
extern
void
kk_device_table_delete
(
EmberEUI64
mac
);
extern
bool
kk_device_find_by_mac11111
(
EmberEUI64
mac
);
extern
bool
kk_device_find_by_mac11111
(
EmberEUI64
mac
);
...
@@ -109,7 +109,7 @@ void kk_message_process(char *messageString)
...
@@ -109,7 +109,7 @@ void kk_message_process(char *messageString)
static
uint8_t
aaa
=
0x00
;
static
uint8_t
aaa
=
0x00
;
EmberEUI64
mac
=
{
0x00
,
0x11
,
0x22
,
0x33
,
0x44
,
0x55
,
0x66
,
0x77
};
EmberEUI64
mac
=
{
0x00
,
0x11
,
0x22
,
0x33
,
0x44
,
0x55
,
0x66
,
0x77
};
mac
[
0
]
=++
aaa
;
mac
[
0
]
=++
aaa
;
kk_device_table_add
(
mac
,
2
,
ep
,
"24"
);
//
kk_device_table_add(mac,2,ep,"24");
}
}
if
(
MEMCOMPARE
(
messageString
,
"AT+456
\r\n
"
,
len
)
==
0
){
if
(
MEMCOMPARE
(
messageString
,
"AT+456
\r\n
"
,
len
)
==
0
){
uint8_t
ep
[
2
]
=
{
1
,
242
};
uint8_t
ep
[
2
]
=
{
1
,
242
};
...
...
platform/zigbee/protocol/zigbee/app/framework/plugin/ias-zone-client/ias-zone-client.c
View file @
64166551
...
@@ -425,6 +425,9 @@ static void checkForIasZoneServer(EmberNodeId emberNodeId, uint8_t* ieeeAddress)
...
@@ -425,6 +425,9 @@ static void checkForIasZoneServer(EmberNodeId emberNodeId, uint8_t* ieeeAddress)
}
}
}
}
extern
void
kk_device_joined
(
EmberNodeId
node
);
void
emberAfPluginIasZoneClientZdoMessageReceivedCallback
(
EmberNodeId
emberNodeId
,
void
emberAfPluginIasZoneClientZdoMessageReceivedCallback
(
EmberNodeId
emberNodeId
,
EmberApsFrame
*
apsFrame
,
EmberApsFrame
*
apsFrame
,
uint8_t
*
message
,
uint8_t
*
message
,
...
...
platform/zigbee/protocol/zigbee/app/framework/util/af-main-host.c
View file @
64166551
...
@@ -542,7 +542,7 @@ int emberAfMain(MAIN_FUNCTION_PARAMETERS)
...
@@ -542,7 +542,7 @@ int emberAfMain(MAIN_FUNCTION_PARAMETERS)
emberAfGetEui64
(
eui64
);
emberAfGetEui64
(
eui64
);
emberAfCorePrintln
(
"~~~~~~~~~~~~~~~~~~~~~NCP MAC:"
);
emberAfCorePrintln
(
"~~~~~~~~~~~~~~~~~~~~~NCP MAC:"
);
emberAfPrintBigEndianEui64
(
eui64
);
emberAfPrintBigEndianEui64
(
eui64
);
//kk_network_check();
pthread_t
tid
;
pthread_t
tid
;
...
@@ -551,22 +551,16 @@ int emberAfMain(MAIN_FUNCTION_PARAMETERS)
...
@@ -551,22 +551,16 @@ int emberAfMain(MAIN_FUNCTION_PARAMETERS)
// initialize the ZCL framework ,(plug in) ,mqtt init is here
// initialize the ZCL framework ,(plug in) ,mqtt init is here
emAfInit
();
emAfInit
();
printf
(
"[%s][%d]
\n
"
,
__FUNCTION__
,
__LINE__
);
COMMAND_READER_INIT
();
COMMAND_READER_INIT
();
printf
(
"[%s][%d]
\n
"
,
__FUNCTION__
,
__LINE__
);
EmberNetworkStatus
Status
=
ezspNetworkState
();
EmberNetworkStatus
Status
=
ezspNetworkState
();
kk_print
(
"ezspNetworkState()~~~~~~[%d]
\r\n
"
,
Status
);
kk_print
(
"ezspNetworkState()~~~~~~[%d]
\r\n
"
,
Status
);
printf
(
"[%s][%d]
\n
"
,
__FUNCTION__
,
__LINE__
);
// main loop
// main loop
while
(
true
)
{
while
(
true
)
{
halResetWatchdog
();
// Periodically reset the watchdog.
halResetWatchdog
();
// Periodically reset the watchdog.
printf
(
"[%s][%d]
\n
"
,
__FUNCTION__
,
__LINE__
);
// see if the NCP has anything waiting to send us
// see if the NCP has anything waiting to send us
ezspTick
();
ezspTick
();
...
...
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