summaryrefslogtreecommitdiff
path: root/src/components/ble/CurrentTimeClient.h
diff options
context:
space:
mode:
authoruli <cybuzuma@vnxs.de>2022-05-28 14:33:04 +0200
committerJF <JF002@users.noreply.github.com>2022-11-11 21:44:00 +0100
commit38092fcb40695098702163ab64a06787b2dc2499 (patch)
tree1bb502aa5032ad9793c48a2ff6d227c5330f5e0f /src/components/ble/CurrentTimeClient.h
parent840aab7f90944c6c91f98bfb6069293fe2f273dd (diff)
add CTS local time characteristic and use it to provide UTC in DateTimeController
Diffstat (limited to 'src/components/ble/CurrentTimeClient.h')
-rw-r--r--src/components/ble/CurrentTimeClient.h10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/components/ble/CurrentTimeClient.h b/src/components/ble/CurrentTimeClient.h
index 9e48be79..c718d2d9 100644
--- a/src/components/ble/CurrentTimeClient.h
+++ b/src/components/ble/CurrentTimeClient.h
@@ -29,14 +29,16 @@ namespace Pinetime {
private:
typedef struct __attribute__((packed)) {
- uint16_t year;
+ uint8_t year_LSO; // explicit byte ordering to be independent of machine order
+ uint8_t year_MSO; // BLE GATT is little endian
uint8_t month;
uint8_t dayofmonth;
uint8_t hour;
uint8_t minute;
uint8_t second;
- uint8_t millis;
- uint8_t reason;
+ uint8_t dayofweek;
+ uint8_t fractions256; // currently ignored
+ uint8_t reason; // currently ignored, not that any host would set it anyway
} CtsData;
static constexpr uint16_t ctsServiceId {0x1805};
@@ -55,4 +57,4 @@ namespace Pinetime {
std::function<void(uint16_t)> onServiceDiscovered;
};
}
-} \ No newline at end of file
+}