Mark Radbourne / Mbed 2 deprecated FXOS8700CQ_To_Azure_IoT

Dependencies:   azure_umqtt_c iothub_mqtt_transport mbed-rtos mbed wolfSSL Socket lwip-eth lwip-sys lwip

Embed: (wiki syntax)

« Back to documentation index

iothub_message.h File Reference

iothub_message.h File Reference

The IoTHub_Message component encapsulates one message that can be transferred by an IoT hub client. More...

Go to the source code of this file.

Functions

 DEFINE_ENUM (IOTHUB_MESSAGE_RESULT, IOTHUB_MESSAGE_RESULT_VALUES)
 Enumeration specifying the status of calls to various APIs in this module.
 DEFINE_ENUM (IOTHUBMESSAGE_CONTENT_TYPE, IOTHUBMESSAGE_CONTENT_TYPE_VALUES)
 Enumeration specifying the content type of the a given message.
 MOCKABLE_FUNCTION (, IOTHUB_MESSAGE_HANDLE, IoTHubMessage_CreateFromByteArray, const unsigned char *, byteArray, size_t, size)
 Creates a new IoT hub message from a byte array.
 MOCKABLE_FUNCTION (, IOTHUB_MESSAGE_HANDLE, IoTHubMessage_CreateFromString, const char *, source)
 Creates a new IoT hub message from a null terminated string.
 MOCKABLE_FUNCTION (, IOTHUB_MESSAGE_HANDLE, IoTHubMessage_Clone, IOTHUB_MESSAGE_HANDLE, iotHubMessageHandle)
 Creates a new IoT hub message with the content identical to that of the iotHubMessageHandle parameter.
 MOCKABLE_FUNCTION (, IOTHUB_MESSAGE_RESULT, IoTHubMessage_GetByteArray, IOTHUB_MESSAGE_HANDLE, iotHubMessageHandle, const unsigned char **, buffer, size_t *, size)
 Fetches a pointer and size for the data associated with the IoT hub message handle.
 MOCKABLE_FUNCTION (, const char *, IoTHubMessage_GetString, IOTHUB_MESSAGE_HANDLE, iotHubMessageHandle)
 Returns the null terminated string stored in the message.
 MOCKABLE_FUNCTION (, IOTHUBMESSAGE_CONTENT_TYPE, IoTHubMessage_GetContentType, IOTHUB_MESSAGE_HANDLE, iotHubMessageHandle)
 Returns the content type of the message given by parameter iotHubMessageHandle.
 MOCKABLE_FUNCTION (, MAP_HANDLE, IoTHubMessage_Properties, IOTHUB_MESSAGE_HANDLE, iotHubMessageHandle)
 Gets a handle to the message's properties map.
 MOCKABLE_FUNCTION (, const char *, IoTHubMessage_GetMessageId, IOTHUB_MESSAGE_HANDLE, iotHubMessageHandle)
 Gets the MessageId from the IOTHUB_MESSAGE_HANDLE.
 MOCKABLE_FUNCTION (, IOTHUB_MESSAGE_RESULT, IoTHubMessage_SetMessageId, IOTHUB_MESSAGE_HANDLE, iotHubMessageHandle, const char *, messageId)
 Sets the MessageId for the IOTHUB_MESSAGE_HANDLE.
 MOCKABLE_FUNCTION (, const char *, IoTHubMessage_GetCorrelationId, IOTHUB_MESSAGE_HANDLE, iotHubMessageHandle)
 Gets the CorrelationId from the IOTHUB_MESSAGE_HANDLE.
 MOCKABLE_FUNCTION (, IOTHUB_MESSAGE_RESULT, IoTHubMessage_SetCorrelationId, IOTHUB_MESSAGE_HANDLE, iotHubMessageHandle, const char *, correlationId)
 Sets the CorrelationId for the IOTHUB_MESSAGE_HANDLE.
 MOCKABLE_FUNCTION (, void, IoTHubMessage_Destroy, IOTHUB_MESSAGE_HANDLE, iotHubMessageHandle)
 Frees all resources associated with the given message handle.

Detailed Description

The IoTHub_Message component encapsulates one message that can be transferred by an IoT hub client.

Definition in file iothub_message.h.


Function Documentation

DEFINE_ENUM ( IOTHUB_MESSAGE_RESULT  ,
IOTHUB_MESSAGE_RESULT_VALUES   
)

Enumeration specifying the status of calls to various APIs in this module.

DEFINE_ENUM ( IOTHUBMESSAGE_CONTENT_TYPE  ,
IOTHUBMESSAGE_CONTENT_TYPE_VALUES   
)

Enumeration specifying the content type of the a given message.

MOCKABLE_FUNCTION ( IOTHUB_MESSAGE_RESULT  ,
IoTHubMessage_SetCorrelationId  ,
IOTHUB_MESSAGE_HANDLE  ,
iotHubMessageHandle  ,
const char *  ,
correlationId   
)

Sets the CorrelationId for the IOTHUB_MESSAGE_HANDLE.

Parameters:
iotHubMessageHandleHandle to the message.
correlationIdPointer to the memory location of the messageId
Returns:
Returns IOTHUB_MESSAGE_OK if the messageId was set successfully or an error code otherwise.
MOCKABLE_FUNCTION ( const char *  ,
IoTHubMessage_GetCorrelationId  ,
IOTHUB_MESSAGE_HANDLE  ,
iotHubMessageHandle   
)

