DMS device stream messages. More...

Functions

void zn_dms_set_message_callback (zos_dms_message_callback_t callback)
 Set callback to be executed when a message is received from the DMS. More...
 
zos_result_t zn_dms_message_start (msgpack_context_t *msg_context, uint16_t max_length)
 Start creating a message to send to the DMS via 'device stream'. More...
 
zos_result_t zn_dms_message_send (msgpack_context_t *msg_context)
 Send a message to the DMS via 'device stream'. More...
 
void zn_dms_message_cleanup (msgpack_context_t *msg_context)
 De-allocate a message. More...
 

Detailed Description

DMS device stream messages.

Function Documentation

void zn_dms_message_cleanup ( msgpack_context_t msg_context)

De-allocate a message.

This de-allocates a message allocted by zn_dms_message_start().

Parameters
msg_contextMessage to be de-allocated
zos_result_t zn_dms_message_send ( msgpack_context_t msg_context)

Send a message to the DMS via 'device stream'.

This transmits a message to the DMS via 'device stream'.

Use zn_dms_message_start() to initialize the message.

Note
Whether is API passes or fails, the supplied message buffer is automatically de-allocated.
Parameters
msg_contextmsgpack_context_t to send to DMS
Returns
Result of API, see zos_result_t
zos_result_t zn_dms_message_start ( msgpack_context_t msg_context,
uint16_t  max_length 
)

Start creating a message to send to the DMS via 'device stream'.

This allocates a buffer and populates MsgPack context to enable sending a message to the DMS via 'device stream'.

Use the MessagePack APIs to populate the message.

When the message is populated, use zn_dms_message_send() to send the message to the DMS.

Note
If zn_dms_message_send() is unable to be called, the message must be de-allocated with zn_dms_message_cleanup().
Parameters
msg_contextmsgpack_context_t to be initialized
max_lengthThe maximum length in bytes of the message
Returns
Result of API, see zos_result_t
void zn_dms_set_message_callback ( zos_dms_message_callback_t  callback)

Set callback to be executed when a message is received from the DMS.

The set callback will be executed when a message is received from the DMS via 'device stream'.

See zos_dms_message_callback_t for more information.

Parameters
callbackCallback to be executed when a message is received from the DMS, see zos_dms_message_callback_t