Azure IoT C SDK
Data Structures | Typedefs | Enumerations | Functions
iothub_message.h File Reference

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

#include "azure_macro_utils/macro_utils.h"
#include "azure_c_shared_utility/map.h"
#include "umock_c/umock_c_prod.h"
#include <stddef.h>

Go to the source code of this file.

Data Structures

struct  IOTHUB_MESSAGE_DIAGNOSTIC_PROPERTY_DATA_HANDLE
 diagnostic related data More...
 

Typedefs

typedef struct IOTHUB_MESSAGE_HANDLE_DATA_TAG * IOTHUB_MESSAGE_HANDLE
 Handle representing an IoT Hub message.
 

Enumerations

enum  IOTHUB_MESSAGE_RESULT {
  IOTHUB_MESSAGE_OK , IOTHUB_MESSAGE_INVALID_ARG , IOTHUB_MESSAGE_INVALID_TYPE , IOTHUB_MESSAGE_ERROR ,
  IOTHUB_MESSAGE_BECAUSE_DESTROY
}
 Enumeration specifying the status of calls to various APIs in this module.
 
enum  IOTHUBMESSAGE_CONTENT_TYPE { IOTHUBMESSAGE_BYTEARRAY , IOTHUBMESSAGE_STRING , IOTHUBMESSAGE_UNKNOWN }
 Enumeration specifying the content type of a given message.
 

Functions

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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. No new memory is allocated, the caller is not responsible for freeing the memory. The memory is valid until IoTHubMessage_Destroy is called on the message. More...
 
IOTHUBMESSAGE_CONTENT_TYPE IoTHubMessage_GetContentType (IOTHUB_MESSAGE_HANDLE iotHubMessageHandle)
 Returns the content type of the message given by parameter iotHubMessageHandle. More...
 
IOTHUB_MESSAGE_RESULT IoTHubMessage_SetContentTypeSystemProperty (IOTHUB_MESSAGE_HANDLE iotHubMessageHandle, const char *contentType)
 Sets the content-type of the message payload, as per supported values on RFC 2046. More...
 
const char * IoTHubMessage_GetContentTypeSystemProperty (IOTHUB_MESSAGE_HANDLE iotHubMessageHandle)
 Returns the content-type of the message payload, if defined. No new memory is allocated, the caller is not responsible for freeing the memory. The memory is valid until IoTHubMessage_Destroy is called on the message. More...
 
IOTHUB_MESSAGE_RESULT IoTHubMessage_SetContentEncodingSystemProperty (IOTHUB_MESSAGE_HANDLE iotHubMessageHandle, const char *contentEncoding)
 Sets the content-encoding of the message payload, as per supported values on RFC 2616. More...
 
const char * IoTHubMessage_GetContentEncodingSystemProperty (IOTHUB_MESSAGE_HANDLE iotHubMessageHandle)
 Returns the content-encoding of the message payload, if defined. No new memory is allocated, the caller is not responsible for freeing the memory. The memory is valid until IoTHubMessage_Destroy is called on the message. More...
 
MAP_HANDLE IoTHubMessage_Properties (IOTHUB_MESSAGE_HANDLE iotHubMessageHandle)
 Gets a handle to the message's properties map. Note that when sending messages via the HTTP transport, the key names in the map must not contain spaces. More...
 
IOTHUB_MESSAGE_RESULT IoTHubMessage_SetProperty (IOTHUB_MESSAGE_HANDLE iotHubMessageHandle, const char *key, const char *value)
 Sets a property on a IoT Hub message. More...
 
const char * IoTHubMessage_GetProperty (IOTHUB_MESSAGE_HANDLE iotHubMessageHandle, const char *key)
 Gets a IoT Hub message's properties item. No new memory is allocated, the caller is not responsible for freeing the memory. The memory is valid until IoTHubMessage_Destroy is called on the message. More...
 
