Part Number: CC2538
Other Parts Discussed in Thread: Z-STACK, CC2531
HI,
I am using CC2538 dev kit to enable the zigbee network and to esatblish the communication between devices on network. Where enable one of the device as Co-ordinator and one more has End device.
Trying to send the data buf from one to other.
char *pBuf = "Hi,welcome. We both are on same network, Cheers";
/**/
endPointDesc_t *epDesc;
afAddrType_t dstAddr;
cId_t cId;
uint8 transId, txOpts, radius;
uint8 cmd0, cmd1;
uint8 retValue = ZFailure;
uint16 dataLen, tempLen;
/ Destination address /
dstAddr.addrMode = AddrBroadcast;
// dstAddr.addrMode = AddrNotPresent;
dstAddr.addr.shortAddr = NWK_BROADCAST_SHORTADDR_DEVALL;
// dstAddr.addrMode = Addr16Bit;
// dstAddr.addr.shortAddr = _NIB.nwkCoordAddress;
/ Destination endpoint /
dstAddr.endPoint = *pBuf++;
dstAddr.panId = _NIB.nwkPanId;
/ Source endpoint /
// epDesc = afFindEndPointDesc(*pBuf++);
epDesc = &ZDApp_epDesc;
/ ClusterId /
cId = osal_build_uint16( pBuf );
pBuf +=2;
/ TransId /
transId = *pBuf++;
/ TxOption /
txOpts = *pBuf++;
/ Radius /
radius = AF_DEFAULT_RADIUS;
/ Length /
dataLen = strlen(pBuf);
retValue = AF_DataRequest(&dstAddr, epDesc, cId, dataLen, pBuf, &transId, txOpts, radius);
HalUARTWrite ( MT_UART_DEFAULT_PORT, "AF Send Msg Done\r\n", strlen("AF Send Msg Done\r\n") );
switch(retValue){
case afStatus_SUCCESS:
HalUARTWrite ( MT_UART_DEFAULT_PORT, "afStatus_SUCCESS\r\n", strlen("afStatus_SUCCESS\r\n") );
break;
case afStatus_FAILED:
HalUARTWrite ( MT_UART_DEFAULT_PORT, "afStatus_FAILED\r\n", strlen("afStatus_FAILED\r\n") );
break;
case afStatus_INVALID_PARAMETER:
HalUARTWrite ( MT_UART_DEFAULT_PORT, "afStatus_INVALID_PARAMETER\r\n", strlen("afStatus_INVALID_PARAMETER\r\n") );
break;
case afStatus_MEM_FAIL:
HalUARTWrite ( MT_UART_DEFAULT_PORT, "afStatus_MEM_FAIL\r\n", strlen("afStatus_MEM_FAIL\r\n") );
break;
case afStatus_NO_ROUTE:
HalUARTWrite ( MT_UART_DEFAULT_PORT, "afStatus_NO_ROUTE\r\n", strlen("afStatus_NO_ROUTE\r\n") );
break;
default:
HalUARTWrite ( MT_UART_DEFAULT_PORT, "afStatus unknown\r\n", strlen("afStatus unknown\r\n") );
break;
}
This is how I am trying to send from end device, and getting "case afStatus_SUCCESS" all the time and alse "AF_DATA_CONFIRM_CMD" also in the callback.
But no call back's at the co-ordinator side. Is it anything wrong in my case.
Even I tried in reverse also from Co-ordinator to end device same thing is happening, I mean sender is getting success return and ACK also but not visible at receiver.
Checking each and every step from "ZDP_IncomingData()" getting nothing.
And one more thing I am also trying to BIND both but its not happening, I mean Router and End devices are getting bind but same end device is not binding with Co-ordinator can I why it is.
Thanks.
