Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Switch LPWAN off deprecated method #428

Merged
merged 3 commits into from
May 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/AIoTC_Config.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
7 changes: 3 additions & 4 deletions src/ArduinoIoTCloudLPWAN.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ ArduinoIoTCloudLPWAN::ArduinoIoTCloudLPWAN()
: _state{State::ConnectPhy}
, _retryEnable{false}
, _maxNumRetry{5}
, _intervalRetry{1000}
, _intervalRetry{AIOT_CONFIG_INTERVAL_RETRY_DELAY_ms}
{

}
Expand All @@ -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)
Expand Down Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion src/property/PropertyContainer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down
Loading