Message ID | 20250424144831.95766-7-ludovico.denittis@collabora.com |
---|---|
State | Superseded |
Headers | show |
Series | Support Sixaxis gamepad with classic bonded only | expand |
Hi Ludovico, On Thu, Apr 24, 2025 at 10:50 AM Ludovico de Nittis <ludovico.denittis@collabora.com> wrote: > > After loading known devices from storage, change the security level if > we have a device with `CablePairing`. > This will allow it to successfully establish a connection. > --- > src/adapter.c | 7 +++++++ > 1 file changed, 7 insertions(+) > > diff --git a/src/adapter.c b/src/adapter.c > index fd425e6d2..8d875013c 100644 > --- a/src/adapter.c > +++ b/src/adapter.c > @@ -68,6 +68,7 @@ > #include "adv_monitor.h" > #include "eir.h" > #include "battery.h" > +#include "profiles/input/server.h" > > #define MODE_OFF 0x00 > #define MODE_CONNECTABLE 0x01 > @@ -5090,6 +5091,12 @@ free: > g_key_file_free(key_file); > } > > + if (btd_adapter_has_cable_pairing_devices(adapter)) { > + DBG("There is at least one known cable paired device, setting the " > + "listening input server security level accordingly"); > + server_set_cable_pairing(&adapter->bdaddr, true); > + } This creates a dependency on the input which is a plugin that can be excluded/not loaded at runtime, so we can't really do this at daemon core. > closedir(dir); > > load_link_keys(adapter, keys, btd_opts.debug_keys); > -- > 2.49.0 > >
Hi Ludovico, On Thu, Apr 24, 2025 at 11:10 AM Ludovico de Nittis <ludovico.denittis@collabora.com> wrote: > > Hi Luiz, > > On 4/24/25 4:57 PM, Luiz Augusto von Dentz wrote: > > Hi Ludovico, > > > > On Thu, Apr 24, 2025 at 10:50 AM Ludovico de Nittis > > <ludovico.denittis@collabora.com> wrote: > >> After loading known devices from storage, change the security level if > >> we have a device with `CablePairing`. > >> This will allow it to successfully establish a connection. > >> --- > >> src/adapter.c | 7 +++++++ > >> 1 file changed, 7 insertions(+) > >> > >> diff --git a/src/adapter.c b/src/adapter.c > >> index fd425e6d2..8d875013c 100644 > >> --- a/src/adapter.c > >> +++ b/src/adapter.c > >> @@ -68,6 +68,7 @@ > >> #include "adv_monitor.h" > >> #include "eir.h" > >> #include "battery.h" > >> +#include "profiles/input/server.h" > >> > >> #define MODE_OFF 0x00 > >> #define MODE_CONNECTABLE 0x01 > >> @@ -5090,6 +5091,12 @@ free: > >> g_key_file_free(key_file); > >> } > >> > >> + if (btd_adapter_has_cable_pairing_devices(adapter)) { > >> + DBG("There is at least one known cable paired device, setting the " > >> + "listening input server security level accordingly"); > >> + server_set_cable_pairing(&adapter->bdaddr, true); > >> + } > > This creates a dependency on the input which is a plugin that can be > > excluded/not loaded at runtime, so we can't really do this at daemon > > core. > > Do you have any suggestions on how to shuffle this around to avoid calling > `server_set_cable_pairing()` directly from `adapter.c`? Because in > theory that > should still happen after we ensured we loaded all devices from storage. We should probably evaluate this on probe, if the device has been marked with cable pairing flag then it should call server_set_cable_pairing, if we cannot evaluate it at that point then we need some callback mechanism to notify the plugin when the cable pairing property changes. > >> closedir(dir); > >> > >> load_link_keys(adapter, keys, btd_opts.debug_keys); > >> -- > >> 2.49.0 > >> > >> > > >
diff --git a/src/adapter.c b/src/adapter.c index fd425e6d2..8d875013c 100644 --- a/src/adapter.c +++ b/src/adapter.c @@ -68,6 +68,7 @@ #include "adv_monitor.h" #include "eir.h" #include "battery.h" +#include "profiles/input/server.h" #define MODE_OFF 0x00 #define MODE_CONNECTABLE 0x01 @@ -5090,6 +5091,12 @@ free: g_key_file_free(key_file); } + if (btd_adapter_has_cable_pairing_devices(adapter)) { + DBG("There is at least one known cable paired device, setting the " + "listening input server security level accordingly"); + server_set_cable_pairing(&adapter->bdaddr, true); + } + closedir(dir); load_link_keys(adapter, keys, btd_opts.debug_keys);