Go to the documentation of this file.
15 #ifndef _az_IOT_CORE_H
16 #define _az_IOT_CORE_H
25 #include <azure/core/_az_cfg_prefix.h>
48 = _az_LOG_MAKE_CLASSIFICATION(_az_FACILITY_IOT_MQTT, 1),
51 = _az_LOG_MAKE_CLASSIFICATION(_az_FACILITY_IOT_MQTT, 2),
56 = _az_LOG_MAKE_CLASSIFICATION(_az_FACILITY_IOT, 2),
59 = _az_LOG_MAKE_CLASSIFICATION(_az_FACILITY_IOT, 3),
62 = _az_LOG_MAKE_CLASSIFICATION(_az_FACILITY_IOT, 4),
67 AZ_IOT_DEFAULT_MQTT_CONNECT_PORT = 8883,
68 AZ_IOT_DEFAULT_MQTT_CONNECT_KEEPALIVE_SECONDS = 240
80 AZ_IOT_STATUS_UNKNOWN = 0,
83 AZ_IOT_STATUS_OK = 200,
84 AZ_IOT_STATUS_ACCEPTED = 202,
85 AZ_IOT_STATUS_NO_CONTENT = 204,
88 AZ_IOT_STATUS_BAD_REQUEST = 400,
89 AZ_IOT_STATUS_UNAUTHORIZED = 401,
90 AZ_IOT_STATUS_FORBIDDEN = 403,
91 AZ_IOT_STATUS_NOT_FOUND = 404,
92 AZ_IOT_STATUS_NOT_ALLOWED = 405,
93 AZ_IOT_STATUS_NOT_CONFLICT = 409,
94 AZ_IOT_STATUS_PRECONDITION_FAILED = 412,
95 AZ_IOT_STATUS_REQUEST_TOO_LARGE = 413,
96 AZ_IOT_STATUS_UNSUPPORTED_TYPE = 415,
97 AZ_IOT_STATUS_THROTTLED = 429,
98 AZ_IOT_STATUS_CLIENT_CLOSED = 499,
99 AZ_IOT_STATUS_SERVER_ERROR = 500,
100 AZ_IOT_STATUS_BAD_GATEWAY = 502,
101 AZ_IOT_STATUS_SERVICE_UNAVAILABLE = 503,
102 AZ_IOT_STATUS_TIMEOUT = 504,
117 #define AZ_IOT_MESSAGE_PROPERTIES_MESSAGE_ID "%24.mid"
124 #define AZ_IOT_MESSAGE_PROPERTIES_CORRELATION_ID "%24.cid"
129 #define AZ_IOT_MESSAGE_PROPERTIES_CONTENT_TYPE "%24.ct"
134 #define AZ_IOT_MESSAGE_PROPERTIES_CONTENT_ENCODING "%24.ce"
139 #define AZ_IOT_MESSAGE_PROPERTIES_USER_ID "%24.uid"
144 #define AZ_IOT_MESSAGE_PROPERTIES_CREATION_TIME "%24.ctime"
149 #define AZ_IOT_MESSAGE_COMPONENT_NAME "%24.sub"
160 int32_t properties_written;
161 uint32_t current_property_index;
185 int32_t written_length);
254 return status < AZ_IOT_STATUS_BAD_REQUEST;
266 return ((status == AZ_IOT_STATUS_THROTTLED) || (status == AZ_IOT_STATUS_SERVER_ERROR));
287 int32_t operation_msec,
289 int32_t min_retry_delay_msec,
290 int32_t max_retry_delay_msec,
291 int32_t random_jitter_msec);
293 #include <azure/core/_az_cfg_suffix.h>
295 #endif // _az_IOT_CORE_H
Definition of az_result and helper functions.
This header defines the types and functions your application uses to be notified of Azure SDK client ...
AZ_NODISCARD az_result az_iot_message_properties_next(az_iot_message_properties *properties, az_span *out_name, az_span *out_value)
Iterates over the list of properties.
AZ_NODISCARD int32_t az_iot_calculate_retry_delay(int32_t operation_msec, int16_t attempt, int32_t min_retry_delay_msec, int32_t max_retry_delay_msec, int32_t random_jitter_msec)
Calculates the recommended delay before retrying an operation that failed.
@ AZ_ERROR_IOT_END_OF_PROPERTIES
While iterating, there are no more properties to return.
Definition: az_iot_common.h:38
int32_t az_result
The type represents the various success and error conditions.
Definition: az_result.h:46
@ AZ_LOG_IOT_SAS_TOKEN
IoT Client generated new SAS token.
Definition: az_iot_common.h:55
AZ_NODISCARD AZ_INLINE bool az_iot_status_retriable(az_iot_status status)
Checks if the status indicates a retriable error occurred during the operation.
Definition: az_iot_common.h:264
@ AZ_ERROR_IOT_TOPIC_NO_MATCH
The IoT topic is not matching the expected format.
Definition: az_iot_common.h:35
az_result_iot
The type represents the various az_result success and error conditions specific to the IoT clients wi...
Definition: az_iot_common.h:32
@ AZ_LOG_MQTT_RECEIVED_TOPIC
Accepted MQTT topic received.
Definition: az_iot_common.h:47
Telemetry or C2D properties.
Definition: az_iot_common.h:156
An az_span represents a contiguous byte buffer and is used for string manipulations,...
@ AZ_LOG_IOT_ADU
Azure IoT classification for ADU APIs.
Definition: az_iot_common.h:61
AZ_NODISCARD az_result az_iot_message_properties_init(az_iot_message_properties *properties, az_span buffer, int32_t written_length)
Initializes the Telemetry or C2D properties.
@ AZ_LOG_MQTT_RECEIVED_PAYLOAD
Accepted MQTT payload received.
Definition: az_iot_common.h:50
AZ_NODISCARD az_result az_iot_message_properties_append(az_iot_message_properties *properties, az_span name, az_span value)
Appends a name-value property to the list of properties.
az_log_classification_iot
Identifies the az_log_classification produced specifically by the IoT clients within the SDK.
Definition: az_iot_common.h:46
AZ_NODISCARD az_result az_iot_message_properties_find(az_iot_message_properties *properties, az_span name, az_span *out_value)
Finds the value of a property.
@ AZ_LOG_IOT_RETRY
IoT Client retry.
Definition: az_iot_common.h:53
az_iot_status
Azure IoT service status codes.
Definition: az_iot_common.h:78
@ AZ_LOG_IOT_AZURERTOS
Azure IoT classification for Azure RTOS.
Definition: az_iot_common.h:58
Represents a "view" over a byte buffer that represents a contiguous region of memory....
Definition: az_span.h:33
AZ_NODISCARD AZ_INLINE bool az_iot_status_succeeded(az_iot_status status)
Checks if the status indicates a successful operation.
Definition: az_iot_common.h:252