const char * IoTHubMessage_GetMessageId (IOTHUB_MESSAGE_HANDLE iotHubMessageHandle)
 Gets the messageId from the IOTHUB_MESSAGE_HANDLE. No new memory is allocated, the caller is not responsible for freeing the memory. The memory is valid until IoTHubMessage_Destroy is called on the message. More...
 
IOTHUB_MESSAGE_RESULT IoTHubMessage_SetMessageId (IOTHUB_MESSAGE_HANDLE iotHubMessageHandle, const char *messageId)
 Sets the messageId for the IOTHUB_MESSAGE_HANDLE. More...
 
const char * IoTHubMessage_GetCorrelationId (IOTHUB_MESSAGE_HANDLE iotHubMessageHandle)
 Gets the CorrelationId from the IOTHUB_MESSAGE_HANDLE. No new memory is allocated, the caller is not responsible for freeing the memory. The memory is valid until IoTHubMessage_Destroy is called on the message. More...
 
IOTHUB_MESSAGE_RESULT IoTHubMessage_SetCorrelationId (IOTHUB_MESSAGE_HANDLE iotHubMessageHandle, const char *correlationId)
 Sets the CorrelationId for the IOTHUB_MESSAGE_HANDLE. More...
 
const IOTHUB_MESSAGE_DIAGNOSTIC_PROPERTY_DATAIoTHubMessage_GetDiagnosticPropertyData (IOTHUB_MESSAGE_HANDLE iotHubMessageHandle)
 Gets the DiagnosticData from the IOTHUB_MESSAGE_HANDLE. CAUTION: SDK user should not call it directly, it is for internal use only. More...
 
IOTHUB_MESSAGE_RESULT IoTHubMessage_SetDiagnosticPropertyData (IOTHUB_MESSAGE_HANDLE iotHubMessageHandle, const IOTHUB_MESSAGE_DIAGNOSTIC_PROPERTY_DATA *diagnosticData)
 Sets the DiagnosticData for the IOTHUB_MESSAGE_HANDLE. CAUTION: SDK user should not call it directly, it is for internal use only. More...
 
const char * IoTHubMessage_GetOutputName (IOTHUB_MESSAGE_HANDLE iotHubMessageHandle)
 Gets the output name from the IOTHUB_MESSAGE_HANDLE. No new memory is allocated, the caller is not responsible for freeing the memory. The memory is valid until IoTHubMessage_Destroy is called on the message. More...
 
IOTHUB_MESSAGE_RESULT IoTHubMessage_SetOutputName (IOTHUB_MESSAGE_HANDLE iotHubMessageHandle, const char *outputName)
 Sets output for named queues. CAUTION: SDK user should not call it directly, it is for internal use only. More...
 
const char * IoTHubMessage_GetInputName (IOTHUB_MESSAGE_HANDLE iotHubMessageHandle)
 Gets the input name from the IOTHUB_MESSAGE_HANDLE. No new memory is allocated, the caller is not responsible for freeing the memory. The memory is valid until IoTHubMessage_Destroy is called on the message. More...
 
IOTHUB_MESSAGE_RESULT IoTHubMessage_SetInputName (IOTHUB_MESSAGE_HANDLE iotHubMessageHandle, const char *inputName)
 Sets input for named queues. CAUTION: SDK user should not call it directly, it is for internal use only. More...
 
const char * IoTHubMessage_GetConnectionModuleId (IOTHUB_MESSAGE_HANDLE iotHubMessageHandle)
 Gets the module name from the IOTHUB_MESSAGE_HANDLE. No new memory is allocated, the caller is not responsible for freeing the memory. The memory is valid until IoTHubMessage_Destroy is called on the message. More...
 
IOTHUB_MESSAGE_RESULT IoTHubMessage_SetConnectionModuleId (IOTHUB_MESSAGE_HANDLE iotHubMessageHandle, const char *connectionModuleId)
 Sets connection module ID. CAUTION: SDK user should not call it directly, it is for internal use only. More...
 
