USB NFC readers, how can I capture sequence without assuming stdin?

Hello, I have 2 identical USB NFC cardreaders that I want to use on the same system but for different purposes. The devices act like a keyboard. From a scan, 10 digits + a newline appear on stdin of the active program, which is obviously always the same target for both readers.
Is there any way to distinguish them, so different programs can listen to a different reader? Can I redirect the target of the devices or capture the number sequence somewhere else?
 
I don't think so, because they will just appear as keyboards to FreeBSD, won't they?

What shows in /var/log/messages/dmesg as you plug and unplug them? If anything?
 
Then it seems to me that you have to look for some uniquely identifyable property value (i.e. one that is not "identical") that you can query. What comes to mind is a serial number. As hinted by richardtoohey2, one place to look for that is the dmesg-es or else look at pciconf(8)
They are very cheap Chinese products and exactly identical, as far as I can see. They appear like a US keyboard controller with a minimal Mifare Ultralight tag reader that is only capable of receving the ID. I now managed to distinguish them based on xinput that shows a different device Id per scanner and make it possible to capture sequences from both indepentenly. Not sure what it's based on. Strangely, the usb ugen devices are 0.4 and 0.9 while the device nmbers from xiinput are in opposite order 13 and 8. Currently running this as manual configuration but a way to associate an xinput device id with a physical usb port would be nice. Otherwise the usb scanners must be connected to particular ports all the time.
 
Back
Top