Serial port reading from C ++ or Python on windows

I need to read the serial port from Windows using either Python or C ++. Which API / library should I use? Can you refer me to a textbook? Thanks!

+6
c ++ python windows serial-port
source share
4 answers

In python, you have a great pyserial package that should be cross-platform (I used only in GNU / Linux environment).

Give it a look, it is very easy to use, but very powerful!

Of course examples .

By the way, if this can be useful here , you can find my project that uses pyserial as an extended example.

+6
source share

In C ++:

There is also complete documentation on communication resources .

+5
source share

This is a classic Win32 serial communication article: http://msdn.microsoft.com/en-us/library/ms810467.aspx

+3
source share

In python, it is as simple as importing pyserial and using its open () method (if you are using a fairly standard system, otherwise you need to configure a number of parameters to suit your environment, of course).

EDIT:
As Enrico noted, pyserial is not the default package in many distributions, so you must install it yourself. I suggest installing and using easy-install , setuptools to process your python add-on packages.

+3
source share

All Articles