const char * IoTHubMessage_GetConnectionDeviceId (IOTHUB_MESSAGE_HANDLE iotHubMessageHandle)
 Gets the connection device ID from the IOTHUB_MESSAGE_HANDLE. No new memory is allocated, the caller is not responsible for freeing the memory. The memory is valid until IoTHubMessage_Destroy is called on the message. More...
 
IOTHUB_MESSAGE_RESULT IoTHubMessage_SetMessageCreationTimeUtcSystemProperty (IOTHUB_MESSAGE_HANDLE iotHubMessageHandle, const char *messageCreationTimeUtc)
 Sets the message creation time in UTC. More...
 
const char * IoTHubMessage_GetMessageCreationTimeUtcSystemProperty (IOTHUB_MESSAGE_HANDLE iotHubMessageHandle)
 Gets the message creation time in UTC from the IOTHUB_MESSAGE_HANDLE. No new memory is allocated, the caller is not responsible for freeing the memory. The memory is valid until IoTHubMessage_Destroy is called on the message. More...
 
IOTHUB_MESSAGE_RESULT IoTHubMessage_SetMessageUserIdSystemProperty (IOTHUB_MESSAGE_HANDLE iotHubMessageHandle, const char *userId)
 Sets the message user id. CAUTION: SDK user should not call it directly, it is for internal use only. More...
 
const char * IoTHubMessage_GetMessageUserIdSystemProperty (IOTHUB_MESSAGE_HANDLE iotHubMessageHandle)
 Gets the message user id from the IOTHUB_MESSAGE_HANDLE. No new memory is allocated, the caller is not responsible for freeing the memory. The memory is valid until IoTHubMessage_Destroy is called on the message. More...
 
IOTHUB_MESSAGE_RESULT IoTHubMessage_SetConnectionDeviceId (IOTHUB_MESSAGE_HANDLE iotHubMessageHandle, const char *connectionDeviceId)
 Sets connection device Id. CAUTION: SDK user should not call it directly, it is for internal use only. More...
 
IOTHUB_MESSAGE_RESULT IoTHubMessage_SetAsSecurityMessage (IOTHUB_MESSAGE_HANDLE iotHubMessageHandle)
 Marks a IoT Hub message as a security message. CAUTION: security messages are special messages not easily accessable by the user. More...
 
bool IoTHubMessage_IsSecurityMessage (IOTHUB_MESSAGE_HANDLE iotHubMessageHandle)
 returns if this message is a IoT Hub security message or not More...
 
IOTHUB_MESSAGE_RESULT IoTHubMessage_SetComponentName (IOTHUB_MESSAGE_HANDLE iotHubMessageHandle, const char *componentName)
 Sets component name of the message. More...
 
const char * IoTHubMessage_GetComponentName (IOTHUB_MESSAGE_HANDLE iotHubMessageHandle)
 Gets the component name from the IOTHUB_MESSAGE_HANDLE. No new memory is allocated, the caller is not responsible for freeing the memory. The memory is valid until IoTHubMessage_Destroy is called on the message. More...
 
void IoTHubMessage_Destroy (IOTHUB_MESSAGE_HANDLE iotHubMessageHandle)
 Frees all resources associated with the given message handle. More...
 

Detailed Description

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

Function Documentation

◆ IoTHubMessage_Clone()

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.

◆ IoTHubMessage_CreateFromByteArray()

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.

◆ IoTHubMessage_CreateFromString()

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.

◆ IoTHubMessage_Destroy()

void IoTHubMessage_Destroy ( IOTHUB_MESSAGE_HANDLE  iotHubMessageHandle)

Frees all resources associated with the given message handle.

Parameters
iotHubMessageHandleHandle to the message.

◆ IoTHubMessage_GetByteArray()

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.

◆ IoTHubMessage_GetComponentName()

