All of lore.kernel.org
 help / color / mirror / Atom feed
* Battery indication for Logitech devices
@ 2022-04-01  9:44 Marcos Alano
  2022-04-01 16:08 ` Filipe Laíns
  0 siblings, 1 reply; 6+ messages in thread
From: Marcos Alano @ 2022-04-01  9:44 UTC (permalink / raw)
  To: HID CORE LAYER

Hello fellow developers!

We are having a discussion about a question and I think we can get
help here. The discussion is
https://gitlab.freedesktop.org/upower/upower/-/issues/166#note_1322354
The problem is when we use a Logitech device, we get two discrepant
information about battery level, one from Bluetooth stack and another
one from HID++ module.
The question here is: what is the most precise information, so we can
deduplicate but keep the indicator precise?

Thank you.

-- 
Marcos H. Alano
Linux System Administrator
marcoshalano@gmail.com

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

* Re: Battery indication for Logitech devices
  2022-04-01  9:44 Battery indication for Logitech devices Marcos Alano
@ 2022-04-01 16:08 ` Filipe Laíns
  2022-04-04  7:10   ` Nestor Lopez Casado
  0 siblings, 1 reply; 6+ messages in thread
From: Filipe Laíns @ 2022-04-01 16:08 UTC (permalink / raw)
  To: Marcos Alano, HID CORE LAYER; +Cc: Nestor Lopez Casado

[-- Attachment #1: Type: text/plain, Size: 772 bytes --]

On Fri, 2022-04-01 at 06:44 -0300, Marcos Alano wrote:
> Hello fellow developers!
> 
> We are having a discussion about a question and I think we can get
> help here. The discussion is
> https://gitlab.freedesktop.org/upower/upower/-/issues/166#note_1322354
> The problem is when we use a Logitech device, we get two discrepant
> information about battery level, one from Bluetooth stack and another
> one from HID++ module.
> The question here is: what is the most precise information, so we can
> deduplicate but keep the indicator precise?
> 
> Thank you.
> 

Hi Marcos,

I think the battery reported by the HID++ driver should be more accurate in
certain devices.

CCing Nestor as he may be able to clarify this further.

Cheers,
Filipe Laíns

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

* Re: Battery indication for Logitech devices
  2022-04-01 16:08 ` Filipe Laíns
@ 2022-04-04  7:10   ` Nestor Lopez Casado
  2022-04-04 10:12     ` Bastien Nocera
  0 siblings, 1 reply; 6+ messages in thread
From: Nestor Lopez Casado @ 2022-04-04  7:10 UTC (permalink / raw)
  To: Filipe Laíns; +Cc: Marcos Alano, HID CORE LAYER

Hello,

I've got this from asking internally:

" The information should be accurate in both BAS and HIDPP interfaces.
However, today the BAS interface is limited. Version  2.0 will be
better but not yet released. As you have access to the HIDPP, I
recommend using only this one. Like this, the type of connection can
be ignored (BLE or USB dongle) "

-nestor


On Fri, Apr 1, 2022 at 6:08 PM Filipe Laíns <lains@archlinux.org> wrote:
>
> On Fri, 2022-04-01 at 06:44 -0300, Marcos Alano wrote:
> > Hello fellow developers!
> >
> > We are having a discussion about a question and I think we can get
> > help here. The discussion is
> > https://gitlab.freedesktop.org/upower/upower/-/issues/166#note_1322354
> > The problem is when we use a Logitech device, we get two discrepant
> > information about battery level, one from Bluetooth stack and another
> > one from HID++ module.
> > The question here is: what is the most precise information, so we can
> > deduplicate but keep the indicator precise?
> >
> > Thank you.
> >
>
> Hi Marcos,
>
> I think the battery reported by the HID++ driver should be more accurate in
> certain devices.
>
> CCing Nestor as he may be able to clarify this further.
>
> Cheers,
> Filipe Laíns

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

* Re: Battery indication for Logitech devices
  2022-04-04  7:10   ` Nestor Lopez Casado
@ 2022-04-04 10:12     ` Bastien Nocera
  2022-05-02 17:05       ` marcoshalano
  2022-05-23 11:46       ` Bastien Nocera
  0 siblings, 2 replies; 6+ messages in thread
From: Bastien Nocera @ 2022-04-04 10:12 UTC (permalink / raw)
  To: Nestor Lopez Casado, Filipe Laíns; +Cc: Marcos Alano, HID CORE LAYER

On Mon, 2022-04-04 at 09:10 +0200, Nestor Lopez Casado wrote:
> Hello,
> 
> I've got this from asking internally:
> 
> " The information should be accurate in both BAS and HIDPP
> interfaces.
> However, today the BAS interface is limited. Version  2.0 will be
> better but not yet released. As you have access to the HIDPP, I
> recommend using only this one. Like this, the type of connection can
> be ignored (BLE or USB dongle) "

As per the patch I just sent (HID: logitech-hidpp: Add Signature M650),
it will unfortunately be difficult to disable the battery reporting
directly from bluetoothd.

We can detect whether a Bluetooth device supports HID++, as it has a
GATT attribute with a Logitech specific UUID[1] (more info/specs
welcome), but not all the HID++ capable Bluetooth devices seem to be
detected by the kernel and they need to be added to a list.

Ideally, the kernel could enable HID++ support for all the Bluetooth
HID++-capable devices, and we could easily block reporting in upower or
bluetoothd without having to care at runtime about whether there's a
separate battery reporting interface because we could assume it was
always there.

Any ideas on how to do that?

[1]:
Device DE:1D:F3:3B:E4:B0 (random)
	Name: Logi M650
	Alias: Logi M650
	Appearance: 0x03c2
	Icon: input-mouse
	Paired: yes
	Trusted: yes
	Blocked: no
	Connected: no
	WakeAllowed: yes
	LegacyPairing: no
	UUID: Generic Access Profile    (00001800-0000-1000-8000-00805f9b34fb)
	UUID: Generic Attribute Profile (00001801-0000-1000-8000-00805f9b34fb)
	UUID: Device Information        (0000180a-0000-1000-8000-00805f9b34fb)
	UUID: Battery Service           (0000180f-0000-1000-8000-00805f9b34fb)
	UUID: Human Interface Device    (00001812-0000-1000-8000-00805f9b34fb)
	UUID: Logitech International SA (0000fd72-0000-1000-8000-00805f9b34fb)
	UUID: Vendor specific           (00010000-0000-1000-8000-011f2000046d)
	Modalias: usb:v046DpB02Ad0009
	ManufacturerData Key: 0x0006
	ManufacturerData Value:
  03 00 80                                         ...             
	ServiceData Key: 0000fd72-0000-1000-8000-00805f9b34fb
	ServiceData Value:
  10 01 01 2a b0 02 02 09                          ...*....        


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

