AceTime
2.3.0
Date and time classes for Arduino that support timezones from the TZ Database.
|
These classes provide a thin layer of indirection for accessing the data structures defined by ZoneInfoMid.h
.
More...
#include <stdint.h>
#include <Arduino.h>
#include <AceCommon.h>
#include "compat.h"
#include "BrokerCommon.h"
#include "ZoneInfoMid.h"
Go to the source code of this file.
Classes | |
class | ace_time::zoneinfomid::ZoneContextBroker< ZC > |
Data broker for accessing a ZoneContext. More... | |
class | ace_time::zoneinfomid::ZoneRuleBroker< ZC, ZR > |
Data broker for accessing ZoneRule. More... | |
class | ace_time::zoneinfomid::ZonePolicyBroker< ZC, ZP, ZR > |
Data broker for accessing ZonePolicy. More... | |
class | ace_time::zoneinfomid::ZoneEraBroker< ZC, ZE, ZP, ZR > |
Data broker for accessing ZoneEra. More... | |
class | ace_time::zoneinfomid::ZoneInfoBroker< ZC, ZI, ZE, ZP, ZR > |
Data broker for accessing ZoneInfo. More... | |
class | ace_time::zoneinfomid::ZoneRegistryBroker< ZI > |
Data broker for accessing the ZoneRegistry. More... | |
class | ace_time::zoneinfomid::ZoneInfoStore< ZC, ZI, ZE, ZP, ZR > |
A storage object that creates an ZoneInfoBroker from a key that identifies the ZoneInfo. More... | |
Functions | |
int16_t | ace_time::zoneinfomid::toDeltaMinutes (uint8_t deltaCode) |
Convert the deltaCode holding the RULES/DSTOFF field in ZoneEra or the SAVE field in ZoneRule to the delta offset in minutes. More... | |
int16_t | ace_time::zoneinfomid::toOffsetMinutes (uint8_t offsetCode, uint8_t deltaCode) |
Convert the offsetCode and deltaCode holding the STDOFF field of the ZoneEra into minutes. More... | |
uint16_t | ace_time::zoneinfomid::timeCodeToMinutes (uint8_t code, uint8_t modifier) |
Convert (code, modifier) fields representing the UNTIL time in ZoneInfo or AT time in ZoneRule in one minute resolution. More... | |
uint8_t | ace_time::zoneinfomid::toSuffix (uint8_t modifier) |
Extract the 'w', 's' 'u' suffix from the 'modifier' field, so that they can be compared against kSuffixW, kSuffixS and kSuffixU. More... | |
These classes provide a thin layer of indirection for accessing the data structures defined by ZoneInfoMid.h
.
The zoneinfo files are stored in flash memory (using the PROGMEM keyword), and cannot be accessed directly on microcontrollers using the Harvard architecture (e.g. AVR) where data and program live in 2 different address spaces. The data in flash memory must be accessed using helper routines in <pgmspace.h>. These classes abstract away this difference so that the code BasicZoneProcessor and ExtendedZoneProcessor can be written to be (mostly) agnostic to how the zoneinfo files are stored.
Definition in file BrokersMid.h.
|
inline |
Convert (code, modifier) fields representing the UNTIL time in ZoneInfo or AT time in ZoneRule in one minute resolution.
The code
parameter holds the AT or UNTIL time in minutes component in units of 15 minutes. The lower 4-bits of modifier
holds the remainder minutes.
Definition at line 70 of file BrokersMid.h.
|
inline |
Convert the deltaCode
holding the RULES/DSTOFF field in ZoneEra or the SAVE field in ZoneRule to the delta offset in minutes.
The lower 4-bits stores minutes in units of 15-minutes, shifted by 1h, so can represent the interval [-01:00 to 02:45].
Definition at line 49 of file BrokersMid.h.
|
inline |
Convert the offsetCode
and deltaCode
holding the STDOFF field of the ZoneEra into minutes.
The offsetCode
is rounded towards -infinity in 15-minute multiples. The upper 4-bits of deltaCode
holds the (unsigned) remainder in one-minute increments.
Definition at line 59 of file BrokersMid.h.
|
inline |
Extract the 'w', 's' 'u' suffix from the 'modifier' field, so that they can be compared against kSuffixW, kSuffixS and kSuffixU.
Used for Zone.UNTIL and Rule.AT fields.
Definition at line 79 of file BrokersMid.h.