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.

Querying Simple Descriptor

Other Parts Discussed in Thread: CC2530

ZDP_SimpleDescReq is not working some times. 

case Active_EP_rsp:

ZDO_ActiveEndpointRsp_t *enRsp = ZDO_ParseEPListRsp(inMsg);

DstAddr.addrMode = (afAddrMode_t)Addr16Bit;

DstAddr.addr.shortAddr = enRsp->nwkAddr;

for(i =0; i<5  &&  enRsp->epList[i]; i++)

{

    enpoint++;

}

osal_memcpy(&ep, enRsp->epList, enpoint);

for(i = 0; i<enpoint;i++)

{

    ZDP_SimpleDescReq(&DstAddr, enRsp->nwkAddr, ep[i], 0);

     MicroWait(50000);MicroWait(50000);MicroWait(50000);

}

Some times i am getting Simple Descriptors response 1 or 2 or 3, if i have a endpoints 3. But in the packet sniffer request is sending. Refer my sniffer log.5822.snif.psd

  • Don't put ZDP_SimpleDescReq in a for loop to request simple descriptor continuously. I would suggest you to request  simple descriptor and wait for response. If there is response, then go to request the next. If not, retry again.

  • For loop is needed right? since we don't know, which device is announcing and how many endpoints are in it. So can i do this.

       

    for(i = 0; i<enpoint;i++)

    {

       Rsp = 0;

        ZDP_SimpleDescReq(&DstAddr, enRsp->nwkAddr, ep[i], 0);

         MicroWait(50000);

        while(Rsp == 0)

         {

             ZDP_SimpleDescReq(&DstAddr, enRsp->nwkAddr, ep[i], 0);

            MicroWait(50000);

        }

    }

    Where i am making Rsp set in Simple_Desc_rsp. Is this Correct Way? any other better suggestion.

  • You put ZDP_SimpleDescReq in a for loop might make the the request fail because the period between two request might be too closed. If you insist to do so, I would suggest you to check the return value of ZDP_SimpleDescReq. Also, your for loop will make receiving response difficult to process because there might be continuous response comes in and your coordinator doesn't fast enough to handle it. In my application, I use a ARM CPU as host and use MT command to communicate with coordinator. After I receive end node announcement, I will put it in my task queue and request active endpoint, simple descriptor with response one by one.

  • Then i request you to suggest me, how i should proceed without forloop in 8051 core not in ARM.

  • You can implement a task queue in Zstack too. When there is a end node announcement, just put them into the queue. Then, you can create a event that processes the queue one by one. This is about application programming and you need to do that by yourself.

  • Ya i can do myself, but i need to know how to implement a task queue in zstack. is there any guidance for thread to know how to implement.

  • This is about application programming and less related to ZStact or CC2530. You need to do it by yourself.

  • Sorry for basic question, I confused with task queue, whether i need to change any thing in the Zstack? or i need to change only my application code?. Task queue indicate to which thing, Because i know the the queue using in Data structure. I request to instruct me, so that i can implement.

  • It is only application code and no need to change any thing in the Zstack. You can create a queue to process a device association. In the queue element, there are short address, active endpoints, and simple descriptors fields. Also, you need to create a queue processing event that is triggered every 2 seconds for example. When there is a end node announcement, you create a new queue element with the short address but leave active endpoints, and simple descriptors fields NULL. When queue processing event is trigger later and find there is a new element that doesn't have active endpoint, it will send request active endpoint to the device. If there is active endpoint response, the active endpoint will fill into the active endpoint field in the queue element. If there is no  active endpoint response, request active endpoint again in next queue processing event. Finally, When there are short address and active endpoint in the queue element, queue processing event will send request simple descriptor. If there is simple descriptor response, the simple descriptor is filled into simple descriptor filed and the association process is finished. If there is no simple descriptor repines, we send request simple descriptor again in next queue processing event and so on.