LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
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


Reply
  Search this Thread
Old 07-15-2019, 10:31 PM   #1
Linuxmonger
LQ Newbie
 
Registered: Jun 2011
Posts: 5

Rep: Reputation: Disabled
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.
 
Old 07-16-2019, 08:21 AM   #2
BW-userx
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

Rep: Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242
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.
 
Old 07-16-2019, 04:48 PM   #3
Linuxmonger
LQ Newbie
 
Registered: Jun 2011
Posts: 5

Original Poster
Rep: Reputation: Disabled
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.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Rebinding usb hid devices to hid-generic driver fails onamatic Linux - Kernel 1 05-25-2014 09:46 AM
USB-xover-USB cable -- emulate USB HID -- hardware/driver options? dizzy13 Linux - Hardware 4 04-24-2013 08:24 PM
how to send datas to HID device?why I can only send two bytes data to HID device? wch_zj Linux - Software 1 01-05-2006 07:14 AM
USB hid.o hijacking my USB Printer Relativity Linux - Hardware 0 12-09-2003 08:56 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 05:51 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration