Go to the documentation of this file.
17 #ifndef _az_IOT_HUB_CLIENT_H
18 #define _az_IOT_HUB_CLIENT_H
27 #include <azure/core/_az_cfg_prefix.h>
35 AZ_HUB_CLIENT_DEFAULT_MQTT_TELEMETRY_QOS = 0
99 #define AZ_IOT_HUB_CLIENT_WEB_SOCKET_PATH "/$iothub/websocket"
107 #define AZ_IOT_HUB_CLIENT_WEB_SOCKET_PATH_NO_X509_CLIENT_CERT \
108 AZ_IOT_HUB_CLIENT_WEB_SOCKET_PATH "?iothub-no-client-cert=true"
129 char* mqtt_user_name,
130 size_t mqtt_user_name_size,
131 size_t* out_mqtt_user_name_length);
151 char* mqtt_client_id,
152 size_t mqtt_client_id_size,
153 size_t* out_mqtt_client_id_length);
180 uint64_t token_expiration_epoch_time,
210 uint64_t token_expiration_epoch_time,
211 az_span base64_hmac_sha256_signature,
214 size_t mqtt_password_size,
215 size_t* out_mqtt_password_length);
243 size_t mqtt_topic_size,
244 size_t* out_mqtt_topic_length);
256 #define AZ_IOT_HUB_CLIENT_C2D_SUBSCRIBE_TOPIC "devices/+/messages/devicebound/#"
296 #define AZ_IOT_HUB_CLIENT_METHODS_SUBSCRIBE_TOPIC "$iothub/methods/POST/#"
349 size_t mqtt_topic_size,
350 size_t* out_mqtt_topic_length);
362 #define AZ_IOT_HUB_CLIENT_TWIN_RESPONSE_SUBSCRIBE_TOPIC "$iothub/twin/res/#"
368 #define AZ_IOT_HUB_CLIENT_TWIN_PATCH_SUBSCRIBE_TOPIC "$iothub/twin/PATCH/properties/desired/#"
376 AZ_IOT_HUB_CLIENT_TWIN_RESPONSE_TYPE_GET = 1,
377 AZ_IOT_HUB_CLIENT_TWIN_RESPONSE_TYPE_DESIRED_PROPERTIES = 2,
378 AZ_IOT_HUB_CLIENT_TWIN_RESPONSE_TYPE_REPORTED_PROPERTIES = 3,
440 size_t mqtt_topic_size,
441 size_t* out_mqtt_topic_length);
463 size_t mqtt_topic_size,
464 size_t* out_mqtt_topic_length);
466 #include <azure/core/_az_cfg_suffix.h>
468 #endif // _az_IOT_HUB_CLIENT_H
AZ_NODISCARD az_result az_iot_hub_client_methods_response_get_publish_topic(az_iot_hub_client const *client, az_span request_id, uint16_t status, char *mqtt_topic, size_t mqtt_topic_size, size_t *out_mqtt_topic_length)
Gets the MQTT topic that must be used to respond to method requests.
Definition of az_result and helper functions.
az_iot_message_properties properties
Definition: az_iot_hub_client.h:264
az_span name
Definition: az_iot_hub_client.h:306
AZ_NODISCARD az_result az_iot_hub_client_init(az_iot_hub_client *client, az_span iot_hub_hostname, az_span device_id, az_iot_hub_client_options const *options)
Initializes an Azure IoT Hub Client.
AZ_NODISCARD az_result az_iot_hub_client_twin_document_get_publish_topic(az_iot_hub_client const *client, az_span request_id, char *mqtt_topic, size_t mqtt_topic_size, size_t *out_mqtt_topic_length)
Gets the MQTT topic that must be used to submit a Twin GET request.
AZ_NODISCARD az_result az_iot_hub_client_sas_get_signature(az_iot_hub_client const *client, uint64_t token_expiration_epoch_time, az_span signature, az_span *out_signature)
Gets the Shared Access clear-text signature.
az_span request_id
Definition: az_iot_hub_client.h:388
AZ_NODISCARD az_iot_hub_client_options az_iot_hub_client_options_default()
Gets the default Azure IoT Hub Client options.
AZ_NODISCARD az_result az_iot_hub_client_twin_parse_received_topic(az_iot_hub_client const *client, az_span received_topic, az_iot_hub_client_twin_response *out_response)
Attempts to parse a received message's topic for twin features.
AZ_NODISCARD az_result az_iot_hub_client_get_user_name(az_iot_hub_client const *client, char *mqtt_user_name, size_t mqtt_user_name_size, size_t *out_mqtt_user_name_length)
Gets the MQTT user name.
az_iot_status status
Definition: az_iot_hub_client.h:394
AZ_NODISCARD az_result az_iot_hub_client_get_client_id(az_iot_hub_client const *client, char *mqtt_client_id, size_t mqtt_client_id_size, size_t *out_mqtt_client_id_length)
Gets the MQTT client id.
int32_t az_result
The type represents the various success and error conditions.
Definition: az_result.h:45
AZ_NODISCARD az_result az_iot_hub_client_telemetry_get_publish_topic(az_iot_hub_client const *client, az_iot_message_properties const *properties, char *mqtt_topic, size_t mqtt_topic_size, size_t *out_mqtt_topic_length)
Gets the MQTT topic that must be used for device to cloud telemetry messages.
AZ_NODISCARD az_result az_iot_hub_client_methods_parse_received_topic(az_iot_hub_client const *client, az_span received_topic, az_iot_hub_client_method_request *out_request)
Attempts to parse a received message's topic for method features.
AZ_NODISCARD az_result az_iot_hub_client_c2d_parse_received_topic(az_iot_hub_client const *client, az_span received_topic, az_iot_hub_client_c2d_request *out_request)
Attempts to parse a received message's topic for C2D features.
AZ_NODISCARD az_result az_iot_hub_client_sas_get_password(az_iot_hub_client const *client, uint64_t token_expiration_epoch_time, az_span base64_hmac_sha256_signature, az_span key_name, char *mqtt_password, size_t mqtt_password_size, size_t *out_mqtt_password_length)
Gets the MQTT password.
The Cloud-To-Device Request.
Definition: az_iot_hub_client.h:263
Telemetry or C2D properties.
Definition: az_iot_common.h:133
az_iot_hub_client_twin_response_type
Twin response type.
Definition: az_iot_hub_client.h:375
An az_span represents a contiguous byte buffer and is used for string manipulations,...
az_iot_hub_client_twin_response_type response_type
Definition: az_iot_hub_client.h:393
AZ_NODISCARD az_result az_iot_hub_client_twin_patch_get_publish_topic(az_iot_hub_client const *client, az_span request_id, char *mqtt_topic, size_t mqtt_topic_size, size_t *out_mqtt_topic_length)
Gets the MQTT topic that must be used to submit a Twin PATCH request.
az_span user_agent
Definition: az_iot_hub_client.h:45
az_span module_id
Definition: az_iot_hub_client.h:44
az_span request_id
Definition: az_iot_hub_client.h:304
Azure IoT Hub Client options.
Definition: az_iot_hub_client.h:43
az_span version
Definition: az_iot_hub_client.h:395
A method request received from IoT Hub.
Definition: az_iot_hub_client.h:303
Twin response.
Definition: az_iot_hub_client.h:386
az_iot_status
Azure IoT service status codes.
Definition: az_iot_common.h:75
Azure IoT Hub Client.
Definition: az_iot_hub_client.h:55
Azure IoT common definitions.
az_span model_id
Definition: az_iot_hub_client.h:47
Represents a "view" over a byte buffer that represents a contiguous region of memory....
Definition: az_span.h:33