Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux? |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
07-15-2019, 10:31 PM
|
#1
|
LQ Newbie
Registered: Jun 2011
Posts: 5
Rep: 
|
How can I get a specific application to grab output of a specific usb hid source?
I have three applications, AppA, AppB and AppC, as well as three USB HID keyboard "wedge" barcode scanners, Left, Center, and Right. The scanners are running in continuous scan mode, whenever a barcode is visible, they send the code as an ascii string followed by a CR.
How can I get AppA to read only the Left scanner, AppB read Center, and AppC only read the Right scanner?
The default behavior is that one app has "focus" and all three scanners would dump data to that application, but then I can't tell which scanner saw any given barcode.
The applications would be in C for this project, if that matters, and the OS would likely be CentOS.
The greater application is robotics on the cheap, trying to do navigation in a known environment.
TY!
Last edited by Linuxmonger; 07-15-2019 at 10:33 PM.
|
|
|
07-16-2019, 08:21 AM
|
#2
|
LQ Guru
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (15 current), Slack15, Ubuntu studio, MX Linux, FreeBSD 13.1, WIn10
Posts: 10,342
|
That sounds like a complicated, tedious inside job to write out.
If it is Linux then linux is linux, and what distro should not matter that much if any.
It should be the desktop being used, or get right down inside of x.
I'd think you'd have to climb into the desktops abilities to tell you which window has focus, then somehow get inside of the app to see if it sent anything. OpenSource you should be able to modify any code to output what it is doing to somewhere else even.
say if you got an app sending data to something, just work in some code within that code to split it off and send you a message to somewhere else that you can get into without disrupting any processes, and inspect to see who is doing what.
I'd take that approach first, messing with the applications source code first to send me information of what it did and when and what else I'd want/need to know.
|
|
|
07-16-2019, 04:48 PM
|
#3
|
LQ Newbie
Registered: Jun 2011
Posts: 5
Original Poster
Rep: 
|
I'm trying to avoid using the desktop, or X.
The scanners don't provide any identity when they scan, simply spit out the barcode, so reading all three and trying to parse won't work.
If they were serial instead of universal serial, it would be simple, I could attach a process to ttyS0, another to ttyS1, and the last to ttyS2, and then I'd know which process read what scanner and when.
I'm hoping that there is a way to attach to the raw device without going through the HID portion so that I can treat the three sources as three separate sources.
|
|
|
All times are GMT -5. The time now is 08:57 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|