问题
I connected my mobile device to the IOT hub. I would like to display the connectivity (online/offline) status of the device on IOT hub service app installed on another device. How to achieve this? Is there any automatic trigger/event that fires when there is change in connectivity status? Also is there any API in service SDK to check the connectivity status of the device.
回答1:
Yes, we publish device connection state on Event Grid, which can be used for trigger: https://docs.microsoft.com/en-us/azure/iot-hub/iot-hub-how-to-order-connection-state-events
来源:https://stackoverflow.com/questions/54438490/device-connectivityonline-offlinestatus-with-the-auzure-iot-hub