Skip to content

Commit 7c58104

Browse files
committed
Moving 'writeProperties' to be a protected member function
1 parent 4d8c0cf commit 7c58104

File tree

2 files changed

+14
-16
lines changed

2 files changed

+14
-16
lines changed

src/ArduinoIoTCloudLPWAN.cpp

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,17 @@ void ArduinoIoTCloudLPWAN::printDebugInfo() {
155155
Debug.print(DBG_INFO, "Thing ID: %s", getThingId().c_str());
156156
}
157157

158+
/******************************************************************************
159+
* PRIVATE MEMBER FUNCTIONS
160+
******************************************************************************/
161+
162+
void ArduinoIoTCloudLPWAN::sendPropertiesToCloud() {
163+
uint8_t data[DEFAULT_CBOR_LORA_MSG_SIZE];
164+
int const length = _thing.encode(data, sizeof(data), true);
165+
if (length > 0) {
166+
writeProperties(data, length);
167+
}
168+
}
158169

159170
int ArduinoIoTCloudLPWAN::writeProperties(const byte data[], int length) {
160171
int retcode = _connection->write(data, length);
@@ -168,18 +179,6 @@ int ArduinoIoTCloudLPWAN::writeProperties(const byte data[], int length) {
168179
return 1;
169180
}
170181

171-
/******************************************************************************
172-
* PRIVATE MEMBER FUNCTIONS
173-
******************************************************************************/
174-
175-
void ArduinoIoTCloudLPWAN::sendPropertiesToCloud() {
176-
uint8_t data[DEFAULT_CBOR_LORA_MSG_SIZE];
177-
int const length = _thing.encode(data, sizeof(data), true);
178-
if (length > 0) {
179-
writeProperties(data, length);
180-
}
181-
}
182-
183182
/******************************************************************************
184183
* EXTERN DEFINITION
185184
******************************************************************************/

src/ArduinoIoTCloudLPWAN.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,15 +73,14 @@ class ArduinoIoTCloudLPWAN : public ArduinoIoTCloudClass {
7373
_intervalRetry = val;
7474
}
7575

76-
protected:
77-
int writeProperties(const byte data[], int length);
78-
7976
private:
80-
void sendPropertiesToCloud();
77+
8178
bool _retryEnable;
8279
int _maxNumRetry;
8380
long _intervalRetry;
8481

82+
void sendPropertiesToCloud();
83+
int writeProperties(const byte data[], int length);
8584
};
8685

8786
/******************************************************************************

0 commit comments

Comments
 (0)