Do you know how Coordinator sends data to Device by Unicast in ZStack?
Please show me the example code that can be anyone of based on ExtAddr or ShortAddr.
If Coordinator wants to unicast by ShortAddr, How can it find Device's ShortAddr?
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Do you know how Coordinator sends data to Device by Unicast in ZStack?
Please show me the example code that can be anyone of based on ExtAddr or ShortAddr.
If Coordinator wants to unicast by ShortAddr, How can it find Device's ShortAddr?
When ZED joins ZC, there is end node announcement that includes the shout address of ZED and you can use that to do unicast. The example of unicast would be like the followings:
afAddrType_t ZED_DstAddr;
ZED_DstAddr.addrMode = afAddr16Bit;
ZED_DstAddr.addr.shortAddr = 0xxxx; // Short address of ZED that you want to unicast.
ZED_DstAddr.endPoint = ZED_ENDPOINT;
if ( AF_DataRequest( &ZED_DstAddr, &ZED_epDesc,
ZED_CLUSTERID,
(byte)message_length, //The message length that you want to unicast
(byte *)pmessage_buffer, //The message buffer pointer that you want o unicast.
&ZED_TransID,
AF_DISCV_ROUTE, AF_DEFAULT_RADIUS ) == afStatus_SUCCESS )
{
}
I'll be very help when or where I know the end node announcement in Zstack Source Code?
Is that the only way to unicast?
It means I can know only when I got AF_INCOMING_MSG_CMD?
I'm sorry. I'll explain it more details.
I think how to unicast is very easy, but I cannot find the way or example.
Using AF_DataRequest(desAddr) with short Adress is very easy.
My question is how can I know short Address of Device?
I know short Address of Device is made only when join.
Is it saved into NV region?
How can I find the table of device's information?
Thank you.
There is NIB data structure that keeps the info of its associated nodes. However, this is not enough to know all of the short address using this info only in a mesh network. I still suggest that you should keep the short address of each device when it joins ZB network and sends out end node announcement to coordinator.