On Friday 13 December 2019 22:31:12 deloptes wrote: > Pali Rohár wrote: > > > 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. > > > > I was not specific to HFP or HSP. In fact HFP is more into automotive and is > not equal to HSP, but I bet you know this. I also did not read HFP specs to > go into detail.
HSP is very simple, it supports only few AT commands (change volume, button press, ring event) and does not need any state machine. HFP is complicated... > I meant many devices that run on battery do not have HFP - but you are very > specific to audio devices that run on battery Yes, my primary motivation was bluetooth headphones (speakers+mic), so here is either HFP or HSP requirement. > >> 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 > > I am more interested in HFP working with my car :) which it stopped doing > since Sailfish X became the phone of choice (was N9 before) ... but I guess > it will be solved when I sell it next year :) > With newer cars it worked well, but in the background the ofono and pulse > parts are a bit odd. HFP is used in cars because of telephony stack. HFP allows to control mobile calls (answer / hold / dial / ...) and basically very different use case as "receiving voice from microphone" (which is in what users want from headphones). But because all those telephony related functions are core part of HFP protocol and without them it is not possible to activate HFP transfer (even if I want just samples from microphone) I have included it in my HFP proposed HFP API via pluggable Telephony Agent. -- Pali Rohár pali.ro...@gmail.com
signature.asc
Description: PGP signature
_______________________________________________ SailfishOS.org Devel mailing list To unsubscribe, please send a mail to devel-unsubscr...@lists.sailfishos.org