Skip to content

Commit 2134bd6

Browse files
authored
Match @param style for all MQTT demos (FreeRTOS#343)
Some demos like MQTT plaintext, serializer, and keep alive do not use @param[in] or @param[out] and instead use @param only. This change makes it so that the style matches among all demos. In addition, because FREERTOS_CONFIG_H has no trailing underscore, CORE_MQTT_CONFIG_H_ is changed to CORE_MQTT_CONFIG_H and same for MBEDTLS_CONFIG_H_.
1 parent 5f0bf94 commit 2134bd6

File tree

7 files changed

+59
-60
lines changed

7 files changed

+59
-60
lines changed

FreeRTOS-Plus/Demo/coreMQTT_Windows_Simulator/MQTT_Keep_Alive/DemoTasks/KeepAliveMQTTExample.c

+15-15
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ static void prvMQTTDemoTask( void * pvParameters );
196196
* Timeout value will exponentially increase until maximum
197197
* timeout value is reached or the number of attempts are exhausted.
198198
*
199-
* @param pxNetworkContext The output parameter to return the created network context.
199+
* @param[out] pxNetworkContext The parameter to return the created network context.
200200
*
201201
* @return The status of the final connection attempt.
202202
*/
@@ -205,8 +205,8 @@ static PlaintextTransportStatus_t prvConnectToServerWithBackoffRetries( NetworkC
205205
/**
206206
* @brief Sends an MQTT Connect packet over the already connected TCP socket.
207207
*
208-
* @param pxMQTTContext MQTT context pointer.
209-
* @param pxNetworkContext Network context.
208+
* @param[in, out] pxMQTTContext MQTT context pointer.
209+
* @param[in] pxNetworkContext Network context.
210210
*
211211
*/
212212
static void prvCreateMQTTConnectionWithBroker( MQTTContext_t * pxMQTTContext,
@@ -217,7 +217,7 @@ static void prvCreateMQTTConnectionWithBroker( MQTTContext_t * pxMQTTContext,
217217
* information from Subscribe ACK. Called by the event callback after processing
218218
* an incoming SUBACK packet.
219219
*
220-
* @param Server response to the subscription request.
220+
* @param[in] Server response to the subscription request.
221221
*/
222222
static void prvUpdateSubAckStatus( MQTTPacketInfo_t * pxPacketInfo );
223223

@@ -226,22 +226,22 @@ static void prvUpdateSubAckStatus( MQTTPacketInfo_t * pxPacketInfo );
226226
* this file. In the case of a Subscribe ACK failure, then subscription is
227227
* retried using an exponential backoff strategy with jitter.
228228
*
229-
* @param pxMQTTContext MQTT context pointer.
229+
* @param[in] pxMQTTContext MQTT context pointer.
230230
*/
231231
static void prvMQTTSubscribeWithBackoffRetries( MQTTContext_t * pxMQTTContext );
232232

233233
/**
234234
* @brief Publishes a message mqttexampleMESSAGE on mqttexampleTOPIC topic.
235235
*
236-
* @param pxMQTTContext MQTT context pointer.
236+
* @param[in] pxMQTTContext MQTT context pointer.
237237
*/
238238
static void prvMQTTPublishToTopic( MQTTContext_t * pxMQTTContext );
239239

240240
/**
241241
* @brief Unsubscribes from the previously subscribed topic as specified
242242
* in mqttexampleTOPIC.
243243
*
244-
* @param pxMQTTContext MQTT context pointer.
244+
* @param[in] pxMQTTContext MQTT context pointer.
245245
*/
246246
static void prvMQTTUnsubscribeFromTopic( MQTTContext_t * pxMQTTContext );
247247

@@ -256,17 +256,17 @@ static uint32_t prvGetTimeMs( void );
256256
* @brief Process a response or ack to an MQTT request (PING, SUBSCRIBE
257257
* or UNSUBSCRIBE). This function processes PINGRESP, SUBACK, UNSUBACK
258258
*
259-
* @param pxIncomingPacket is a pointer to structure containing deserialized
259+
* @param[in] pxIncomingPacket is a pointer to structure containing deserialized
260260
* MQTT response.
261-
* @param usPacketId is the packet identifier from the ack received.
261+
* @param[in] usPacketId is the packet identifier from the ack received.
262262
*/
263263
static void prvMQTTProcessResponse( MQTTPacketInfo_t * pxIncomingPacket,
264264
uint16_t usPacketId );
265265

266266
/**
267267
* @brief Process incoming Publish message.
268268
*
269-
* @param pxPublishInfo is a pointer to structure containing deserialized
269+
* @param[in] pxPublishInfo is a pointer to structure containing deserialized
270270
* Publish message.
271271
*/
272272
static void prvMQTTProcessIncomingPublish( MQTTPublishInfo_t * pxPublishInfo );
@@ -277,7 +277,7 @@ static void prvMQTTProcessIncomingPublish( MQTTPublishInfo_t * pxPublishInfo );
277277
*
278278
* This should only be called after a control packet has been sent.
279279
*
280-
* @param pxTimer The auto-reload software timer for handling keep alive.
280+
* @param[in] pxTimer The auto-reload software timer for handling keep alive.
281281
*
282282
* @return The status returned by #xTimerReset.
283283
*/
@@ -289,17 +289,17 @@ static BaseType_t prvCheckTimeoutThenResetTimer( TimerHandle_t pxTimer );
289289
* Its responsibility is to send a PINGREQ packet if a PINGRESP is not pending
290290
* and no control packets have been sent after some given interval.
291291
*
292-
* @param pxTimer The auto-reload software timer for handling keep alive.
292+
* @param[in] pxTimer The auto-reload software timer for handling keep alive.
293293
*/
294294
static void prvKeepAliveTimerCallback( TimerHandle_t pxTimer );
295295

296296
/**
297297
* @brief The application callback function for getting the incoming publish
298298
* and incoming acks reported from the MQTT library.
299299
*
300-
* @param pxMQTTContext MQTT context pointer.
301-
* @param pxPacketInfo Packet Info pointer for the incoming packet.
302-
* @param pxDeserializedInfo Deserialized information from the incoming packet.
300+
* @param[in] pxMQTTContext MQTT context pointer.
301+
* @param[in] pxPacketInfo Packet Info pointer for the incoming packet.
302+
* @param[in] pxDeserializedInfo Deserialized information from the incoming packet.
303303
*/
304304
static void prvEventCallback( MQTTContext_t * pxMQTTContext,
305305
MQTTPacketInfo_t * pxPacketInfo,

FreeRTOS-Plus/Demo/coreMQTT_Windows_Simulator/MQTT_Multitask/mbedtls_config.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@
4646

4747
/* This file configures mbed TLS for FreeRTOS. */
4848

49-
#ifndef MBEDTLS_CONFIG_H_
50-
#define MBEDTLS_CONFIG_H_
49+
#ifndef MBEDTLS_CONFIG_H
50+
#define MBEDTLS_CONFIG_H
5151

5252
/* FreeRTOS include. */
5353
#include "FreeRTOS.h"
@@ -148,4 +148,4 @@ int mbedtls_platform_entropy_poll( void * data,
148148

149149
#include "mbedtls/check_config.h"
150150

151-
#endif /* ifndef MBEDTLS_CONFIG_H_ */
151+
#endif /* ifndef MBEDTLS_CONFIG_H */

FreeRTOS-Plus/Demo/coreMQTT_Windows_Simulator/MQTT_Mutual_Auth/DemoTasks/MutualAuthMQTTExample.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ static void prvMQTTDemoTask( void * pvParameters );
265265
* Timeout value will exponentially increase until maximum
266266
* timeout value is reached or the number of attempts are exhausted.
267267
*
268-
* @param[out] pxNetworkContext The output parameter to return the created network context.
268+
* @param[out] pxNetworkContext The parameter to return the created network context.
269269
*
270270
* @return The status of the final connection attempt.
271271
*/

FreeRTOS-Plus/Demo/coreMQTT_Windows_Simulator/MQTT_Mutual_Auth/mbedtls_config.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@
4646

4747
/* This file configures mbed TLS for FreeRTOS. */
4848

49-
#ifndef MBEDTLS_CONFIG_H_
50-
#define MBEDTLS_CONFIG_H_
49+
#ifndef MBEDTLS_CONFIG_H
50+
#define MBEDTLS_CONFIG_H
5151

5252
/* FreeRTOS include. */
5353
#include "FreeRTOS.h"
@@ -148,4 +148,4 @@ int mbedtls_platform_entropy_poll( void * data,
148148

149149
#include "mbedtls/check_config.h"
150150

151-
#endif /* ifndef MBEDTLS_CONFIG_H_ */
151+
#endif /* ifndef MBEDTLS_CONFIG_H */

FreeRTOS-Plus/Demo/coreMQTT_Windows_Simulator/MQTT_Plain_Text/DemoTasks/PlaintextMQTTExample.c

+19-18
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
*
2222
* http://www.FreeRTOS.org
2323
* http://aws.amazon.com/freertos
24+
*
2425
*/
2526

2627
/*
@@ -172,7 +173,7 @@ static void prvMQTTDemoTask( void * pvParameters );
172173
* Timeout value will exponentially increase until maximum
173174
* timeout value is reached or the number of attempts are exhausted.
174175
*
175-
* @param pxNetworkContext The output parameter to return the created network context.
176+
* @param[out] pxNetworkContext The parameter to return the created network context.
176177
*
177178
* @return The status of the final connection attempt.
178179
*/
@@ -181,8 +182,8 @@ static PlaintextTransportStatus_t prvConnectToServerWithBackoffRetries( NetworkC
181182
/**
182183
* @brief Sends an MQTT Connect packet over the already connected TCP socket.
183184
*
184-
* @param pxMQTTContext MQTT context pointer.
185-
* @param pxNetworkContext Network context.
185+
* @param[in, out] pxMQTTContext MQTT context pointer.
186+
* @param[in] pxNetworkContext Network context.
186187
*
187188
*/
188189
static void prvCreateMQTTConnectionWithBroker( MQTTContext_t * pxMQTTContext,
@@ -193,7 +194,7 @@ static void prvCreateMQTTConnectionWithBroker( MQTTContext_t * pxMQTTContext,
193194
* information from Subscribe ACK. Called by the event callback after processing
194195
* an incoming SUBACK packet.
195196
*
196-
* @param Server response to the subscription request.
197+
* @param[in] Server response to the subscription request.
197198
*/
198199
static void prvUpdateSubAckStatus( MQTTPacketInfo_t * pxPacketInfo );
199200

@@ -202,22 +203,22 @@ static void prvUpdateSubAckStatus( MQTTPacketInfo_t * pxPacketInfo );
202203
* this file. In the case of a Subscribe ACK failure, then subscription is
203204
* retried using an exponential backoff strategy with jitter.
204205
*
205-
* @param pxMQTTContext MQTT context pointer.
206+
* @param[in] pxMQTTContext MQTT context pointer.
206207
*/
207208
static void prvMQTTSubscribeWithBackoffRetries( MQTTContext_t * pxMQTTContext );
208209

209210
/**
210211
* @brief Publishes a message mqttexampleMESSAGE on mqttexampleTOPIC topic.
211212
*
212-
* @param pxMQTTContext MQTT context pointer.
213+
* @param[in] pxMQTTContext MQTT context pointer.
213214
*/
214215
static void prvMQTTPublishToTopic( MQTTContext_t * pxMQTTContext );
215216

216217
/**
217218
* @brief Unsubscribes from the previously subscribed topic as specified
218219
* in mqttexampleTOPIC.
219220
*
220-
* @param pxMQTTContext MQTT context pointer.
221+
* @param[in] pxMQTTContext MQTT context pointer.
221222
*/
222223
static void prvMQTTUnsubscribeFromTopic( MQTTContext_t * pxMQTTContext );
223224

@@ -230,19 +231,19 @@ static uint32_t prvGetTimeMs( void );
230231

231232
/**
232233
* @brief Process a response or ack to an MQTT request (PING, SUBSCRIBE
233-
* or UNSUBSCRIBE). This function processes PINGRESP, SUBACK, UNSUBACK
234+
* or UNSUBSCRIBE). This function processes PINGRESP, SUBACK, and UNSUBACK.
234235
*
235-
* @param pxIncomingPacket is a pointer to structure containing deserialized
236+
* @param[in] pxIncomingPacket is a pointer to structure containing deserialized
236237
* MQTT response.
237-
* @param usPacketId is the packet identifier from the ack received.
238+
* @param[in] usPacketId is the packet identifier from the ack received.
238239
*/
239240
static void prvMQTTProcessResponse( MQTTPacketInfo_t * pxIncomingPacket,
240241
uint16_t usPacketId );
241242

242243
/**
243244
* @brief Process incoming Publish message.
244245
*
245-
* @param pxPublishInfo is a pointer to structure containing deserialized
246+
* @param[in] pxPublishInfo is a pointer to structure containing deserialized
246247
* Publish message.
247248
*/
248249
static void prvMQTTProcessIncomingPublish( MQTTPublishInfo_t * pxPublishInfo );
@@ -251,9 +252,9 @@ static void prvMQTTProcessIncomingPublish( MQTTPublishInfo_t * pxPublishInfo );
251252
* @brief The application callback function for getting the incoming publish
252253
* and incoming acks reported from the MQTT library.
253254
*
254-
* @param pxMQTTContext MQTT context pointer.
255-
* @param pxPacketInfo Packet Info pointer for the incoming packet.
256-
* @param pxDeserializedInfo Deserialized information from the incoming packet.
255+
* @param[in] pxMQTTContext MQTT context pointer.
256+
* @param[in] pxPacketInfo Packet Info pointer for the incoming packet.
257+
* @param[in] pxDeserializedInfo Deserialized information from the incoming packet.
257258
*/
258259
static void prvEventCallback( MQTTContext_t * pxMQTTContext,
259260
MQTTPacketInfo_t * pxPacketInfo,
@@ -367,7 +368,7 @@ static void prvMQTTDemoTask( void * pvParameters )
367368

368369
/**************************** Subscribe. ******************************/
369370

370-
/* If server rejected the subscription request, attempt to resubscribe to
371+
/* If server rejected the subscription request, attempt to resubscribe to
371372
* the topic. Attempts are made according to the exponential backoff retry
372373
* strategy declared in retry_utils.h. */
373374
prvMQTTSubscribeWithBackoffRetries( &xMQTTContext );
@@ -383,7 +384,7 @@ static void prvMQTTDemoTask( void * pvParameters )
383384
* to the same topic, the broker will send the same publish message
384385
* back to the application. */
385386
LogInfo( ( "Attempt to receive publish message from broker." ) );
386-
xMQTTStatus = MQTT_ProcessLoop( &xMQTTContext,
387+
xMQTTStatus = MQTT_ProcessLoop( &xMQTTContext,
387388
mqttexamplePROCESS_LOOP_TIMEOUT_MS );
388389
configASSERT( xMQTTStatus == MQTTSuccess );
389390

@@ -397,7 +398,7 @@ static void prvMQTTDemoTask( void * pvParameters )
397398
prvMQTTUnsubscribeFromTopic( &xMQTTContext );
398399

399400
/* Process the incoming packet from the broker. */
400-
xMQTTStatus = MQTT_ProcessLoop( &xMQTTContext,
401+
xMQTTStatus = MQTT_ProcessLoop( &xMQTTContext,
401402
mqttexamplePROCESS_LOOP_TIMEOUT_MS );
402403
configASSERT( xMQTTStatus == MQTTSuccess );
403404

@@ -406,7 +407,7 @@ static void prvMQTTDemoTask( void * pvParameters )
406407
/* Send an MQTT Disconnect packet over the connected TCP socket.
407408
* There is no corresponding response for a disconnect packet. After
408409
* sending the disconnect, the client must close the network connection. */
409-
LogInfo( ( "Disconnecting the MQTT connection with %s.",
410+
LogInfo( ( "Disconnecting the MQTT connection with %s.",
410411
democonfigMQTT_BROKER_ENDPOINT ) );
411412
xMQTTStatus = MQTT_Disconnect( &xMQTTContext );
412413
configASSERT( xMQTTStatus == MQTTSuccess );

FreeRTOS-Plus/Demo/coreMQTT_Windows_Simulator/MQTT_Plain_Text/core_mqtt_config.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@
2424
*
2525
* 1 tab == 4 spaces!
2626
*/
27-
#ifndef CORE_MQTT_CONFIG_H_
28-
#define CORE_MQTT_CONFIG_H_
27+
#ifndef CORE_MQTT_CONFIG_H
28+
#define CORE_MQTT_CONFIG_H
2929

3030
/**************************************************/
3131
/******* DO NOT CHANGE the following order ********/
@@ -64,4 +64,4 @@
6464
*/
6565
#define MQTT_STATE_ARRAY_MAX_COUNT 10U
6666

67-
#endif /* ifndef CORE_MQTT_CONFIG_H_ */
67+
#endif /* ifndef CORE_MQTT_CONFIG_H */

0 commit comments

Comments
 (0)