linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: Battery level of energy
       [not found] <CAAOqupzg6GN147uofDAyuFLid5QHOns0nkjOw=+=OicV=cezwA () mail ! gmail ! com>
@ 2019-03-30 16:05 ` Cysioland
  0 siblings, 0 replies; 4+ messages in thread
From: Cysioland @ 2019-03-30 16:05 UTC (permalink / raw)
  To: Grigory Fateyev, linux-bluetooth


[-- Attachment #1.1: Type: text/plain, Size: 3646 bytes --]

I actually had a similar problem with my headset, and it turns out that
a headset can report its battery status through Apple-specific AT
commands, namely through a "AT+IPHONEACCEV command". If you listen
through Wireshark or something similar, you may periodically receive
battery level info. In my case it was "AT+IPHONEACCEV=2,1,2,2,0", which
corresponded to 30% of battery (value after "1" means "battery level",
and level is scaled between 0 and 9). Hope that helps.

Documentation:
https://developer.apple.com/accessories/Accessory-Design-Guidelines.pdf

W dniu 23.01.2019 o 18:27, Grigory Fateyev pisze:> It has such info:
>
> [MDR-XB650BT]# info 00:18:09:C5:44:1E
> Device 00:18:09:C5:44:1E
> Name: MDR-XB650BT
> Alias: MDR-XB650BT
> Class: 0x240404
> Icon: audio-card
> Paired: yes
> Trusted: yes
> Blocked: no
> Connected: yes
> LegacyPairing: no
> UUID: Headset                   (00001108-0000-1000-8000-00805f9b34fb)
> UUID: Audio Sink                (0000110b-0000-1000-8000-00805f9b34fb)
> UUID: A/V Remote Control Target (0000110c-0000-1000-8000-00805f9b34fb)
> UUID: A/V Remote Control        (0000110e-0000-1000-8000-00805f9b34fb)
> UUID: Handsfree                 (0000111e-0000-1000-8000-00805f9b34fb)
>
> PS. Luiz, sorry for the direct copy!
>
> =D1=81=D1=80, 23 =D1=8F=D0=BD=D0=B2. 2019 =D0=B3. =D0=B2 20:04, Luiz
August=
> o von Dentz <luiz.dentz@gmail.com>:
>>
>> Hi Grigory,
>> On Wed, Jan 23, 2019 at 6:22 PM Grigory Fateyev <gfborn@gmail.com> wrote:
>>>
>>> Hello!
>>>
>>> I have a bluetooth headset Sony MDR-XB650BT.
>>>
>>> # hcitool info 00:18:09:C5:44:1E
>>> Requesting information ...
>>> BD Address:  00:18:09:C5:44:1E
>>> OUI Company: CRESYN (00-18-09)
>>> Device Name: MDR-XB650BT
>>> LMP Version: 4.0 (0x6) LMP Subversion: 0x2576
>>> Manufacturer: Cambridge Silicon Radio (10)
>>> Features page 0: 0xff 0xff 0x8f 0xfe 0x9b 0xff 0x59 0x87
>>> <3-slot packets> <5-slot packets> <encryption> <slot offset>
>>> <timing accuracy> <role switch> <hold mode> <sniff mode>
>>> <park state> <RSSI> <channel quality> <SCO link> <HV2 packets>
>>> <HV3 packets> <u-law log> <A-law log> <CVSD> <paging scheme>
>>> <power control> <transparent SCO> <broadcast encrypt>
>>> <EDR ACL 2 Mbps> <EDR ACL 3 Mbps> <enhanced iscan>
>>> <interlaced iscan> <interlaced pscan> <inquiry with RSSI>
>>> <extended SCO> <EV4 packets> <EV5 packets> <AFH cap. slave>
>>> <AFH class. slave> <3-slot EDR ACL> <5-slot EDR ACL>
>>> <sniff subrating> <pause encryption> <AFH cap. master>
>>> <AFH class. master> <EDR eSCO 2 Mbps> <EDR eSCO 3 Mbps>
>>> <3-slot EDR eSCO> <extended inquiry> <simple pairing>
>>> <encapsulated PDU> <non-flush flag> <LSTO> <inquiry TX power>
>>> <EPC> <extended features>
>>> Features page 1: 0x01 0x00 0x00 0x00 0x00 0x00 0x00 0x00
>>>
>>> I'd like to get the energy level at least in shell. In which direction
>>> I should look for? How to know if my device has GATT support? If it
>>> connected with Android smartphone, where Android version is < 6.0, it
>>> has an icon with level in percents. I want to get the same on my linux
>>> machine.
>>
>> bluetoothd should be able to detect if there is a battery service,
>> well at least if you are connect over LE, note that in past there
>> exists ways to fetch the battery level of AVRCP and HFP via AT
>> commands, so perhaps Android is using one of those, btw you should be
>> able to see what bluetoothd has discover with:
>>
>> bluetoothctl> info <bdaddr>
>>
>>> Thank you!
>>>
>>> --
>>> Grigory
>>
>>
>>
>> --
>> Luiz Augusto von Dentz
>
>
>
> --=20
> Grigory
>


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Battery level of energy
  2019-01-23 17:04 ` Luiz Augusto von Dentz
@ 2019-01-23 17:27   ` Grigory Fateyev
  0 siblings, 0 replies; 4+ messages in thread
From: Grigory Fateyev @ 2019-01-23 17:27 UTC (permalink / raw)
  To: linux-bluetooth

It has such info:

[MDR-XB650BT]# info 00:18:09:C5:44:1E
Device 00:18:09:C5:44:1E
Name: MDR-XB650BT
Alias: MDR-XB650BT
Class: 0x240404
Icon: audio-card
Paired: yes
Trusted: yes
Blocked: no
Connected: yes
LegacyPairing: no
UUID: Headset                   (00001108-0000-1000-8000-00805f9b34fb)
UUID: Audio Sink                (0000110b-0000-1000-8000-00805f9b34fb)
UUID: A/V Remote Control Target (0000110c-0000-1000-8000-00805f9b34fb)
UUID: A/V Remote Control        (0000110e-0000-1000-8000-00805f9b34fb)
UUID: Handsfree                 (0000111e-0000-1000-8000-00805f9b34fb)

PS. Luiz, sorry for the direct copy!

ср, 23 янв. 2019 г. в 20:04, Luiz Augusto von Dentz <luiz.dentz@gmail.com>:
>
> Hi Grigory,
> On Wed, Jan 23, 2019 at 6:22 PM Grigory Fateyev <gfborn@gmail.com> wrote:
> >
> > Hello!
> >
> > I have a bluetooth headset Sony MDR-XB650BT.
> >
> > # hcitool info 00:18:09:C5:44:1E
> > Requesting information ...
> > BD Address:  00:18:09:C5:44:1E
> > OUI Company: CRESYN (00-18-09)
> > Device Name: MDR-XB650BT
> > LMP Version: 4.0 (0x6) LMP Subversion: 0x2576
> > Manufacturer: Cambridge Silicon Radio (10)
> > Features page 0: 0xff 0xff 0x8f 0xfe 0x9b 0xff 0x59 0x87
> > <3-slot packets> <5-slot packets> <encryption> <slot offset>
> > <timing accuracy> <role switch> <hold mode> <sniff mode>
> > <park state> <RSSI> <channel quality> <SCO link> <HV2 packets>
> > <HV3 packets> <u-law log> <A-law log> <CVSD> <paging scheme>
> > <power control> <transparent SCO> <broadcast encrypt>
> > <EDR ACL 2 Mbps> <EDR ACL 3 Mbps> <enhanced iscan>
> > <interlaced iscan> <interlaced pscan> <inquiry with RSSI>
> > <extended SCO> <EV4 packets> <EV5 packets> <AFH cap. slave>
> > <AFH class. slave> <3-slot EDR ACL> <5-slot EDR ACL>
> > <sniff subrating> <pause encryption> <AFH cap. master>
> > <AFH class. master> <EDR eSCO 2 Mbps> <EDR eSCO 3 Mbps>
> > <3-slot EDR eSCO> <extended inquiry> <simple pairing>
> > <encapsulated PDU> <non-flush flag> <LSTO> <inquiry TX power>
> > <EPC> <extended features>
> > Features page 1: 0x01 0x00 0x00 0x00 0x00 0x00 0x00 0x00
> >
> > I'd like to get the energy level at least in shell. In which direction
> > I should look for? How to know if my device has GATT support? If it
> > connected with Android smartphone, where Android version is < 6.0, it
> > has an icon with level in percents. I want to get the same on my linux
> > machine.
>
> bluetoothd should be able to detect if there is a battery service,
> well at least if you are connect over LE, note that in past there
> exists ways to fetch the battery level of AVRCP and HFP via AT
> commands, so perhaps Android is using one of those, btw you should be
> able to see what bluetoothd has discover with:
>
> bluetoothctl> info <bdaddr>
>
> > Thank you!
> >
> > --
> > Grigory
>
>
>
> --
> Luiz Augusto von Dentz



-- 
Grigory

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Battery level of energy
  2019-01-23 16:18 Grigory Fateyev
@ 2019-01-23 17:04 ` Luiz Augusto von Dentz
  2019-01-23 17:27   ` Grigory Fateyev
  0 siblings, 1 reply; 4+ messages in thread
From: Luiz Augusto von Dentz @ 2019-01-23 17:04 UTC (permalink / raw)
  To: Grigory Fateyev; +Cc: linux-bluetooth

Hi Grigory,
On Wed, Jan 23, 2019 at 6:22 PM Grigory Fateyev <gfborn@gmail.com> wrote:
>
> Hello!
>
> I have a bluetooth headset Sony MDR-XB650BT.
>
> # hcitool info 00:18:09:C5:44:1E
> Requesting information ...
> BD Address:  00:18:09:C5:44:1E
> OUI Company: CRESYN (00-18-09)
> Device Name: MDR-XB650BT
> LMP Version: 4.0 (0x6) LMP Subversion: 0x2576
> Manufacturer: Cambridge Silicon Radio (10)
> Features page 0: 0xff 0xff 0x8f 0xfe 0x9b 0xff 0x59 0x87
> <3-slot packets> <5-slot packets> <encryption> <slot offset>
> <timing accuracy> <role switch> <hold mode> <sniff mode>
> <park state> <RSSI> <channel quality> <SCO link> <HV2 packets>
> <HV3 packets> <u-law log> <A-law log> <CVSD> <paging scheme>
> <power control> <transparent SCO> <broadcast encrypt>
> <EDR ACL 2 Mbps> <EDR ACL 3 Mbps> <enhanced iscan>
> <interlaced iscan> <interlaced pscan> <inquiry with RSSI>
> <extended SCO> <EV4 packets> <EV5 packets> <AFH cap. slave>
> <AFH class. slave> <3-slot EDR ACL> <5-slot EDR ACL>
> <sniff subrating> <pause encryption> <AFH cap. master>
> <AFH class. master> <EDR eSCO 2 Mbps> <EDR eSCO 3 Mbps>
> <3-slot EDR eSCO> <extended inquiry> <simple pairing>
> <encapsulated PDU> <non-flush flag> <LSTO> <inquiry TX power>
> <EPC> <extended features>
> Features page 1: 0x01 0x00 0x00 0x00 0x00 0x00 0x00 0x00
>
> I'd like to get the energy level at least in shell. In which direction
> I should look for? How to know if my device has GATT support? If it
> connected with Android smartphone, where Android version is < 6.0, it
> has an icon with level in percents. I want to get the same on my linux
> machine.

bluetoothd should be able to detect if there is a battery service,
well at least if you are connect over LE, note that in past there
exists ways to fetch the battery level of AVRCP and HFP via AT
commands, so perhaps Android is using one of those, btw you should be
able to see what bluetoothd has discover with:

bluetoothctl> info <bdaddr>

> Thank you!
>
> --
> Grigory



-- 
Luiz Augusto von Dentz

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Battery level of energy
@ 2019-01-23 16:18 Grigory Fateyev
  2019-01-23 17:04 ` Luiz Augusto von Dentz
  0 siblings, 1 reply; 4+ messages in thread
From: Grigory Fateyev @ 2019-01-23 16:18 UTC (permalink / raw)
  To: linux-bluetooth

Hello!

I have a bluetooth headset Sony MDR-XB650BT.

# hcitool info 00:18:09:C5:44:1E
Requesting information ...
BD Address:  00:18:09:C5:44:1E
OUI Company: CRESYN (00-18-09)
Device Name: MDR-XB650BT
LMP Version: 4.0 (0x6) LMP Subversion: 0x2576
Manufacturer: Cambridge Silicon Radio (10)
Features page 0: 0xff 0xff 0x8f 0xfe 0x9b 0xff 0x59 0x87
<3-slot packets> <5-slot packets> <encryption> <slot offset>
<timing accuracy> <role switch> <hold mode> <sniff mode>
<park state> <RSSI> <channel quality> <SCO link> <HV2 packets>
<HV3 packets> <u-law log> <A-law log> <CVSD> <paging scheme>
<power control> <transparent SCO> <broadcast encrypt>
<EDR ACL 2 Mbps> <EDR ACL 3 Mbps> <enhanced iscan>
<interlaced iscan> <interlaced pscan> <inquiry with RSSI>
<extended SCO> <EV4 packets> <EV5 packets> <AFH cap. slave>
<AFH class. slave> <3-slot EDR ACL> <5-slot EDR ACL>
<sniff subrating> <pause encryption> <AFH cap. master>
<AFH class. master> <EDR eSCO 2 Mbps> <EDR eSCO 3 Mbps>
<3-slot EDR eSCO> <extended inquiry> <simple pairing>
<encapsulated PDU> <non-flush flag> <LSTO> <inquiry TX power>
<EPC> <extended features>
Features page 1: 0x01 0x00 0x00 0x00 0x00 0x00 0x00 0x00

I'd like to get the energy level at least in shell. In which direction
I should look for? How to know if my device has GATT support? If it
connected with Android smartphone, where Android version is < 6.0, it
has an icon with level in percents. I want to get the same on my linux
machine.

Thank you!

-- 
Grigory

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-03-30 16:15 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <CAAOqupzg6GN147uofDAyuFLid5QHOns0nkjOw=+=OicV=cezwA () mail ! gmail ! com>
2019-03-30 16:05 ` Battery level of energy Cysioland
2019-01-23 16:18 Grigory Fateyev
2019-01-23 17:04 ` Luiz Augusto von Dentz
2019-01-23 17:27   ` Grigory Fateyev

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).