Skip to content

Commit 6abf46b

Browse files
committed
Fix LPWAN build
1 parent 1158d66 commit 6abf46b

File tree

5 files changed

+16
-4
lines changed

5 files changed

+16
-4
lines changed

Diff for: src/ArduinoIoTCloud.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,9 @@
2727

2828
ArduinoIoTCloudClass::ArduinoIoTCloudClass()
2929
: _connection{nullptr}
30+
#ifdef HAS_TCP
3031
, _client{nullptr}
32+
#endif
3133
, _adapter{NetworkAdapter::WIFI}
3234
, _last_checked_property_index{0}
3335
, _time_service(TimeService)

Diff for: src/ArduinoIoTCloud.h

+4
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,9 @@ class ArduinoIoTCloudClass
103103
inline bool deviceNotAttached() { return _thing_id == ""; }
104104

105105
inline ConnectionHandler * getConnection() { return _connection; }
106+
#ifdef HAS_TCP
106107
inline Client * getClient() { return _client; }
108+
#endif
107109

108110

109111
inline unsigned long getInternalTime() { return _time_service.getTime(); }
@@ -155,7 +157,9 @@ class ArduinoIoTCloudClass
155157
protected:
156158

157159
ConnectionHandler * _connection;
160+
#ifdef HAS_TCP
158161
Client * _client;
162+
#endif
159163
NetworkAdapter _adapter;
160164
PropertyContainer _device_property_container;
161165
PropertyContainer _thing_property_container;

Diff for: src/ArduinoIoTCloudLPWAN.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ int ArduinoIoTCloudLPWAN::begin(ConnectionHandler& connection, bool retry)
6868
{
6969
_connection = &connection;
7070
_retryEnable = retry;
71-
_time_service.begin(nullptr);
71+
_time_service.begin();
7272
return 1;
7373
}
7474

Diff for: src/utility/time/TimeService.cpp

+7-2
Original file line numberDiff line numberDiff line change
@@ -126,13 +126,18 @@ TimeServiceClass::TimeServiceClass()
126126
**************************************************************************************/
127127

128128
void TimeServiceClass::begin(UDP & udp)
129+
{
130+
_udp = &udp;
131+
132+
begin();
133+
}
134+
135+
void TimeServiceClass::begin()
129136
{
130137
initRTC();
131138
#ifdef HAS_LORA
132139
setRTC(EPOCH_AT_COMPILE_TIME);
133140
#endif
134-
135-
_udp = &udp;
136141
}
137142

138143
unsigned long TimeServiceClass::getTime()

Diff for: src/utility/time/TimeService.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@ class TimeServiceClass
4242

4343
TimeServiceClass();
4444

45-
void begin (UDP & udp);
45+
void begin(UDP & udp);
46+
void begin();
4647
unsigned long getTime();
4748
void setTime(unsigned long time);
4849
unsigned long getLocalTime();

0 commit comments

Comments
 (0)