const char* IoTHubMessage_GetComponentName ( IOTHUB_MESSAGE_HANDLE  iotHubMessageHandle)

Gets the component name from the IOTHUB_MESSAGE_HANDLE. No new memory is allocated, the caller is not responsible for freeing the memory. The memory is valid until IoTHubMessage_Destroy is called on the message.

Parameters
iotHubMessageHandleHandle to the message.
Returns
A const char* pointing to the component name.

◆ IoTHubMessage_GetConnectionDeviceId()

const char* IoTHubMessage_GetConnectionDeviceId ( IOTHUB_MESSAGE_HANDLE  iotHubMessageHandle)

Gets the connection device ID from the IOTHUB_MESSAGE_HANDLE. No new memory is allocated, the caller is not responsible for freeing the memory. The memory is valid until IoTHubMessage_Destroy is called on the message.

Parameters
iotHubMessageHandleHandle to the message.
Returns
A const char* pointing to the connection device Id.

◆ IoTHubMessage_GetConnectionModuleId()

const char* IoTHubMessage_GetConnectionModuleId ( IOTHUB_MESSAGE_HANDLE  iotHubMessageHandle)

Gets the module name from the IOTHUB_MESSAGE_HANDLE. No new memory is allocated, the caller is not responsible for freeing the memory. The memory is valid until IoTHubMessage_Destroy is called on the message.

Parameters
iotHubMessageHandleHandle to the message.
Returns
A const char* pointing to the connection module Id.

◆ IoTHubMessage_GetContentEncodingSystemProperty()

const char* IoTHubMessage_GetContentEncodingSystemProperty ( IOTHUB_MESSAGE_HANDLE  iotHubMessageHandle)

Returns the content-encoding of the message payload, if defined. No new memory is allocated, the caller is not responsible for freeing the memory. The memory is valid until IoTHubMessage_Destroy is called on the message.

Parameters
iotHubMessageHandleHandle to the message.
Returns
A string with the content-encoding value if defined (or NULL otherwise).

◆ IoTHubMessage_GetContentType()

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.
Remarks
This function retrieves the standardized type of the payload, which indicates if iotHubMessageHandle was created using a String or a Byte Array.
Returns
An IOTHUBMESSAGE_CONTENT_TYPE value.

◆ IoTHubMessage_GetContentTypeSystemProperty()

const char* IoTHubMessage_GetContentTypeSystemProperty ( IOTHUB_MESSAGE_HANDLE  iotHubMessageHandle)

Returns the content-type of the message payload, if defined. No new memory is allocated, the caller is not responsible for freeing the memory. The memory is valid until IoTHubMessage_Destroy is called on the message.

Parameters
iotHubMessageHandleHandle to the message.
Returns
A string with the content-type value if defined (or NULL otherwise).

◆ IoTHubMessage_GetCorrelationId()

const char* IoTHubMessage_GetCorrelationId ( IOTHUB_MESSAGE_HANDLE  iotHubMessageHandle)

Gets the CorrelationId from the IOTHUB_MESSAGE_HANDLE. No new memory is allocated, the caller is not responsible for freeing the memory. The memory is valid until IoTHubMessage_Destroy is called on the message.

Parameters
iotHubMessageHandleHandle to the message.
Returns
A const char* pointing to the Correlation Id.

◆ IoTHubMessage_GetDiagnosticPropertyData()

const IOTHUB_MESSAGE_DIAGNOSTIC_PROPERTY_DATA* IoTHubMessage_GetDiagnosticPropertyData ( IOTHUB_MESSAGE_HANDLE  iotHubMessageHandle)

Gets the DiagnosticData from the IOTHUB_MESSAGE_HANDLE. CAUTION: SDK user should not call it directly, it is for internal use only.

Parameters
iotHubMessageHandleHandle to the message.
Returns
A const IOTHUB_MESSAGE_DIAGNOSTIC_PROPERTY_DATA* pointing to the diagnostic property data.

