Boost logo

Boost Users :

Subject: Re: [Boost-users] Read from serial devices on USB
From: michi7x7 (mailing-lists_at_[hidden])
Date: 2010-09-15 14:30:18


  Hi,

> Hi,
>
> 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.
>
It's not possible to list devices or get OS-specific data, but you can
use the OS-API for that. native() will return the native type.
> How can i do that?
>
> Can this same approach be used later for say... bluetooth serial devices? How?
The devices are usually handled similar, thus they are presented as
"COM1" or "/dev/tty...". If the OS can load appropriate drivers, the API
will gain access automatically.
This abstraction also means, that you don't get access to the device
itself, only to the serial connection.
> Thank you all in advance.
>
> Alejandro
>
Regards,

michi7x7


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