From 4540401f46c37f9eb8b583ee5e106a27a6916ced Mon Sep 17 00:00:00 2001 From: "Zachary J. Fields" Date: Mon, 19 Feb 2024 07:54:29 -0600 Subject: [PATCH 1/3] chore: Switch LPWAN off deprecated method --- src/ArduinoIoTCloudLPWAN.cpp | 2 +- src/property/PropertyContainer.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ArduinoIoTCloudLPWAN.cpp b/src/ArduinoIoTCloudLPWAN.cpp index 0f96d36db..d6a062a7a 100644 --- a/src/ArduinoIoTCloudLPWAN.cpp +++ b/src/ArduinoIoTCloudLPWAN.cpp @@ -61,7 +61,7 @@ ArduinoIoTCloudLPWAN::ArduinoIoTCloudLPWAN() int ArduinoIoTCloudLPWAN::connected() { - return (_connection->getStatus() == NetworkConnectionState::CONNECTED) ? 1 : 0; + return (_connection->check() == NetworkConnectionState::CONNECTED) ? 1 : 0; } int ArduinoIoTCloudLPWAN::begin(ConnectionHandler& connection, bool retry) diff --git a/src/property/PropertyContainer.cpp b/src/property/PropertyContainer.cpp index 833250f02..3ab4e75e0 100644 --- a/src/property/PropertyContainer.cpp +++ b/src/property/PropertyContainer.cpp @@ -95,7 +95,7 @@ void requestUpdateForAllProperties(PropertyContainer & prop_cont) void updateTimestampOnLocallyChangedProperties(PropertyContainer & prop_cont) { - /* This function updates the timestamps on the primitive properties + /* This function updates the timestamps on the primitive properties * that have been modified locally since last cloud synchronization */ std::for_each(prop_cont.begin(), From 8d7c71616391ec05535389c11ca58134028b41e7 Mon Sep 17 00:00:00 2001 From: "Zachary J. Fields" Date: Mon, 19 Feb 2024 16:17:26 -0600 Subject: [PATCH 2/3] chore: increase LoRa retry interval --- src/ArduinoIoTCloudLPWAN.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/ArduinoIoTCloudLPWAN.cpp b/src/ArduinoIoTCloudLPWAN.cpp index d6a062a7a..9a3d4ae18 100644 --- a/src/ArduinoIoTCloudLPWAN.cpp +++ b/src/ArduinoIoTCloudLPWAN.cpp @@ -50,7 +50,7 @@ ArduinoIoTCloudLPWAN::ArduinoIoTCloudLPWAN() : _state{State::ConnectPhy} , _retryEnable{false} , _maxNumRetry{5} -, _intervalRetry{1000} +, _intervalRetry{10000} { } @@ -105,8 +105,7 @@ ArduinoIoTCloudLPWAN::State ArduinoIoTCloudLPWAN::handle_ConnectPhy() ArduinoIoTCloudLPWAN::State ArduinoIoTCloudLPWAN::handle_SyncTime() { - unsigned long const internal_posix_time = _time_service.getTime(); - DEBUG_VERBOSE("ArduinoIoTCloudLPWAN::%s internal clock configured to posix timestamp %d", __FUNCTION__, internal_posix_time); + DEBUG_VERBOSE("ArduinoIoTCloudLPWAN::%s internal clock configured to posix timestamp %lu", __FUNCTION__, _time_service.getTime()); DEBUG_INFO("Connected to Arduino IoT Cloud"); return State::Connected; } From 73fd2874f18c50486a8fd4f6c929f473c5ad5c21 Mon Sep 17 00:00:00 2001 From: "Zachary J. Fields" Date: Tue, 27 Feb 2024 12:42:38 -0600 Subject: [PATCH 3/3] chore: Address PR feedback --- src/AIoTC_Config.h | 1 + src/ArduinoIoTCloudLPWAN.cpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/AIoTC_Config.h b/src/AIoTC_Config.h index e47a8ac2b..7828191f0 100644 --- a/src/AIoTC_Config.h +++ b/src/AIoTC_Config.h @@ -137,6 +137,7 @@ * CONSTANTS ******************************************************************************/ +#define AIOT_CONFIG_INTERVAL_RETRY_DELAY_ms (10000UL) #define AIOT_CONFIG_RECONNECTION_RETRY_DELAY_ms (1000UL) #define AIOT_CONFIG_MAX_RECONNECTION_RETRY_DELAY_ms (32000UL) #define AIOT_CONFIG_DEVICE_TOPIC_SUBSCRIBE_RETRY_DELAY_ms (5*1000UL) diff --git a/src/ArduinoIoTCloudLPWAN.cpp b/src/ArduinoIoTCloudLPWAN.cpp index 9a3d4ae18..e3f625fb7 100644 --- a/src/ArduinoIoTCloudLPWAN.cpp +++ b/src/ArduinoIoTCloudLPWAN.cpp @@ -50,7 +50,7 @@ ArduinoIoTCloudLPWAN::ArduinoIoTCloudLPWAN() : _state{State::ConnectPhy} , _retryEnable{false} , _maxNumRetry{5} -, _intervalRetry{10000} +, _intervalRetry{AIOT_CONFIG_INTERVAL_RETRY_DELAY_ms} { }