◆ IoTHubMessage_GetInputName()

const char* IoTHubMessage_GetInputName ( IOTHUB_MESSAGE_HANDLE  iotHubMessageHandle)

Gets the input name from the IOTHUB_MESSAGE_HANDLE. No new memory is allocated, the caller is not responsible for freeing the memory. The memory is valid until IoTHubMessage_Destroy is called on the message.

Parameters
iotHubMessageHandleHandle to the message.
Returns
A const char* pointing to the Input Id.

◆ IoTHubMessage_GetMessageCreationTimeUtcSystemProperty()

const char* IoTHubMessage_GetMessageCreationTimeUtcSystemProperty ( IOTHUB_MESSAGE_HANDLE  iotHubMessageHandle)

Gets the message creation time in UTC from the IOTHUB_MESSAGE_HANDLE. No new memory is allocated, the caller is not responsible for freeing the memory. The memory is valid until IoTHubMessage_Destroy is called on the message.

Parameters
iotHubMessageHandleHandle to the message.
Returns
A const char* pointing to the message creation time in UTC.

◆ IoTHubMessage_GetMessageId()

const char* IoTHubMessage_GetMessageId ( IOTHUB_MESSAGE_HANDLE  iotHubMessageHandle)

Gets the messageId from the IOTHUB_MESSAGE_HANDLE. No new memory is allocated, the caller is not responsible for freeing the memory. The memory is valid until IoTHubMessage_Destroy is called on the message.

Parameters
iotHubMessageHandleHandle to the message.
Returns
A const char* pointing to the messageId.

◆ IoTHubMessage_GetMessageUserIdSystemProperty()

const char* IoTHubMessage_GetMessageUserIdSystemProperty ( IOTHUB_MESSAGE_HANDLE  iotHubMessageHandle)

Gets the message user id from the IOTHUB_MESSAGE_HANDLE. No new memory is allocated, the caller is not responsible for freeing the memory. The memory is valid until IoTHubMessage_Destroy is called on the message.

Parameters
iotHubMessageHandleHandle to the message.
Returns
A const char* pointing to the message user id.

◆ IoTHubMessage_GetOutputName()

const char* IoTHubMessage_GetOutputName ( IOTHUB_MESSAGE_HANDLE  iotHubMessageHandle)

Gets the output name from the IOTHUB_MESSAGE_HANDLE. No new memory is allocated, the caller is not responsible for freeing the memory. The memory is valid until IoTHubMessage_Destroy is called on the message.

Parameters
iotHubMessageHandleHandle to the message.
Returns
A const char* pointing to the Output Id.

◆ IoTHubMessage_GetProperty()

const char* IoTHubMessage_GetProperty ( IOTHUB_MESSAGE_HANDLE  iotHubMessageHandle,
const char *  key 
)

Gets a IoT Hub message's properties item. No new memory is allocated, the caller is not responsible for freeing the memory. The memory is valid until IoTHubMessage_Destroy is called on the message.

Parameters
iotHubMessageHandleHandle to the message.
keyname of the property to retrieve.
Returns
A string with the property's value, or NULL if it does not exist in the properties list.

◆ IoTHubMessage_GetString()

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. No new memory is allocated, the caller is not responsible for freeing the memory. The memory is valid until IoTHubMessage_Destroy is called on the message.

Parameters
iotHubMessageHandleHandle to the message.
Returns
NULL if an error occurs or a pointer to the stored null terminated string otherwise.

◆ IoTHubMessage_IsSecurityMessage()

bool IoTHubMessage_IsSecurityMessage ( IOTHUB_MESSAGE_HANDLE  iotHubMessageHandle)

returns if this message is a IoT Hub security message or not

Parameters
iotHubMessageHandleHandle to the message.
Returns
Returns true if the message is a security message false otherwise.

◆ IoTHubMessage_Properties()

