2 * Amazon FreeRTOS MQTT V2.0.0
\r
3 * Copyright (C) 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
\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
12 * The above copyright notice and this permission notice shall be included in all
\r
13 * copies or substantial portions of the Software.
\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
22 * http://aws.amazon.com/freertos
\r
23 * http://www.FreeRTOS.org
\r
27 * @file iot_mqtt_config_defaults.h
\r
28 * @brief MQTT default config options.
\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
34 #ifndef _AWS_MQTT_CONFIG_DEFAULTS_H_
\r
35 #define _AWS_MQTT_CONFIG_DEFAULTS_H_
\r
38 * @brief Enable subscription management.
\r
40 * Subscription management allows the user to register per subscription
\r
43 #ifndef mqttconfigENABLE_SUBSCRIPTION_MANAGEMENT
\r
44 #define mqttconfigENABLE_SUBSCRIPTION_MANAGEMENT ( 1 )
\r
48 * @brief Maximum length of the topic which can be stored in subscription
\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
57 #ifndef mqttconfigSUBSCRIPTION_MANAGER_MAX_TOPIC_LENGTH
\r
58 #define mqttconfigSUBSCRIPTION_MANAGER_MAX_TOPIC_LENGTH ( 128 )
\r
62 * @brief Maximum number of subscriptions which can be stored in subscription
\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
71 #ifndef mqttconfigSUBSCRIPTION_MANAGER_MAX_SUBSCRIPTIONS
\r
72 #define mqttconfigSUBSCRIPTION_MANAGER_MAX_SUBSCRIPTIONS ( 8 )
\r
76 * @brief Define mqttconfigASSERT to enable asserts.
\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
83 * #define mqttconfigASSERT( x ) assert( x )
\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
90 * extern void vAssertCalled( const char *pcFile, uint32_t ulLine );
\r
91 * #define mqttconfigASSERT( x ) if( ( x ) == 0 ) vAssertCalled( __FILE__, __LINE__ )
\r
94 #ifndef mqttconfigASSERT
\r
95 #define mqttconfigASSERT( x )
\r
99 * @brief Define mqttconfigENABLE_DEBUG_LOGS macro to 1 for enabling debug logs.
\r
101 * If you choose to enable debug logs, the following function must be implemented
\r
102 * which is called to print logs:
\r
104 * void vLoggingPrintf( const char *pcFormatString, ... );
\r
107 #if ( mqttconfigENABLE_DEBUG_LOGS == 1 )
\r
108 extern void vLoggingPrintf( const char * pcFormatString,
\r
110 #define mqttconfigDEBUG_LOG( x ) vLoggingPrintf x
\r
112 #define mqttconfigDEBUG_LOG( x )
\r
115 #endif /* _AWS_MQTT_CONFIG_DEFAULTS_H_ */
\r