Remove/disable endpoint at runtime

Hi,

I have a doubt regarding the possibility of removing or disabling an endpoint at runtime.

Assuming that we have a device with multiple endpoints, is there a mechanism to disable temporarely or definetely an endpoint from the device itself?

Valerio

Parents
  • Hi

    I don't see a way to remove and delete an endpoint entirely, but you can remove an endpoint from all groups/subscribers if that's sufficient, using the zb_apsme_remove_all_groups_req_s and zb_apsme_remove_all_groups_conf_s. It doesn't seem like a normal use case to disable endpoints at runtime. It also depends on what you mean by "disabling", as it would be disabled if it is turned off I guess.

    Best regards,

    Simon

  • Hi Simonr, sorry for my late reply.

    It also depends on what you mean by "disabling", as it would be disabled if it is turned off I guess.

    To clarify what I meant:

    1) we have a device running multiple endpoints

    2) we would like to "switch off" Zigbee communication just for a single endpoint. We don't want to switch off the device entirely.

    We can summarize the steps that we do to use the stack as:
    1) we allocate and initialize the data used for multiple Zboss Zigbee endpoints
    2) we register the proper callbacks and initialize what is needed (we call ZB_ZCL_REGISTER_DEVICE_CB(), ZB_AF_REGISTER_DEVICE_CTX(), ...)
    3) we call ZB_AF_SET_ENDPOINT_HANDLER(endpoint_id, callback)
    4) from the controller, we see the endpoints, and we add them
    5) we can communicate as desired
    6) we want to switch off just one endpoint (we want to do that form from the device itself) so that the Zboss stack does not handle its communication anymore.


    To achieve step 6, we suppose that:
    A) we could remove the endpoint from all groups as you suggested
    B) we could call ZB_AF_SET_ENDPOINT_HANDLER(endpoint_id, NULL) to prevent the callback to be called
    C) possibly we could update the device context variable of type zb_af_device_ctx_t (registered using ZB_AF_REGISTER_DEVICE_CTX()).
    Note that as update we mean the change of zb_af_device_ctx_t::ep_count and/or zb_af_device_ctx_t::ep_desc_list.
    Do you have any suggestions about points B and C?


    Moreover, could you please add some details about how we could use zb_apsme_remove_all_groups_req_s? How do we forward this command to the stack?

Reply
  • Hi Simonr, sorry for my late reply.

    It also depends on what you mean by "disabling", as it would be disabled if it is turned off I guess.

    To clarify what I meant:

    1) we have a device running multiple endpoints

    2) we would like to "switch off" Zigbee communication just for a single endpoint. We don't want to switch off the device entirely.

    We can summarize the steps that we do to use the stack as:
    1) we allocate and initialize the data used for multiple Zboss Zigbee endpoints
    2) we register the proper callbacks and initialize what is needed (we call ZB_ZCL_REGISTER_DEVICE_CB(), ZB_AF_REGISTER_DEVICE_CTX(), ...)
    3) we call ZB_AF_SET_ENDPOINT_HANDLER(endpoint_id, callback)
    4) from the controller, we see the endpoints, and we add them
    5) we can communicate as desired
    6) we want to switch off just one endpoint (we want to do that form from the device itself) so that the Zboss stack does not handle its communication anymore.


    To achieve step 6, we suppose that:
    A) we could remove the endpoint from all groups as you suggested
    B) we could call ZB_AF_SET_ENDPOINT_HANDLER(endpoint_id, NULL) to prevent the callback to be called
    C) possibly we could update the device context variable of type zb_af_device_ctx_t (registered using ZB_AF_REGISTER_DEVICE_CTX()).
    Note that as update we mean the change of zb_af_device_ctx_t::ep_count and/or zb_af_device_ctx_t::ep_desc_list.
    Do you have any suggestions about points B and C?


    Moreover, could you please add some details about how we could use zb_apsme_remove_all_groups_req_s? How do we forward this command to the stack?

Children
No Data
Related