]> granicus.if.org Git - esp-idf/commitdiff
aws_iot: Expose common SDK compile-time configuration in menuconfig
authorAngus Gratton <angus@espressif.com>
Thu, 20 Jul 2017 05:28:29 +0000 (15:28 +1000)
committerAngus Gratton <gus@projectgus.com>
Thu, 20 Jul 2017 05:28:29 +0000 (15:28 +1000)
Closes https://github.com/espressif/esp-idf/issues/637

components/aws_iot/Kconfig
components/aws_iot/include/aws_iot_config.h

index 031def977debe55facd91b3950bdda996547aee0..76b587e9c03642b9d9535048aeeb3c60c5e726d1 100644 (file)
@@ -30,3 +30,56 @@ config AWS_IOT_MQTT_PORT
         If you need per-device port numbers for different regions, you can
         override the default port number in your app.
 
+
+config AWS_IOT_MQTT_TX_BUF_LEN
+    int "MQTT TX Buffer Length"
+    depends on AWS_IOT_SDK
+    default 512
+    range 32 65536
+    help
+        Maximum MQTT transmit buffer size. This is the maximum MQTT
+        message length (including protocol overhead) which can be sent.
+
+        Sending longer messages will fail.
+
+config AWS_IOT_MQTT_RX_BUF_LEN
+    int "MQTT RX Buffer Length"
+    depends on AWS_IOT_SDK
+    default 512
+    range 32 65536
+    help
+        Maximum MQTT receive buffer size. This is the maximum MQTT
+        message length (including protocol overhead) which can be
+        received.
+
+        Longer messages are dropped.
+
+
+
+config AWS_IOT_MQTT_NUM_SUBSCRIBE_HANDLERS
+    int "Maximum MQTT Topic Filters"
+    depends on AWS_IOT_SDK
+    default 5
+    range 1 100
+    help
+        Maximum number of concurrent MQTT topic filters.
+
+
+config AWS_IOT_MQTT_MIN_RECONNECT_WAIT_INTERVAL
+    int "Auto reconnect initial interval (ms)"
+    depends on AWS_IOT_SDK
+    default 1000
+    range 10 3600000
+    help
+        Initial delay before making first reconnect attempt, if the AWS IoT connection fails.
+        Client will perform exponential backoff, starting from this value.
+
+config AWS_IOT_MQTT_MAX_RECONNECT_WAIT_INTERVAL
+    int "Auto reconnect maximum interval (ms)"
+    depends on AWS_IOT_SDK
+    default 128000
+    range 10 3600000
+    help
+        Maximum delay between reconnection attempts. If the exponentially increased delay
+        interval reaches this value, the client will stop automatically attempting to reconnect.
+
index a19de46e0846e84022388d5d0ec007aa605e1abb..2d10702af88cfff33bbc151f8a5ce61d09f0b331 100644 (file)
@@ -37,9 +37,9 @@
 #define AWS_IOT_MY_THING_NAME          "ESP32" ///< Thing Name of the Shadow this device is associated with
 
 // MQTT PubSub
-#define AWS_IOT_MQTT_TX_BUF_LEN 512 ///< Any time a message is sent out through the MQTT layer. The message is copied into this buffer anytime a publish is done. This will also be used in the case of Thing Shadow
-#define AWS_IOT_MQTT_RX_BUF_LEN 512 ///< Any message that comes into the device should be less than this buffer size. If a received message is bigger than this buffer size the message will be dropped.
-#define AWS_IOT_MQTT_NUM_SUBSCRIBE_HANDLERS 5 ///< Maximum number of topic filters the MQTT client can handle at any given time. This should be increased appropriately when using Thing Shadow
+#define AWS_IOT_MQTT_TX_BUF_LEN CONFIG_AWS_IOT_MQTT_TX_BUF_LEN ///< Any time a message is sent out through the MQTT layer. The message is copied into this buffer anytime a publish is done. This will also be used in the case of Thing Shadow
+#define AWS_IOT_MQTT_RX_BUF_LEN CONFIG_AWS_IOT_MQTT_RX_BUF_LEN ///< Any message that comes into the device should be less than this buffer size. If a received message is bigger than this buffer size the message will be dropped.
+#define AWS_IOT_MQTT_NUM_SUBSCRIBE_HANDLERS CONFIG_AWS_IOT_MQTT_NUM_SUBSCRIBE_HANDLERS ///< Maximum number of topic filters the MQTT client can handle at any given time. This should be increased appropriately when using Thing Shadow
 
 // Thing Shadow specific configs
 #define SHADOW_MAX_SIZE_OF_RX_BUFFER (AWS_IOT_MQTT_RX_BUF_LEN + 1) ///< Maximum size of the SHADOW buffer to store the received Shadow message
@@ -54,7 +54,7 @@
 #define MAX_SHADOW_TOPIC_LENGTH_BYTES (MAX_SHADOW_TOPIC_LENGTH_WITHOUT_THINGNAME + MAX_SIZE_OF_THING_NAME) ///< This size includes the length of topic with Thing Name
 
 // Auto Reconnect specific config
-#define AWS_IOT_MQTT_MIN_RECONNECT_WAIT_INTERVAL 1000 ///< Minimum time before the First reconnect attempt is made as part of the exponential back-off algorithm
-#define AWS_IOT_MQTT_MAX_RECONNECT_WAIT_INTERVAL 128000 ///< Maximum time interval after which exponential back-off will stop attempting to reconnect.
+#define AWS_IOT_MQTT_MIN_RECONNECT_WAIT_INTERVAL CONFIG_AWS_IOT_MQTT_MIN_RECONNECT_WAIT_INTERVAL ///< Minimum time before the First reconnect attempt is made as part of the exponential back-off algorithm
+#define AWS_IOT_MQTT_MAX_RECONNECT_WAIT_INTERVAL CONFIG_AWS_IOT_MQTT_MAX_RECONNECT_WAIT_INTERVAL ///< Maximum time interval after which exponential back-off will stop attempting to reconnect.
 
 #endif /* _AWS_IOT_CONFIG_H_ */