MAP_HANDLE IoTHubMessage_Properties ( IOTHUB_MESSAGE_HANDLE  iotHubMessageHandle)

Gets a handle to the message's properties map. Note that when sending messages via the HTTP transport, the key names in the map must not contain spaces.

DEPRECATED: Use IoTHubMessage_SetProperty and IoTHubMessage_GetProperty instead. **

Parameters
iotHubMessageHandleHandle to the message.
Returns
A MAP_HANDLE pointing to the properties map for this message.

◆ IoTHubMessage_SetAsSecurityMessage()

IOTHUB_MESSAGE_RESULT IoTHubMessage_SetAsSecurityMessage ( IOTHUB_MESSAGE_HANDLE  iotHubMessageHandle)

Marks a IoT Hub message as a security message. CAUTION: security messages are special messages not easily accessable by the user.

Parameters
iotHubMessageHandleHandle to the message.
Returns
Returns IOTHUB_MESSAGE_OK if the security message was set successfully or an error code otherwise.

◆ IoTHubMessage_SetComponentName()

IOTHUB_MESSAGE_RESULT IoTHubMessage_SetComponentName ( IOTHUB_MESSAGE_HANDLE  iotHubMessageHandle,
const char *  componentName 
)

Sets component name of the message.

Parameters
iotHubMessageHandleHandle to the message.
componentNamePointer to the component name.
Returns
Returns IOTHUB_MESSAGE_OK if the componentName was set successfully or an error code otherwise.

◆ IoTHubMessage_SetConnectionDeviceId()

IOTHUB_MESSAGE_RESULT IoTHubMessage_SetConnectionDeviceId ( IOTHUB_MESSAGE_HANDLE  iotHubMessageHandle,
const char *  connectionDeviceId 
)

Sets connection device Id. CAUTION: SDK user should not call it directly, it is for internal use only.

Parameters
iotHubMessageHandleHandle to the message.
connectionDeviceIdPointer to the device ID of connector
Returns
Returns IOTHUB_MESSAGE_OK if the DiagnosticData was set successfully or an error code otherwise.

◆ IoTHubMessage_SetConnectionModuleId()

IOTHUB_MESSAGE_RESULT IoTHubMessage_SetConnectionModuleId ( IOTHUB_MESSAGE_HANDLE  iotHubMessageHandle,
const char *  connectionModuleId 
)

Sets connection module ID. CAUTION: SDK user should not call it directly, it is for internal use only.

Parameters
iotHubMessageHandleHandle to the message.
connectionModuleIdPointer to the module ID of connector
Returns
Returns IOTHUB_MESSAGE_OK if the connectionModuleId was set successfully or an error code otherwise.

◆ IoTHubMessage_SetContentEncodingSystemProperty()

IOTHUB_MESSAGE_RESULT IoTHubMessage_SetContentEncodingSystemProperty ( IOTHUB_MESSAGE_HANDLE  iotHubMessageHandle,
const char *  contentEncoding 
)

Sets the content-encoding of the message payload, as per supported values on RFC 2616.

Parameters
iotHubMessageHandleHandle to the message.
contentEncodingString defining the encoding of the payload (e.g., utf-8).
Returns
An IOTHUB_MESSAGE_RESULT value.

◆ IoTHubMessage_SetContentTypeSystemProperty()

IOTHUB_MESSAGE_RESULT IoTHubMessage_SetContentTypeSystemProperty ( IOTHUB_MESSAGE_HANDLE  iotHubMessageHandle,
const char *  contentType 
)

Sets the content-type of the message payload, as per supported values on RFC 2046.

Parameters
iotHubMessageHandleHandle to the message.
contentTypeString defining the type of the payload (e.g., text/plain).
Returns
An IOTHUB_MESSAGE_RESULT value.

◆ IoTHubMessage_SetCorrelationId()

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 CorrelationId was set successfully or an error code otherwise.

◆ IoTHubMessage_SetDiagnosticPropertyData()

