bluetooth GATT questions
#1
Can someone help clear up my understanding of bluetooth services and attributes on Infinitime? I figured out how to set date and time using gatttool, but am confused as to why there are three different characteristics associated with the CurrentTime service, and how I could have found that out from the source code instead of trial and error with gatttool until I found something that looked like a time and date code.

In Infinitime/src/components/ble/CurrentTimeService.h, I can see that ctsId sets the UUID of the CurrentTime service to 0x1805. gatttool tells me this has three characteristics with handles 17, 18, and 19. Handle 19 has the date and time, and gatttool can set time on the watch with char-write-cmd. But what are handles 17 and 18 doing? And where in the source code are these characteristics defined?

Thanks,
  Reply
#2
I've not been involved in (or even read) the implementation in Infinitime but the spec for the current time service is here (https://www.bluetooth.com/specifications...rvice-1-1/ ) and I note that two of the three specified characteristics are optional.
PineTime: wasp-os and MicroPython, Pinebook Pro:  Debian Bullseye
  Reply
#3
Thank you, @danielt .

Following a link in the doc you mentioned, I found this list of UUIDs. That must make it easy for companion app (GadgetBridge, etc.) developers if everyone sticks to the standards when declaring their services. Sure enough:
  • UUID 1805 is the Current Time Service, which is defined in CurrentTimeService.h. 
  • UUID 2a2b (handle 19 that I referred to earlier) is the current time characteristic, which is also defined in CurrentTimeService.h
  • UUID 2800 (handle 17) is a service declaration (?), I found a definition for it in one of the nimble headers
  • UUID 2803 (handle 18) is a GATT characteristic declaration (?), I found that also in a nimble header.
So I guess InfiniTime has implemented only one of the three characteristics you mentioned (uuid 2a2b) and the other three are just part of the GATT protocol? I found a book chapter about GATT that I think will clear it up.
  Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Bluetooth BLE-MIDI-controller app for PineTime / InfiniTime Luno 0 936 08-20-2023, 05:17 AM
Last Post: Luno
  Python programme for a vibration signal from Raspberry Pi 4 via bluetooth connection Tria91 1 1,203 06-03-2023, 04:14 PM
Last Post: wibble
  Realtime heartrate and accelerometer via bluetooth Marc_s 0 972 05-01-2023, 05:40 AM
Last Post: Marc_s
  help on developing BLE bluetooth MIDI Luno 0 992 04-05-2023, 12:08 PM
Last Post: Luno
  How to use bluetooth after flashing mynewt razrosman 0 1,460 06-09-2022, 12:27 PM
Last Post: razrosman
  bluetooth heart rate real time monitoring ptmatrtwo 3 4,625 02-03-2022, 10:06 PM
Last Post: barray
  Article: Bluetooth Time Sync and LVGL on PineTime Mynewt lupyuen 0 2,998 10-15-2020, 05:51 PM
Last Post: lupyuen
  Article: Your First Bluetooth Low Energy App with Flutter lupyuen 0 3,411 06-03-2020, 05:44 PM
Last Post: lupyuen
  Firmware Update over Bluetooth LE lupyuen 2 4,272 05-16-2020, 02:17 AM
Last Post: lupyuen

Forum Jump:


Users browsing this thread: 1 Guest(s)