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
Diff: iothub_message.h
- Revision:
- 50:bbc71457b0ea
- Parent:
- 48:cc5d91f2b06d
- Child:
- 51:2550e3ad7bb0
diff -r d4d1becced7d -r bbc71457b0ea iothub_message.h --- a/iothub_message.h Fri Aug 26 12:58:54 2016 -0700 +++ b/iothub_message.h Fri Sep 09 13:37:43 2016 -0700 @@ -57,7 +57,7 @@ * @return A valid @c IOTHUB_MESSAGE_HANDLE if the message was successfully * created or @c NULL in case an error occurs. */ -extern IOTHUB_MESSAGE_HANDLE IoTHubMessage_CreateFromByteArray(const unsigned char* byteArray, size_t size); +MOCKABLE_FUNCTION(, IOTHUB_MESSAGE_HANDLE, IoTHubMessage_CreateFromByteArray, const unsigned char*, byteArray, size_t, size); /** * @brief Creates a new IoT hub message from a null terminated string. The @@ -69,7 +69,7 @@ * @return A valid @c IOTHUB_MESSAGE_HANDLE if the message was successfully * created or @c NULL in case an error occurs. */ -extern IOTHUB_MESSAGE_HANDLE IoTHubMessage_CreateFromString(const char* source); +MOCKABLE_FUNCTION(, IOTHUB_MESSAGE_HANDLE, IoTHubMessage_CreateFromString, const char*, source); /** * @brief Creates a new IoT hub message with the content identical to that @@ -80,7 +80,7 @@ * @return A valid @c IOTHUB_MESSAGE_HANDLE if the message was successfully * cloned or @c NULL in case an error occurs. */ -extern IOTHUB_MESSAGE_HANDLE IoTHubMessage_Clone(IOTHUB_MESSAGE_HANDLE iotHubMessageHandle); +MOCKABLE_FUNCTION(, IOTHUB_MESSAGE_HANDLE, IoTHubMessage_Clone, IOTHUB_MESSAGE_HANDLE, iotHubMessageHandle); /** * @brief Fetches a pointer and size for the data associated with the IoT @@ -97,7 +97,7 @@ * @return Returns IOTHUB_MESSAGE_OK if the byte array was fetched successfully * or an error code otherwise. */ -extern IOTHUB_MESSAGE_RESULT IoTHubMessage_GetByteArray(IOTHUB_MESSAGE_HANDLE iotHubMessageHandle, const unsigned char** buffer, size_t* size); +MOCKABLE_FUNCTION(, IOTHUB_MESSAGE_RESULT, IoTHubMessage_GetByteArray, IOTHUB_MESSAGE_HANDLE, iotHubMessageHandle, const unsigned char**, buffer, size_t*, size); /** * @brief Returns the null terminated string stored in the message. @@ -109,7 +109,7 @@ * @return @c NULL if an error occurs or a pointer to the stored null * terminated string otherwise. */ -extern const char* IoTHubMessage_GetString(IOTHUB_MESSAGE_HANDLE iotHubMessageHandle); +MOCKABLE_FUNCTION(, const char*, IoTHubMessage_GetString, IOTHUB_MESSAGE_HANDLE, iotHubMessageHandle); /** * @brief Returns the content type of the message given by parameter @@ -119,7 +119,7 @@ * * @return An @c IOTHUBMESSAGE_CONTENT_TYPE value. */ -extern IOTHUBMESSAGE_CONTENT_TYPE IoTHubMessage_GetContentType(IOTHUB_MESSAGE_HANDLE iotHubMessageHandle); +MOCKABLE_FUNCTION(, IOTHUBMESSAGE_CONTENT_TYPE, IoTHubMessage_GetContentType, IOTHUB_MESSAGE_HANDLE, iotHubMessageHandle); /** * @brief Gets a handle to the message's properties map. @@ -128,7 +128,7 @@ * * @return A @c MAP_HANDLE pointing to the properties map for this message. */ -extern MAP_HANDLE IoTHubMessage_Properties(IOTHUB_MESSAGE_HANDLE iotHubMessageHandle); +MOCKABLE_FUNCTION(, MAP_HANDLE, IoTHubMessage_Properties, IOTHUB_MESSAGE_HANDLE, iotHubMessageHandle); /** * @brief Gets the MessageId from the IOTHUB_MESSAGE_HANDLE. @@ -137,7 +137,7 @@ * * @return A const char* pointing to the Message Id. */ -extern const char* IoTHubMessage_GetMessageId(IOTHUB_MESSAGE_HANDLE iotHubMessageHandle); +MOCKABLE_FUNCTION(, const char*, IoTHubMessage_GetMessageId, IOTHUB_MESSAGE_HANDLE, iotHubMessageHandle); /** * @brief Sets the MessageId for the IOTHUB_MESSAGE_HANDLE. @@ -148,7 +148,7 @@ * @return Returns IOTHUB_MESSAGE_OK if the messageId was set successfully * or an error code otherwise. */ -extern IOTHUB_MESSAGE_RESULT IoTHubMessage_SetMessageId(IOTHUB_MESSAGE_HANDLE iotHubMessageHandle, const char* messageId); +MOCKABLE_FUNCTION(, IOTHUB_MESSAGE_RESULT, IoTHubMessage_SetMessageId, IOTHUB_MESSAGE_HANDLE, iotHubMessageHandle, const char*, messageId); /** * @brief Gets the CorrelationId from the IOTHUB_MESSAGE_HANDLE. @@ -157,7 +157,7 @@ * * @return A const char* pointing to the Correlation Id. */ -extern const char* IoTHubMessage_GetCorrelationId(IOTHUB_MESSAGE_HANDLE iotHubMessageHandle); +MOCKABLE_FUNCTION(, const char*, IoTHubMessage_GetCorrelationId, IOTHUB_MESSAGE_HANDLE, iotHubMessageHandle); /** * @brief Sets the CorrelationId for the IOTHUB_MESSAGE_HANDLE. @@ -168,14 +168,14 @@ * @return Returns IOTHUB_MESSAGE_OK if the messageId was set successfully * or an error code otherwise. */ -extern IOTHUB_MESSAGE_RESULT IoTHubMessage_SetCorrelationId(IOTHUB_MESSAGE_HANDLE iotHubMessageHandle, const char* correlationId); +MOCKABLE_FUNCTION(, IOTHUB_MESSAGE_RESULT, IoTHubMessage_SetCorrelationId, IOTHUB_MESSAGE_HANDLE, iotHubMessageHandle, const char*, correlationId); /** * @brief Frees all resources associated with the given message handle. * * @param iotHubMessageHandle Handle to the message. */ -extern void IoTHubMessage_Destroy(IOTHUB_MESSAGE_HANDLE iotHubMessageHandle); +MOCKABLE_FUNCTION(, void, IoTHubMessage_Destroy, IOTHUB_MESSAGE_HANDLE, iotHubMessageHandle); #ifdef __cplusplus }