IOTHUB_MESSAGE_RESULT IoTHubMessage_SetDiagnosticPropertyData ( IOTHUB_MESSAGE_HANDLE  iotHubMessageHandle,
const IOTHUB_MESSAGE_DIAGNOSTIC_PROPERTY_DATA diagnosticData 
)

Sets the DiagnosticData for the IOTHUB_MESSAGE_HANDLE. CAUTION: SDK user should not call it directly, it is for internal use only.

Parameters
iotHubMessageHandleHandle to the message.
diagnosticDataPointer to the memory location of the diagnosticData
Returns
Returns IOTHUB_MESSAGE_OK if the DiagnosticData was set successfully or an error code otherwise.

◆ IoTHubMessage_SetInputName()

IOTHUB_MESSAGE_RESULT IoTHubMessage_SetInputName ( IOTHUB_MESSAGE_HANDLE  iotHubMessageHandle,
const char *  inputName 
)

Sets input for named queues. CAUTION: SDK user should not call it directly, it is for internal use only.

Parameters
iotHubMessageHandleHandle to the message.
inputNamePointer to the queue to input message to
Returns
Returns IOTHUB_MESSAGE_OK if the inputName was set successfully or an error code otherwise.

◆ IoTHubMessage_SetMessageCreationTimeUtcSystemProperty()

IOTHUB_MESSAGE_RESULT IoTHubMessage_SetMessageCreationTimeUtcSystemProperty ( IOTHUB_MESSAGE_HANDLE  iotHubMessageHandle,
const char *  messageCreationTimeUtc 
)

Sets the message creation time in UTC.

Parameters
iotHubMessageHandleHandle to the message.
messageCreationTimeUtcPointer to the message creation time as null-terminated string
Returns
Returns IOTHUB_MESSAGE_OK if the messageCreationTimeUtc was set successfully or an error code otherwise.

◆ IoTHubMessage_SetMessageId()

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.

◆ IoTHubMessage_SetMessageUserIdSystemProperty()

IOTHUB_MESSAGE_RESULT IoTHubMessage_SetMessageUserIdSystemProperty ( IOTHUB_MESSAGE_HANDLE  iotHubMessageHandle,
const char *  userId 
)

Sets the message user id. CAUTION: SDK user should not call it directly, it is for internal use only.

Parameters
iotHubMessageHandleHandle to the message.
userIdPointer to the message user id as null-terminated string
Returns
Returns IOTHUB_MESSAGE_OK if the userId was set successfully or an error code otherwise.

◆ IoTHubMessage_SetOutputName()

IOTHUB_MESSAGE_RESULT IoTHubMessage_SetOutputName ( IOTHUB_MESSAGE_HANDLE  iotHubMessageHandle,
const char *  outputName 
)

Sets output for named queues. CAUTION: SDK user should not call it directly, it is for internal use only.

Parameters
iotHubMessageHandleHandle to the message.
outputNamePointer to the queue to output message to
Returns
Returns IOTHUB_MESSAGE_OK if the outputName was set successfully or an error code otherwise.

◆ IoTHubMessage_SetProperty()

IOTHUB_MESSAGE_RESULT IoTHubMessage_SetProperty ( IOTHUB_MESSAGE_HANDLE  iotHubMessageHandle,
const char *  key,
const char *  value 
)

Sets a property on a IoT Hub message.

Parameters
iotHubMessageHandleHandle to the message.
keyname of the property to set. Note that when sending messages via the HTTP transport, this value must not contain spaces.
valueof the property to set.
       @b NOTE: The accepted character sets for the key name and value parameters are dependent on different factors, such as the protocol 
       being used. For more information on the character sets accepted by Azure IoT Hub, see 
       <a href="https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-messages-construct">Create and read IoT Hub messages</a>.
Returns
An IOTHUB_MESSAGE_RESULT value indicating the result of setting the property.