Serial port monitoring

This is a discussion on Serial port monitoring within the C Programming forums, part of the General Programming Boards category; Does any one know of a way to monitor a serial port? I dont really need to send or receive ...

  1. #1
    Registered User
    Join Date
    Aug 2009
    Posts
    2

    Serial port monitoring

    Does any one know of a way to monitor a serial port? I dont really need to send or receive data I just need something that will tell me when a serial port is active or not (ie if the port is in use or not)

  2. #2

  3. #3
    Registered User
    Join Date
    Sep 2006
    Posts
    8,868
    How to monitor it depends on the OS, (and/or the BIOS if allowed), of course.

  4. #4
    Banned
    Join Date
    Aug 2010
    Location
    Ontario Canada
    Posts
    9,547
    For windows...

    Open the port with CreateFile()
    Check/set status bits with DeviceIoControl()
    Close the port with CloseHandle()

    If the port is busy, CreateFile() will fail.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Comodo Firewall Vulnerability (Port 0)
    By Mario F. in forum Tech Board
    Replies: 0
    Last Post: 11-11-2009, 07:56 AM
  2. serial port to poll on request
    By infineonintern in forum C++ Programming
    Replies: 2
    Last Post: 06-11-2009, 06:52 AM
  3. Can't Read From Serial Port
    By HalNineThousand in forum Linux Programming
    Replies: 14
    Last Post: 03-20-2008, 05:56 PM
  4. brace-enclosed error
    By jdc18 in forum C++ Programming
    Replies: 53
    Last Post: 05-03-2007, 05:49 PM
  5. DOS, Serial, and Touch Screen
    By jon_nc17 in forum A Brief History of Cprogramming.com
    Replies: 0
    Last Post: 01-08-2003, 03:59 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21