Skip to content

Commit

Permalink
defining MQTT_TX_BUFFER_SIZE and STRING_PROPERTY_MAX_SIZE in cofig file
Browse files Browse the repository at this point in the history
  • Loading branch information
andreagilardoni committed Jan 17, 2024
1 parent d436b80 commit f9946bb
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
15 changes: 15 additions & 0 deletions src/AIoTC_Config.h
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,21 @@
#define HAS_TCP
#endif

#ifdef HAS_TCP
#ifndef MQTT_TX_BUFFER_SIZE
#define MQTT_TX_BUFFER_SIZE 256
#endif // MQTT_TX_BUFFER_SIZE

#ifndef STRING_PROPERTY_MAX_SIZE
// 6 represents the expected overhead of a string property inside a cbor
#define STRING_PROPERTY_MAX_SIZE MQTT_TX_BUFFER_SIZE - 6
#endif // STRING_PROPERTY_MAX_SIZE
#else
#ifndef STRING_PROPERTY_MAX_SIZE
#define STRING_PROPERTY_MAX_SIZE 50
#endif // STRING_PROPERTY_MAX_SIZE
#endif // HAS_TCP

/******************************************************************************
* CONSTANTS
******************************************************************************/
Expand Down
2 changes: 1 addition & 1 deletion src/ArduinoIoTCloudTCP.h
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ class ArduinoIoTCloudTCP: public ArduinoIoTCloudClass
#endif

private:
static const int MQTT_TRANSMIT_BUFFER_SIZE = 256;
static const int MQTT_TRANSMIT_BUFFER_SIZE = MQTT_TX_BUFFER_SIZE;

enum class State
{
Expand Down

0 comments on commit f9946bb

Please sign in to comment.