Gets the CorrelationId from the IOTHUB_MESSAGE_HANDLE.

Parameters:
iotHubMessageHandleHandle to the message.
Returns:
A const char* pointing to the Correlation Id.
MOCKABLE_FUNCTION ( IOTHUB_MESSAGE_RESULT  ,
IoTHubMessage_SetMessageId  ,
IOTHUB_MESSAGE_HANDLE  ,
iotHubMessageHandle  ,
const char *  ,
messageId   
)

Sets the MessageId for the IOTHUB_MESSAGE_HANDLE.

Parameters:
iotHubMessageHandleHandle to the message.
messageIdPointer to the memory location of the messageId
Returns:
Returns IOTHUB_MESSAGE_OK if the messageId was set successfully or an error code otherwise.
MOCKABLE_FUNCTION ( const char *  ,
IoTHubMessage_GetMessageId  ,
IOTHUB_MESSAGE_HANDLE  ,
iotHubMessageHandle   
)

Gets the MessageId from the IOTHUB_MESSAGE_HANDLE.

Parameters:
iotHubMessageHandleHandle to the message.
Returns:
A const char* pointing to the Message Id.
MOCKABLE_FUNCTION ( MAP_HANDLE  ,
IoTHubMessage_Properties  ,
IOTHUB_MESSAGE_HANDLE  ,
iotHubMessageHandle   
)

Gets a handle to the message's properties map.

Parameters:
iotHubMessageHandleHandle to the message.
Returns:
A MAP_HANDLE pointing to the properties map for this message.
MOCKABLE_FUNCTION ( IOTHUBMESSAGE_CONTENT_TYPE  ,
IoTHubMessage_GetContentType  ,
IOTHUB_MESSAGE_HANDLE  ,
iotHubMessageHandle   
)

Returns the content type of the message given by parameter iotHubMessageHandle.

Parameters:
iotHubMessageHandleHandle to the message.
Returns:
An IOTHUBMESSAGE_CONTENT_TYPE value.
MOCKABLE_FUNCTION ( const char *  ,
IoTHubMessage_GetString  ,
IOTHUB_MESSAGE_HANDLE  ,
iotHubMessageHandle   
)

Returns the null terminated string stored in the message.

If the content type of the message is not IOTHUBMESSAGE_STRING then the function returns NULL.

Parameters:
iotHubMessageHandleHandle to the message.
Returns:
NULL if an error occurs or a pointer to the stored null terminated string otherwise.
MOCKABLE_FUNCTION ( IOTHUB_MESSAGE_RESULT  ,
IoTHubMessage_GetByteArray  ,
IOTHUB_MESSAGE_HANDLE  ,
iotHubMessageHandle  ,
const unsigned char **  ,
buffer  ,
size_t *  ,
size   
)

Fetches a pointer and size for the data associated with the IoT hub message handle.

If the content type of the message is not IOTHUBMESSAGE_BYTEARRAY then the function returns IOTHUB_MESSAGE_INVALID_ARG.

Parameters:
iotHubMessageHandleHandle to the message.
bufferPointer to the memory location where the pointer to the buffer will be written.
sizeThe size of the buffer will be written to this address.
Returns:
Returns IOTHUB_MESSAGE_OK if the byte array was fetched successfully or an error code otherwise.
MOCKABLE_FUNCTION ( IOTHUB_MESSAGE_HANDLE  ,
IoTHubMessage_Clone  ,
IOTHUB_MESSAGE_HANDLE  ,
iotHubMessageHandle   
)

Creates a new IoT hub message with the content identical to that of the iotHubMessageHandle parameter.

Parameters:
iotHubMessageHandleHandle to the message that is to be cloned.
Returns:
A valid IOTHUB_MESSAGE_HANDLE if the message was successfully cloned or NULL in case an error occurs.
MOCKABLE_FUNCTION ( IOTHUB_MESSAGE_HANDLE  ,
IoTHubMessage_CreateFromString  ,
const char *  ,
source   
)

Creates a new IoT hub message from a null terminated string.

The type of the message will be set to IOTHUBMESSAGE_STRING.

Parameters:
sourceThe null terminated string from which the message is to be created.
Returns:
A valid IOTHUB_MESSAGE_HANDLE if the message was successfully created or NULL in case an error occurs.
MOCKABLE_FUNCTION ( IOTHUB_MESSAGE_HANDLE  ,
IoTHubMessage_CreateFromByteArray  ,
const unsigned char *  ,
byteArray  ,
size_t  ,
size   
)

Creates a new IoT hub message from a byte array.

The type of the message will be set to IOTHUBMESSAGE_BYTEARRAY.

Parameters:
byteArrayThe byte array from which the message is to be created.
sizeThe size of the byte array.
Returns:
A valid IOTHUB_MESSAGE_HANDLE if the message was successfully created or NULL in case an error occurs.
MOCKABLE_FUNCTION ( void  ,
IoTHubMessage_Destroy  ,
IOTHUB_MESSAGE_HANDLE  ,
iotHubMessageHandle   
)

Frees all resources associated with the given message handle.

Parameters:
iotHubMessageHandleHandle to the message.