Skip to content

Commit e2cbcd5

Browse files
committed
Merge branch 'feature/aws_iot_thing_shadow_settings' into 'master'
aws iot: Expose Thing Shadow settings in menuconfig See merge request idf/esp-idf!1765
2 parents 532107c + eaff702 commit e2cbcd5

File tree

3 files changed

+86
-7
lines changed

3 files changed

+86
-7
lines changed

components/aws_iot/Kconfig

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,3 +83,77 @@ config AWS_IOT_MQTT_MAX_RECONNECT_WAIT_INTERVAL
8383
Maximum delay between reconnection attempts. If the exponentially increased delay
8484
interval reaches this value, the client will stop automatically attempting to reconnect.
8585

86+
menu "Thing Shadow"
87+
depends on AWS_IOT_SDK
88+
89+
config AWS_IOT_OVERRIDE_THING_SHADOW_RX_BUFFER
90+
bool "Override Shadow RX buffer size"
91+
depends on AWS_IOT_SDK
92+
default n
93+
help
94+
Allows setting a different Thing Shadow RX buffer
95+
size. This is the maximum size of a Thing Shadow
96+
message in bytes, plus one.
97+
98+
If not overridden, the default value is the MQTT RX Buffer length plus one. If overriden, do not set higher than the default value.
99+
100+
config AWS_IOT_SHADOW_MAX_SIZE_OF_RX_BUFFER
101+
int "Maximum RX Buffer (bytes)"
102+
depends on AWS_IOT_OVERRIDE_THING_SHADOW_RX_BUFFER
103+
default 513
104+
range 32 65536
105+
help
106+
Allows setting a different Thing Shadow RX buffer size.
107+
This is the maximum size of a Thing Shadow message in bytes,
108+
plus one.
109+
110+
111+
config AWS_IOT_SHADOW_MAX_SIZE_OF_UNIQUE_CLIENT_ID_BYTES
112+
int "Maximum unique client ID size (bytes)"
113+
depends on AWS_IOT_SDK
114+
default 80
115+
range 4 1000
116+
help
117+
Maximum size of the Unique Client Id.
118+
119+
config AWS_IOT_SHADOW_MAX_SIMULTANEOUS_ACKS
120+
int "Maximum simultaneous responses"
121+
depends on AWS_IOT_SDK
122+
default 10
123+
range 1 100
124+
help
125+
At any given time we will wait for this many responses. This will correlate to the rate at which the shadow actions are requested
126+
127+
config AWS_IOT_SHADOW_MAX_SIMULTANEOUS_THINGNAMES
128+
int "Maximum simultaneous Thing Name operations"
129+
depends on AWS_IOT_SDK
130+
default 10
131+
range 1 100
132+
help
133+
We could perform shadow action on any thing Name and this is maximum Thing Names we can act on at any given time
134+
135+
config AWS_IOT_SHADOW_MAX_JSON_TOKEN_EXPECTED
136+
int "Maximum expected JSON tokens"
137+
depends on AWS_IOT_SDK
138+
default 120
139+
help
140+
These are the max tokens that is expected to be in the Shadow JSON document. Includes the metadata which is published
141+
142+
config AWS_IOT_SHADOW_MAX_SHADOW_TOPIC_LENGTH_WITHOUT_THINGNAME
143+
int "Maximum topic length (not including Thing Name)"
144+
depends on AWS_IOT_SDK
145+
default 60
146+
range 10 1000
147+
help
148+
All shadow actions have to be published or subscribed to a topic which is of the format $aws/things/{thingName}/shadow/update/accepted. This refers to the size of the topic without the Thing Name
149+
150+
config AWS_IOT_SHADOW_MAX_SIZE_OF_THING_NAME
151+
int "Maximum Thing Name length"
152+
depends on AWS_IOT_SDK
153+
default 20
154+
range 4 1000
155+
help
156+
Maximum length of a Thing Name.
157+
158+
endmenu # Thing Shadow
159+

components/aws_iot/include/aws_iot_config.h

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,15 +42,20 @@
4242
#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
4343

