Functions to interact with queues.
More...
#include <stddef.h>
#include <stdint.h>
#include <stdbool.h>
Go to the source code of this file.
Functions to interact with queues.
◆ MQTTAgentMessageSend_t
typedef bool(* MQTTAgentMessageSend_t) (MQTTAgentMessageContext_t *pMsgCtx, MQTTAgentCommand_t *const *pCommandToSend, uint32_t blockTimeMs) |
Send a message to the specified context. Must be thread safe.
- Parameters
-
[in] | pMsgCtx | An MQTTAgentMessageContext_t. |
[in] | pCommandToSend | Pointer to address to send to queue. |
[in] | blockTimeMs | Block time to wait for a send. |
- Returns
true
if send was successful, else false
.
◆ MQTTAgentMessageRecv_t
typedef bool(* MQTTAgentMessageRecv_t) (MQTTAgentMessageContext_t *pMsgCtx, MQTTAgentCommand_t **pReceivedCommand, uint32_t blockTimeMs) |
Receive a message from the specified context. Must be thread safe.
- Parameters
-
[in] | pMsgCtx | An MQTTAgentMessageContext_t. |
[out] | pReceivedCommand | Pointer to write address of received command. |
[in] | blockTimeMs | Block time to wait for a receive. |
- Returns
true
if receive was successful, else false
.
◆ MQTTAgentCommandGet_t
typedef MQTTAgentCommand_t *(* MQTTAgentCommandGet_t) (uint32_t blockTimeMs) |
Obtain a MQTTAgentCommand_t structure.
- Note
- MQTTAgentCommand_t structures hold everything the MQTT agent needs to process a command that originates from application. Examples of commands are PUBLISH and SUBSCRIBE. The MQTTAgentCommand_t structure must persist for the duration of the command's operation.
- Parameters
-
[in] | blockTimeMs | The length of time the calling task should remain in the Blocked state (so not consuming any CPU time) to wait for a MQTTAgentCommand_t structure to become available should one not be immediately at the time of the call. |
- Returns
- A pointer to a MQTTAgentCommand_t structure if one becomes available before blockTimeMs time expired, otherwise NULL.
◆ MQTTAgentCommandRelease_t
typedef bool(* MQTTAgentCommandRelease_t) (MQTTAgentCommand_t *pCommandToRelease) |
Give a MQTTAgentCommand_t structure back to the application.
- Note
- MQTTAgentCommand_t structures hold everything the MQTT agent needs to process a command that originates from application. Examples of commands are PUBLISH and SUBSCRIBE. The MQTTAgentCommand_t structure must persist for the duration of the command's operation.
- Parameters
-
[in] | pCommandToRelease | A pointer to the MQTTAgentCommand_t structure to return to the application. The structure must first have been obtained by calling an MQTTAgentCommandGet_t, otherwise it will have no effect. |
- Returns
- true if the MQTTAgentCommand_t structure was returned to the application, otherwise false.