Skip to content

Commit 0c1955b

Browse files
committed
Moving constant DEFAULT_CBOR_LORA_MSG_SIZE into source file since there is no need for it to ba globally known. Also renaming for better clarity
1 parent 7c58104 commit 0c1955b

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

src/ArduinoIoTCloudLPWAN.cpp

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,12 @@
2525

2626
#include<ArduinoIoTCloudLPWAN.h>
2727

28+
/******************************************************************************
29+
CONSTANTS
30+
******************************************************************************/
31+
32+
static size_t const CBOR_LORA_MSG_MAX_SIZE = 255;
33+
2834
/******************************************************************************
2935
CTOR/DTOR
3036
******************************************************************************/
@@ -71,7 +77,7 @@ void ArduinoIoTCloudLPWAN::update() {
7177
if(connectionCheck() != ArduinoIoTConnectionStatus::CONNECTED) return;
7278

7379
if (_connection->available()) {
74-
uint8_t msgBuf[DEFAULT_CBOR_LORA_MSG_SIZE];
80+
uint8_t msgBuf[CBOR_LORA_MSG_MAX_SIZE];
7581
uint8_t i = 0;
7682
while (_connection->available()) {
7783
msgBuf[i++] = _connection->read();
@@ -160,7 +166,7 @@ void ArduinoIoTCloudLPWAN::printDebugInfo() {
160166
******************************************************************************/
161167

162168
void ArduinoIoTCloudLPWAN::sendPropertiesToCloud() {
163-
uint8_t data[DEFAULT_CBOR_LORA_MSG_SIZE];
169+
uint8_t data[CBOR_LORA_MSG_MAX_SIZE];
164170
int const length = _thing.encode(data, sizeof(data), true);
165171
if (length > 0) {
166172
writeProperties(data, length);

src/ArduinoIoTCloudLPWAN.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,6 @@
2424

2525
#include <ArduinoIoTCloud.h>
2626

27-
/******************************************************************************
28-
CONSTANTS
29-
******************************************************************************/
30-
31-
static uint8_t const DEFAULT_CBOR_LORA_MSG_SIZE = 255;
32-
3327
/******************************************************************************
3428
* CLASS DECLARATION
3529
******************************************************************************/

0 commit comments

Comments
 (0)