Skip to content

Commit 189c99a

Browse files
committed
Turn member function 'connectionCheck' to be private, there is no need for the function to be public
1 parent ab632f5 commit 189c99a

File tree

2 files changed

+31
-31
lines changed

2 files changed

+31
-31
lines changed

src/ArduinoIoTCloudLPWAN.cpp

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,36 @@ void ArduinoIoTCloudLPWAN::update() {
9090
execCloudEventCallback(ArduinoIoTCloudEvent::SYNC);
9191
}
9292

93+
void ArduinoIoTCloudLPWAN::printDebugInfo() {
94+
Debug.print(DBG_INFO, "***** Arduino IoT Cloud LPWAN- configuration info *****");
95+
Debug.print(DBG_INFO, "Device ID: %s", getDeviceId().c_str());
96+
Debug.print(DBG_INFO, "Thing ID: %s", getThingId().c_str());
97+
}
98+
99+
/******************************************************************************
100+
* PRIVATE MEMBER FUNCTIONS
101+
******************************************************************************/
102+
103+
void ArduinoIoTCloudLPWAN::sendPropertiesToCloud() {
104+
uint8_t data[CBOR_LORA_MSG_MAX_SIZE];
105+
int const length = _thing.encode(data, sizeof(data), true);
106+
if (length > 0) {
107+
writeProperties(data, length);
108+
}
109+
}
110+
111+
int ArduinoIoTCloudLPWAN::writeProperties(const byte data[], int length) {
112+
int retcode = _connection->write(data, length);
113+
int i = 0;
114+
while (_retryEnable && retcode < 0 && i < _maxNumRetry) {
115+
delay(_intervalRetry);
116+
retcode = _connection->write(data, length);
117+
i++;
118+
}
119+
120+
return 1;
121+
}
122+
93123
ArduinoIoTConnectionStatus ArduinoIoTCloudLPWAN::connectionCheck() {
94124
if (_connection != NULL) {
95125

@@ -155,36 +185,6 @@ ArduinoIoTConnectionStatus ArduinoIoTCloudLPWAN::connectionCheck() {
155185
return _iotStatus;
156186
}
157187

158-
void ArduinoIoTCloudLPWAN::printDebugInfo() {
159-
Debug.print(DBG_INFO, "***** Arduino IoT Cloud LPWAN- configuration info *****");
160-
Debug.print(DBG_INFO, "Device ID: %s", getDeviceId().c_str());
161-
Debug.print(DBG_INFO, "Thing ID: %s", getThingId().c_str());
162-
}
163-
164-
/******************************************************************************
165-
* PRIVATE MEMBER FUNCTIONS
166-
******************************************************************************/
167-
168-
void ArduinoIoTCloudLPWAN::sendPropertiesToCloud() {
169-
uint8_t data[CBOR_LORA_MSG_MAX_SIZE];
170-
int const length = _thing.encode(data, sizeof(data), true);
171-
if (length > 0) {
172-
writeProperties(data, length);
173-
}
174-
}
175-
176-
int ArduinoIoTCloudLPWAN::writeProperties(const byte data[], int length) {
177-
int retcode = _connection->write(data, length);
178-
int i = 0;
179-
while (_retryEnable && retcode < 0 && i < _maxNumRetry) {
180-
delay(_intervalRetry);
181-
retcode = _connection->write(data, length);
182-
i++;
183-
}
184-
185-
return 1;
186-
}
187-
188188
/******************************************************************************
189189
* EXTERN DEFINITION
190190
******************************************************************************/

src/ArduinoIoTCloudLPWAN.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ class ArduinoIoTCloudLPWAN : public ArduinoIoTCloudClass {
4040
virtual int connected () override;
4141
virtual void printDebugInfo() override;
4242

43-
ArduinoIoTConnectionStatus connectionCheck();
4443
int begin(ConnectionHandler& connection, bool retry = false);
4544

4645
inline bool isRetryEnabled () const { return _retryEnable; }
@@ -60,6 +59,7 @@ class ArduinoIoTCloudLPWAN : public ArduinoIoTCloudClass {
6059

6160
void sendPropertiesToCloud();
6261
int writeProperties(const byte data[], int length);
62+
ArduinoIoTConnectionStatus connectionCheck();
6363
};
6464

6565
/******************************************************************************

0 commit comments

Comments
 (0)