InfiniTime icon indicating copy to clipboard operation
InfiniTime copied to clipboard

Support Battery Level Status BLE characteristic

Open liamcharger opened this issue 1 year ago • 15 comments

I would like the Battery Level Status characteristic to be implemented (see 3.29 in this spec)

I'm working on some features in InfiniLink that require the charging state to be known.

At the same time, this may allow InfiniTime to show itself in the iOS battery widget, like it is shown here: image

liamcharger avatar Dec 03 '24 15:12 liamcharger

I would love to have that!

ghost avatar Dec 19 '24 02:12 ghost

As it turns out, the battery characteristic is enough for iOS to display the device in the widget, but the connection needs to be encrypted. (When using ANCS, it appeared.)

image

liamcharger avatar Jan 05 '25 03:01 liamcharger

@liamcharger Is it possible for the icon to be some watch?

cyberneel avatar Jan 07 '25 03:01 cyberneel

In theory, the icon should be a watch when the GAP Appearance value is set to Generic Watch (0xC0). The value is set here. According to the doc, the value is currently being set for a generic mouse, which is incorrect, but when I switched it to 0xC0, it didn't change.

liamcharger avatar Jan 07 '25 16:01 liamcharger

According to https://www.bluetooth.com/wp-content/uploads/Files/Specification/Assigned_Numbers.html, 0xC2 is smartwatch which would be correct (Section 2.6.3). Where did you see generic mouse? I could totally be misreading this BTW, I don't find the spec legible...

mark9064 avatar Jan 10 '25 17:01 mark9064

According to https://www.bluetooth.com/wp-content/uploads/Files/Specification/Assigned_Numbers.html, 0xC2 is smartwatch which would be correct (Section 2.6.3).

Interesting, you're right, although CxC0 would still be generic watch. Smartwatch wasn't listed where I was looking

Where did you see generic mouse?

I'm looking for it, but I can't find the spec. It wasn't the same one you linked, though...

liamcharger avatar Jan 10 '25 17:01 liamcharger

I think it's correct. I have a sports watch supporting BLE as well, I've just checked and it uses 0xC1 which NRF connect displays as "sports watch" - checks out. But interestingly 0xC2 is displayed as "unknown". So perhaps 0xC2 isn't well supported for some reason?

You tried C0 right? And that didn't work with apple either? I wouldn't be against changing it if C0 appears to be the way to do it

mark9064 avatar Jan 10 '25 17:01 mark9064

Both C0 and C2 didn't work; I just checked what iOS was receiving, and I got a 0 (undefined).

Then I tried reading directly from the Appearance characteristic from InfiniLink in case the issue was with what iOS was doing, but I didn't get any data from it.

So for some reason, iOS in general isn't getting an appearance value.

liamcharger avatar Jan 10 '25 21:01 liamcharger

The joys of the black box apple BLE stack appear endless!

Do you have another device to check if that can read the value? Just to confirm it's there at all

mark9064 avatar Jan 10 '25 22:01 mark9064

I actually do have an old Android device I can use...I'll get back to you on what I find.

liamcharger avatar Jan 11 '25 14:01 liamcharger

Been a while, sorry about that :/

Anyways, android gave me C2... So for whatever reason, iOS won't read it

liamcharger avatar Aug 31 '25 18:08 liamcharger

Strange... maybe it uses some other characteristic to determine the device type?

mark9064 avatar Sep 02 '25 17:09 mark9064

I did some research, but I can't find anything. So the only logical one would be the appearance characteristic

May be able to get an answer from dev forums though

liamcharger avatar Sep 03 '25 13:09 liamcharger

An engineer responded and told me to grab some specific logs and he would forward them to the bluetooth team

I'll post updates here

liamcharger avatar Sep 04 '25 12:09 liamcharger

Sounds promising! Fingers crossed...

mark9064 avatar Sep 04 '25 23:09 mark9064