zigbee 绑定表
来源:互联网 发布:淘宝游戏专营怎么进入 编辑:程序博客网 时间:2024/06/05 20:08
如何绑定可以参照: http://blog.csdn.net/tanqiuwei/article/details/7642766
首先绑定表: BindingEntry_t
typedef struct
{
uint16 srcIdx; // Address Manager index
uint8 srcEP;
uint8 dstGroupMode; // Destination address type; 0 - Normal address index, 1 -
// Group address
uint16 dstIdx; // This field is used in both modes (group and non-group) to
// save NV and RAM space
// dstGroupMode = 0 - Address Manager index
// dstGroupMode = 1 - Group Address
uint8 dstEP;
uint8 numClusterIds;
uint16 clusterIdList【MAX_BINDING_CLUSTER_IDS】;
// Don‘t use MAX_BINDING_CLUSTERS_ID when
// using the clusterIdList field. Use
// gMAX_BINDING_CLUSTER_IDS
} BindingEntry_t;
1.加入
static uint16 BindClusterIds[] = { ZCL_CLUSTER_ID_GEN_ON_OFF }; zAddrType_t ZC_DstAddr; ZC_DstAddr.addrMode = Addr16Bit; ZC_DstAddr.addr.shortAddr = 0x0000; bindAddEntry( SAMPLEswitch_ENDPOINT,&ZC_DstAddr, SAMPLELIGHT_ENDPOINT,1, BindClusterIds );
2.移除
void bindRemoveDev( zAddrType_t *Addr ); //移除之后需要:ZDApp_NVUpdate();3.更新地址
void bindUpdateAddr( uint16 oldAddr, uint16 newAddr ); //交换邦定表中的短地址,所有oldAddr将被newAddr取代。 BindingEntry_t *bindFindExisting( zAddrType_t *srcAddr, byte srcEpInt, zAddrType_t *dstAddr, byte dstEpInt );4.查询
byte bindNumBoundTo( zAddrType_t *devAddr, byte devEpInt, byte srcMode ); 计算符合条件的邦定表入口数目。返回找到的邦定表入口数目。 devAddr -要查找的邦定表地址 devEpInt -终端 srcMode TRUE 查找源地址,FALSE 查找目的地址 uint16 bindNumOfEntries( void ); 返回邦定表中的条目数,以cluster计数。 void bindCapacity( uint16 *maxEntries, uint16 *usedEntries ); 返回邦定表的可能最大数目,和在用的最大数目,以入口记录计数。 maxEntries -指向最大入口数目的变量,绑定表的最大入口可以通过 NWK_MAX_BINDING_ENTRIES【f8wConfig.cfg】更改
z-stack3.0:
/********************************************************************* * @fn bdb_zclFindingBindingEpType * * @brief Gives the Ep Type according to application clusters in * simple descriptor * * @return epType - If Target, Initiator or both */uint8 bdb_zclFindingBindingEpType( endPointDesc_t *epDesc )
/********************************************************************* * @fn bdb_zclFindingBindingAddBindEntry * * @brief This function is used to Add an entry to the binding table * * @param SrcEndpInt - source endpoint * @param BindClusterId - cluster to try bind * @param Cnt - list of remote clusters * @param ClusterList - pointer to the Object ID list * @param DstAddr - Address of remote node * @param DstEndpInt - EndPoint of remote node * * @return status - Success if added */static ZStatus_t bdb_zclFindingBindingAddBindEntry( byte SrcEndpInt, uint16 BindClusterId, byte Cnt, uint16 * ClusterList, zAddrType_t *DstAddr, byte DstEndpInt )
/********************************************************************* * @fn bdb_exitFindingBindingWStatus * * @brief Clean respondent list and reports the status to bdb state machine * * @return */void bdb_exitFindingBindingWStatus( uint8 status )/********************************************************************* * @fn bdb_zclSimpleDescClusterListClean * * @brief This function free Simple Descriptor cluster lists * * @param pSimpleDesc - pointer to simple descriptor * * @return status */static void bdb_zclSimpleDescClusterListClean( SimpleDescriptionFormat_t *pSimpleDesc )
阅读全文
1 0
- zigbee 绑定表
- zigbee 绑定
- Zigbee绑定流程
- zigbee之终端设备绑定
- Zigbee绑定流程
- zigbee绑定问题
- zigbee 6:绑定
- Zigbee绑定流程
- ZigBee绑定通信原理
- 再谈ZigBee中的绑定机制
- 再谈ZigBee中的绑定机制
- [Zigbee]绑定操作的时间
- ZigBee学习之绑定表管理函数详解——ZStack API解读
- ZigBee 2007中绑定的理解
- 重谈Zigbee的绑定问题
- zigbee协议栈之中终端绑定
- ZigBee 2007中绑定的理解
- 重谈Zigbee的绑定问题
- Linux驱动设计ioctl函数的cmd参数不能为2
- C语言程序的结构特点
- Cocos2d-js 骨骼动画载入
- c++容器
- 2.2.7—单链表—Remove Nth Node From End of List
- zigbee 绑定表
- Visual Studio代码缩进快捷键
- 【Docker】docker创建单机版的solr和IKAnalyzer的集成
- JQuery中on和click的区别
- Vim 实用技巧,一些自己常用到的命令
- codeforces837B Flag on Berland
- 从朋友圈一道小学试题想到的
- Java中子类能够继承父类的private属性或方法吗?
- Curling 2.0 (深搜)