Skip to content

Commit 3bab053

Browse files
committed
Do not compile time service/ntp utils if we have a LoRa board since there is no need for time services for certificate verification
1 parent c84299e commit 3bab053

File tree

4 files changed

+20
-0
lines changed

4 files changed

+20
-0
lines changed

src/utility/NTPUtils.cpp

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

22+
#include "../ArduinoIoTCloud_Defines.h"
23+
#ifndef HAS_LORA
24+
2225
#include "NTPUtils.h"
2326
#include "Arduino.h"
2427

@@ -78,3 +81,5 @@ void NTPUtils::sendNTPpacket(UDP & udp)
7881
udp.write(ntp_packet_buf, NTP_PACKET_SIZE);
7982
udp.endPacket();
8083
}
84+
85+
#endif /* #ifndef HAS_LORA */

src/utility/NTPUtils.h

+5
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@
1818
#ifndef __NTP_UTILS__
1919
#define __NTP_UTILS__
2020

21+
#include "../ArduinoIoTCloud_Defines.h"
22+
#ifndef HAS_LORA
23+
2124
/*
2225
This Utility Class is derived from the example code found here https://www.arduino.cc/en/Tutorial/UdpNTPClient
2326
For more information on NTP (Network Time Protocol) you can refer to this Wikipedia article https://en.wikipedia.org/wiki/Network_Time_Protocol
@@ -51,4 +54,6 @@ class NTPUtils
5154

5255
};
5356

57+
#endif /* #ifndef HAS_LORA */
58+
5459
#endif

src/utility/TimeService.cpp

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

22+
#include "../ArduinoIoTCloud_Defines.h"
23+
#ifndef HAS_LORA
24+
2225
#include "TimeService.h"
2326

2427
#include <time.h>
@@ -122,3 +125,5 @@ time_t cvt_time(char const * time)
122125

123126
return mktime(&t);
124127
}
128+
129+
#endif /* #ifndef HAS_LORA */

src/utility/TimeService.h

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

25+
#include "../ArduinoIoTCloud_Defines.h"
26+
#ifndef HAS_LORA
27+
2528
#include <Arduino_ConnectionHandler.h>
2629

2730
/**************************************************************************************
@@ -47,4 +50,6 @@ class TimeService
4750

4851
};
4952

53+
#endif /* #ifndef HAS_LORA */
54+
5055
#endif /* ARDUINO_IOT_CLOUD_TIME_SERVICE_H_ */

0 commit comments

Comments
 (0)