OmNtp

Declared In:

Introduction

class to keep a local clock synchronized from a server



Member Functions

getTime(int &, int &, float &)
getTime(int &, int &, int &)
getTimeString()
getTimeString()
ntp
setLocalTimeZone
setTimeUrl
setTimeUrl(const char *)
setTimeUrl(const char *)
setTimeZone(int)
setTimeZone(int)
setWifiAvailable
tick

getTime(int &, int &, float &)


public

bool getTime( int &hourOut, int &minuteOut, float &secondOut);
Discussion

Get the time of day in two handy integers and a float.


getTime(int &, int &, int &)


public

bool getTime( int &hourOut, int &minuteOut, int &secondOut);
Discussion

Get the time of day in three handy integers.


getTimeString()


public

const char *getTimeString();
Discussion

Get the time of day in a handy string like HH:MM:SS.


getTimeString()


public

const char *getTimeString();
Discussion

(It's a static char[], by the way.)


ntp


public

static OmNtp *ntp();
Discussion

Get the last-created ntp instance, if any


setLocalTimeZone


public

void setLocalTimeZone();
Discussion

Issue a request to an http service, the url you set with setTimeUrl().


setTimeUrl


public

void setTimeUrl( const char *timeUrl);
Discussion

Https not supported, just http.


setTimeUrl(const char *)


public

void setTimeUrl( const char *timeUrl);
Discussion

URL to a server under your control that gives the current time.


setTimeUrl(const char *)


public

void setTimeUrl( const char *timeUrl);
Discussion

OmNtp will deduce the timezone relative to NTP from it, also.


setTimeZone(int)


public

void setTimeZone( int hourOffset);
Discussion

This number gets added to UTC for your time zone. It ranges


setTimeZone(int)


public

void setTimeZone( int hourOffset);
Discussion

from -12 to +12. California in December needs -8.


setWifiAvailable


public

void setWifiAvailable( bool wifiAvailable);
Discussion

Call this after wifi properly established


tick


public

void tick( long milliseconds);
Discussion

Call this in your loop(). Assumes about 20-50 ms interval.