Documentation

Mistake on this page? Email us

Deregister your device

Devices usually deregister from Device Management services for one of two reasons:

  • The registration session lifetime on the LwM2M server expires. The client is marked as deregistered. For example, if the client has not been able to send its register_update() within the registered lifetime due to connectivity issues, it will be dropped to the deregistered state by LwM2M server.

  • The client requests deregistration by calling the MbedCloudClient::close() API:

    MbedCloudClient::close();
    

    The result of that request can be:

    • Success

      If the client is successfully deregistered from the Device Management service, your application receives the result through the unregistered callback:

      MbedCloudClient::on_unregistered(void(*fn)(void));
      
    • Failure

      If the deregistration operation fails, your application receives the result through the error callback:

      MbedCloudClient::on_error(void(*fn)(int));
      

      The error parameter passed with the callback contains more information on the error; use it to fix the problem.

When the client is deregistered from the LwM2M server for any reason, it will be marked as deregistered in the Device Management services. All queued messages will be removed from the server-queue.

If the client tries to connect to the services while in the deregistered state, it will be forced to perform a full registration again.

Deregister does not remove the device identity from the device, so the device will use the same identity to register with the Device Management service next time.