Microsoft Azure IoTHub client libraries
Dependents: sht15_remote_monitoring RobotArmDemo iothub_client_sample_amqp f767zi_mqtt ... more
This library implements the Microsoft Azure IoTHub client library. The code is replicated from https://github.com/Azure/azure-iot-sdks
iothub_message.h@93:7c0bbb86b167, 2018-10-04 (annotated)
- Committer:
- AzureIoTClient
- Date:
- Thu Oct 04 09:15:49 2018 -0700
- Revision:
- 93:7c0bbb86b167
- Parent:
- 92:97148cf9aa2a
1.2.10
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
AzureIoTClient | 16:deba40344375 | 1 | // Copyright (c) Microsoft. All rights reserved. |
AzureIoTClient | 16:deba40344375 | 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. |
AzureIoTClient | 16:deba40344375 | 3 | |
AzureIoTClient | 16:deba40344375 | 4 | /** @file iothub_message.h |
AzureIoTClient | 92:97148cf9aa2a | 5 | * @brief The @c IoTHub_Message component encapsulates one message that |
AzureIoTClient | 16:deba40344375 | 6 | * can be transferred by an IoT hub client. |
AzureIoTClient | 16:deba40344375 | 7 | */ |
AzureIoTClient | 16:deba40344375 | 8 | |
AzureIoTClient | 16:deba40344375 | 9 | #ifndef IOTHUB_MESSAGE_H |
AzureIoTClient | 16:deba40344375 | 10 | #define IOTHUB_MESSAGE_H |
AzureIoTClient | 16:deba40344375 | 11 | |
Azure.IoT Build | 38:a05929a75111 | 12 | #include "azure_c_shared_utility/macro_utils.h" |
AzureIoTClient | 92:97148cf9aa2a | 13 | #include "azure_c_shared_utility/map.h" |
AzureIoTClient | 53:1e5a1ca1f274 | 14 | #include "azure_c_shared_utility/umock_c_prod.h" |
AzureIoTClient | 16:deba40344375 | 15 | |
AzureIoTClient | 16:deba40344375 | 16 | #ifdef __cplusplus |
AzureIoTClient | 16:deba40344375 | 17 | #include <cstddef> |
AzureIoTClient | 77:e4e36df9caee | 18 | extern "C" |
AzureIoTClient | 16:deba40344375 | 19 | { |
AzureIoTClient | 16:deba40344375 | 20 | #else |
AzureIoTClient | 16:deba40344375 | 21 | #include <stddef.h> |
AzureIoTClient | 16:deba40344375 | 22 | #endif |
AzureIoTClient | 16:deba40344375 | 23 | |
AzureIoTClient | 16:deba40344375 | 24 | #define IOTHUB_MESSAGE_RESULT_VALUES \ |
AzureIoTClient | 16:deba40344375 | 25 | IOTHUB_MESSAGE_OK, \ |
AzureIoTClient | 16:deba40344375 | 26 | IOTHUB_MESSAGE_INVALID_ARG, \ |
AzureIoTClient | 16:deba40344375 | 27 | IOTHUB_MESSAGE_INVALID_TYPE, \ |
AzureIoTClient | 16:deba40344375 | 28 | IOTHUB_MESSAGE_ERROR \ |
AzureIoTClient | 16:deba40344375 | 29 | |
AzureIoTClient | 77:e4e36df9caee | 30 | /** @brief Enumeration specifying the status of calls to various |
AzureIoTClient | 77:e4e36df9caee | 31 | * APIs in this module. |
AzureIoTClient | 77:e4e36df9caee | 32 | */ |
AzureIoTClient | 16:deba40344375 | 33 | DEFINE_ENUM(IOTHUB_MESSAGE_RESULT, IOTHUB_MESSAGE_RESULT_VALUES); |
AzureIoTClient | 16:deba40344375 | 34 | |
AzureIoTClient | 16:deba40344375 | 35 | #define IOTHUBMESSAGE_CONTENT_TYPE_VALUES \ |
AzureIoTClient | 16:deba40344375 | 36 | IOTHUBMESSAGE_BYTEARRAY, \ |
AzureIoTClient | 16:deba40344375 | 37 | IOTHUBMESSAGE_STRING, \ |
AzureIoTClient | 16:deba40344375 | 38 | IOTHUBMESSAGE_UNKNOWN \ |
AzureIoTClient | 16:deba40344375 | 39 | |
AzureIoTClient | 77:e4e36df9caee | 40 | /** @brief Enumeration specifying the content type of the a given |
AzureIoTClient | 77:e4e36df9caee | 41 | * message. |
AzureIoTClient | 77:e4e36df9caee | 42 | */ |
AzureIoTClient | 16:deba40344375 | 43 | DEFINE_ENUM(IOTHUBMESSAGE_CONTENT_TYPE, IOTHUBMESSAGE_CONTENT_TYPE_VALUES); |
AzureIoTClient | 16:deba40344375 | 44 | |
AzureIoTClient | 48:cc5d91f2b06d | 45 | typedef struct IOTHUB_MESSAGE_HANDLE_DATA_TAG* IOTHUB_MESSAGE_HANDLE; |
AzureIoTClient | 16:deba40344375 | 46 | |
AzureIoTClient | 77:e4e36df9caee | 47 | /** @brief diagnostic related data*/ |
AzureIoTClient | 77:e4e36df9caee | 48 | typedef struct IOTHUB_MESSAGE_DIAGNOSTIC_PROPERTY_DATA_TAG |
AzureIoTClient | 77:e4e36df9caee | 49 | { |
AzureIoTClient | 77:e4e36df9caee | 50 | char* diagnosticId; |
AzureIoTClient | 77:e4e36df9caee | 51 | char* diagnosticCreationTimeUtc; |
AzureIoTClient | 77:e4e36df9caee | 52 | }IOTHUB_MESSAGE_DIAGNOSTIC_PROPERTY_DATA, *IOTHUB_MESSAGE_DIAGNOSTIC_PROPERTY_DATA_HANDLE; |
AzureIoTClient | 77:e4e36df9caee | 53 | |
AzureIoTClient | 77:e4e36df9caee | 54 | static const char DIAG_CREATION_TIME_UTC_PROPERTY_NAME[] = "diag_creation_time_utc"; |
AzureIoTClient | 77:e4e36df9caee | 55 | |
AzureIoTClient | 16:deba40344375 | 56 | /** |
AzureIoTClient | 77:e4e36df9caee | 57 | * @brief Creates a new IoT hub message from a byte array. The type of the |
AzureIoTClient | 77:e4e36df9caee | 58 | * message will be set to @c IOTHUBMESSAGE_BYTEARRAY. |
AzureIoTClient | 77:e4e36df9caee | 59 | * |
AzureIoTClient | 77:e4e36df9caee | 60 | * @param byteArray The byte array from which the message is to be created. |
AzureIoTClient | 77:e4e36df9caee | 61 | * @param size The size of the byte array. |
AzureIoTClient | 77:e4e36df9caee | 62 | * |
AzureIoTClient | 77:e4e36df9caee | 63 | * @return A valid @c IOTHUB_MESSAGE_HANDLE if the message was successfully |
AzureIoTClient | 77:e4e36df9caee | 64 | * created or @c NULL in case an error occurs. |
AzureIoTClient | 77:e4e36df9caee | 65 | */ |
AzureIoTClient | 50:bbc71457b0ea | 66 | MOCKABLE_FUNCTION(, IOTHUB_MESSAGE_HANDLE, IoTHubMessage_CreateFromByteArray, const unsigned char*, byteArray, size_t, size); |
AzureIoTClient | 16:deba40344375 | 67 | |
AzureIoTClient | 16:deba40344375 | 68 | /** |
AzureIoTClient | 77:e4e36df9caee | 69 | * @brief Creates a new IoT hub message from a null terminated string. The |
AzureIoTClient | 77:e4e36df9caee | 70 | * type of the message will be set to @c IOTHUBMESSAGE_STRING. |
AzureIoTClient | 77:e4e36df9caee | 71 | * |
AzureIoTClient | 77:e4e36df9caee | 72 | * @param source The null terminated string from which the message is to be |
AzureIoTClient | 77:e4e36df9caee | 73 | * created. |
AzureIoTClient | 77:e4e36df9caee | 74 | * |
AzureIoTClient | 77:e4e36df9caee | 75 | * @return A valid @c IOTHUB_MESSAGE_HANDLE if the message was successfully |
AzureIoTClient | 77:e4e36df9caee | 76 | * created or @c NULL in case an error occurs. |
AzureIoTClient | 77:e4e36df9caee | 77 | */ |
AzureIoTClient | 50:bbc71457b0ea | 78 | MOCKABLE_FUNCTION(, IOTHUB_MESSAGE_HANDLE, IoTHubMessage_CreateFromString, const char*, source); |
AzureIoTClient | 16:deba40344375 | 79 | |
AzureIoTClient | 16:deba40344375 | 80 | /** |
AzureIoTClient | 77:e4e36df9caee | 81 | * @brief Creates a new IoT hub message with the content identical to that |
AzureIoTClient | 77:e4e36df9caee | 82 | * of the @p iotHubMessageHandle parameter. |
AzureIoTClient | 77:e4e36df9caee | 83 | * |
AzureIoTClient | 77:e4e36df9caee | 84 | * @param iotHubMessageHandle Handle to the message that is to be cloned. |
AzureIoTClient | 77:e4e36df9caee | 85 | * |
AzureIoTClient | 77:e4e36df9caee | 86 | * @return A valid @c IOTHUB_MESSAGE_HANDLE if the message was successfully |
AzureIoTClient | 77:e4e36df9caee | 87 | * cloned or @c NULL in case an error occurs. |
AzureIoTClient | 77:e4e36df9caee | 88 | */ |
AzureIoTClient | 50:bbc71457b0ea | 89 | MOCKABLE_FUNCTION(, IOTHUB_MESSAGE_HANDLE, IoTHubMessage_Clone, IOTHUB_MESSAGE_HANDLE, iotHubMessageHandle); |
AzureIoTClient | 16:deba40344375 | 90 | |
AzureIoTClient | 16:deba40344375 | 91 | /** |
AzureIoTClient | 77:e4e36df9caee | 92 | * @brief Fetches a pointer and size for the data associated with the IoT |
AzureIoTClient | 77:e4e36df9caee | 93 | * hub message handle. If the content type of the message is not |
AzureIoTClient | 77:e4e36df9caee | 94 | * @c IOTHUBMESSAGE_BYTEARRAY then the function returns |
AzureIoTClient | 77:e4e36df9caee | 95 | * @c IOTHUB_MESSAGE_INVALID_ARG. |
AzureIoTClient | 77:e4e36df9caee | 96 | * |
AzureIoTClient | 77:e4e36df9caee | 97 | * @param iotHubMessageHandle Handle to the message. |
AzureIoTClient | 77:e4e36df9caee | 98 | * @param buffer Pointer to the memory location where the |
AzureIoTClient | 77:e4e36df9caee | 99 | * pointer to the buffer will be written. |
AzureIoTClient | 77:e4e36df9caee | 100 | * @param size The size of the buffer will be written to |
AzureIoTClient | 77:e4e36df9caee | 101 | * this address. |
AzureIoTClient | 77:e4e36df9caee | 102 | * |
AzureIoTClient | 77:e4e36df9caee | 103 | * @return Returns IOTHUB_MESSAGE_OK if the byte array was fetched successfully |
AzureIoTClient | 77:e4e36df9caee | 104 | * or an error code otherwise. |
AzureIoTClient | 77:e4e36df9caee | 105 | */ |
AzureIoTClient | 50:bbc71457b0ea | 106 | MOCKABLE_FUNCTION(, IOTHUB_MESSAGE_RESULT, IoTHubMessage_GetByteArray, IOTHUB_MESSAGE_HANDLE, iotHubMessageHandle, const unsigned char**, buffer, size_t*, size); |
AzureIoTClient | 16:deba40344375 | 107 | |
AzureIoTClient | 16:deba40344375 | 108 | /** |
AzureIoTClient | 77:e4e36df9caee | 109 | * @brief Returns the null terminated string stored in the message. |
AzureIoTClient | 77:e4e36df9caee | 110 | * If the content type of the message is not @c IOTHUBMESSAGE_STRING |
AzureIoTClient | 77:e4e36df9caee | 111 | * then the function returns @c NULL. |
AzureIoTClient | 77:e4e36df9caee | 112 | * |
AzureIoTClient | 77:e4e36df9caee | 113 | * @param iotHubMessageHandle Handle to the message. |
AzureIoTClient | 77:e4e36df9caee | 114 | * |
AzureIoTClient | 77:e4e36df9caee | 115 | * @return @c NULL if an error occurs or a pointer to the stored null |
AzureIoTClient | 77:e4e36df9caee | 116 | * terminated string otherwise. |
AzureIoTClient | 77:e4e36df9caee | 117 | */ |
AzureIoTClient | 50:bbc71457b0ea | 118 | MOCKABLE_FUNCTION(, const char*, IoTHubMessage_GetString, IOTHUB_MESSAGE_HANDLE, iotHubMessageHandle); |
AzureIoTClient | 16:deba40344375 | 119 | |
AzureIoTClient | 16:deba40344375 | 120 | /** |
AzureIoTClient | 77:e4e36df9caee | 121 | * @brief Returns the content type of the message given by parameter |
AzureIoTClient | 77:e4e36df9caee | 122 | * @c iotHubMessageHandle. |
AzureIoTClient | 77:e4e36df9caee | 123 | * |
AzureIoTClient | 77:e4e36df9caee | 124 | * @param iotHubMessageHandle Handle to the message. |
AzureIoTClient | 77:e4e36df9caee | 125 | * |
AzureIoTClient | 77:e4e36df9caee | 126 | * @remarks This function retrieves the standardized type of the payload, which indicates if @c iotHubMessageHandle was created using a String or a Byte Array. |
AzureIoTClient | 77:e4e36df9caee | 127 | * |
AzureIoTClient | 77:e4e36df9caee | 128 | * @return An @c IOTHUBMESSAGE_CONTENT_TYPE value. |
AzureIoTClient | 77:e4e36df9caee | 129 | */ |
AzureIoTClient | 50:bbc71457b0ea | 130 | MOCKABLE_FUNCTION(, IOTHUBMESSAGE_CONTENT_TYPE, IoTHubMessage_GetContentType, IOTHUB_MESSAGE_HANDLE, iotHubMessageHandle); |
AzureIoTClient | 16:deba40344375 | 131 | |
AzureIoTClient | 16:deba40344375 | 132 | /** |
AzureIoTClient | 74:ea0021abecf7 | 133 | * @brief Sets the content-type of the message payload, as per supported values on RFC 2046. |
AzureIoTClient | 74:ea0021abecf7 | 134 | * |
AzureIoTClient | 74:ea0021abecf7 | 135 | * @param iotHubMessageHandle Handle to the message. |
AzureIoTClient | 74:ea0021abecf7 | 136 | * |
AzureIoTClient | 74:ea0021abecf7 | 137 | * @param contentType String defining the type of the payload (e.g., text/plain). |
AzureIoTClient | 74:ea0021abecf7 | 138 | * |
AzureIoTClient | 74:ea0021abecf7 | 139 | * @return An @c IOTHUB_MESSAGE_RESULT value. |
AzureIoTClient | 74:ea0021abecf7 | 140 | */ |
AzureIoTClient | 74:ea0021abecf7 | 141 | MOCKABLE_FUNCTION(, IOTHUB_MESSAGE_RESULT, IoTHubMessage_SetContentTypeSystemProperty, IOTHUB_MESSAGE_HANDLE, iotHubMessageHandle, const char*, contentType); |
AzureIoTClient | 74:ea0021abecf7 | 142 | |
AzureIoTClient | 74:ea0021abecf7 | 143 | /** |
AzureIoTClient | 74:ea0021abecf7 | 144 | * @brief Returns the content-type of the message payload, if defined. |
AzureIoTClient | 74:ea0021abecf7 | 145 | * |
AzureIoTClient | 74:ea0021abecf7 | 146 | * @param iotHubMessageHandle Handle to the message. |
AzureIoTClient | 74:ea0021abecf7 | 147 | * |
AzureIoTClient | 74:ea0021abecf7 | 148 | * @return A string with the content-type value if defined (or NULL otherwise). |
AzureIoTClient | 74:ea0021abecf7 | 149 | */ |
AzureIoTClient | 74:ea0021abecf7 | 150 | MOCKABLE_FUNCTION(, const char*, IoTHubMessage_GetContentTypeSystemProperty, IOTHUB_MESSAGE_HANDLE, iotHubMessageHandle); |
AzureIoTClient | 74:ea0021abecf7 | 151 | |
AzureIoTClient | 74:ea0021abecf7 | 152 | /** |
AzureIoTClient | 74:ea0021abecf7 | 153 | * @brief Sets the content-encoding of the message payload, as per supported values on RFC 2616. |
AzureIoTClient | 74:ea0021abecf7 | 154 | * |
AzureIoTClient | 74:ea0021abecf7 | 155 | * @param iotHubMessageHandle Handle to the message. |
AzureIoTClient | 74:ea0021abecf7 | 156 | * |
AzureIoTClient | 74:ea0021abecf7 | 157 | * @param contentEncoding String defining the encoding of the payload (e.g., utf-8). |
AzureIoTClient | 74:ea0021abecf7 | 158 | * |
AzureIoTClient | 74:ea0021abecf7 | 159 | * @return An @c IOTHUB_MESSAGE_RESULT value. |
AzureIoTClient | 74:ea0021abecf7 | 160 | */ |
AzureIoTClient | 74:ea0021abecf7 | 161 | MOCKABLE_FUNCTION(, IOTHUB_MESSAGE_RESULT, IoTHubMessage_SetContentEncodingSystemProperty, IOTHUB_MESSAGE_HANDLE, iotHubMessageHandle, const char*, contentEncoding); |
AzureIoTClient | 74:ea0021abecf7 | 162 | |
AzureIoTClient | 74:ea0021abecf7 | 163 | /** |
AzureIoTClient | 74:ea0021abecf7 | 164 | * @brief Returns the content-encoding of the message payload, if defined. |
AzureIoTClient | 74:ea0021abecf7 | 165 | * |
AzureIoTClient | 74:ea0021abecf7 | 166 | * @param iotHubMessageHandle Handle to the message. |
AzureIoTClient | 74:ea0021abecf7 | 167 | * |
AzureIoTClient | 74:ea0021abecf7 | 168 | * @return A string with the content-encoding value if defined (or NULL otherwise). |
AzureIoTClient | 74:ea0021abecf7 | 169 | */ |
AzureIoTClient | 74:ea0021abecf7 | 170 | MOCKABLE_FUNCTION(, const char*, IoTHubMessage_GetContentEncodingSystemProperty, IOTHUB_MESSAGE_HANDLE, iotHubMessageHandle); |
AzureIoTClient | 74:ea0021abecf7 | 171 | |
AzureIoTClient | 74:ea0021abecf7 | 172 | /** |
AzureIoTClient | 92:97148cf9aa2a | 173 | ** DEPRECATED: Use IoTHubMessage_SetProperty and IoTHubMessage_GetProperty instead. ** |
AzureIoTClient | 77:e4e36df9caee | 174 | * @brief Gets a handle to the message's properties map. |
AzureIoTClient | 92:97148cf9aa2a | 175 | * Note that when sending messages via the HTTP transport, the key names in the map must not contain spaces. |
AzureIoTClient | 77:e4e36df9caee | 176 | * |
AzureIoTClient | 77:e4e36df9caee | 177 | * @param iotHubMessageHandle Handle to the message. |
AzureIoTClient | 77:e4e36df9caee | 178 | * |
AzureIoTClient | 77:e4e36df9caee | 179 | * @return A @c MAP_HANDLE pointing to the properties map for this message. |
AzureIoTClient | 77:e4e36df9caee | 180 | */ |
AzureIoTClient | 50:bbc71457b0ea | 181 | MOCKABLE_FUNCTION(, MAP_HANDLE, IoTHubMessage_Properties, IOTHUB_MESSAGE_HANDLE, iotHubMessageHandle); |
AzureIoTClient | 16:deba40344375 | 182 | |
AzureIoTClient | 16:deba40344375 | 183 | /** |
AzureIoTClient | 88:248736be106e | 184 | * @brief Sets a property on a Iothub Message. |
AzureIoTClient | 88:248736be106e | 185 | * |
AzureIoTClient | 88:248736be106e | 186 | * @param iotHubMessageHandle Handle to the message. |
AzureIoTClient | 88:248736be106e | 187 | * |
AzureIoTClient | 92:97148cf9aa2a | 188 | * @param key name of the property to set. Note that when sending messages via the HTTP transport, this value must not contain spaces. |
AzureIoTClient | 88:248736be106e | 189 | * |
AzureIoTClient | 88:248736be106e | 190 | * @param value of the property to set. |
AzureIoTClient | 88:248736be106e | 191 | * |
AzureIoTClient | 88:248736be106e | 192 | * @return An @c IOTHUB_MESSAGE_RESULT value indicating the result of setting the property. |
AzureIoTClient | 88:248736be106e | 193 | */ |
AzureIoTClient | 88:248736be106e | 194 | MOCKABLE_FUNCTION(, IOTHUB_MESSAGE_RESULT, IoTHubMessage_SetProperty, IOTHUB_MESSAGE_HANDLE, iotHubMessageHandle, const char*, key, const char*, value); |
AzureIoTClient | 88:248736be106e | 195 | |
AzureIoTClient | 88:248736be106e | 196 | /** |
AzureIoTClient | 88:248736be106e | 197 | * @brief Gets a IotHub Message's properties item. |
AzureIoTClient | 88:248736be106e | 198 | * |
AzureIoTClient | 88:248736be106e | 199 | * @param iotHubMessageHandle Handle to the message. |
AzureIoTClient | 88:248736be106e | 200 | * |
AzureIoTClient | 88:248736be106e | 201 | * @param key name of the property to retrieve. |
AzureIoTClient | 88:248736be106e | 202 | * |
AzureIoTClient | 88:248736be106e | 203 | * @return A string with the property's value, or NULL if it does not exist in the properties list. |
AzureIoTClient | 88:248736be106e | 204 | */ |
AzureIoTClient | 88:248736be106e | 205 | MOCKABLE_FUNCTION(, const char*, IoTHubMessage_GetProperty, IOTHUB_MESSAGE_HANDLE, iotHubMessageHandle, const char*, key); |
AzureIoTClient | 88:248736be106e | 206 | |
AzureIoTClient | 88:248736be106e | 207 | /** |
AzureIoTClient | 18:1e9adb15c645 | 208 | * @brief Gets the MessageId from the IOTHUB_MESSAGE_HANDLE. |
AzureIoTClient | 18:1e9adb15c645 | 209 | * |
AzureIoTClient | 18:1e9adb15c645 | 210 | * @param iotHubMessageHandle Handle to the message. |
AzureIoTClient | 18:1e9adb15c645 | 211 | * |
AzureIoTClient | 18:1e9adb15c645 | 212 | * @return A const char* pointing to the Message Id. |
AzureIoTClient | 18:1e9adb15c645 | 213 | */ |
AzureIoTClient | 50:bbc71457b0ea | 214 | MOCKABLE_FUNCTION(, const char*, IoTHubMessage_GetMessageId, IOTHUB_MESSAGE_HANDLE, iotHubMessageHandle); |
AzureIoTClient | 18:1e9adb15c645 | 215 | |
AzureIoTClient | 18:1e9adb15c645 | 216 | /** |
AzureIoTClient | 18:1e9adb15c645 | 217 | * @brief Sets the MessageId for the IOTHUB_MESSAGE_HANDLE. |
AzureIoTClient | 18:1e9adb15c645 | 218 | * |
AzureIoTClient | 18:1e9adb15c645 | 219 | * @param iotHubMessageHandle Handle to the message. |
AzureIoTClient | 18:1e9adb15c645 | 220 | * @param messageId Pointer to the memory location of the messageId |
AzureIoTClient | 18:1e9adb15c645 | 221 | * |
AzureIoTClient | 18:1e9adb15c645 | 222 | * @return Returns IOTHUB_MESSAGE_OK if the messageId was set successfully |
AzureIoTClient | 18:1e9adb15c645 | 223 | * or an error code otherwise. |
AzureIoTClient | 18:1e9adb15c645 | 224 | */ |
AzureIoTClient | 50:bbc71457b0ea | 225 | MOCKABLE_FUNCTION(, IOTHUB_MESSAGE_RESULT, IoTHubMessage_SetMessageId, IOTHUB_MESSAGE_HANDLE, iotHubMessageHandle, const char*, messageId); |
AzureIoTClient | 18:1e9adb15c645 | 226 | |
AzureIoTClient | 18:1e9adb15c645 | 227 | /** |
AzureIoTClient | 18:1e9adb15c645 | 228 | * @brief Gets the CorrelationId from the IOTHUB_MESSAGE_HANDLE. |
AzureIoTClient | 18:1e9adb15c645 | 229 | * |
AzureIoTClient | 18:1e9adb15c645 | 230 | * @param iotHubMessageHandle Handle to the message. |
AzureIoTClient | 18:1e9adb15c645 | 231 | * |
AzureIoTClient | 18:1e9adb15c645 | 232 | * @return A const char* pointing to the Correlation Id. |
AzureIoTClient | 18:1e9adb15c645 | 233 | */ |
AzureIoTClient | 50:bbc71457b0ea | 234 | MOCKABLE_FUNCTION(, const char*, IoTHubMessage_GetCorrelationId, IOTHUB_MESSAGE_HANDLE, iotHubMessageHandle); |
AzureIoTClient | 18:1e9adb15c645 | 235 | |
AzureIoTClient | 18:1e9adb15c645 | 236 | /** |
AzureIoTClient | 18:1e9adb15c645 | 237 | * @brief Sets the CorrelationId for the IOTHUB_MESSAGE_HANDLE. |
AzureIoTClient | 18:1e9adb15c645 | 238 | * |
AzureIoTClient | 18:1e9adb15c645 | 239 | * @param iotHubMessageHandle Handle to the message. |
AzureIoTClient | 18:1e9adb15c645 | 240 | * @param correlationId Pointer to the memory location of the messageId |
AzureIoTClient | 18:1e9adb15c645 | 241 | * |
AzureIoTClient | 18:1e9adb15c645 | 242 | * @return Returns IOTHUB_MESSAGE_OK if the messageId was set successfully |
AzureIoTClient | 18:1e9adb15c645 | 243 | * or an error code otherwise. |
AzureIoTClient | 18:1e9adb15c645 | 244 | */ |
AzureIoTClient | 50:bbc71457b0ea | 245 | MOCKABLE_FUNCTION(, IOTHUB_MESSAGE_RESULT, IoTHubMessage_SetCorrelationId, IOTHUB_MESSAGE_HANDLE, iotHubMessageHandle, const char*, correlationId); |
AzureIoTClient | 18:1e9adb15c645 | 246 | |
AzureIoTClient | 18:1e9adb15c645 | 247 | /** |
AzureIoTClient | 77:e4e36df9caee | 248 | * @brief Gets the DiagnosticData from the IOTHUB_MESSAGE_HANDLE. CAUTION: SDK user should not call it directly, it is for internal use only. |
AzureIoTClient | 77:e4e36df9caee | 249 | * |
AzureIoTClient | 77:e4e36df9caee | 250 | * @param iotHubMessageHandle Handle to the message. |
AzureIoTClient | 77:e4e36df9caee | 251 | * |
AzureIoTClient | 77:e4e36df9caee | 252 | * @return A const IOTHUB_MESSAGE_DIAGNOSTIC_PROPERTY_DATA* pointing to the diagnostic property data. |
AzureIoTClient | 77:e4e36df9caee | 253 | */ |
AzureIoTClient | 77:e4e36df9caee | 254 | MOCKABLE_FUNCTION(, const IOTHUB_MESSAGE_DIAGNOSTIC_PROPERTY_DATA*, IoTHubMessage_GetDiagnosticPropertyData, IOTHUB_MESSAGE_HANDLE, iotHubMessageHandle); |
AzureIoTClient | 77:e4e36df9caee | 255 | |
AzureIoTClient | 77:e4e36df9caee | 256 | /** |
AzureIoTClient | 77:e4e36df9caee | 257 | * @brief Sets the DiagnosticData for the IOTHUB_MESSAGE_HANDLE. CAUTION: SDK user should not call it directly, it is for internal use only. |
AzureIoTClient | 77:e4e36df9caee | 258 | * |
AzureIoTClient | 77:e4e36df9caee | 259 | * @param iotHubMessageHandle Handle to the message. |
AzureIoTClient | 77:e4e36df9caee | 260 | * @param diagnosticData Pointer to the memory location of the diagnosticData |
AzureIoTClient | 77:e4e36df9caee | 261 | * |
AzureIoTClient | 77:e4e36df9caee | 262 | * @return Returns IOTHUB_MESSAGE_OK if the DiagnosticData was set successfully |
AzureIoTClient | 77:e4e36df9caee | 263 | * or an error code otherwise. |
AzureIoTClient | 77:e4e36df9caee | 264 | */ |
AzureIoTClient | 77:e4e36df9caee | 265 | MOCKABLE_FUNCTION(, IOTHUB_MESSAGE_RESULT, IoTHubMessage_SetDiagnosticPropertyData, IOTHUB_MESSAGE_HANDLE, iotHubMessageHandle, const IOTHUB_MESSAGE_DIAGNOSTIC_PROPERTY_DATA*, diagnosticData); |
AzureIoTClient | 77:e4e36df9caee | 266 | |
AzureIoTClient | 77:e4e36df9caee | 267 | /** |
AzureIoTClient | 89:a2ed767a532e | 268 | * @brief Gets the output name from the IOTHUB_MESSAGE_HANDLE. |
AzureIoTClient | 89:a2ed767a532e | 269 | * |
AzureIoTClient | 89:a2ed767a532e | 270 | * @param iotHubMessageHandle Handle to the message. |
AzureIoTClient | 89:a2ed767a532e | 271 | * |
AzureIoTClient | 89:a2ed767a532e | 272 | * @return A const char* pointing to the Output Id. |
AzureIoTClient | 89:a2ed767a532e | 273 | */ |
AzureIoTClient | 89:a2ed767a532e | 274 | MOCKABLE_FUNCTION(, const char*, IoTHubMessage_GetOutputName, IOTHUB_MESSAGE_HANDLE, iotHubMessageHandle); |
AzureIoTClient | 89:a2ed767a532e | 275 | |
AzureIoTClient | 89:a2ed767a532e | 276 | |
AzureIoTClient | 89:a2ed767a532e | 277 | /** |
AzureIoTClient | 89:a2ed767a532e | 278 | * @brief Sets output for named queues. CAUTION: SDK user should not call it directly, it is for internal use only. |
AzureIoTClient | 89:a2ed767a532e | 279 | * |
AzureIoTClient | 89:a2ed767a532e | 280 | * @param iotHubMessageHandle Handle to the message. |
AzureIoTClient | 89:a2ed767a532e | 281 | * @param outputName Pointer to the queue to output message to |
AzureIoTClient | 89:a2ed767a532e | 282 | * |
AzureIoTClient | 89:a2ed767a532e | 283 | * @return Returns IOTHUB_MESSAGE_OK if the DiagnosticData was set successfully |
AzureIoTClient | 89:a2ed767a532e | 284 | * or an error code otherwise. |
AzureIoTClient | 89:a2ed767a532e | 285 | */ |
AzureIoTClient | 89:a2ed767a532e | 286 | MOCKABLE_FUNCTION(, IOTHUB_MESSAGE_RESULT, IoTHubMessage_SetOutputName, IOTHUB_MESSAGE_HANDLE, iotHubMessageHandle, const char*, outputName); |
AzureIoTClient | 89:a2ed767a532e | 287 | |
AzureIoTClient | 89:a2ed767a532e | 288 | |
AzureIoTClient | 89:a2ed767a532e | 289 | /** |
AzureIoTClient | 89:a2ed767a532e | 290 | * @brief Gets the input name from the IOTHUB_MESSAGE_HANDLE. |
AzureIoTClient | 89:a2ed767a532e | 291 | * |
AzureIoTClient | 89:a2ed767a532e | 292 | * @param iotHubMessageHandle Handle to the message. |
AzureIoTClient | 89:a2ed767a532e | 293 | * |
AzureIoTClient | 89:a2ed767a532e | 294 | * @return A const char* pointing to the Input Id. |
AzureIoTClient | 89:a2ed767a532e | 295 | */ |
AzureIoTClient | 89:a2ed767a532e | 296 | MOCKABLE_FUNCTION(, const char*, IoTHubMessage_GetInputName, IOTHUB_MESSAGE_HANDLE, iotHubMessageHandle); |
AzureIoTClient | 89:a2ed767a532e | 297 | |
AzureIoTClient | 89:a2ed767a532e | 298 | /** |
AzureIoTClient | 89:a2ed767a532e | 299 | * @brief Sets input for named queues. CAUTION: SDK user should not call it directly, it is for internal use only. |
AzureIoTClient | 89:a2ed767a532e | 300 | * |
AzureIoTClient | 89:a2ed767a532e | 301 | * @param iotHubMessageHandle Handle to the message. |
AzureIoTClient | 89:a2ed767a532e | 302 | * @param inputName Pointer to the queue to input message to |
AzureIoTClient | 89:a2ed767a532e | 303 | * |
AzureIoTClient | 89:a2ed767a532e | 304 | * @return Returns IOTHUB_MESSAGE_OK if the DiagnosticData was set successfully |
AzureIoTClient | 89:a2ed767a532e | 305 | * or an error code otherwise. |
AzureIoTClient | 89:a2ed767a532e | 306 | */ |
AzureIoTClient | 89:a2ed767a532e | 307 | MOCKABLE_FUNCTION(, IOTHUB_MESSAGE_RESULT, IoTHubMessage_SetInputName, IOTHUB_MESSAGE_HANDLE, iotHubMessageHandle, const char*, inputName); |
AzureIoTClient | 89:a2ed767a532e | 308 | |
AzureIoTClient | 89:a2ed767a532e | 309 | /** |
AzureIoTClient | 89:a2ed767a532e | 310 | * @brief Gets the module name from the IOTHUB_MESSAGE_HANDLE. |
AzureIoTClient | 89:a2ed767a532e | 311 | * |
AzureIoTClient | 89:a2ed767a532e | 312 | * @param iotHubMessageHandle Handle to the message. |
AzureIoTClient | 89:a2ed767a532e | 313 | * |
AzureIoTClient | 89:a2ed767a532e | 314 | * @return A const char* pointing to the connection module Id. |
AzureIoTClient | 89:a2ed767a532e | 315 | */ |
AzureIoTClient | 89:a2ed767a532e | 316 | MOCKABLE_FUNCTION(, const char*, IoTHubMessage_GetConnectionModuleId, IOTHUB_MESSAGE_HANDLE, iotHubMessageHandle); |
AzureIoTClient | 89:a2ed767a532e | 317 | |
AzureIoTClient | 89:a2ed767a532e | 318 | /** |
AzureIoTClient | 89:a2ed767a532e | 319 | * @brief Sets connection module ID. CAUTION: SDK user should not call it directly, it is for internal use only. |
AzureIoTClient | 89:a2ed767a532e | 320 | * |
AzureIoTClient | 89:a2ed767a532e | 321 | * @param iotHubMessageHandle Handle to the message. |
AzureIoTClient | 89:a2ed767a532e | 322 | * @param connectionModuleId Pointer to the module ID of connector |
AzureIoTClient | 89:a2ed767a532e | 323 | * |
AzureIoTClient | 89:a2ed767a532e | 324 | * @return Returns IOTHUB_MESSAGE_OK if the DiagnosticData was set successfully |
AzureIoTClient | 89:a2ed767a532e | 325 | * or an error code otherwise. |
AzureIoTClient | 89:a2ed767a532e | 326 | */ |
AzureIoTClient | 89:a2ed767a532e | 327 | MOCKABLE_FUNCTION(, IOTHUB_MESSAGE_RESULT, IoTHubMessage_SetConnectionModuleId, IOTHUB_MESSAGE_HANDLE, iotHubMessageHandle, const char*, connectionModuleId); |
AzureIoTClient | 89:a2ed767a532e | 328 | |
AzureIoTClient | 89:a2ed767a532e | 329 | |
AzureIoTClient | 89:a2ed767a532e | 330 | /** |
AzureIoTClient | 89:a2ed767a532e | 331 | * @brief Gets the connection device ID from the IOTHUB_MESSAGE_HANDLE. |
AzureIoTClient | 89:a2ed767a532e | 332 | * |
AzureIoTClient | 89:a2ed767a532e | 333 | * @param iotHubMessageHandle Handle to the message. |
AzureIoTClient | 89:a2ed767a532e | 334 | * |
AzureIoTClient | 89:a2ed767a532e | 335 | * @return A const char* pointing to the connection device Id. |
AzureIoTClient | 89:a2ed767a532e | 336 | */ |
AzureIoTClient | 89:a2ed767a532e | 337 | MOCKABLE_FUNCTION(, const char*, IoTHubMessage_GetConnectionDeviceId, IOTHUB_MESSAGE_HANDLE, iotHubMessageHandle); |
AzureIoTClient | 89:a2ed767a532e | 338 | |
AzureIoTClient | 89:a2ed767a532e | 339 | /** |
AzureIoTClient | 89:a2ed767a532e | 340 | * @brief Sets connection device Id. CAUTION: SDK user should not call it directly, it is for internal use only. |
AzureIoTClient | 89:a2ed767a532e | 341 | * |
AzureIoTClient | 89:a2ed767a532e | 342 | * @param iotHubMessageHandle Handle to the message. |
AzureIoTClient | 89:a2ed767a532e | 343 | * @param connectionDeviceId Pointer to the device ID of connector |
AzureIoTClient | 89:a2ed767a532e | 344 | * |
AzureIoTClient | 89:a2ed767a532e | 345 | * @return Returns IOTHUB_MESSAGE_OK if the DiagnosticData was set successfully |
AzureIoTClient | 89:a2ed767a532e | 346 | * or an error code otherwise. |
AzureIoTClient | 89:a2ed767a532e | 347 | */ |
AzureIoTClient | 89:a2ed767a532e | 348 | MOCKABLE_FUNCTION(, IOTHUB_MESSAGE_RESULT, IoTHubMessage_SetConnectionDeviceId, IOTHUB_MESSAGE_HANDLE, iotHubMessageHandle, const char*, connectionDeviceId); |
AzureIoTClient | 89:a2ed767a532e | 349 | |
AzureIoTClient | 89:a2ed767a532e | 350 | |
AzureIoTClient | 89:a2ed767a532e | 351 | /** |
AzureIoTClient | 77:e4e36df9caee | 352 | * @brief Frees all resources associated with the given message handle. |
AzureIoTClient | 77:e4e36df9caee | 353 | * |
AzureIoTClient | 77:e4e36df9caee | 354 | * @param iotHubMessageHandle Handle to the message. |
AzureIoTClient | 77:e4e36df9caee | 355 | */ |
AzureIoTClient | 50:bbc71457b0ea | 356 | MOCKABLE_FUNCTION(, void, IoTHubMessage_Destroy, IOTHUB_MESSAGE_HANDLE, iotHubMessageHandle); |
AzureIoTClient | 16:deba40344375 | 357 | |
AzureIoTClient | 16:deba40344375 | 358 | #ifdef __cplusplus |
AzureIoTClient | 16:deba40344375 | 359 | } |
AzureIoTClient | 16:deba40344375 | 360 | #endif |
AzureIoTClient | 16:deba40344375 | 361 | |
AzureIoTClient | 16:deba40344375 | 362 | #endif /* IOTHUB_MESSAGE_H */ |