4444
// Thing Shadow specific configs
45-
#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
45+
#ifdef CONFIG_AWS_IOT_OVERRIDE_THING_SHADOW_RX_BUFFER
46+
#define SHADOW_MAX_SIZE_OF_RX_BUFFER CONFIG AWS_IOT_SHADOW_MAX_SIZE_OF_RX_BUFFER ///< Maximum size of the SHADOW buffer to store the received Shadow message, including NULL termianting byte
47+
#else
48+
#define SHADOW_MAX_SIZE_OF_RX_BUFFER (AWS_IOT_MQTT_RX_BUF_LEN + 1)
49+
#endif
50+
4651
#define MAX_SIZE_OF_UNIQUE_CLIENT_ID_BYTES 80 ///< Maximum size of the Unique Client Id. For More info on the Client Id refer \ref response "Acknowledgments"
4752
#define MAX_SIZE_CLIENT_ID_WITH_SEQUENCE (MAX_SIZE_OF_UNIQUE_CLIENT_ID_BYTES + 10) ///< This is size of the extra sequence number that will be appended to the Unique client Id
4853
#define MAX_SIZE_CLIENT_TOKEN_CLIENT_SEQUENCE (MAX_SIZE_CLIENT_ID_WITH_SEQUENCE + 20) ///< This is size of the the total clientToken key and value pair in the JSON
49-
#define MAX_ACKS_TO_COMEIN_AT_ANY_GIVEN_TIME 10 ///< At Any given time we will wait for this many responses. This will correlate to the rate at which the shadow actions are requested
50-
#define MAX_THINGNAME_HANDLED_AT_ANY_GIVEN_TIME 10 ///< We could perform shadow action on any thing Name and this is maximum Thing Names we can act on at any given time
51-
#define MAX_JSON_TOKEN_EXPECTED 120 ///< These are the max tokens that is expected to be in the Shadow JSON document. Include the metadata that gets published
52-
#define MAX_SHADOW_TOPIC_LENGTH_WITHOUT_THINGNAME 60 ///< All shadow actions have to be published or subscribed to a topic which is of the formablogt $aws/things/{thingName}/shadow/update/accepted. This refers to the size of the topic without the Thing Name
53-
#define MAX_SIZE_OF_THING_NAME 20 ///< The Thing Name should not be bigger than this value. Modify this if the Thing Name needs to be bigger
54+
#define MAX_ACKS_TO_COMEIN_AT_ANY_GIVEN_TIME CONFIG_AWS_IOT_SHADOW_MAX_SIMULTANEOUS_ACKS ///< At Any given time we will wait for this many responses. This will correlate to the rate at which the shadow actions are requested
55+
#define MAX_THINGNAME_HANDLED_AT_ANY_GIVEN_TIME CONFIG_AWS_IOT_SHADOW_MAX_SIMULTANEOUS_THINGNAMES ///< We could perform shadow action on any thing Name and this is maximum Thing Names we can act on at any given time
56+
#define MAX_JSON_TOKEN_EXPECTED CONFIG_AWS_IOT_SHADOW_MAX_JSON_TOKEN_EXPECTED ///< These are the max tokens that is expected to be in the Shadow JSON document. Include the metadata that gets published
57+
#define MAX_SHADOW_TOPIC_LENGTH_WITHOUT_THINGNAME CONFIG_AWS_IOT_SHADOW_MAX_SHADOW_TOPIC_LENGTH_WITHOUT_THINGNAME ///< All shadow actions have to be published or subscribed to a topic which is of the formablogt $aws/things/{thingName}/shadow/update/accepted. This refers to the size of the topic without the Thing Name
58+
#define MAX_SIZE_OF_THING_NAME CONFIG_AWS_IOT_SHADOW_MAX_SIZE_OF_THING_NAME ///< The Thing Name should not be bigger than this value. Modify this if the Thing Name needs to be bigger
5459
#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
5560

5661
// Auto Reconnect specific config

0 commit comments

Comments
 (0)