#include "FreeRTOS.h"\r
#include "platform/iot_platform_types_freertos.h" //_RB_Makes common config file FreeRTOS specific\r
\r
-/*\r
- * Set this to the number of recyclable tasks for the task pool to cache.\r
+/**\r
+ * @brief The number of recyclable jobs for the task pool to cache.\r
*\r
- * Caching dynamically allocated tasks (recyclable tasks) helps the application\r
- * to limit the number of allocations at runtime. Caching recyclable tasks may\r
+ * Caching dynamically allocated jobs (recyclable jobs) helps the application\r
+ * to limit the number of allocations at runtime. Caching recyclable jobs may\r
* help making the application more responsive and predictable, by removing a\r
* potential for memory allocation failures, but it may also have negative\r
* repercussions on the amount of memory available at any given time. It is up\r
- * to the application developer to strike the correct balance these competing\r
- * needs. The task pool will cache when the application calling\r
- * IotTaskPool_RecycleJob. Any recycled tasks in excess of\r
+ * to the application developer to strike the correct balance among these\r
+ * competing needs. The task pool will cache a job when the application calls\r
+ * IotTaskPool_RecycleJob on a job which was created using\r
+ * IotTaskPool_CreateRecyclableJob API. Any recycled jobs in excess of\r
* IOT_TASKPOOL_JOBS_RECYCLE_LIMIT will be destroyed and its memory will be\r
- * release.\r
+ * released.\r
*\r
* Default value (if undefined): 8\r
*/\r
-#define IOT_TASKPOOL_JOBS_RECYCLE_LIMIT 8\r
+#define IOT_TASKPOOL_JOBS_RECYCLE_LIMIT 8\r
\r
-/*\r
+/**\r
+ * @brief Enable/Disable asserts for the task pool library.\r
+ * \r
* Set this to 1 to perform sanity checks when using the task pool library.\r
- *\r
* Asserts are useful for debugging, but should be disabled in production code.\r
* If this is set to 1, IotTaskPool_Assert can be defined to set the assertion\r
* function; otherwise, the standard library's assert function will be used.\r
* Recommended values: 1 when debugging; 0 in production code.\r
* Default value (if undefined): 0\r
*/\r
-#define IOT_TASKPOOL_ENABLE_ASSERTS 1\r
+#define IOT_TASKPOOL_ENABLE_ASSERTS 1\r
\r
-/*\r
- * Set the log level of the task pool library.\r
+/**\r
+ * @brief Set the log level of the task pool library.\r
*\r
* Log messages from the task pool library at or below this setting will be\r
* printed.\r
* Default value (if undefined): IOT_LOG_LEVEL_GLOBAL; if that is undefined,\r
* then IOT_LOG_NONE.\r
*/\r
-#define IOT_LOG_LEVEL_TASKPOOL IOT_LOG_INFO\r
+#define IOT_LOG_LEVEL_TASKPOOL IOT_LOG_INFO\r
\r
-/*\r
- *\r
+/**\r
+ * @brief The number of worker tasks in the task pool.\r
+ * \r
+ * The minimal version of the of task pool library only supports one task pool\r
+ * and the number of the worker tasks is fixed at the compile time.\r
*/\r
-#define IOT_TASKPOOL_NUMBER_OF_WORKERS 3\r
+#define IOT_TASKPOOL_NUMBER_OF_WORKERS 3\r
\r
-/*\r
- *\r
+/**\r
+ * @brief The stack size (in bytes) for each worker task in the task pool.\r
+ * \r
+ * The minimal version of the of task pool library only supports one task pool\r
+ * and the configuration of each worker task fixed at the compile time.\r
*/\r
-#define IOT_TASKPOOL_WORKER_STACK_SIZE_BYTES 2048\r
+#define IOT_TASKPOOL_WORKER_STACK_SIZE_BYTES 2048\r
\r
-/* How long the MQTT library will wait for PINGRESPs or PUBACKs. */\r
-#define IOT_MQTT_RESPONSE_WAIT_MS ( 10000 )\r
+/**\r
+ * @brief The amount of time the MQTT library waits for responses (PINGRESPs or\r
+ * PUBACKs) from the MQTT broker.\r
+ */\r
+#define IOT_MQTT_RESPONSE_WAIT_MS ( 10000 )\r
\r
-#define AWS_IOT_MQTT_ENABLE_METRICS 0\r
+/**\r
+ * @brief Enable/Disable anonymous metrics collection when using AWS IoT.\r
+ *\r
+ * This demo does not support TLS and so does not work with AWS IoT. Therefore,\r
+ * the metric collection must be disabled.\r
+ */\r
+#define AWS_IOT_MQTT_ENABLE_METRICS 0\r
\r
/* Include the common configuration file for FreeRTOS. */\r
#include "iot_config_common.h"\r
\r
void ( * callbackFunction )( void *,\r
IotMqttCallbackParam_t * ) = NULL;\r
- _topicMatchParams_t topicMatchParams =\r
- {\r
- .pTopicName = pCallbackParam->u.message.info.pTopicName,\r
- .topicNameLength = pCallbackParam->u.message.info.topicNameLength,\r
- .exactMatchOnly = false\r
- };\r
+ _topicMatchParams_t topicMatchParams = { 0 };\r
+\r
+ topicMatchParams.pTopicName = pCallbackParam->u.message.info.pTopicName;\r
+ topicMatchParams.topicNameLength = pCallbackParam->u.message.info.topicNameLength;\r
+ topicMatchParams.exactMatchOnly = false;\r
\r
/* Prevent any other thread from modifying the subscription list while this\r
* function is searching. */\r
uint16_t packetIdentifier,\r
int32_t order )\r
{\r
- const _packetMatchParams_t packetMatchParams =\r
- {\r
- .packetIdentifier = packetIdentifier,\r
- .order = order\r
- };\r
+ _packetMatchParams_t packetMatchParams = { 0 };\r
+\r
+ packetMatchParams.packetIdentifier = packetIdentifier;\r
+ packetMatchParams.order = order;\r
\r
IotMutex_Lock( &( pMqttConnection->subscriptionMutex ) );\r
IotListDouble_RemoveAllMatches( &( pMqttConnection->subscriptionList ),\r
bool status = false;\r
_mqttSubscription_t * pSubscription = NULL;\r
IotLink_t * pSubscriptionLink = NULL;\r
- _topicMatchParams_t topicMatchParams =\r
- {\r
- .pTopicName = pTopicFilter,\r
- .topicNameLength = topicFilterLength,\r
- .exactMatchOnly = true\r
- };\r
+ _topicMatchParams_t topicMatchParams = { 0 };\r
+\r
+ topicMatchParams.pTopicName = pTopicFilter;\r
+ topicMatchParams.topicNameLength = topicFilterLength;\r
+ topicMatchParams.exactMatchOnly = false;\r
\r
/* Prevent any other thread from modifying the subscription list while this\r
* function is running. */\r