coreMQTT Agent v1.0.0
Thread safe MQTT 3.1.1 Client
core_mqtt_agent_message_interface.h
Go to the documentation of this file.
1/*
2 * coreMQTT Agent v1.0.0
3 * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
4 *
5 * Permission is hereby granted, free of charge, to any person obtaining a copy of
6 * this software and associated documentation files (the "Software"), to deal in
7 * the Software without restriction, including without limitation the rights to
8 * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
9 * the Software, and to permit persons to whom the Software is furnished to do so,
10 * subject to the following conditions:
11 *
12 * The above copyright notice and this permission notice shall be included in all
13 * copies or substantial portions of the Software.
14 *
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
17 * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
18 * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
19 * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21 */
22
27#ifndef CORE_MQTT_AGENT_MESSAGE_INTERFACE_H
28#define CORE_MQTT_AGENT_MESSAGE_INTERFACE_H
29
30#include <stddef.h>
31#include <stdint.h>
32#include <stdbool.h>
33
34/* Declare here so interface functions can use. */
35struct MQTTAgentCommand;
36struct MQTTAgentMessageContext;
37
41typedef struct MQTTAgentCommand MQTTAgentCommand_t;
42
47/* @[define_messagectx] */
48typedef struct MQTTAgentMessageContext MQTTAgentMessageContext_t;
49/* @[define_messagectx] */
50
61/* @[define_messagesend] */
63 MQTTAgentCommand_t * const * pCommandToSend,
64 uint32_t blockTimeMs );
65/* @[define_messagesend] */
66
77/* @[define_messagerecv] */
79 MQTTAgentCommand_t ** pReceivedCommand,
80 uint32_t blockTimeMs );
81/* @[define_messagerecv] */
82
98/* @[define_messageget] */
99typedef MQTTAgentCommand_t * ( * MQTTAgentCommandGet_t )( uint32_t blockTimeMs );
100/* @[define_messageget] */
101
116/* @[define_messagerelease] */
117typedef bool ( * MQTTAgentCommandRelease_t )( MQTTAgentCommand_t * pCommandToRelease );
118/* @[define_messagerelease] */
119
125/* @[define_messageinterface] */
126typedef struct MQTTAgentMessageInterface
127{
134/* @[define_messageinterface] */
135
136#endif /* CORE_MQTT_AGENT_MESSAGE_INTERFACE_H */
bool(* MQTTAgentCommandRelease_t)(MQTTAgentCommand_t *pCommandToRelease)
Give a MQTTAgentCommand_t structure back to the application.
Definition: core_mqtt_agent_message_interface.h:117
bool(* MQTTAgentMessageSend_t)(MQTTAgentMessageContext_t *pMsgCtx, MQTTAgentCommand_t *const *pCommandToSend, uint32_t blockTimeMs)
Send a message to the specified context. Must be thread safe.
Definition: core_mqtt_agent_message_interface.h:62
MQTTAgentCommand_t *(* MQTTAgentCommandGet_t)(uint32_t blockTimeMs)
Obtain a MQTTAgentCommand_t structure.
Definition: core_mqtt_agent_message_interface.h:99
bool(* MQTTAgentMessageRecv_t)(MQTTAgentMessageContext_t *pMsgCtx, MQTTAgentCommand_t **pReceivedCommand, uint32_t blockTimeMs)
Receive a message from the specified context. Must be thread safe.
Definition: core_mqtt_agent_message_interface.h:78
struct MQTTAgentMessageContext MQTTAgentMessageContext_t
Context with which tasks may deliver messages to the agent.
Definition: core_mqtt_agent_message_interface.h:48
The commands sent from the APIs to the MQTT agent task.
Definition: core_mqtt_agent.h:137
Function pointers and contexts used for sending and receiving commands, and allocating memory for the...
Definition: core_mqtt_agent_message_interface.h:127
MQTTAgentMessageContext_t * pMsgCtx
Definition: core_mqtt_agent_message_interface.h:128
MQTTAgentMessageRecv_t recv
Definition: core_mqtt_agent_message_interface.h:130
MQTTAgentCommandGet_t getCommand
Definition: core_mqtt_agent_message_interface.h:131
MQTTAgentMessageSend_t send
Definition: core_mqtt_agent_message_interface.h:129
MQTTAgentCommandRelease_t releaseCommand
Definition: core_mqtt_agent_message_interface.h:132