@@ -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+
93123ArduinoIoTConnectionStatus 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 ******************************************************************************/
0 commit comments