#include <Serial.h>
Public Member Functions | |
BOOL | Open (const char *port, int nBaud=9600) |
Open connection to serial port. | |
BOOL | Close (void) |
Close the serial connection. | |
int | ReadData (void *, int) |
Read data from COM port. | |
int | SendData (const unsigned char *, int) |
Send data to the COM port. | |
int | ReadDataWaiting (void) |
Check for data waiting to be read. | |
BOOL | IsOpened (void) |
Protected Member Functions | |
BOOL | WriteCommByte (unsigned char) |
Protected Attributes | |
HANDLE | m_hIDComDev |
OVERLAPPED | m_OverlappedRead |
OVERLAPPED | m_OverlappedWrite |
BOOL | m_bOpened |
This is adapted from http://www.codeguru.com/cpp/i-n/network/serialcommunications/article.php/c2503
This version Copyright (c) 2008 by James Bremner All rights reserved.
Use license: Modified from standard BSD license.
Redistribution and use in source and binary forms are permitted provided that the above copyright notice and this paragraph are duplicated in all such forms and that any documentation, advertising materials, Web server pages, and other materials related to such distribution and use acknowledge that the software was developed by James Bremner. The name "James Bremner" may not be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
Close the serial connection.
|
|
Open connection to serial port.
|
|
Read data from COM port.
|
|
Check for data waiting to be read.
|
|
Send data to the COM port.
|