Device registration status lookup example/reference in "C" or in Azure IoT SDK C?

Arjun Sivasree 0 Reputation points
2023-02-27T02:22:18.0366667+00:00

https://learn.microsoft.com/en-us/rest/api/iot-dps/device/runtime-registration/device-registration-status-lookup#deviceregistrationresult
As per above link, I understand that there is an API to check the device registration status of device registration in IoT hub.

Is there an example which I can refer to about how to use this API in C or Azure IoT SDK C? I could not find anything in documentation or samples.

Azure IoT Hub
Azure IoT Hub
An Azure service that enables bidirectional communication between internet of things (IoT) devices and applications.
1,115 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Dom 1,466 Reputation points Microsoft Employee
    2023-02-27T11:03:40.86+00:00

    Hi, you might also find this sample useful: https://github.com/Azure/azure-iot-sdk-c/tree/main/provisioning_service_client/samples/prov_sc_query_sample.

    As it stands the sample just prints the registration IDs, but you could modify it to use individualEnrollment_getDeviceRegistrationState to get the registration state.

    0 comments No comments

  2. AshokPeddakotla-MSFT 27,296 Reputation points
    2023-03-01T06:56:41.9933333+00:00

    Arjun Sivasree Thanks for reaching out!

    Is there an example which I can refer to about how to use this API in C or Azure IoT SDK C? I could not find anything in documentation or samples.

    Did you check this sample already? https://github.com/Azure/azure-iot-sdk-c/blob/32942abb994f6855edc2a4dee8afd80735df4151/provisioning_service_client/src/provisioning_sc_device_registration_state.c

    Do let us know if that helps or need any further help.

    0 comments No comments