Skip to content

Commit

Permalink
Remove not needed code for compilation with stream util support
Browse files Browse the repository at this point in the history
  • Loading branch information
MathewHDYT committed Aug 18, 2023
1 parent 3854f06 commit 41fe6b3
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/ThingsBoard.h
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,9 @@ constexpr char RPC_EMPTY_PARAMS_VALUE[] = "{}";
// Log messages.
#if THINGSBOARD_ENABLE_PROGMEM
constexpr char UNABLE_TO_DE_SERIALIZE_JSON[] PROGMEM = "Unable to de-serialize received json data with error (%s)";
#if !THINGSBOARD_ENABLE_STREAM_UTILS
constexpr char INVALID_BUFFER_SIZE[] PROGMEM = "Buffer size (%u) to small for the given payloads size (%u), increase with setBufferSize accordingly or set THINGSBOARD_ENABLE_STREAM_UTILS to 1 before including ThingsBoard";
#endif // !THINGSBOARD_ENABLE_STREAM_UTILS
constexpr char NUMBER_PRINTF[] PROGMEM = "%u";
#if !THINGSBOARD_ENABLE_DYNAMIC
constexpr char MAX_RPC_EXCEEDED[] PROGMEM = "Too many server-side RPC subscriptions, increase MaxFieldsAmt or unsubscribe";
Expand Down Expand Up @@ -149,7 +151,9 @@ constexpr char SEND_SERIALIZED[] PROGMEM = "Hidden, because json data is bigger
#endif // THINGSBOARD_ENABLE_DEBUG
#else
constexpr char UNABLE_TO_DE_SERIALIZE_JSON[] = "Unable to de-serialize received json data with error (%s)";
#if !THINGSBOARD_ENABLE_STREAM_UTILS
constexpr char INVALID_BUFFER_SIZE[] = "Buffer size (%u) to small for the given payloads size (%u), increase with setBufferSize accordingly or set THINGSBOARD_ENABLE_STREAM_UTILS to 1 before including ThingsBoard";
#endif // !THINGSBOARD_ENABLE_STREAM_UTILS
constexpr char NUMBER_PRINTF[] = "%u";
#if !THINGSBOARD_ENABLE_DYNAMIC
constexpr char MAX_RPC_EXCEEDED[] = "Too many server-side RPC subscriptions, increase MaxFieldsAmt or unsubscribe";
Expand Down Expand Up @@ -521,6 +525,7 @@ class ThingsBoardSized {
return false;
}

#if !THINGSBOARD_ENABLE_STREAM_UTILS
const size_t currentBufferSize = m_client.getBufferSize();
const size_t jsonSize = strlen(json);

Expand All @@ -530,6 +535,7 @@ class ThingsBoardSized {
Logger::log(message);
return false;
}
#endif // !THINGSBOARD_ENABLE_STREAM_UTILS

#if THINGSBOARD_ENABLE_DEBUG
char message[JSON_STRING_SIZE(strlen(SEND_MESSAGE)) + JSON_STRING_SIZE(strlen(topic)) + jsonSize];
Expand Down

0 comments on commit 41fe6b3

Please sign in to comment.