summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 71b07ce)
raw | patch | inline | side by side (parent: 71b07ce)
author | tcave <t-cave@ti.com> | |
Tue, 28 May 2013 12:23:36 +0000 (13:23 +0100) | ||
committer | tcave <t-cave@ti.com> | |
Tue, 28 May 2013 12:23:36 +0000 (13:23 +0100) |
Linux/zllSocCmd.c | patch | blob | history | |
Linux/zllSocCmd.h | patch | blob | history |
diff --git a/Linux/zllSocCmd.c b/Linux/zllSocCmd.c
index 412fb9e19812b71f74699e2a7e9f0ba8e3faaa43..1414fb36c8e6fc35c0335faa91806a350b6c667a 100644 (file)
--- a/Linux/zllSocCmd.c
+++ b/Linux/zllSocCmd.c
@@ -755,6 +755,58 @@ void zllSocRecallScene(uint16_t groupId, uint8_t sceneId, uint16_t dstAddr, uint
tcflush(serialPortFd, TCOFLUSH);
}
+/*********************************************************************
+ * @fn zllSocBind
+ *
+ * @brief Recall Scene.
+ *
+ * @param
+ *
+ * @return none
+ */
+void zllSocBind(uint16_t srcNwkAddr, uint8_t srcEndpoint, uint8_t srcIEEE[8], uint8_t dstEndpoint, uint8_t dstIEEE[8], uint16_t clusterID )
+{
+ uint8_t cmd[] = {
+ 0xFE,
+ 23, /*RPC payload Len */
+ 0x25, /*MT_RPC_CMD_SREQ + MT_RPC_SYS_ZDO */
+ 0x21, /*MT_ZDO_BIND_REQ*/
+ (srcNwkAddr & 0x00ff), /*Src Nwk Addr - To send the bind message to*/
+ (srcNwkAddr & 0xff00) >> 8, /*Src Nwk Addr - To send the bind message to*/
+ srcIEEE[0], /*Src IEEE Addr for the binding*/
+ srcIEEE[1], /*Src IEEE Addr for the binding*/
+ srcIEEE[2], /*Src IEEE Addr for the binding*/
+ srcIEEE[3], /*Src IEEE Addr for the binding*/
+ srcIEEE[4], /*Src IEEE Addr for the binding*/
+ srcIEEE[5], /*Src IEEE Addr for the binding*/
+ srcIEEE[6], /*Src IEEE Addr for the binding*/
+ srcIEEE[7], /*Src IEEE Addr for the binding*/
+ srcEndpoint, /*Src endpoint for the binding*/
+ (clusterID & 0x00ff), /*cluster ID to bind*/
+ (clusterID & 0xff00) >> 8, /*cluster ID to bind*/
+ afAddr64Bit, /*Addr mode of the dst to bind*/
+ dstIEEE[0], /*Dst IEEE Addr for the binding*/
+ dstIEEE[1], /*Dst IEEE Addr for the binding*/
+ dstIEEE[2], /*Dst IEEE Addr for the binding*/
+ dstIEEE[3], /*Dst IEEE Addr for the binding*/
+ dstIEEE[4], /*Dst IEEE Addr for the binding*/
+ dstIEEE[5], /*Dst IEEE Addr for the binding*/
+ dstIEEE[6], /*Dst IEEE Addr for the binding*/
+ dstIEEE[7], /*Dst IEEE Addr for the binding*/
+ dstEndpoint, /*Dst endpoint for the binding*/
+ 0x00 //FCS - fill in later
+ };
+
+ calcFcs(cmd, sizeof(cmd));
+
+ printf("zllSocBind: srcNwkAddr=0x%x, srcEndpoint=0x%x, srcIEEE=0x%x:%x:%x:%x:%x:%x:%x:%x, dstEndpoint=0x%x, dstIEEE=0x%x:%x:%x:%x:%x:%x:%x:%x, clusterID:%x\n",
+ srcNwkAddr, srcEndpoint, srcIEEE[0], srcIEEE[1], srcIEEE[2], srcIEEE[3], srcIEEE[4], srcIEEE[5], srcIEEE[6], srcIEEE[7],
+ srcEndpoint, dstIEEE[0], dstIEEE[1], dstIEEE[2], dstIEEE[3], dstIEEE[4], dstIEEE[5], dstIEEE[6], dstIEEE[7], clusterID);
+
+ write(serialPortFd,cmd,sizeof(cmd));
+ tcflush(serialPortFd, TCOFLUSH);
+}
+
/*********************************************************************
* @fn zllSocGetState
*
diff --git a/Linux/zllSocCmd.h b/Linux/zllSocCmd.h
index bc614bf0ab291b1312e978173dd3d2fdaef9f0bc..e9e0b82f965faffdd2ea59012c1c5cdd56fc64e4 100644 (file)
--- a/Linux/zllSocCmd.h
+++ b/Linux/zllSocCmd.h
void zllSocAddGroup(uint16_t groupId, uint16_t dstAddr, uint8_t endpoint, uint8_t addrMode);
void zllSocStoreScene(uint16_t groupId, uint8_t sceneId, uint16_t dstAddr, uint8_t endpoint, uint8_t addrMode);
void zllSocRecallScene(uint16_t groupId, uint8_t sceneId, uint16_t dstAddr, uint8_t endpoint, uint8_t addrMode);
+void zllSocBind(uint16_t srcNwkAddr, uint8_t srcEndpoint, uint8_t srcIEEE[8], uint8_t dstEndpoint, uint8_t dstIEEE[8], uint16_t clusterID);
//ZCL Get API's
void zllSocGetState(uint16_t dstAddr, uint8_t endpoint, uint8_t addrMode);
void zllSocGetLevel(uint16_t dstAddr, uint8_t endpoint, uint8_t addrMode);