Reputation: 63
I want to develop an application where I have to interact with a GSM Modem and require to write AT Commands on the modem via the com port (USB) from a C++ program.
How can I access ports?
Upvotes: 0
Views: 3271
Reputation: 7378
So you have to study serial port communication first. not GSM communication...
I've arleady built a c++ serial port class. I'll release the source code on bitbucket soon, or you can download some serial port library such
boost::asio (cross-platoform)
QSerialPort (cross-platoform) it'll be part of QT 5.1.
CSerialPort (window only)
boost::asio is for asyncronous communication, it implements tcp/ip, udp/ip, serialport ecc... Bur require good knowledge of C++ programming.
I suggest you to learn better how serial port communication work. Look at wikipedia
Upvotes: 2
Reputation: 180303
You're looking for CreateFile
, which despite its name will also open COM ports. Just pass the COM port name instead of a filename.
Upvotes: 0
Reputation: 532
If you have the correct driver for your USB device, Windows will show your device as COM port (e.g COM3). You can access the COM port from your code, and manipulate the settings. Your question seems very generic about serial port, so I couldn't be specific. However, here is some help
http://msdn.microsoft.com/en-us/library/ff802693.aspx ,
Upvotes: 2