Skip to content

Commit b33b5f9

Browse files
committed
Allow compilation of TimeService for LORA boards, just leave out the part that requires a UDP connection. Consequently the RTC will always be set to the EPOCH at compile time
1 parent 41700b1 commit b33b5f9

File tree

2 files changed

+5
-10
lines changed

2 files changed

+5
-10
lines changed

src/utility/time/TimeService.cpp

+5-5
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,6 @@
1919
* INCLUDE
2020
**************************************************************************************/
2121

22-
#include "../../AIoTC_Config.h"
23-
#ifndef HAS_LORA
24-
2522
#include "TimeService.h"
2623

2724
#include <time.h>
@@ -93,6 +90,9 @@ unsigned long TimeService::getTime()
9390

9491
unsigned long TimeService::getRemoteTime()
9592
{
93+
#include "../../AIoTC_Config.h"
94+
#ifndef HAS_LORA
95+
9696
if(_con_hdl == nullptr)
9797
return EPOCH_AT_COMPILE_TIME;
9898

@@ -113,6 +113,8 @@ unsigned long TimeService::getRemoteTime()
113113
return ntp_time;
114114
}
115115

116+
#endif /* ifndef HAS_LORA */
117+
116118
/* Return the epoch timestamp at compile time as a last
117119
* line of defense. Otherwise the certificate expiration
118120
* date is wrong and we'll be unable to establish a connection
@@ -159,5 +161,3 @@ time_t cvt_time(char const * time)
159161

160162
return mktime(&t);
161163
}
162-
163-
#endif /* #ifndef HAS_LORA */

src/utility/time/TimeService.h

-5
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,6 @@
2222
* INCLUDE
2323
**************************************************************************************/
2424

25-
#include "../../AIoTC_Config.h"
26-
#ifndef HAS_LORA
27-
2825
#include <Arduino_ConnectionHandler.h>
2926

3027
#ifdef ARDUINO_ARCH_SAMD
@@ -58,6 +55,4 @@ class TimeService
5855

5956
};
6057

61-
#endif /* #ifndef HAS_LORA */
62-
6358
#endif /* ARDUINO_IOT_CLOUD_TIME_SERVICE_H_ */

0 commit comments

Comments
 (0)