I am running openwrt, have minimum software installed.
When I plug keyboard device into the router, it launches hotplug event, executing the script for add/bind. I can know usbhid device is being attached, and its DEVPATH. The keyboard must have /dev/hidraw* device for it, which then I can access for identifying what is being pressed on the keyboard.
My problem is I can't find how to reliably match DEVPATH to the device file. Of course device file name is buried within the directory DEVPATH points to in /sys, but what is the logic? I may work backwards by taking major/minor of the device file and identify device paths and compare to current one being reported, but again there's another problem getting major/minor reliably.
Any help would be appreciated.
When I plug keyboard device into the router, it launches hotplug event, executing the script for add/bind. I can know usbhid device is being attached, and its DEVPATH. The keyboard must have /dev/hidraw* device for it, which then I can access for identifying what is being pressed on the keyboard.
My problem is I can't find how to reliably match DEVPATH to the device file. Of course device file name is buried within the directory DEVPATH points to in /sys, but what is the logic? I may work backwards by taking major/minor of the device file and identify device paths and compare to current one being reported, but again there's another problem getting major/minor reliably.
Any help would be appreciated.