11/* *The MIT License (MIT)
22
3- Copyright (c) 2015 by Daniel Eichhorn
3+ Copyright (c) 2018 by Daniel Eichhorn, ThingPulse
44
55Permission is hereby granted, free of charge, to any person obtaining a copy
66of this software and associated documentation files (the "Software"), to deal
@@ -20,7 +20,7 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
2020OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
2121SOFTWARE.
2222
23- See more at http ://blog.squix.ch
23+ See more at https ://thingpulse.com
2424*/
2525
2626#include " TimeClient.h"
@@ -40,14 +40,14 @@ void TimeClient::updateTime() {
4040 Serial.println (" connection failed" );
4141 return ;
4242 }
43-
43+
4444 // This will send the request to the server
4545 client.print (String (" GET / HTTP/1.1\r\n " ) +
4646 String (" Host: google.com\r\n " ) +
4747 String (" Connection: close\r\n\r\n " ));
4848 int repeatCounter = 0 ;
4949 while (!client.available () && repeatCounter < 10 ) {
50- delay (1000 );
50+ delay (1000 );
5151 Serial.println (" ." );
5252 repeatCounter++;
5353 }
@@ -60,7 +60,7 @@ void TimeClient::updateTime() {
6060 while ((size = client.available ()) > 0 ) {
6161 line = client.readStringUntil (' \n ' );
6262 line.toUpperCase ();
63- // example:
63+ // example:
6464 // date: Thu, 19 Nov 2015 20:25:40 GMT
6565 if (line.startsWith (" DATE: " )) {
6666 Serial.println (line.substring (23 , 25 ) + " :" + line.substring (26 , 28 ) + " :" +line.substring (29 , 31 ));
@@ -123,5 +123,3 @@ long TimeClient::getCurrentEpoch() {
123123long TimeClient::getCurrentEpochWithUtcOffset () {
124124 return round (getCurrentEpoch () + 3600 * myUtcOffset + 86400L ) % 86400L ;
125125}
126-
127-
0 commit comments