Azure IoT Hub作為多租戶服務,對不同的用戶暴露了不同的接口(如下圖所示)。
下面對各類接口進行詳細解釋:
- 設備接口:
- Send device-to-cloud messages: 通過該接口發送都d2c消息。
- Receive cloud-device messages: 接受c2d消息。
- Initiate file uploads: 設備通過該接口接受來自IoT Hub提供的azure storage的SAS 鏈接,並上傳文件到該鏈接。
- Retrieve and update device twin properties: 獲取並更新device twin的屬性。
- Receive direct methods requests. 設備通過該端口監聽來自雲端的服務請求。
- 服務接口:
- Receive device-to-cloud messages:接受d2c消息。
- Send cloud-to-device messages: 發送c2d消息。
- Receive file notifications: 接受文件是否上傳成功通知。
- Direct method invocation: 該接口可以讓后端服務對前段設備觸發指令。
- 設備管理接口:IoT Hub 暴露了RESTFUL 的設備管理接口(包括設備的創建、獲取、更新與刪除)
- 資源管理接口:該接口可以用來對IoT Hub進行管理,包括創建、刪除以及更新相關屬性。