You are here:

C++/serial port communication using c++

Advertisement


Question
sir,
i have been asked to do serial port programming using C++

it should include opening port, close and view the status of the serial port. You should also be able to control speed, timeout,start bit,stop bit,parity bit and stuff like that

please provide me some solution in the form of sample programs,books or techniques..
since i am new to programming,i dont know from where and how should i start

regards,
mayuri

Answer
Serial port programming is somewhat platform specific. Since you are using VC++, I presume that you want to do this on the windows platform.

First get up to speed on the Win32 API for opening, reading and writing files.   
http://msdn.microsoft.com/en-us/library/bb540534%28v=vs.85%29.aspx

Then, read up on how to use those functions for serial port i/o.
http://msdn.microsoft.com/en-us/library/ms810467.aspx  

C++

All Answers


Answers by Expert:


Ask Experts

Volunteer


vijayan

Expertise

my primary areas of interest are generic and template metaprogramming, STL, algorithms, design patterns and c++11. i would not answer questions about gui and web programming.

Experience

about 15 years or so

Education/Credentials
post graduate engineer

©2016 About.com. All rights reserved.