]> git.sur5r.net Git - freertos/blob - FreeRTOS-Plus/Source/FreeRTOS-IoT-Libraries/c_sdk/standard/mqtt/include/iot_mqtt_config_defaults.h
Correct an err in queue.c introduced when previously updating behaviour when queue...
[freertos] / FreeRTOS-Plus / Source / FreeRTOS-IoT-Libraries / c_sdk / standard / mqtt / include / iot_mqtt_config_defaults.h
1 /*\r
2  * Amazon FreeRTOS MQTT V2.0.0\r
3  * Copyright (C) 2018 Amazon.com, Inc. or its affiliates.  All Rights Reserved.\r
4  *\r
5  * Permission is hereby granted, free of charge, to any person obtaining a copy of\r
6  * this software and associated documentation files (the "Software"), to deal in\r
7  * the Software without restriction, including without limitation the rights to\r
8  * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\r
9  * the Software, and to permit persons to whom the Software is furnished to do so,\r
10  * subject to the following conditions:\r
11  *\r
12  * The above copyright notice and this permission notice shall be included in all\r
13  * copies or substantial portions of the Software.\r
14  *\r
15  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r
16  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\r
17  * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\r
18  * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\r
19  * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\r
20  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
21  *\r
22  * http://aws.amazon.com/freertos\r
23  * http://www.FreeRTOS.org\r
24  */\r
25 \r
26 /**\r
27  * @file iot_mqtt_config_defaults.h\r
28  * @brief MQTT default config options.\r
29  *\r
30  * Ensures that the config options for MQTT are set to sensible default\r
31  * values if the user does not provide one.\r
32  */\r
33 \r
34 #ifndef _AWS_MQTT_CONFIG_DEFAULTS_H_\r
35 #define _AWS_MQTT_CONFIG_DEFAULTS_H_\r
36 \r
37 /**\r
38  * @brief Enable subscription management.\r
39  *\r
40  * Subscription management allows the user to register per subscription\r
41  * callback.\r
42  */\r
43 #ifndef mqttconfigENABLE_SUBSCRIPTION_MANAGEMENT\r
44     #define mqttconfigENABLE_SUBSCRIPTION_MANAGEMENT    ( 1 )\r
45 #endif\r
46 \r
47 /**\r
48  * @brief Maximum length of the topic which can be stored in subscription\r
49  * manager.\r
50  *\r
51  * If the user has enabled subscription management (by defining the macro\r
52  * mqttconfigENABLE_SUBSCRIPTION_MANAGEMENT to 1), then this macro must be defined\r
53  * to accommodate the maximum length topic which the user is going to subscribe.\r
54  * The subscribe operation will fail if the user tries to subscribe to a topic\r
55  * of length more than the maximum specified here.\r
56  */\r
57 #ifndef mqttconfigSUBSCRIPTION_MANAGER_MAX_TOPIC_LENGTH\r
58     #define mqttconfigSUBSCRIPTION_MANAGER_MAX_TOPIC_LENGTH    ( 128 )\r
59 #endif\r
60 \r
61 /**\r
62  * @brief Maximum number of subscriptions which can be stored in subscription\r
63  * manager.\r
64  *\r
65  * If the user has enabled subscription management (by defining the macro\r
66  * mqttconfigENABLE_SUBSCRIPTION_MANAGEMENT to 1), then this macro must be defined\r
67  * to the maximum number of topics which the user is going to subscribe\r
68  * simultaneously. The subscribe operation will fail is the user tries to\r
69  * subscribe to more topics than the maximum specified here.\r
70  */\r
71 #ifndef mqttconfigSUBSCRIPTION_MANAGER_MAX_SUBSCRIPTIONS\r
72     #define mqttconfigSUBSCRIPTION_MANAGER_MAX_SUBSCRIPTIONS    ( 8 )\r
73 #endif\r
74 \r
75 /**\r
76  * @brief Define mqttconfigASSERT to enable asserts.\r
77  *\r
78  * mqttconfigASSERT should be defined to match the semantics of standard\r
79  * C assert() macro i.e. an assertion should trigger if the parameter\r
80  * passed is zero. If the standard C assert is available, the user might\r
81  * do the following:\r
82  * @code\r
83  * #define mqttconfigASSERT( x ) assert( x )\r
84  * @endcode\r
85  *\r
86  * Otherwise, a user can choose to implement a function which should be\r
87  * called when an assertion triggers and then define the mqttconfigASSERT\r
88  * to that function:\r
89  * @code\r
90  * extern void vAssertCalled( const char *pcFile, uint32_t ulLine );\r
91  * #define mqttconfigASSERT( x ) if( ( x ) == 0 ) vAssertCalled( __FILE__, __LINE__ )\r
92  * @endcode\r
93  */\r
94 #ifndef mqttconfigASSERT\r
95     #define mqttconfigASSERT( x )\r
96 #endif\r
97 \r
98 /**\r
99  * @brief Define mqttconfigENABLE_DEBUG_LOGS macro to 1 for enabling debug logs.\r
100  *\r
101  * If you choose to enable debug logs, the following function must be implemented\r
102  * which is called to print logs:\r
103  * @code\r
104  * void vLoggingPrintf( const char *pcFormatString, ... );\r
105  * @endcode\r
106  */\r
107 #if ( mqttconfigENABLE_DEBUG_LOGS == 1 )\r
108     extern void vLoggingPrintf( const char * pcFormatString,\r
109                                 ... );\r
110     #define mqttconfigDEBUG_LOG( x )    vLoggingPrintf x\r
111 #else\r
112     #define mqttconfigDEBUG_LOG( x )\r
113 #endif\r
114 \r
115 #endif /* _AWS_MQTT_CONFIG_DEFAULTS_H_ */\r