File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -83,9 +83,15 @@ class CayenneArduinoMQTTClient
83
83
84
84
/* *
85
85
* Main Cayenne loop
86
+ *
87
+ * @param yieldTime Time in milliseconds to yield to allow processing of incoming MQTT messages and keep alive packets.
88
+ * NOTE: Decreasing the yieldTime while calling write functions (e.g. virtualWrite) in your main loop could cause a
89
+ * large number of messages to be sent to the Cayenne server. Use caution when adjusting this because sending too many
90
+ * messages could cause your IP to be rate limited or even blocked. If you would like to reduce the yieldTime to cause your
91
+ * main loop to run faster, make sure you use a timer for your write functions to prevent them from running too often.
86
92
*/
87
- void loop () {
88
- CayenneMQTTYield (&_mqttClient, 1000 );
93
+ void loop (int yieldTime = 1000 ) {
94
+ CayenneMQTTYield (&_mqttClient, yieldTime );
89
95
pollChannels (virtualChannels);
90
96
#ifdef DIGITAL_AND_ANALOG_SUPPORT
91
97
pollChannels (digitalChannels);
You can’t perform that action at this time.
0 commit comments