File tree 2 files changed +48
-0
lines changed
2 files changed +48
-0
lines changed Original file line number Diff line number Diff line change @@ -173,14 +173,35 @@ void NTPClient::setTimeOffset(int timeOffset) {
173
173
this ->_timeOffset = timeOffset;
174
174
}
175
175
176
+ long NTPClient::getTimeOffset () {
177
+ return this ->_timeOffset ;
178
+ }
179
+
176
180
void NTPClient::setUpdateInterval (unsigned long updateInterval) {
177
181
this ->_updateInterval = updateInterval;
178
182
}
179
183
184
+ unsigned long NTPClient::getUpdateInterval () {
185
+ return this ->_updateInterval ;
186
+ }
187
+
180
188
void NTPClient::setPoolServerName (const char * poolServerName) {
181
189
this ->_poolServerName = poolServerName;
182
190
}
183
191
192
+ const char *NTPClient::getPoolServerName () {
193
+ return this ->_poolServerName ;
194
+ }
195
+
196
+ void NTPClient::setPoolServerIP (IPAddress poolServerIP) {
197
+ this ->_poolServerIP = poolServerIP;
198
+ this ->_poolServerName = NULL ;
199
+ }
200
+
201
+ IPAddress NTPClient::getPoolServerIP () {
202
+ return this ->_poolServerIP ;
203
+ }
204
+
184
205
void NTPClient::sendNTPPacket () {
185
206
// set all bytes in the buffer to 0
186
207
memset (this ->_packetBuffer , 0 , NTP_PACKET_SIZE);
Original file line number Diff line number Diff line change @@ -44,6 +44,23 @@ class NTPClient {
44
44
*/
45
45
void setPoolServerName (const char * poolServerName);
46
46
47
+ /* *
48
+ * Get time server name
49
+ */
50
+ const char *getPoolServerName ();
51
+
52
+ /* *
53
+ * Set time server IP
54
+ *
55
+ * @param poolServerIP
56
+ */
57
+ void setPoolServerIP (IPAddress poolServerIP);
58
+
59
+ /*
60
+ * Get time server IP
61
+ */
62
+ IPAddress getPoolServerIP ();
63
+
47
64
/* *
48
65
* Set random local port
49
66
*/
@@ -91,12 +108,22 @@ class NTPClient {
91
108
*/
92
109
void setTimeOffset (int timeOffset);
93
110
111
+ /* *
112
+ * Get the time offset
113
+ */
114
+ long getTimeOffset ();
115
+
94
116
/* *
95
117
* Set the update interval to another frequency. E.g. useful when the
96
118
* timeOffset should not be set in the constructor
97
119
*/
98
120
void setUpdateInterval (unsigned long updateInterval);
99
121
122
+ /* *
123
+ * Get the update interval
124
+ */
125
+ unsigned long getUpdateInterval ();
126
+
100
127
/* *
101
128
* @return time formatted like `hh:mm:ss`
102
129
*/
You can’t perform that action at this time.
0 commit comments