Echo serial port to console in C (windows)

Posted on 2010-01-06
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

    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

    LVL 86

    Accepted Solution

    Take a look at ("Serial Communications in Win32") - this article contains everything you need to know and also comes with full source code.

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Join & Write a Comment

    Suggested Solutions

    This article covers general Notes 8.5 troubleshooting information including recreating the Notes\Data folder.
    Healthcare organizations in the United States must adhere to the guidance of both the HIPAA (Health Insurance Portability and Accountability Act) and HITECH (Health Information Technology for Economic and Clinical Health Act) for securing and protec…
    Video by: Grant
    The goal of this video is to provide viewers with basic examples to understand and use nested-loops in the C programming language.
    Viewers will learn how to use the Hootsuite Dashboard.

    745 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

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now