Boost logo

Boost Users :

Subject: Re: [Boost-users] Read from serial devices on USB
From: Andrew Holden (aholden_at_[hidden])
Date: 2010-09-15 14:48:22


On Wednesday, September 15, 2010 2:17 PM, Alejandro Martínez wrote:
>
> I'm trying to communicate with a usb serial device plugged to a
> USB port. I've seen some examples with boost::asio and connecting to ie:
>
> /dev/ttyUSB0 for linux, or
> COM1 for windows
>
> etc.
>
> But i need something more robust and multiplatform. Like listing all the
> available devices and choosing by looking at the vendor id, or device id
> or something like that.
>
> How can i do that?

I'm not aware of any portable libraries to do this. Each operating system has its own proprietary interface to the USB stack, and these are sufficiently different from each other to make a portable abstraction difficult.

Even so, something like that might make a good boost library. Maybe built on top of asio...

> Can this same approach be used later for say... bluetooth serial devices? How?

I'm not sure. Do operating systems even keep their Bluetooth interface similar to the USB interface?


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net