* Re: Battery indication for Logitech devices
  2022-04-04 10:12     ` Bastien Nocera
@ 2022-05-02 17:05       ` marcoshalano
  2022-05-23 11:46       ` Bastien Nocera
  1 sibling, 0 replies; 6+ messages in thread
From: marcoshalano @ 2022-05-02 17:05 UTC (permalink / raw)
  To: Bastien Nocera, Nestor Lopez Casado, Filipe Laíns, HID CORE LAYER

On 04/04/2022 07:12, Bastien Nocera <hadess@hadess.net> wrote:
> On Mon, 2022-04-04 at 09:10 +0200, Nestor Lopez Casado wrote:
> > Hello,
> >
> > I've got this from asking internally:
> >
> > " The information should be accurate in both BAS and HIDPP
> > interfaces.
> > However, today the BAS interface is limited. Version  2.0 will be
> > better but not yet released. As you have access to the HIDPP, I
> > recommend using only this one. Like this, the type of connection can
> > be ignored (BLE or USB dongle) "
> 
> As per the patch I just sent (HID: logitech-hidpp: Add Signature M650),
> it will unfortunately be difficult to disable the battery reporting
> directly from bluetoothd.
> 
> We can detect whether a Bluetooth device supports HID++, as it has a
> GATT attribute with a Logitech specific UUID[1] (more info/specs
> welcome), but not all the HID++ capable Bluetooth devices seem to be
> detected by the kernel and they need to be added to a list.
> 
> Ideally, the kernel could enable HID++ support for all the Bluetooth
> HID++-capable devices, and we could easily block reporting in upower or
> bluetoothd without having to care at runtime about whether there's a
> separate battery reporting interface because we could assume it was
> always there.
> 
> Any ideas on how to do that?

Any ideas, anyone?
> 
> [1]:
> Device DE:1D:F3:3B:E4:B0 (random)
> 	Name: Logi M650
> 	Alias: Logi M650
> 	Appearance: 0x03c2
> 	Icon: input-mouse
> 	Paired: yes
> 	Trusted: yes
> 	Blocked: no
> 	Connected: no
> 	WakeAllowed: yes
> 	LegacyPairing: no
> 	UUID: Generic Access Profile    (00001800-0000-1000-8000-00805f9b34fb)
> 	UUID: Generic Attribute Profile (00001801-0000-1000-8000-00805f9b34fb)
> 	UUID: Device Information        (0000180a-0000-1000-8000-00805f9b34fb)
> 	UUID: Battery Service           (0000180f-0000-1000-8000-00805f9b34fb)
> 	UUID: Human Interface Device    (00001812-0000-1000-8000-00805f9b34fb)
> 	UUID: Logitech International SA (0000fd72-0000-1000-8000-00805f9b34fb)
> 	UUID: Vendor specific           (00010000-0000-1000-8000-011f2000046d)
> 	Modalias: usb:v046DpB02Ad0009
> 	ManufacturerData Key: 0x0006
> 	ManufacturerData Value:
>    03 00 80                                         ...
> 	ServiceData Key: 0000fd72-0000-1000-8000-00805f9b34fb
> 	ServiceData Value:
>    10 01 01 2a b0 02 02 09                          ...*....
> 
> 


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

* Re: Battery indication for Logitech devices
  2022-04-04 10:12     ` Bastien Nocera
  2022-05-02 17:05       ` marcoshalano
@ 2022-05-23 11:46       ` Bastien Nocera
  1 sibling, 0 replies; 6+ messages in thread
From: Bastien Nocera @ 2022-05-23 11:46 UTC (permalink / raw)
  To: Nestor Lopez Casado, Filipe Laíns; +Cc: Marcos Alano, HID CORE LAYER

On Mon, 2022-04-04 at 12:12 +0200, Bastien Nocera wrote:
> On Mon, 2022-04-04 at 09:10 +0200, Nestor Lopez Casado wrote:
> > Hello,
> > 
> > I've got this from asking internally:
> > 
> > " The information should be accurate in both BAS and HIDPP
> > interfaces.
> > However, today the BAS interface is limited. Version  2.0 will be
> > better but not yet released. As you have access to the HIDPP, I
> > recommend using only this one. Like this, the type of connection
> > can
> > be ignored (BLE or USB dongle) "
> 
> As per the patch I just sent (HID: logitech-hidpp: Add Signature
> M650),
> it will unfortunately be difficult to disable the battery reporting
> directly from bluetoothd.
> 
> We can detect whether a Bluetooth device supports HID++, as it has a
> GATT attribute with a Logitech specific UUID[1] (more info/specs
> welcome), but not all the HID++ capable Bluetooth devices seem to be
> detected by the kernel and they need to be added to a list.
> 
> Ideally, the kernel could enable HID++ support for all the Bluetooth
> HID++-capable devices, and we could easily block reporting in upower
> or
> bluetoothd without having to care at runtime about whether there's a
> separate battery reporting interface because we could assume it was
> always there.
> 
> Any ideas on how to do that?

Asking this again.

Is there a full list somewhere of all the Bluetooth devices that
support HID++ or a way to detect them so we can avoid the piecemeal
approach currently taken:
https://lore.kernel.org/linux-input/20220404100311.3304-1-hadess@hadess.net/

Once we know for certain what all those Logitech devices are, we can
start blocking them in upower or bluez.

Cheers

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

end of thread, other threads:[~2022-05-23 11:46 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-01  9:44 Battery indication for Logitech devices Marcos Alano
2022-04-01 16:08 ` Filipe Laíns
2022-04-04  7:10   ` Nestor Lopez Casado
2022-04-04 10:12     ` Bastien Nocera
2022-05-02 17:05       ` marcoshalano
2022-05-23 11:46       ` Bastien Nocera

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.