Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A way to query IoT Hub from device and get response? #2611

Closed
aleksandarkrstic opened this issue Apr 20, 2024 · 5 comments
Closed

A way to query IoT Hub from device and get response? #2611

aleksandarkrstic opened this issue Apr 20, 2024 · 5 comments
Labels

Comments

@aleksandarkrstic
Copy link

aleksandarkrstic commented Apr 20, 2024

Hello,

I am using Azure C SDK to connect my device to IoT Hub and must say that everything is working fine for me and I didn't have any problems. However, I was wondering if there is a way to invoke some service or query IoT Hub from device side and get response (something similar to Direct Method but not cloud to device, rather like device to cloud "Direct Method" where device can query some service on the IoT Hub and get response as string for example)? Is that possible and how?

Thanks in advance.

@ericwolz
Copy link
Contributor

although the iothub_service_client is depercated in this SDK, it's still functional. There are no current plans to remove this, other than no new hub features will be added.

Sample:
https://github.com/Azure/azure-iot-sdk-c/blob/main/iothub_service_client/samples/iothub_devicemethod_sample/iothub_devicemethod_sample.c

@aleksandarkrstic
Copy link
Author

Thanks, but isn't this still Cloud to Device direct method but from back-end app?
I am looking for a way to "invoke" some "method" on IoT Hub and get response from IoTHub Client SDK if possible.

@ericwolz
Copy link
Contributor

Are you looking for Azure Functions?

https://azure.microsoft.com/en-us/products/functions

@ericwolz
Copy link
Contributor

@ewertons
Copy link
Contributor

Closing this issue based on the last instructions from @ericwol-msft
Please feel free to reopen this issue if you would like to follow up.
Thanks,
Azure IoT SDK Team

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants