Re: Battery1 vs. GATT reporting

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Ed,

Your understanding is correct about the purpose of that flag. So I can
confirm that (1) is true. For (2), I can confirm otherwise, since I am
able to get both battery values from GATT API and Battery1 API. Here
is my output:

```
// pair and connect to an LE device with battery service first (e.g an LE Mouse)
// [bluetoothctl]# gatt.list-attributes
// [bluetoothctl]# gatt.select-attribute
/org/bluez/hci0/dev_C6_XX/service000e/char000f

// via GATT API
[BluetoothMouse3600:/service000e/char000f]# gatt.read
Attempting to read /org/bluez/hci0/dev_C6_XX/service000e/char000f
[CHG] Attribute /org/bluez/hci0/dev_C6_XX/service000e/char000f Value:
  4d                                               M
  4d                                               M

// via Battery API
[BluetoothMouse3600:/service000e/char000f]# info
Device C6:XX (random)
        Name: BluetoothMouse3600
        Alias: BluetoothMouse3600
        ...
        Battery Percentage: 0x4e (78)
[BluetoothMouse3600:/service000e/char000f]#
```

Could you try the same with bluetoothctl and share the output?

On Mon, Feb 28, 2022 at 6:20 AM Ed Beroset <beroset@xxxxxxxxxxxxxx> wrote:
>
> In
> https://git.kernel.org/pub/scm/bluetooth/bluez.git/commit/?id=713f6f09 a
> flag named "external" was added which, if I'm understanding correctly,
> is supposed to mark the Battery1 profile as safe to also share via GATT.
>   However, I was recently working on an application that relies on the
> GATT API for battery power and found that it only seemed to work as
> expected (reporting via both) if I set the flag to false rather than
> true as in the commit.  I looked through the code and it all looks
> correct, but my observation indicates that perhaps the sense of the flag
> is somehow inverted.
>
> Here's the project I was working on, with the relevant bug report.
> https://github.com/AsteroidOS/libasteroid/issues/13
>
> So can someone verify that:
> 1. the interface is intended to be shared via GATT and Battery1
> 2. that it does not work that way today
>
> Ed
>



[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux