On Friday 13 December 2019 21:22:27 deloptes wrote:
> Pali Rohár wrote:
> 
> > On Friday 13 December 2019 00:37:13 Bjoern Bidar wrote:
> >> Hey
> >> 
> >> Looks really interessting especially when considering how buggy the
> >> profile handling is currently and the mess that every vendor creates.
> > 
> > My proposed design already handles battery level (via AT+IPHONEACCEV
> > command and other vendors too) and should allow to define new interfaces
> > for other vendor extensions which may come in future.
> > 
> >> I think when it comes to the programming language c plus glib is probably
> >> the preffered choice.
> > 
> > For prototype implementation which basically handles whole specification
> > except HFP AG role I chose Perl language. But just because it is fast
> > for me to write such low level code which needs to parse lot of text
> > protocol commands and do socket bluetooth socket stuff. It was just
> > prototype to check if my prosed API specification make sense and if it
> > is possible to implement daemon according to it. C language is fine for
> > me, but I decision would depends on people who would do real
> > implementation.
> > 
> > If somebody else is interesting in with helping, please let me know.
> > 
> >> I hope this brings linux closer to the feature state of bluedroid.
> 
> Respect!
> 
> I played recently a lot with BT so got interested in what you are writing. I
> found
> 
> https://bbs.archlinux.org/viewtopic.php?id=236499 pointing to the spec 1.7
> https://www.bluetooth.org/docman/handlers/DownloadDoc.ashx?doc_id=292287

Yes, HFP 1.7 has support for reporting battery level via HF indicators,
so via AT+BIEV= command.

> Looks like that not all devices support one and the same method to report
> battery level. (I can imagine that not many support H[S|F]P).

But you are right that not all devices support HFP 1.7 and important is
that HF indicator for battery level is optional and even HFP 1.7
compliant device does not have to support it.

And also more HFP pre-1.7 devices reports battery level via own custom
vendor AT commands. E.g. via apple command AT+IPHONEACCEV=1,1, or via
csr command AT+CSRBATT=

All 3 ways I implemented in my Perl prototype.

> Anyway - seems to be interesting topic
> https://stackoverflow.com/questions/49078659/check-battery-level-of-connected-bluetooth-device-on-linux
> https://www.bluetooth.com/specifications/gatt/

This is GATT profile, which is independent of HFP profile and therefore
is out of scope of HFP implementation.

> I am more interested in more robust H[S|F]P implementation, though it looks
> like it depends widely on the manufacturer.

Yes, manufactures uses own custom AT commands, but I know only above 3
ways how devices report battery level via HFP.

Prototype with documentation and API specification I put into
repository: https://github.com/pali/hsphfpd-prototype

-- 
Pali Rohár
pali.ro...@gmail.com

Attachment: signature.asc
Description: PGP signature

_______________________________________________
SailfishOS.org Devel mailing list
To unsubscribe, please send a mail to devel-unsubscr...@lists.sailfishos.org

Reply via email to