Skip to content

Commit 05d299d

Browse files
committed
LoRa based boards to not establish a direct connection to the cloud server like the TCP based boards do. Instead we only have a connection to the gateway and no control wether or not this connection extends to cloud. Therefore checking the connection to the gateway is the only thing we can do.
1 parent cb3eeb3 commit 05d299d

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/ArduinoIoTCloudLPWAN.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,9 @@ bool ArduinoIoTCloudLPWAN::disconnect() {
5858
return true;
5959
}
6060

61-
int ArduinoIoTCloudLPWAN::connected() {
62-
int state = _connection->getStatus() == NetworkConnectionState::INIT ? 1 : 0;
63-
return state;
61+
int ArduinoIoTCloudLPWAN::connected()
62+
{
63+
return (_connection->getStatus() == NetworkConnectionState::CONNECTED) ? 1 : 0;
6464
}
6565

6666
int ArduinoIoTCloudLPWAN::begin(ConnectionHandler& connection, bool retry) {
@@ -141,7 +141,7 @@ ArduinoIoTConnectionStatus ArduinoIoTCloudLPWAN::checkCloudConnection()
141141
case ArduinoIoTConnectionStatus::CONNECTING:
142142
{
143143
Debug.print(DBG_INFO, "Arduino IoT Cloud connecting ...");
144-
if (_connection->getStatus() == NetworkConnectionState::CONNECTED)
144+
if (connected())
145145
{
146146
next_iot_status = ArduinoIoTConnectionStatus::CONNECTED;
147147
}

0 commit comments

Comments
 (0)