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

  • Hi Valerio

    Can you please provide some more information here. Are you using Bluetooth Mesh, Zigbee, Open Thread, or some proprietary protocol using end points here? Please also let me know what SDK (nRF5 SDK or nRFConnect SDK) and version you're using. 

    Best regards,

    Simon

  • Sorry for the missing information.
    The SDK I'm using is "nRF5 SDK for Thread and Zigbee v4.1.0" and the protocol is Zigbee

  • 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?

  • Hi again

    Endpoints are added by using the zb_af_register_device_ctx(), which registers a context containing the endpoint. However, there is no "unregister" or "remove" equivalent. So it's not supported to specifically remove them it seems. Removing it from all groups will be the closest you get I guess, as that at least will have it removed.

    I would go for this over suggestion B at least, as that is more of a "brute force" way of doing it, when you knowingly prevent the callback. Option C would be valid though I think, if you find it useful to update the endpoint device like this.

    I'll have to ask internally for more information on how the zb_apsme_remove_all_groups_req_s is forwarded to the stack, as I'm not getting much out of the documentation either.

    Best regards,

    Simon

Related