This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

ZB_ZCL_SEND_COMMAND_SHORT (..., cb) call back

Hi,

Q1, Would it send out APS ACK request? so the call back is dealing the APS ACK confirmation, right?

Q2, If we set the call back as NULL, how the buffer got released?

Q3, If multiple ZB_ZCL_SEND_COMMAND_SHORT are sent, would the zboss call the right call back?

Thanks

  • Hi!

     

    Q1, Would it send out APS ACK request? so the call back is dealing the APS ACK confirmation, right?

     Yes.

    Q2, If we set the call back as NULL, how the buffer got released?

    It doesn't get released. 

     

    Q3, If multiple ZB_ZCL_SEND_COMMAND_SHORT are sent, would the zboss call the right call back?

     I'll have to get back to you on this tomorrow. 

    Best regards,

    Heidi

  • Here is an update.

    Q2: Generally, if no callback is set, the stack will free it upon receiving APS ACK. The only broken scenario is when the stack cannot send the command - in such a situation the app should handle the return code to free it, which is impossible with the macro-version.

    So you should either use zb_zcl_finish_and_send_packet() (which is described in zb_zcl_common.h in SDK_for_Thread_and_Zigbee_4.0.0) or provide a callback function. 

    Q3: They are called with the order of receiving APS ACKs. So, if one is lost, the order may differ from the sending queue. 

  • How about ZB_ZCL_GROUPS_SEND_ADD_GROUP_REQ (..., cb), it uses ZB_ZCL_SEND_COMMAND_SHORT to send the packet. There is no way to check if the stack send the command in this case. How we deal this situation? 

  • Hi Robert,

    Heidi is out on business travel so I have taken over this case. If you want to check if the stack have sent the add group command you will need to register an endpoint handler and parse the add group response manually, just like you would parse a read attribute response for example.

    From the ZCL spec section 3.6.2.4.1 the payload of the add group response command is the following:

    This command is generated in response to a received Add Group command. The Status field is set to
    SUCCESS, DUPLICATE_EXISTS, or INSUFFICIENT_SPACE as appropriate. The Group ID field is set to
    the Group ID field of the received Add Group command.

    Best regards,

    Marjeris

  • Hi Msromero,

    Correct me if I am wrong.

    The following is how I understand

    ZB_ZCL_GROUPS_SEND_ADD_GROUP_REQ (..., Default Response, cb, ...)

       if Default Response is enabled, the client needs to register an endpoint handler to take care of it. The cb is assigned to handle the APS ACK. It the cb is NULL, the stack will free it upon receiving APS ACK.

    When the server receives the Add Group command, it will respond it. The registered end point handler inside the client will receive the server response, and use ZB_ZCL_GROUPS_GET_ADD_GROUP_RES to parse the returned response.

    Q1. If Default Response is enabled, the server will respond the default response and Add Group Command?

    Q2. In the zigbee/light_control/light_bulb does not see any ZB_ZCL_GROUPS_GET_ADD_GROUP_REQ

    to respond the add group command?

    Q3. In Add group command definitions, it mentioned "For more information see 5.5.3_groups sample". Where to find 5.5.3?

    Thanks so much

Related