Rename MQTT Agent structs and files (#576)

This commit is contained in:
Archit Aggarwal 2021-04-26 11:29:50 -07:00 committed by GitHub
parent 1fe418dc9f
commit 43bd42db27
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 62 additions and 62 deletions

View file

@ -71,7 +71,7 @@
#include "core_mqtt.h"
/* MQTT agent include. */
#include "mqtt_agent.h"
#include "core_mqtt_agent.h"
/* MQTT Agent ports. */
#include "freertos_agent_message.h"
@ -359,7 +359,7 @@ MQTTAgentContext_t xGlobalMqttAgentContext;
static uint8_t xNetworkBuffer[ MQTT_AGENT_NETWORK_BUFFER_SIZE ];
static AgentMessageContext_t xCommandQueue;
static MQTTAgentMessageContext_t xCommandQueue;
/**
* @brief The global array of subscription elements.
@ -397,9 +397,9 @@ static MQTTStatus_t prvMQTTInit( void )
TransportInterface_t xTransport;
MQTTStatus_t xReturn;
MQTTFixedBuffer_t xFixedBuffer = { .pBuffer = xNetworkBuffer, .size = MQTT_AGENT_NETWORK_BUFFER_SIZE };
static uint8_t staticQueueStorageArea[ MQTT_AGENT_COMMAND_QUEUE_LENGTH * sizeof( Command_t * ) ];
static uint8_t staticQueueStorageArea[ MQTT_AGENT_COMMAND_QUEUE_LENGTH * sizeof( MQTTAgentCommand_t * ) ];
static StaticQueue_t staticQueueStructure;
AgentMessageInterface_t messageInterface =
MQTTAgentMessageInterface_t messageInterface =
{
.pMsgCtx = NULL,
.send = Agent_MessageSend,
@ -410,7 +410,7 @@ static MQTTStatus_t prvMQTTInit( void )
LogDebug( ( "Creating command queue." ) );
xCommandQueue.queue = xQueueCreateStatic( MQTT_AGENT_COMMAND_QUEUE_LENGTH,
sizeof( Command_t * ),
sizeof( MQTTAgentCommand_t * ),
staticQueueStorageArea,
&staticQueueStructure );
configASSERT( xCommandQueue.queue );
@ -531,7 +531,7 @@ static MQTTStatus_t prvHandleResubscribe( void )
/* These variables need to stay in scope until command completes. */
static MQTTAgentSubscribeArgs_t xSubArgs = { 0 };
static MQTTSubscribeInfo_t xSubInfo[ SUBSCRIPTION_MANAGER_MAX_SUBSCRIPTIONS ] = { 0 };
static CommandInfo_t xCommandParams = { 0 };
static MQTTAgentCommandInfo_t xCommandParams = { 0 };
/* Loop through each subscription in the subscription list and add a subscribe
* command to the command queue. */
@ -772,7 +772,7 @@ static BaseType_t prvSocketDisconnect( NetworkContext_t * pxNetworkContext )
static void prvMQTTClientSocketWakeupCallback( Socket_t pxSocket )
{
CommandInfo_t xCommandParams = { 0 };
MQTTAgentCommandInfo_t xCommandParams = { 0 };
/* Just to avoid compiler warnings. The socket is not used but the function
* prototype cannot be changed because this is a callback function. */

View file

@ -59,7 +59,7 @@
#include "core_mqtt.h"
/* MQTT agent include. */
#include "mqtt_agent.h"
#include "core_mqtt_agent.h"
/* Subscription manager header include. */
#include "subscription_manager.h"
@ -100,7 +100,7 @@
* @brief Defines the structure to use as the command callback context in this
* demo.
*/
struct CommandContext
struct MQTTAgentCommandContext
{
MQTTStatus_t xReturnStatus;
TaskHandle_t xTaskToNotify;
@ -141,7 +141,7 @@ static void prvSubscribeCommandCallback( void * pxCommandContext,
* @param[in] pxCommandContext Context of the initial command.
* @param[in].xReturnStatus The result of the command.
*/
static void prvPublishCommandCallback( CommandContext_t * pxCommandContext,
static void prvPublishCommandCallback( MQTTAgentCommandContext_t * pxCommandContext,
MQTTAgentReturnInfo_t * pxReturnInfo );
/**
@ -236,7 +236,7 @@ void vStartSimpleSubscribePublishTask( uint32_t ulNumberToCreate,
/*-----------------------------------------------------------*/
static void prvPublishCommandCallback( CommandContext_t * pxCommandContext,
static void prvPublishCommandCallback( MQTTAgentCommandContext_t * pxCommandContext,
MQTTAgentReturnInfo_t * pxReturnInfo )
{
/* Store the result in the application defined context so the task that
@ -260,7 +260,7 @@ static void prvSubscribeCommandCallback( void * pxCommandContext,
MQTTAgentReturnInfo_t * pxReturnInfo )
{
bool xSubscriptionAdded = false;
CommandContext_t * pxApplicationDefinedContext = ( CommandContext_t * ) pxCommandContext;
MQTTAgentCommandContext_t * pxApplicationDefinedContext = ( MQTTAgentCommandContext_t * ) pxCommandContext;
MQTTAgentSubscribeArgs_t * pxSubscribeArgs = ( MQTTAgentSubscribeArgs_t * ) pxApplicationDefinedContext->pArgs;
/* Store the result in the application defined context so the task that
@ -345,8 +345,8 @@ static bool prvSubscribeToTopic( MQTTQoS_t xQoS,
MQTTAgentSubscribeArgs_t xSubscribeArgs;
MQTTSubscribeInfo_t xSubscribeInfo;
static int32_t ulNextSubscribeMessageID = 0;
CommandContext_t xApplicationDefinedContext = { 0 };
CommandInfo_t xCommandParams = { 0 };
MQTTAgentCommandContext_t xApplicationDefinedContext = { 0 };
MQTTAgentCommandInfo_t xCommandParams = { 0 };
/* Create a unique number of the subscribe that is about to be sent. The number
* is used as the command context and is sent back to this task as a notification
@ -426,13 +426,13 @@ static void prvSimpleSubscribePublishTask( void * pvParameters )
MQTTPublishInfo_t xPublishInfo = { 0 };
char payloadBuf[ mqttexampleSTRING_BUFFER_LENGTH ];
char taskName[ mqttexampleSTRING_BUFFER_LENGTH ];
CommandContext_t xCommandContext;
MQTTAgentCommandContext_t xCommandContext;
uint32_t ulNotification = 0U, ulValueToNotify = 0UL;
MQTTStatus_t xCommandAdded;
uint32_t ulTaskNumber = ( uint32_t ) pvParameters;
MQTTQoS_t xQoS;
TickType_t xTicksToDelay;
CommandInfo_t xCommandParams = { 0 };
MQTTAgentCommandInfo_t xCommandParams = { 0 };
char * pcTopicBuffer = topicBuf[ ulTaskNumber ];
/* Have different tasks use different QoS. 0 and 1. 2 can also be used

View file

@ -157,8 +157,8 @@
<ClCompile Include="..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\FreeRTOS_UDP_IP.c" />
<ClCompile Include="..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\portable\BufferManagement\BufferAllocation_2.c" />
<ClCompile Include="..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\portable\NetworkInterface\WinPCap\NetworkInterface.c" />
<ClCompile Include="..\..\..\Source\Application-Protocols\coreMQTT-Agent\source\mqtt_agent.c" />
<ClCompile Include="..\..\..\Source\Application-Protocols\coreMQTT-Agent\source\mqtt_agent_command_functions.c" />
<ClCompile Include="..\..\..\Source\Application-Protocols\coreMQTT-Agent\source\core_mqtt_agent.c" />
<ClCompile Include="..\..\..\Source\Application-Protocols\coreMQTT-Agent\source\core_mqtt_agent_command_functions.c" />
<ClCompile Include="..\..\..\Source\Utilities\mbedtls_freertos\mbedtls_freertos_port.c" />
<ClCompile Include="..\..\..\Source\Utilities\mbedtls_freertos\mbedtls_error.c" />
<ClCompile Include="..\..\..\Source\Utilities\backoff_algorithm\source\backoff_algorithm.c" />
@ -520,8 +520,8 @@
<ClInclude Include="..\..\..\..\FreeRTOS-Plus\Source\Utilities\logging\logging_levels.h" />
<ClInclude Include="..\..\..\..\FreeRTOS-Plus\Source\Utilities\logging\logging_stack.h" />
<ClInclude Include="..\..\..\Source\Application-Protocols\coreMQTT-Agent\source\include\agent_message.h" />
<ClInclude Include="..\..\..\Source\Application-Protocols\coreMQTT-Agent\source\include\mqtt_agent.h" />
<ClInclude Include="..\..\..\Source\Application-Protocols\coreMQTT-Agent\source\include\mqtt_agent_command_functions.h" />
<ClInclude Include="..\..\..\Source\Application-Protocols\coreMQTT-Agent\source\include\core_mqtt_agent.h" />
<ClInclude Include="..\..\..\Source\Application-Protocols\coreMQTT-Agent\source\include\core_mqtt_agent_command_functions.h" />
<ClInclude Include="..\..\..\Source\Application-Protocols\coreMQTT\source\include\core_mqtt_config_defaults.h" />
<ClInclude Include="..\..\..\Source\FreeRTOS-Plus-TCP\include\FreeRTOS_errno_TCP.h" />
<ClInclude Include="..\..\..\Source\Utilities\mbedtls_freertos\mbedtls_error.h" />
@ -625,4 +625,4 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
</Project>

View file

@ -423,10 +423,10 @@
<ClCompile Include="DemoTasks\simple_sub_pub_demo.c">
<Filter>DemoTasks</Filter>
</ClCompile>
<ClCompile Include="..\..\..\Source\Application-Protocols\coreMQTT-Agent\source\mqtt_agent.c">
<ClCompile Include="..\..\..\Source\Application-Protocols\coreMQTT-Agent\source\core_mqtt_agent.c">
<Filter>FreeRTOS+\FreeRTOS IoT Libraries\standard\coreMQTT-Agent</Filter>
</ClCompile>
<ClCompile Include="..\..\..\Source\Application-Protocols\coreMQTT-Agent\source\mqtt_agent_command_functions.c">
<ClCompile Include="..\..\..\Source\Application-Protocols\coreMQTT-Agent\source\core_mqtt_agent_command_functions.c">
<Filter>FreeRTOS+\FreeRTOS IoT Libraries\standard\coreMQTT-Agent</Filter>
</ClCompile>
<ClCompile Include="..\..\Common\coreMQTT_Agent_Interface\freertos_agent_message.c">
@ -809,10 +809,10 @@
<ClInclude Include="..\..\..\Source\Application-Protocols\coreMQTT-Agent\source\include\agent_message.h">
<Filter>FreeRTOS+\FreeRTOS IoT Libraries\standard\coreMQTT-Agent\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\Source\Application-Protocols\coreMQTT-Agent\source\include\mqtt_agent.h">
<ClInclude Include="..\..\..\Source\Application-Protocols\coreMQTT-Agent\source\include\core_mqtt_agent.h">
<Filter>FreeRTOS+\FreeRTOS IoT Libraries\standard\coreMQTT-Agent\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\Source\Application-Protocols\coreMQTT-Agent\source\include\mqtt_agent_command_functions.h">
<ClInclude Include="..\..\..\Source\Application-Protocols\coreMQTT-Agent\source\include\core_mqtt_agent_command_functions.h">
<Filter>FreeRTOS+\FreeRTOS IoT Libraries\standard\coreMQTT-Agent\include</Filter>
</ClInclude>
<ClInclude Include="..\..\Common\coreMQTT_Agent_Interface\include\freertos_agent_message.h">
@ -825,4 +825,4 @@
<Filter>subscription-manager</Filter>
</ClInclude>
</ItemGroup>
</Project>
</Project>