From 2fbd8cb666de25da34b0ffb1cdeb3b9ceacd7876 Mon Sep 17 00:00:00 2001 From: Yannick Ulrich Date: Fri, 21 Oct 2022 22:47:05 +0100 Subject: [PATCH] Added navigation characteristics --- infinitime.go | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/infinitime.go b/infinitime.go index d48e902..964a93d 100644 --- a/infinitime.go +++ b/infinitime.go @@ -38,6 +38,10 @@ const ( FSTransferChar = "adaf0200-4669-6c65-5472-616e73666572" FSVersionChar = "adaf0100-4669-6c65-5472-616e73666572" WeatherDataChar = "00040001-78fc-48fe-8e23-433b3a1942d0" + NavFlagsChar = "00010001-78fc-48fe-8e23-433b3a1942d0" + NavNarrativeChar= "00010002-78fc-48fe-8e23-433b3a1942d0" + NavManDistChar = "00010003-78fc-48fe-8e23-433b3a1942d0" + NavProgressChar = "00010004-78fc-48fe-8e23-433b3a1942d0" ) var charNames = map[string]string{ @@ -52,10 +56,18 @@ var charNames = map[string]string{ FSTransferChar: "Filesystem Transfer", FSVersionChar: "Filesystem Version", WeatherDataChar: "Weather Data", + NavFlagsChar: "Navigation Icon", + NavNarrativeChar:"Navigation Instruction", + NavManDistChar: "Navigation Distance to next event", + NavProgressChar: "Navigation Progress", } type Device struct { device *device.Device1 + navflagsChar *gatt.GattCharacteristic1 + navnarrativeChar*gatt.GattCharacteristic1 + navmandistChar *gatt.GattCharacteristic1 + navprogressChar *gatt.GattCharacteristic1 newAlertChar *gatt.GattCharacteristic1 notifEventChar *gatt.GattCharacteristic1 stepCountChar *gatt.GattCharacteristic1 @@ -394,6 +406,14 @@ func (i *Device) resolveChars() error { charResolved := true // Set correct characteristics switch char.Properties.UUID { + case NavFlagsChar: + i.navflagsChar = char + case NavNarrativeChar: + i.navnarrativeChar = char + case NavManDistChar: + i.navmandistChar = char + case NavProgressChar: + i.navprogressChar = char case NewAlertChar: i.newAlertChar = char case NotifEventChar: