TinyCTS
Bluetooth Current Time Service client and server for Arduino
Loading...
Searching...
No Matches
tiny_cts::TinyCTSLocalTimeInfo Class Reference

The Local Time Information characteristic (0x2A0F): the time zone and the daylight saving time (DST) offset. Local time = UTC + time zone + DST. More...

#include <TinyCTSTypes.h>

Public Member Functions

int dstMinutes () const
 The summer time offset in minutes (0 if not known).
size_t encode (uint8_t *out) const
bool isKnown () const
 false if the time zone is not known.
int utcOffsetMinutes () const
 Offset of the local time to UTC in minutes.
int zoneMinutes () const
 The time zone in minutes (0 if not known).

Static Public Member Functions

static bool decode (const uint8_t *data, size_t len, TinyCTSLocalTimeInfo &i)
static TinyCTSLocalTimeInfo fromMinutes (int utcOffsetMinutes, int dstMinutes=0)
 From the offsets in minutes.

Public Attributes

uint8_t dstOffset = UnknownDst
 0 = standard, 2 = +0.5h, 4 = +1h, 8 = +2h
int8_t timeZone = UnknownTimeZone
 offset to UTC in 15 minutes, -48..56

Static Public Attributes

static constexpr size_t Size = 2
static constexpr uint8_t UnknownDst = 255
static constexpr int8_t UnknownTimeZone = -128

Detailed Description

The Local Time Information characteristic (0x2A0F): the time zone and the daylight saving time (DST) offset. Local time = UTC + time zone + DST.

Member Function Documentation

◆ fromMinutes()

TinyCTSLocalTimeInfo tiny_cts::TinyCTSLocalTimeInfo::fromMinutes ( int utcOffsetMinutes,
int dstMinutes = 0 )
inlinestatic

From the offsets in minutes.

Parameters
utcOffsetMinutesThe standard time zone, e.g. 60 for CET
dstMinutesThe summer time offset in minutes: 0, 30, 60 or 120

The documentation for this class was generated from the following file: