Echo serial port to console in C (windows)

Posted on 2010-01-06
Medium Priority
Last Modified: 2013-11-25
I am completely new to programming in C and am trying to access and read serial ports. I am trying to listen to COM1. What I am trying to do is to sit in a while loop and have the serial messages echoed to the console. Any help would be greatly appreciated. I am very new to C and do not understand very much of it. I am using the gcc compiler on a Windows XP machine.

Any help and/or code would be greatly appreciated

Thank you!
Question by:beavis601

Author Comment

ID: 26200878
To clarify, I want to be able to open a serial port and listen for incoming streams.

wait for messages to come in and send them to my own buffer to be echoed to the console
LVL 33

Assisted Solution

pgnatyuk earned 248 total points
ID: 26202661
LVL 86

Accepted Solution

jkr earned 252 total points
ID: 26202667
Take a look at http://msdn.microsoft.com/en-us/library/ms810467.aspx ("Serial Communications in Win32") - this article contains everything you need to know and also comes with full source code.

Featured Post

Get quick recovery of individual SharePoint items

Free tool – Veeam Explorer for Microsoft SharePoint, enables fast, easy restores of SharePoint sites, documents, libraries and lists — all with no agents to manage and no additional licenses to buy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Steps to fix error: “Couldn’t mount the database that you specified. Specified database: HU-DB; Error code: An Active Manager operation fail”
There can be many situations demanding the conversion of Outlook OST files to PST format and as such, there is no shortage of automated tools to perform this conversion. However, what makes Stellar OST to PST converter stand above the rest? Let us e…
The viewer will learn how to successfully download and install the SARDU utility on Windows 7, without downloading adware.
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question