ASIO?

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

ASIO?

Boost - Users mailing list

Hi,

 

I’m looking for a mechanism allowing me to enumerate serial (Com) ports on Windows/Mac. I also need to be able to retrieve the name of a given serial device. I’ve had a quick look at boost::asio, but it isn’t clear to me if it can do what I want.

 

I’d be grateful for any advice, including alternatives if boost and/or ASIO aren’t up to the job.

 

Best wishes.

 

Tim Burgess

Raised Bar Ltd.

E: [hidden email]

M: +44 (0)7989 486976

 


_______________________________________________
Boost-users mailing list
[hidden email]
https://lists.boost.org/mailman/listinfo.cgi/boost-users
Reply | Threaded
Open this post in threaded view
|

Re: ASIO?

Boost - Users mailing list

On windows, the easiest way is trying to open COM1, COM2 in sequence and see whether open succeeded.

If you’ll enumerate more than 10 ports, you should name them as \\.\COM10 etc.

 

 

From: Boost-users <[hidden email]> On Behalf Of Tim Burgess via Boost-users
Sent: Wednesday, September 5, 2018 12:46
To: boost-users list <[hidden email]>
Cc: [hidden email]
Subject: [Boost-users] ASIO?

 

Hi,

 

I’m looking for a mechanism allowing me to enumerate serial (Com) ports on Windows/Mac. I also need to be able to retrieve the name of a given serial device. I’ve had a quick look at boost::asio, but it isn’t clear to me if it can do what I want.

 

I’d be grateful for any advice, including alternatives if boost and/or ASIO aren’t up to the job.

 

Best wishes.

 

Tim Burgess

Raised Bar Ltd.

E: [hidden email]

M: +44 (0)7989 486976

 


_______________________________________________
Boost-users mailing list
[hidden email]
https://lists.boost.org/mailman/listinfo.cgi/boost-users
Reply | Threaded
Open this post in threaded view
|

Re: ASIO?

Boost - Users mailing list
In reply to this post by Boost - Users mailing list
The boost.asio is for communication, not for the hardware management, so in order to enumerate the port the program requires to call local API.

On Windows, check here


Once you have the port, just use boost.asio to communicate with it.

If you're not familiar with the usage of boost.asio, please read the tutorial and examples for the network applications, the serial port is the same.

Good luck.

On Wed, Sep 5, 2018 at 7:46 PM Tim Burgess via Boost-users <[hidden email]> wrote:

Hi,

 

I’m looking for a mechanism allowing me to enumerate serial (Com) ports on Windows/Mac. I also need to be able to retrieve the name of a given serial device. I’ve had a quick look at boost::asio, but it isn’t clear to me if it can do what I want.

 

I’d be grateful for any advice, including alternatives if boost and/or ASIO aren’t up to the job.

 

Best wishes.

 

Tim Burgess

Raised Bar Ltd.

E: [hidden email]

M: +44 (0)7989 486976

 

_______________________________________________
Boost-users mailing list
[hidden email]
https://lists.boost.org/mailman/listinfo.cgi/boost-users

_______________________________________________
Boost-users mailing list
[hidden email]
https://lists.boost.org/mailman/listinfo.cgi/boost-users