环境:
Z-Stack 3.0.1
EndDevice
配置:
/* Maximum number of entries in the Binding table. */
-DNWK_MAX_BINDING_ENTRIES=16
打印:
Match_Desc_rsp
ZStatus 0xb2
已经把最大绑定条目设为16了,但是每次都是提示绑定表已满(#define ZApsTableFull 0xb2)
是不是有些宏没打开?
YiKai Chen:
試試擦除芯片在下載固件測試看看
one Man:
回复 YiKai Chen:
试过了,不行。
打印绑定表出来全是0xFF,证明表是空的,没有绑定过,但是为什么会提示绑定表已满呢?
YiKai Chen:
回复 one Man:
你是在哪裡打印下面的資訊
Match_Desc_rsp
ZStatus 0xb2
one Man:
回复 YiKai Chen:
匹配成功后打算绑定这个设备,代码如下:
case Match_Desc_rsp: { zAddrType_t dstAddr; ZDO_ActiveEndpointRsp_t *pRsp = ZDO_ParseEPListRsp( inMsg ); printf("Match_Desc_rsp\n"); dstAddr.addrMode = Addr16Bit; dstAddr.addr.shortAddr = pRsp->nwkAddr; ZStatus = APSME_BindRequest( zclTemperatureHumiditySensor_SimpleDesc.EndPoint, ZCL_CLUSTER_ID_HVAC_FAN_CONTROL, &dstAddr, pRsp->epList[0] ); printf("ZStatus 0x%02x\n", ZStatus); if (ZStatus == ZSuccess ) { osal_start_timerEx( ZDAppTaskID, ZDO_NWK_UPDATE_NV, 250 ); printf("Bind Success\n"); } else { for(uint8 i =0; i < NWK_MAX_BINDING_ENTRIES; i++) { printf("%x %x %x\n", BindingTable[i].dstEP, BindingTable[i].srcEP, BindingTable[i].numClusterIds); for(uint8 j=0; j<BindingTable[i].numClusterIds; j++) printf("%04x\n", BindingTable[i].clusterIdList[j]); } } } break;
YiKai Chen:
回复 one Man:
試試用 bindAddEntry取代APSME_BindRequest
Alvin Chen:
回复 one Man:
可以使用 ZDP_BindReq()进行尝试一下。
3.2.5.3 ZDP_BindReq()
This is actually a macro that calls ZDP_BindUnbindReq (). This call will build and send a Bind Request. Use this
function to request the Zigbee Coordinator to bind application based on clusterID.
Prototype
afStatus_t ZDP_BindReq( zAddrType_t *dstAddr, byte *SourceAddr,
byte SrcEP, byte ClusterID, byte *DestinationAddr, byte DstEP, byte SecuritySuite );