A time interface class. This class replicates the normal time functions, but goes a couple of steps further. mbed library 82 and prior has a defective gmtime function. Also, this class enables access to setting the time, and adjusting the accuracy of the RTC.
Dependents: CI-data-logger-server WattEye X10Svr SSDP_Server
Diff: TimeInterface.h
- Revision:
- 24:45a9e7081499
- Parent:
- 21:f3818e2e0370
- Child:
- 26:9ee3fac64626
--- a/TimeInterface.h Sun Jun 10 22:43:56 2018 +0000 +++ b/TimeInterface.h Mon Aug 13 00:54:52 2018 +0000 @@ -62,26 +62,32 @@ /// // +--------+ /// // /// // +--------+ -/// // | RTC |<---- setTime(char*, uint16_t, uint32_t) -/// // | |<---- adjust_sec(int32_t) -/// // | |<---- set_cal(int32_t) -/// // | |----> int32_t get_cal() -/// // | |----> bool get_dst() -/// // | | -/// // | |<---- set_time(time_t t, int16_t) -/// // | |----> time_t time(time_t *) +/// // | |<------------ setTime(char * server, uint16_t port, uint32_t timeout) +/// // | NTP |<-----------> Ethernet +/// // | |----+ +/// // +--------+ | +/// // | +/// // +--------+ | +/// // | RTC |<---+-------- set_time(time_t t, int16_t tzo) +/// // | |<------------ adjust_sec(int32_t) +/// // | |<------------ set_cal(int32_t) +/// // | |------------> int32_t get_cal() +/// // | |------------> time_t time(time_t *) /// // | |------+ /// // +--------+ | -/// // +- | <---- set_dst(char *, char *) -/// // +--------+ | | +----------+ -/// // | |<--+ +--|time_local| -/// // |dst_pair|---------| |--------> time_t timelocal(time_t *) -/// // +--------+ +--| | -/// // | +----------+ -/// // +--------+ | -/// // | tzo |------+ -/// // | |<---- set_tzo_min(int16_t) -/// // | |----> int16_t get_tzo_min() +/// // | +/// // +--------+ | +/// // | |<---- | <---- set_dst(bool dst) +/// // | |<---- | <---- set_dst(char * start_dst, char * end_dst) +/// // | |----- | ----> bool get_dst() +/// // |dst_pair|---+ | +----------+ +/// // +--------+ | | | | +/// // | +->| | +/// // +--------+ +---->|time_local|--------> time_t timelocal(time_t *) +/// // | tzo |<--------| | +/// // | | +----------+ +/// // | |<------------ set_tzo_min(int16_t) +/// // | |------------> int16_t get_tzo_min() /// // +--------+ /// // /// // +--------+ +--------------------------+