From 6708d43981dcca95ef1fa290272abb8e8f6455b5 Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Tue, 16 Jan 2024 22:17:17 +0000 Subject: [PATCH] Uncrustify: triggered by comment. --- .../ota_over_mqtt_demo/ota_over_mqtt_demo.h | 22 +++---- .../ota_over_mqtt_demo_config.h | 44 +++++++------- .../sub_pub_unsub_demo/sub_pub_unsub_demo.h | 14 ++--- .../sub_pub_unsub_demo_config.h | 34 +++++------ .../temp_sub_pub_and_led_control_demo.h | 14 ++--- ...temp_sub_pub_and_led_control_demo_config.h | 26 ++++----- .../networking/mqtt/core_mqtt_agent_manager.h | 24 ++++---- .../mqtt/core_mqtt_agent_manager_config.h | 42 +++++++------- .../mqtt/core_mqtt_agent_manager_events.h | 30 +++++----- main/networking/mqtt/subscription_manager.h | 58 +++++++++---------- main/networking/wifi/app_wifi.h | 2 +- 11 files changed, 155 insertions(+), 155 deletions(-) diff --git a/main/demo_tasks/ota_over_mqtt_demo/ota_over_mqtt_demo.h b/main/demo_tasks/ota_over_mqtt_demo/ota_over_mqtt_demo.h index 2fa8a50..7ec8957 100644 --- a/main/demo_tasks/ota_over_mqtt_demo/ota_over_mqtt_demo.h +++ b/main/demo_tasks/ota_over_mqtt_demo/ota_over_mqtt_demo.h @@ -25,19 +25,19 @@ */ #ifndef OTA_OVER_MQTT_DEMO_H -#define OTA_OVER_MQTT_DEMO_H + #define OTA_OVER_MQTT_DEMO_H -#include "freertos/FreeRTOS.h" -#include "core_mqtt_agent.h" + #include "freertos/FreeRTOS.h" + #include "core_mqtt_agent.h" -#ifdef __cplusplus -extern "C" { -#endif + #ifdef __cplusplus + extern "C" { + #endif /** * @brief Starts the OTA codesigning demo. */ -void vStartOTACodeSigningDemo( void ); + void vStartOTACodeSigningDemo( void ); /** * @brief Default callback used to receive default messages for OTA. @@ -52,11 +52,11 @@ void vStartOTACodeSigningDemo( void ); * * @return true if the message is processed by OTA. */ -bool vOTAProcessMessage( void * pvIncomingPublishCallbackContext, - MQTTPublishInfo_t * pxPublishInfo ); + bool vOTAProcessMessage( void * pvIncomingPublishCallbackContext, + MQTTPublishInfo_t * pxPublishInfo ); -#ifdef __cplusplus + #ifdef __cplusplus } -#endif + #endif #endif /* OTA_OVER_MQTT_DEMO_H */ diff --git a/main/demo_tasks/ota_over_mqtt_demo/ota_over_mqtt_demo_config.h b/main/demo_tasks/ota_over_mqtt_demo/ota_over_mqtt_demo_config.h index 85357ba..2d731b8 100644 --- a/main/demo_tasks/ota_over_mqtt_demo/ota_over_mqtt_demo_config.h +++ b/main/demo_tasks/ota_over_mqtt_demo/ota_over_mqtt_demo_config.h @@ -25,67 +25,67 @@ */ #ifndef OTA_OVER_MQTT_DEMO_CONFIG_H -#define OTA_OVER_MQTT_DEMO_CONFIG_H + #define OTA_OVER_MQTT_DEMO_CONFIG_H /* ESP-IDF sdkconfig include. */ -#include + #include -#if CONFIG_GRI_RUN_QUALIFICATION_TEST - #include "qualification_wrapper_config.h" -#endif /* CONFIG_GRI_RUN_QUALIFICATION_TEST */ + #if CONFIG_GRI_RUN_QUALIFICATION_TEST + #include "qualification_wrapper_config.h" + #endif /* CONFIG_GRI_RUN_QUALIFICATION_TEST */ -#ifdef __cplusplus -extern "C" { -#endif + #ifdef __cplusplus + extern "C" { + #endif /** * @brief The thing name of the device. */ -#define otademoconfigCLIENT_IDENTIFIER ( CONFIG_GRI_THING_NAME ) + #define otademoconfigCLIENT_IDENTIFIER ( CONFIG_GRI_THING_NAME ) /** * @brief The maximum size of the file paths used in the demo. */ -#define otademoconfigMAX_FILE_PATH_SIZE ( CONFIG_GRI_OTA_DEMO_MAX_FILE_PATH_SIZE ) + #define otademoconfigMAX_FILE_PATH_SIZE ( CONFIG_GRI_OTA_DEMO_MAX_FILE_PATH_SIZE ) /** * @brief The maximum size of the stream name required for downloading update file * from streaming service. */ -#define otademoconfigMAX_STREAM_NAME_SIZE ( CONFIG_GRI_OTA_DEMO_MAX_STREAM_NAME_SIZE ) + #define otademoconfigMAX_STREAM_NAME_SIZE ( CONFIG_GRI_OTA_DEMO_MAX_STREAM_NAME_SIZE ) /** * @brief The delay used in the OTA demo task to periodically output the OTA * statistics like number of packets received, dropped, processed and queued per connection. */ -#define otademoconfigTASK_DELAY_MS ( CONFIG_GRI_OTA_DEMO_TASK_DELAY_MS ) + #define otademoconfigTASK_DELAY_MS ( CONFIG_GRI_OTA_DEMO_TASK_DELAY_MS ) /** * @brief The maximum time for which OTA demo waits for an MQTT operation to be complete. * This involves receiving an acknowledgment for broker for SUBSCRIBE, UNSUBSCRIBE and non * QOS0 publishes. */ -#define otademoconfigMQTT_TIMEOUT_MS ( CONFIG_GRI_OTA_DEMO_MQTT_TIMEOUT_MS ) + #define otademoconfigMQTT_TIMEOUT_MS ( CONFIG_GRI_OTA_DEMO_MQTT_TIMEOUT_MS ) /** * @brief The task priority of OTA agent task. */ -#define otademoconfigAGENT_TASK_PRIORITY ( CONFIG_GRI_OTA_DEMO_AGENT_TASK_PRIORITY ) + #define otademoconfigAGENT_TASK_PRIORITY ( CONFIG_GRI_OTA_DEMO_AGENT_TASK_PRIORITY ) /** * @brief The stack size of OTA agent task. */ -#define otademoconfigAGENT_TASK_STACK_SIZE ( CONFIG_GRI_OTA_DEMO_AGENT_TASK_STACK_SIZE ) + #define otademoconfigAGENT_TASK_STACK_SIZE ( CONFIG_GRI_OTA_DEMO_AGENT_TASK_STACK_SIZE ) /** * @brief The task priority of the OTA demo task. */ -#define otademoconfigDEMO_TASK_PRIORITY ( CONFIG_GRI_OTA_DEMO_DEMO_TASK_PRIORITY ) + #define otademoconfigDEMO_TASK_PRIORITY ( CONFIG_GRI_OTA_DEMO_DEMO_TASK_PRIORITY ) /** * @brief The task stack size of the OTA demo task. */ -#define otademoconfigDEMO_TASK_STACK_SIZE ( CONFIG_GRI_OTA_DEMO_DEMO_TASK_STACK_SIZE ) + #define otademoconfigDEMO_TASK_STACK_SIZE ( CONFIG_GRI_OTA_DEMO_DEMO_TASK_STACK_SIZE ) /** * @brief The version for the firmware which is running. OTA agent uses this @@ -93,12 +93,12 @@ extern "C" { * download image should be higher than the current version, otherwise the new image is * rejected in self test phase. */ -#define APP_VERSION_MAJOR ( CONFIG_GRI_OTA_DEMO_APP_VERSION_MAJOR ) -#define APP_VERSION_MINOR ( CONFIG_GRI_OTA_DEMO_APP_VERSION_MINOR ) -#define APP_VERSION_BUILD ( CONFIG_GRI_OTA_DEMO_APP_VERSION_BUILD ) + #define APP_VERSION_MAJOR ( CONFIG_GRI_OTA_DEMO_APP_VERSION_MAJOR ) + #define APP_VERSION_MINOR ( CONFIG_GRI_OTA_DEMO_APP_VERSION_MINOR ) + #define APP_VERSION_BUILD ( CONFIG_GRI_OTA_DEMO_APP_VERSION_BUILD ) -#ifdef __cplusplus + #ifdef __cplusplus } -#endif + #endif #endif /* OTA_OVER_MQTT_DEMO_CONFIG_H */ diff --git a/main/demo_tasks/sub_pub_unsub_demo/sub_pub_unsub_demo.h b/main/demo_tasks/sub_pub_unsub_demo/sub_pub_unsub_demo.h index dfd59ef..cd3ee72 100644 --- a/main/demo_tasks/sub_pub_unsub_demo/sub_pub_unsub_demo.h +++ b/main/demo_tasks/sub_pub_unsub_demo/sub_pub_unsub_demo.h @@ -25,19 +25,19 @@ */ #ifndef SUB_PUB_UNSUB_DEMO_H -#define SUB_PUB_UNSUB_DEMO_H + #define SUB_PUB_UNSUB_DEMO_H -#ifdef __cplusplus -extern "C" { -#endif + #ifdef __cplusplus + extern "C" { + #endif /** * @brief This function starts the SubPubUnsub demo. */ -void vStartSubscribePublishUnsubscribeDemo( void ); + void vStartSubscribePublishUnsubscribeDemo( void ); -#ifdef __cplusplus + #ifdef __cplusplus } -#endif + #endif #endif /* SUB_PUB_UNSUB_DEMO_H */ diff --git a/main/demo_tasks/sub_pub_unsub_demo/sub_pub_unsub_demo_config.h b/main/demo_tasks/sub_pub_unsub_demo/sub_pub_unsub_demo_config.h index e62a367..228d1f6 100644 --- a/main/demo_tasks/sub_pub_unsub_demo/sub_pub_unsub_demo_config.h +++ b/main/demo_tasks/sub_pub_unsub_demo/sub_pub_unsub_demo_config.h @@ -25,62 +25,62 @@ */ #ifndef SUB_PUB_UNSUB_DEMO_CONFIG_H -#define SUB_PUB_UNSUB_DEMO_CONFIG_H + #define SUB_PUB_UNSUB_DEMO_CONFIG_H /* ESP-IDF sdkconfig include. */ -#include + #include -#if CONFIG_GRI_RUN_QUALIFICATION_TEST - #include "qualification_wrapper_config.h" -#endif /* CONFIG_GRI_RUN_QUALIFICATION_TEST */ + #if CONFIG_GRI_RUN_QUALIFICATION_TEST + #include "qualification_wrapper_config.h" + #endif /* CONFIG_GRI_RUN_QUALIFICATION_TEST */ -#ifdef __cplusplus -extern "C" { -#endif + #ifdef __cplusplus + extern "C" { + #endif /** * @brief Size of statically allocated buffers for holding topic names and * payloads. */ -#define subpubunsubconfigSTRING_BUFFER_LENGTH ( ( unsigned int ) ( CONFIG_GRI_SUB_PUB_UNSUB_DEMO_STRING_BUFFER_LENGTH ) ) + #define subpubunsubconfigSTRING_BUFFER_LENGTH ( ( unsigned int ) ( CONFIG_GRI_SUB_PUB_UNSUB_DEMO_STRING_BUFFER_LENGTH ) ) /** * @brief Delay for each task between subscription, publish, unsubscription * loops. */ -#define subpubunsubconfigDELAY_BETWEEN_SUB_PUB_UNSUB_LOOPS_MS ( ( unsigned int ) ( CONFIG_GRI_SUB_PUB_UNSUB_DEMO_DELAY_BETWEEN_SUB_PUB_UNSUB_LOOPS_MS ) ) + #define subpubunsubconfigDELAY_BETWEEN_SUB_PUB_UNSUB_LOOPS_MS ( ( unsigned int ) ( CONFIG_GRI_SUB_PUB_UNSUB_DEMO_DELAY_BETWEEN_SUB_PUB_UNSUB_LOOPS_MS ) ) /** * @brief The maximum amount of time in milliseconds to wait for the commands * to be posted to the MQTT agent should the MQTT agent's command queue be full. * Tasks wait in the Blocked state, so don't use any CPU time. */ -#define subpubunsubconfigMAX_COMMAND_SEND_BLOCK_TIME_MS ( ( unsigned int ) ( CONFIG_GRI_SUB_PUB_UNSUB_DEMO_MAX_COMMAND_SEND_BLOCK_TIME_MS ) ) + #define subpubunsubconfigMAX_COMMAND_SEND_BLOCK_TIME_MS ( ( unsigned int ) ( CONFIG_GRI_SUB_PUB_UNSUB_DEMO_MAX_COMMAND_SEND_BLOCK_TIME_MS ) ) /** * @brief The QoS level of MQTT messages sent by this demo. This must be 0 or 1 * if using AWS as AWS only supports levels 0 or 1. If using another MQTT broker * that supports QoS level 2, this can be set to 2. */ -#define subpubunsubconfigQOS_LEVEL ( ( unsigned long ) ( CONFIG_GRI_SUB_PUB_UNSUB_DEMO_QOS_LEVEL ) ) + #define subpubunsubconfigQOS_LEVEL ( ( unsigned long ) ( CONFIG_GRI_SUB_PUB_UNSUB_DEMO_QOS_LEVEL ) ) /** * @brief The number of SubPubUnsub tasks to create for this demo. */ -#define subpubunsubconfigNUM_TASKS_TO_CREATE ( ( unsigned long ) ( CONFIG_GRI_SUB_PUB_UNSUB_DEMO_NUM_TASKS_TO_CREATE ) ) + #define subpubunsubconfigNUM_TASKS_TO_CREATE ( ( unsigned long ) ( CONFIG_GRI_SUB_PUB_UNSUB_DEMO_NUM_TASKS_TO_CREATE ) ) /** * @brief The task priority of each of the SubPubUnsub tasks. */ -#define subpubunsubconfigTASK_PRIORITY ( ( unsigned int ) ( CONFIG_GRI_SUB_PUB_UNSUB_DEMO_TASK_PRIORITY ) ) + #define subpubunsubconfigTASK_PRIORITY ( ( unsigned int ) ( CONFIG_GRI_SUB_PUB_UNSUB_DEMO_TASK_PRIORITY ) ) /** * @brief The task stack size for each of the SubPubUnsub tasks. */ -#define subpubunsubconfigTASK_STACK_SIZE ( ( unsigned int ) ( CONFIG_GRI_SUB_PUB_UNSUB_DEMO_TASK_STACK_SIZE ) ) + #define subpubunsubconfigTASK_STACK_SIZE ( ( unsigned int ) ( CONFIG_GRI_SUB_PUB_UNSUB_DEMO_TASK_STACK_SIZE ) ) -#ifdef __cplusplus + #ifdef __cplusplus } -#endif + #endif #endif /* SUB_PUB_UNSUB_DEMO_CONFIG_H */ diff --git a/main/demo_tasks/temp_sub_pub_and_led_control_demo/temp_sub_pub_and_led_control_demo.h b/main/demo_tasks/temp_sub_pub_and_led_control_demo/temp_sub_pub_and_led_control_demo.h index 396568b..7e39337 100644 --- a/main/demo_tasks/temp_sub_pub_and_led_control_demo/temp_sub_pub_and_led_control_demo.h +++ b/main/demo_tasks/temp_sub_pub_and_led_control_demo/temp_sub_pub_and_led_control_demo.h @@ -25,19 +25,19 @@ */ #ifndef TEMP_SUB_PUB_AND_LED_CONTROL_DEMO_H -#define TEMP_SUB_PUB_AND_LED_CONTROL_DEMO_H + #define TEMP_SUB_PUB_AND_LED_CONTROL_DEMO_H -#ifdef __cplusplus -extern "C" { -#endif + #ifdef __cplusplus + extern "C" { + #endif /** * @brief This function starts the Temp Sub Pub and LED Control demo. */ -void vStartTempSubPubAndLEDControlDemo( void ); + void vStartTempSubPubAndLEDControlDemo( void ); -#ifdef __cplusplus + #ifdef __cplusplus } -#endif + #endif #endif /* TEMP_SUB_PUB_AND_LED_CONTROL_DEMO_H */ diff --git a/main/demo_tasks/temp_sub_pub_and_led_control_demo/temp_sub_pub_and_led_control_demo_config.h b/main/demo_tasks/temp_sub_pub_and_led_control_demo/temp_sub_pub_and_led_control_demo_config.h index 2fc91f5..d5a33cc 100644 --- a/main/demo_tasks/temp_sub_pub_and_led_control_demo/temp_sub_pub_and_led_control_demo_config.h +++ b/main/demo_tasks/temp_sub_pub_and_led_control_demo/temp_sub_pub_and_led_control_demo_config.h @@ -25,52 +25,52 @@ */ #ifndef TEMP_SUB_PUB_AND_LED_CONTROL_DEMO_CONFIG_H -#define TEMP_SUB_PUB_AND_LED_CONTROL_DEMO_CONFIG_H + #define TEMP_SUB_PUB_AND_LED_CONTROL_DEMO_CONFIG_H /* ESP-IDF sdkconfig include. */ -#include + #include -#ifdef __cplusplus -extern "C" { -#endif + #ifdef __cplusplus + extern "C" { + #endif /** * @brief Size of statically allocated buffers for holding topic names and * payloads. */ -#define temppubsubandledcontrolconfigSTRING_BUFFER_LENGTH ( ( unsigned int ) ( CONFIG_GRI_TEMPERATURE_PUB_SUB_AND_LED_CONTROL_DEMO_STRING_BUFFER_LENGTH ) ) + #define temppubsubandledcontrolconfigSTRING_BUFFER_LENGTH ( ( unsigned int ) ( CONFIG_GRI_TEMPERATURE_PUB_SUB_AND_LED_CONTROL_DEMO_STRING_BUFFER_LENGTH ) ) /** * @brief Delay for the synchronous publisher task between publishes. */ -#define temppubsubandledcontrolconfigDELAY_BETWEEN_PUBLISH_OPERATIONS_MS ( ( unsigned int ) ( CONFIG_GRI_TEMPERATURE_PUB_SUB_AND_LED_CONTROL_DEMO_DELAY_BETWEEN_PUBLISH_OPERATIONS_MS ) ) + #define temppubsubandledcontrolconfigDELAY_BETWEEN_PUBLISH_OPERATIONS_MS ( ( unsigned int ) ( CONFIG_GRI_TEMPERATURE_PUB_SUB_AND_LED_CONTROL_DEMO_DELAY_BETWEEN_PUBLISH_OPERATIONS_MS ) ) /** * @brief The maximum amount of time in milliseconds to wait for the commands * to be posted to the MQTT agent should the MQTT agent's command queue be full. * Tasks wait in the Blocked state, so don't use any CPU time. */ -#define temppubsubandledcontrolconfigMAX_COMMAND_SEND_BLOCK_TIME_MS ( ( unsigned int ) ( CONFIG_GRI_TEMPERATURE_PUB_SUB_AND_LED_CONTROL_DEMO_MAX_COMMAND_SEND_BLOCK_TIME_MS ) ) + #define temppubsubandledcontrolconfigMAX_COMMAND_SEND_BLOCK_TIME_MS ( ( unsigned int ) ( CONFIG_GRI_TEMPERATURE_PUB_SUB_AND_LED_CONTROL_DEMO_MAX_COMMAND_SEND_BLOCK_TIME_MS ) ) /** * @brief The QoS level of MQTT messages sent by this demo. This must be 0 or 1 * if using AWS as AWS only supports levels 0 or 1. If using another MQTT broker * that supports QoS level 2, this can be set to 2. */ -#define temppubsubandledcontrolconfigQOS_LEVEL ( ( unsigned long ) ( CONFIG_GRI_TEMPERATURE_PUB_SUB_AND_LED_CONTROL_DEMO_QOS_LEVEL ) ) + #define temppubsubandledcontrolconfigQOS_LEVEL ( ( unsigned long ) ( CONFIG_GRI_TEMPERATURE_PUB_SUB_AND_LED_CONTROL_DEMO_QOS_LEVEL ) ) /** * @brief The task priority of temperature pub sub and LED control task. */ -#define temppubsubandledcontrolconfigTASK_PRIORITY ( ( unsigned int ) ( CONFIG_GRI_TEMPERATURE_PUB_SUB_AND_LED_CONTROL_DEMO_TASK_PRIORITY ) ) + #define temppubsubandledcontrolconfigTASK_PRIORITY ( ( unsigned int ) ( CONFIG_GRI_TEMPERATURE_PUB_SUB_AND_LED_CONTROL_DEMO_TASK_PRIORITY ) ) /** * @brief The task stack size of temperature pub sub and LED control task. */ -#define temppubsubandledcontrolconfigTASK_STACK_SIZE ( ( unsigned int ) ( CONFIG_GRI_TEMPERATURE_PUB_SUB_AND_LED_CONTROL_DEMO_TASK_STACK_SIZE ) ) + #define temppubsubandledcontrolconfigTASK_STACK_SIZE ( ( unsigned int ) ( CONFIG_GRI_TEMPERATURE_PUB_SUB_AND_LED_CONTROL_DEMO_TASK_STACK_SIZE ) ) -#ifdef __cplusplus + #ifdef __cplusplus } -#endif + #endif #endif /* TEMP_SUB_PUB_AND_LED_CONTROL_DEMO_CONFIG_H */ diff --git a/main/networking/mqtt/core_mqtt_agent_manager.h b/main/networking/mqtt/core_mqtt_agent_manager.h index 5578d76..019cf10 100644 --- a/main/networking/mqtt/core_mqtt_agent_manager.h +++ b/main/networking/mqtt/core_mqtt_agent_manager.h @@ -25,15 +25,15 @@ */ #ifndef CORE_MQTT_AGENT_NETWORK_MANAGER_H -#define CORE_MQTT_AGENT_NETWORK_MANAGER_H + #define CORE_MQTT_AGENT_NETWORK_MANAGER_H -#include "network_transport.h" -#include "freertos/FreeRTOS.h" -#include "esp_event.h" + #include "network_transport.h" + #include "freertos/FreeRTOS.h" + #include "esp_event.h" -#ifdef __cplusplus -extern "C" { -#endif + #ifdef __cplusplus + extern "C" { + #endif /** * @brief Register an event handler with coreMQTT-Agent events. @@ -42,7 +42,7 @@ extern "C" { * * @return pdPASS if successful, pdFAIL otherwise. */ -BaseType_t xCoreMqttAgentManagerRegisterHandler( esp_event_handler_t xEventHandler ); + BaseType_t xCoreMqttAgentManagerRegisterHandler( esp_event_handler_t xEventHandler ); /** * @brief Start the coreMQTT-Agent manager. @@ -55,7 +55,7 @@ BaseType_t xCoreMqttAgentManagerRegisterHandler( esp_event_handler_t xEventHandl * * @return pdPASS if successful, pdFAIL otherwise. */ -BaseType_t xCoreMqttAgentManagerStart( NetworkContext_t * pxNetworkContextIn ); + BaseType_t xCoreMqttAgentManagerStart( NetworkContext_t * pxNetworkContextIn ); /** * @brief Posts a coreMQTT-Agent event to the default event loop. @@ -64,10 +64,10 @@ BaseType_t xCoreMqttAgentManagerStart( NetworkContext_t * pxNetworkContextIn ); * * @return pdPASS if successful, pdFAIL otherwise. */ -BaseType_t xCoreMqttAgentManagerPost( int32_t lEventId ); + BaseType_t xCoreMqttAgentManagerPost( int32_t lEventId ); -#ifdef __cplusplus + #ifdef __cplusplus } -#endif + #endif #endif /* CORE_MQTT_AGENT_NETWORK_MANAGER_H */ diff --git a/main/networking/mqtt/core_mqtt_agent_manager_config.h b/main/networking/mqtt/core_mqtt_agent_manager_config.h index cdbacef..eccd0f6 100644 --- a/main/networking/mqtt/core_mqtt_agent_manager_config.h +++ b/main/networking/mqtt/core_mqtt_agent_manager_config.h @@ -25,57 +25,57 @@ */ #ifndef CORE_MQTT_AGENT_MANAGER_CONFIG_H -#define CORE_MQTT_AGENT_MANAGER_CONFIG_H + #define CORE_MQTT_AGENT_MANAGER_CONFIG_H /* ESP-IDF sdkconfig include. */ -#include + #include -#if CONFIG_GRI_RUN_QUALIFICATION_TEST - #include "qualification_wrapper_config.h" -#endif /* CONFIG_GRI_RUN_QUALIFICATION_TEST */ + #if CONFIG_GRI_RUN_QUALIFICATION_TEST + #include "qualification_wrapper_config.h" + #endif /* CONFIG_GRI_RUN_QUALIFICATION_TEST */ -#ifdef __cplusplus -extern "C" { -#endif + #ifdef __cplusplus + extern "C" { + #endif /** * @brief The thing name of the device. */ -#define configCLIENT_IDENTIFIER ( CONFIG_GRI_THING_NAME ) + #define configCLIENT_IDENTIFIER ( CONFIG_GRI_THING_NAME ) /** * @brief The task stack size of the connection handling task. */ -#define configCONNECTION_TASK_STACK_SIZE ( CONFIG_GRI_CONNECTION_TASK_STACK_SIZE ) + #define configCONNECTION_TASK_STACK_SIZE ( CONFIG_GRI_CONNECTION_TASK_STACK_SIZE ) /** * @brief The task priority of the connection handling task. */ -#define configCONNECTION_TASK_PRIORITY ( CONFIG_GRI_CONNECTION_TASK_PRIORITY ) + #define configCONNECTION_TASK_PRIORITY ( CONFIG_GRI_CONNECTION_TASK_PRIORITY ) /** * @brief The maximum back-off delay (in milliseconds) for retrying failed operation * with server. */ -#define configRETRY_MAX_BACKOFF_DELAY_MS ( CONFIG_GRI_RETRY_MAX_BACKOFF_DELAY_MS ) + #define configRETRY_MAX_BACKOFF_DELAY_MS ( CONFIG_GRI_RETRY_MAX_BACKOFF_DELAY_MS ) /** * @brief The base back-off delay (in milliseconds) to use for network operation retry * attempts. */ -#define configRETRY_BACKOFF_BASE_MS ( CONFIG_GRI_RETRY_BACKOFF_BASE_MS ) + #define configRETRY_BACKOFF_BASE_MS ( CONFIG_GRI_RETRY_BACKOFF_BASE_MS ) /** * @brief Dimensions the buffer used to serialize and deserialize MQTT packets. * @note Specified in bytes. Must be large enough to hold the maximum * anticipated MQTT payload. */ -#define configMQTT_AGENT_NETWORK_BUFFER_SIZE ( CONFIG_GRI_MQTT_AGENT_NETWORK_BUFFER_SIZE ) + #define configMQTT_AGENT_NETWORK_BUFFER_SIZE ( CONFIG_GRI_MQTT_AGENT_NETWORK_BUFFER_SIZE ) /** * @brief The length of the queue used to hold commands for the agent. */ -#define configMQTT_AGENT_COMMAND_QUEUE_LENGTH ( CONFIG_GRI_MQTT_AGENT_COMMAND_QUEUE_LENGTH ) + #define configMQTT_AGENT_COMMAND_QUEUE_LENGTH ( CONFIG_GRI_MQTT_AGENT_COMMAND_QUEUE_LENGTH ) /** * @brief The maximum time interval in seconds which is allowed to elapse @@ -86,26 +86,26 @@ extern "C" { * absence of sending any other Control Packets, the Client MUST send a * PINGREQ Packet. */ -#define configMQTT_AGENT_KEEP_ALIVE_INTERVAL_SECONDS ( CONFIG_GRI_MQTT_AGENT_KEEP_ALIVE_INTERVAL_SECONDS ) + #define configMQTT_AGENT_KEEP_ALIVE_INTERVAL_SECONDS ( CONFIG_GRI_MQTT_AGENT_KEEP_ALIVE_INTERVAL_SECONDS ) /** * @brief Timeout for receiving CONNACK after sending an MQTT CONNECT packet. * Defined in milliseconds. */ -#define configMQTT_AGENT_CONNACK_RECV_TIMEOUT_MS ( CONFIG_GRI_MQTT_AGENT_CONNACK_RECV_TIMEOUT_MS ) + #define configMQTT_AGENT_CONNACK_RECV_TIMEOUT_MS ( CONFIG_GRI_MQTT_AGENT_CONNACK_RECV_TIMEOUT_MS ) /** * @brief The task stack size of the coreMQTT-Agent task. */ -#define configMQTT_AGENT_TASK_STACK_SIZE ( CONFIG_GRI_MQTT_AGENT_TASK_STACK_SIZE ) + #define configMQTT_AGENT_TASK_STACK_SIZE ( CONFIG_GRI_MQTT_AGENT_TASK_STACK_SIZE ) /** * @brief The task priority of the coreMQTT-Agent task. */ -#define configMQTT_AGENT_TASK_PRIORITY ( CONFIG_GRI_MQTT_AGENT_TASK_PRIORITY ) + #define configMQTT_AGENT_TASK_PRIORITY ( CONFIG_GRI_MQTT_AGENT_TASK_PRIORITY ) -#ifdef __cplusplus + #ifdef __cplusplus } -#endif + #endif #endif /* CORE_MQTT_AGENT_MANAGER_CONFIG_H */ diff --git a/main/networking/mqtt/core_mqtt_agent_manager_events.h b/main/networking/mqtt/core_mqtt_agent_manager_events.h index 4dcbe89..43e2570 100644 --- a/main/networking/mqtt/core_mqtt_agent_manager_events.h +++ b/main/networking/mqtt/core_mqtt_agent_manager_events.h @@ -25,26 +25,26 @@ */ #ifndef CORE_MQTT_AGENT_MANAGER_EVENTS_H -#define CORE_MQTT_AGENT_MANAGER_EVENTS_H + #define CORE_MQTT_AGENT_MANAGER_EVENTS_H -#include "esp_event.h" + #include "esp_event.h" -#ifdef __cplusplus -extern "C" { -#endif + #ifdef __cplusplus + extern "C" { + #endif -ESP_EVENT_DECLARE_BASE( CORE_MQTT_AGENT_EVENT ); + ESP_EVENT_DECLARE_BASE( CORE_MQTT_AGENT_EVENT ); -enum -{ - CORE_MQTT_AGENT_CONNECTED_EVENT, - CORE_MQTT_AGENT_DISCONNECTED_EVENT, - CORE_MQTT_AGENT_OTA_STARTED_EVENT, - CORE_MQTT_AGENT_OTA_STOPPED_EVENT -}; + enum + { + CORE_MQTT_AGENT_CONNECTED_EVENT, + CORE_MQTT_AGENT_DISCONNECTED_EVENT, + CORE_MQTT_AGENT_OTA_STARTED_EVENT, + CORE_MQTT_AGENT_OTA_STOPPED_EVENT + }; -#ifdef __cplusplus + #ifdef __cplusplus } -#endif + #endif #endif /* CORE_MQTT_AGENT_MANAGER_EVENTS_H */ diff --git a/main/networking/mqtt/subscription_manager.h b/main/networking/mqtt/subscription_manager.h index f6dc5b0..e4387c7 100644 --- a/main/networking/mqtt/subscription_manager.h +++ b/main/networking/mqtt/subscription_manager.h @@ -29,22 +29,22 @@ * @brief Functions for managing MQTT subscriptions. */ #ifndef SUBSCRIPTION_MANAGER_H -#define SUBSCRIPTION_MANAGER_H + #define SUBSCRIPTION_MANAGER_H /* core MQTT include. */ -#include "core_mqtt.h" + #include "core_mqtt.h" /** * @brief Maximum number of subscriptions maintained by the subscription manager * simultaneously in a list. */ -#ifndef SUBSCRIPTION_MANAGER_MAX_SUBSCRIPTIONS - #define SUBSCRIPTION_MANAGER_MAX_SUBSCRIPTIONS 10U -#endif + #ifndef SUBSCRIPTION_MANAGER_MAX_SUBSCRIPTIONS + #define SUBSCRIPTION_MANAGER_MAX_SUBSCRIPTIONS 10U + #endif -#ifdef __cplusplus -extern "C" { -#endif + #ifdef __cplusplus + extern "C" { + #endif /** * @brief Callback function called when receiving a publish. @@ -52,8 +52,8 @@ extern "C" { * @param[in] pvIncomingPublishCallbackContext The incoming publish callback context. * @param[in] pxPublishInfo Deserialized publish information. */ -typedef void (* IncomingPubCallback_t )( void * pvIncomingPublishCallbackContext, - MQTTPublishInfo_t * pxPublishInfo ); + typedef void (* IncomingPubCallback_t )( void * pvIncomingPublishCallbackContext, + MQTTPublishInfo_t * pxPublishInfo ); /** * @brief An element in the list of subscriptions. @@ -67,13 +67,13 @@ typedef void (* IncomingPubCallback_t )( void * pvIncomingPublishCallbackContext * copied in the subscription manager and hence the topic filter strings need to * stay in scope until unsubscribed. */ -typedef struct subscriptionElement -{ - IncomingPubCallback_t pxIncomingPublishCallback; - void * pvIncomingPublishCallbackContext; - uint16_t usFilterStringLength; - const char * pcSubscriptionFilterString; -} SubscriptionElement_t; + typedef struct subscriptionElement + { + IncomingPubCallback_t pxIncomingPublishCallback; + void * pvIncomingPublishCallbackContext; + uint16_t usFilterStringLength; + const char * pcSubscriptionFilterString; + } SubscriptionElement_t; /** * @brief Add a subscription to the subscription list. @@ -90,11 +90,11 @@ typedef struct subscriptionElement * * @return `true` if subscription added or exists, `false` if insufficient memory. */ -bool addSubscription( SubscriptionElement_t * pxSubscriptionList, - const char * pcTopicFilterString, - uint16_t usTopicFilterLength, - IncomingPubCallback_t pxIncomingPublishCallback, - void * pvIncomingPublishCallbackContext ); + bool addSubscription( SubscriptionElement_t * pxSubscriptionList, + const char * pcTopicFilterString, + uint16_t usTopicFilterLength, + IncomingPubCallback_t pxIncomingPublishCallback, + void * pvIncomingPublishCallbackContext ); /** * @brief Remove a subscription from the subscription list. @@ -106,9 +106,9 @@ bool addSubscription( SubscriptionElement_t * pxSubscriptionList, * @param[in] pcTopicFilterString Topic filter of subscription. * @param[in] usTopicFilterLength Length of topic filter. */ -void removeSubscription( SubscriptionElement_t * pxSubscriptionList, - const char * pcTopicFilterString, - uint16_t usTopicFilterLength ); + void removeSubscription( SubscriptionElement_t * pxSubscriptionList, + const char * pcTopicFilterString, + uint16_t usTopicFilterLength ); /** * @brief Handle incoming publishes by invoking the callbacks registered @@ -120,11 +120,11 @@ void removeSubscription( SubscriptionElement_t * pxSubscriptionList, * @return `true` if an application callback could be invoked; * `false` otherwise. */ -bool handleIncomingPublishes( SubscriptionElement_t * pxSubscriptionList, - MQTTPublishInfo_t * pxPublishInfo ); + bool handleIncomingPublishes( SubscriptionElement_t * pxSubscriptionList, + MQTTPublishInfo_t * pxPublishInfo ); -#ifdef __cplusplus + #ifdef __cplusplus } -#endif + #endif #endif /* SUBSCRIPTION_MANAGER_H */ diff --git a/main/networking/wifi/app_wifi.h b/main/networking/wifi/app_wifi.h index f717069..2e29a18 100644 --- a/main/networking/wifi/app_wifi.h +++ b/main/networking/wifi/app_wifi.h @@ -30,4 +30,4 @@ void vWaitOnWifiConnected( void ); #ifdef __cplusplus } -#endif \ No newline at end of file +#endif