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.

LAUNCHXL-CC26X2R1: Sending data via report command whether receiving any responses in End-Device

Part Number: LAUNCHXL-CC26X2R1
Other Parts Discussed in Thread: Z-STACK

Hi TI team,

Now, I used the function of zcl_SendReportCmd to send data from End-Device to Coordinator.

I wonder whether my End-Device will receive any response packets from my Coordinator. Because if my data(packets) missed over-the-air, I may need to resend it again.

Could you teach me where or which functions that I can receive response packets in the example code of Zed_Switch if my End-Device can receive response packets from Coordinator?

Thanks

  • Hi Lawrence,

    The stack will take care of retries.

    Please refer to section 8 of Z-Stack Overview.

    MAC acks are used by default, which typically helps with reliability. Number of retries are defined in Stack/Config/f8wconfig.

    In addition to the MAC acks, you can use APS acks.
    You can enable this on an endpoint by creating a zclOptionRec_t list and registering it with zcl_registerClusterOptionList (found in zcl.c). Set AF_ACK_REQUEST as the option for your endpoint.


    Regards,
    Toby
  • using zed_switch as an example, where should application check AF_DATA_CONFIRM_CMD?
  • I think I find it. I should add "case zstackmsg_CmdIDs_AF_DATA_CONFIRM_IND" in zclSampleSw_processZStackMsgs to check it.
  • Hi YK,
    Could I know what you purpose of checking AF_DATA_CONFIRM_CMD?
    It means when you send a data and you can use "case zstackmsg_CmdIDs_AF_DATA_CONFIRM_IND" to check whether you receive any responses.
    Thanks
  • Hi Toby,
    I just found the DAPSC_MAX_FRAME_RETRIES=3 in the file of f8wconfig.cfg. And I think it is for APS acks.
    Which value do I check for number of retries of MAC acks in the file of f8wconfig.cfg? Or Do you know how many times of retries for MAC acks in the example code of zed_switch?

    And What the max value of retries for MAC acks?
    Thanks

  • Yes, that's what I mean.
  • Hi YK,
    Could I know how do you check responses, according to the structure of zstackmsg_afDataConfirmInd_t?
    Thanks
  • Yes, checking transID in zstackmsg_afDataConfirmInd_t
  • Hi YK,
    Could I ask you one more question?
    According to Toby, we need to use the function of zcl_registerClusterOptionList to register AF_ACK_REQUEST for APS acks.
    But I found AF_ACK_REQUEST seems be registered in the example code of zed_switch. Whether it means it already enable the APS acks. Am I right or I miss something? 

    And you also mention check the transID for responses. Could you explain more for this part because I still have no idea how to use the transID to check it?

    Here is code for registering it: 

    static zclOptionRec_t zcl_Groups_Options[] =
    {
    {
    ZCL_CLUSTER_ID_GEN_GROUPS,
    ( AF_ACK_REQUEST ),
    },
    };


    Thanks

  • 1. You still need to use zcl_registerClusterOptionList to register AF_ACK_REQUEST for specific cluster ID you want to check.
    2. You can refer to zclSampleSw_processKey and will see how to use Zstackapi_bdbGetZCLFrameCounterReq to get and use Rsp.zclFrameCounter to send zcl command. Then, you can check transID in zstackmsg_afDataConfirmInd_t to see if it matches to Rsp.zclFrameCounter.

    if(keysPressed == KEY_RIGHT)
    {
    zstack_bdbGetZCLFrameCounterRsp_t Rsp;

    Zstackapi_bdbGetZCLFrameCounterReq(zclSampleSw_Entity, &Rsp);
    zclGeneral_SendOnOff_CmdToggle( SAMPLESW_ENDPOINT, &zclSampleSw_DstAddr, FALSE, Rsp.zclFrameCounter );
    }
  • Hi YK,
    Question 1:
    If I want to register a specific cluster ID that I want to check whether I can add my specific cluster ID into below code?

    static zclOptionRec_t zcl_Groups_Options[] =
    {
    {
    ZCL_CLUSTER_ID_GEN_GROUPS,
    xxxxxxxxxx, //my specific cluster ID
    ( AF_ACK_REQUEST ),
    },
    };

    Question 2:
    If I register a specific cluster ID for APS acks and when I miss my data over-the-air, Z-stack will automatically resend my data 3 times(between retries is 3 seconds),based on the configuration(DAPSC_MAX_FRAME_RETRIES=3 and DAPSC_ACK_WAIT_DURATION_POLLED=3000) in the file of f8wconfig.cfg. Am I right?

    Question 3:
    Do you have any idea about how many times of retries for MAC acks that Toby mention?
    Thanks
  • 1. I would suggest you to use your own zclOptionRec_t
    2. Yes
    3. I don't dig into latest Z-Stack to know exact MAC retry time.
  • Hi YK,
    OK. I already send a question of MAC acks to Toby.

    If I want to create a own zclOptionRec_t . Could I know where I can write my code? Because I found the Group cluster was registered in the function of bdb_checkMatchingEndpoints via function of zcl_registerClusterOptionList.

    Could I create a new zclOptionRec_t and also register in the function of bdb_checkMatchingEndpoints?
    Thanks

  • I think MAC retry is defined by NWK_MAX_DATA_RETRIES in f8wConfig.opts

    /* Max number of times retry looking for the next hop address of a message */
    -DNWK_MAX_DATA_RETRIES=2
  • Hi YK,
    Noted.
    I wonder if I want to create a own zclOptionRec_t . Could I know where I can write my code? Because I found the Group cluster was registered in the function of bdb_checkMatchingEndpoints via function of zcl_registerClusterOptionList.

    Could I create a new zclOptionRec_t and also register in the function of bdb_checkMatchingEndpoints?
    Thanks
  • You can register it in your application init function.
  • Hi YK,
    Noted
    Thanks
  • For the MAC retries, YK is correct. You can see description here: dev.ti.com/.../network_configuration.html

    For the zclOptionRec_t, you can find the definition in zcl.h.
    As an example, for multiple entries, you could declare as follows:

    zclOptionsRec_t optionsRec[] =
    {
    	{
    		oneClusterID,
    		AF_ACK_REQUEST 
    	},
    	{
    		anotherClusterID,
    		AF_ACK_REQUEST
    	}
    }

  • Hi Toby,

    Noted. 

    Could I know what the max value of MAC retries because I could not find it in the link of dev.ti.com/.../network_configuration.html ?

    Thanks

  • Theoretically, no limit.

    Practically, Z-Stack uses an unsigned 8-bit integer, so the largest value is 255.