I want to connect one or more Wii remotes for reading their inputs. From the output of cat /proc/bus/input/devices
I can extract data like Sysfs
and the input Handlers
. The Handers
information I use to read from the corresponding input device (e.g. from /dev/input/event17
). My question: how can I get the corresponding MAC addresses?
The output for one remote looks like:
N: Name="Nintendo Wii Remote"
P: Phys=
S: Sysfs=/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.2/2-1.2:1.0/bluetooth/hci0/hci0:3/0005:057E:0306.0009/input/input29
U: Uniq=
H: Handlers=kbd event17 js0
B: PROP=0
B: EV=200003
B: KEY=10800000 0 1003000000000006 0 0 168000000000 0
B: FF=107030000 0
(Once a remote is inactive for a while I like to disconnect it via bluetoothctl disconnect {MAC-address}
, but I need to distinguish between multiple remotes… And I don’t want to disconnect the wrong remote…)