Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Battery Level Status BLE characteristic #2177

Open
liamcharger opened this issue Dec 3, 2024 · 10 comments
Open

Support Battery Level Status BLE characteristic #2177

liamcharger opened this issue Dec 3, 2024 · 10 comments
Labels
enhancement Enhancement to an existing app/feature feature request

Comments

@liamcharger
Copy link
Contributor

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 liamcharger changed the title Support Battery Level Status BLE Characteristic Support Battery Level Status BLE characteristic Dec 3, 2024
@Ralimbahere
Copy link

I would love to have that!

@mark9064 mark9064 added enhancement Enhancement to an existing app/feature feature request labels Dec 19, 2024
@liamcharger
Copy link
Contributor Author

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

@cyberneel
Copy link

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

@liamcharger
Copy link
Contributor Author

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.

@mark9064
Copy link
Member

mark9064 commented Jan 10, 2025

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...

@liamcharger
Copy link
Contributor Author

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...

@mark9064
Copy link
Member

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

@liamcharger
Copy link
Contributor Author

liamcharger commented Jan 10, 2025

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.

@mark9064
Copy link
Member

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

@liamcharger
Copy link
Contributor Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Enhancement to an existing app/feature feature request
Projects
None yet
Development

No branches or pull requests

4 participants