pnegre / python-whiteboard

Linux whiteboard in python
http://wiki.github.com/pnegre/python-whiteboard/
GNU General Public License v2.0
117 stars 23 forks source link

[Feature request] Possibility of using the newer kernel events? #22

Open parkerlreed opened 6 years ago

parkerlreed commented 6 years ago

For example on my Plus I get this when connecting from Bluez 5

[114301.190380] wiimote 0005:057E:0330.0059: detected device: Nintendo Wii Remote Plus (Gen 2)
[114301.190631] input: Nintendo Wii Remote Accelerometer as /devices/pci0000:00/0000:00:14.0/usb1/1-8/1-8:1.0/bluetooth/hci0/hci0:21/0005:057E:0330.0059/input/input168
[114301.190786] input: Nintendo Wii Remote IR as /devices/pci0000:00/0000:00:14.0/usb1/1-8/1-8:1.0/bluetooth/hci0/hci0:21/0005:057E:0330.0059/input/input169
[114301.190876] input: Nintendo Wii Remote as /devices/pci0000:00/0000:00:14.0/usb1/1-8/1-8:1.0/bluetooth/hci0/hci0:21/0005:057E:0330.0059/input/input167
[114301.287793] wiimote 0005:057E:0330.0059: detected extension: Nintendo Wii Motion Plus
[114301.287878] input: Nintendo Wii Remote Motion Plus as /devices/pci0000:00/0000:00:14.0/usb1/1-8/1-8:1.0/bluetooth/hci0/hci0:21/0005:057E:0330.0059/input/input170

Taking the IR entry and enumerating the folder shows

[parker@inspiron15 ~]$ ls /sys/devices/pci0000:00/0000:00:14.0/usb1/1-8/1-8:1.0/bluetooth/hci0/hci0:21/0005:057E:0330.0059/input/input169
capabilities  event24  modalias  phys   properties  uevent
device        id       name      power  subsystem   uniq

That event24 folder is the /dev/input/ mapping for that particular component (IR)

[parker@inspiron15 ~]$ cat /sys/devices/pci0000:00/0000:00:14.0/usb1/1-8/1-8:1.0/bluetooth/hci0/hci0:21/0005:057E:0330.0059/input/input169/event24/uevent
MAJOR=13
MINOR=88
DEVNAME=input/event24

If the dev node could be used, it would make it so the Wiimote could stay connected to host without having to go through the 1+2/SYNC pairing every single time.