You are not logged in.

#1 2025-11-21 13:28:21

ivanbrennan
Member
Registered: 2020-08-16
Posts: 3

Bluetooth device: udev bind occurs ~25s after sysfs attribute appears

I’m debugging a udev rule that sets a sysfs attribute (fn_lock) on a Bluetooth HID keyboard.

ACTION=="bind", SUBSYSTEM=="hid", ENV{HID_ID}=="0005:000017EF:000060E1", ATTR{fn_lock}="0"

The fn_lock attribute does not exist until shortly after (~1s) the "add" event occurs, which is why I'm matching on the "bind" event instead.

However, the "bind" event seems to be happening long after (~25s) the fn_lock attribute actually appears. I've used the following loop to see when fn_lock appears:

for i in {1..100}; do ls /sys/bus/hid/devices/*:17EF:*/fn_lock; sleep 0.2; done

I'm wondering why there's such a long delay. Is it possible this bluetooth UHID device is producing multiple HID interfaces and my udev rule is not matching the first one that binds?

Any other debugging suggestions are welcome and appreciated. Thanks!

Offline

Board footer

Powered by FluxBB