Re: portable devices - USB - and other horrors

new topic     » goto parent     » topic index » view thread      » older message » newer message
jessedavis said...

I need some help. Devices in Euphoria. I need to interface with the keyboard and two additional serial (USB) devices. I do not have access to the machines nor do I know what else is attached to them. I need to know how (under Euphoria) to generate a list of system attached devices with device numbers or addresses

Depends on the OS. On Linux/GNU, this is trivial - just run a system() command to redirect the output of "lsusb -v" to a file. Then open and read and parse that file.

That said, you hint later below that this is for Windoze. So, you can use the wmic command to get similar information (albeit in a different but still human-readable format).

wmic path CIM_LogicalDevice where "Description like 'USB%'" get /value 

https://stackoverflow.com/questions/44433346/

jessedavis said...

that I can then use in an open(??,"r") instruction to attach to the device by generating a file number. Perhaps a system_exec() command to the system to generate a file which I can then open and parse?? Ultimately I want to to end up with a command:

sequence txt = gets(fn)

It's the "fn" that's causing the difficulty.

Much easier under Linux/GNU, which has a variety of ways to get to a USB device, e.g. /dev/bus/usb/addr1/addr2 or /dev/ttyUSB* specifically for serial devices or /dev/input/* for USB keyboards et al, and /dev/disk/by-id/usb* for usb disks and flashdrives.

For Windoze, "COMX:" would probably work for the serial devices. I'm not sure how you'd directly access a USB keyboard if you needed to do that. Assuming by "keyboard" you just mean standard input - gets(0) and friends are enough for that.

Hopefully the output of wmic would help you identify which COMX: port to use. (I don't have access to a Windoze box atm to test.)

jessedavis said...



Please remember that things like device_view, control panel\device_manager, or Windows Portable Devices, etc. will probably not work as user intervention is required. It's probably easy and I am overly complicating it!

Ah, the good old days of "com 2:"

Thanks in advance for any guidance you can offer.

Regards,
jd

Would help if we knew what you were specifically trying to do. Forward input from the keyboard into the two serial devices on a Windoze server?

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu