AceTime  1.9.0
Date and time classes for Arduino that support timezones from the TZ Database.
BrokerCommon.h
Go to the documentation of this file.
1 /*
2  * MIT License
3  * Copyright (c) 2019 Brian T. Park
4  */
5 
6 #ifndef ACE_TIME_BROKER_COMMON_H
7 #define ACE_TIME_BROKER_COMMON_H
8 
15 #include <stdint.h>
16 
17 class __FlashStringHelper;
18 
19 namespace ace_time {
20 namespace internal {
21 
23 inline uint16_t timeCodeToMinutes(uint8_t code, uint8_t modifier) {
24  return code * (uint16_t) 15 + (modifier & 0x0f);
25 }
26 
31 inline uint8_t toSuffix(uint8_t modifier) {
32  return modifier & 0xf0;
33 }
34 
51 const char* findShortName(const char* name);
52 
57 const __FlashStringHelper* findShortName(const __FlashStringHelper* fname);
58 
59 } // internal
60 } // ace_time
61 
62 #endif
ace_time::internal::timeCodeToMinutes
uint16_t timeCodeToMinutes(uint8_t code, uint8_t modifier)
Convert (timeCode, timeModifier) fields in ZoneInfo to minutes.
Definition: BrokerCommon.h:23
ace_time::internal::toSuffix
uint8_t toSuffix(uint8_t modifier)
Extract the 'w', 's' 'u' suffix from the 'modifier' field, so that they can be compared against kSuff...
Definition: BrokerCommon.h:31