Redistribution and use in source and binary forms, with or without modification, are permitted provided the following conditions are met:
THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Definition in file serialport.h.
#include "basictypes.h"
Go to the source code of this file.
Data Structures | |
struct | SERIALPORT_structObject |
The serial port data container. i.e. The serial port 'object'. More... | |
Enumerations | |
enum | SERIALPORT_enumBaudRate |
baud rate enumeration More... | |
enum | SERIALPORT_enumParity |
serial port parity enumeration. refer http://msdn.microsoft.com/en-us/library/aa363214(VS.85).aspx More... | |
enum | SERIALPORT_enumDataBits |
serial port data bits enumeration. More... | |
enum | SERIALPORT_enumStopBits |
serial port stop bits enumeration refer http://msdn.microsoft.com/en-us/library/aa363214(VS.85).aspx More... | |
enum | SERIALPORT_enumFlowControl |
serial port handshake enumeration More... | |
enum | SERIALPORT_enumBehaviour { SERIALPORT_BEHAVIOUR_WAIT_UNTIL_BYTES_DETECTED = 0, SERIALPORT_BEHAVIOUR_RETURN_IMMEDIATELY = 1 } |
The serial port behaviour during read operations. More... | |
Functions | |
BOOL | SERIALPORT_Initialize (SERIALPORT_structObject *serialport) |
Initialize a serial port 'object'. This does not open the serial port. Call this function after the declaration of the struct. | |
BOOL | SERIALPORT_Open (SERIALPORT_structObject *serialport) |
| |
BOOL | SERIALPORT_Close (SERIALPORT_structObject *serialport) |
| |
BOOL | SERIALPORT_Read (SERIALPORT_structObject *serialport, unsigned char *buffer, const unsigned int bytesAvailableInBuffer, unsigned int *bytesRead) |
BOOL | SERIALPORT_Write (SERIALPORT_structObject *serialport, const unsigned char *buffer, const unsigned int numberOfBytesToWrite) |
| |
BOOL | SERIALPORT_WaitOnRingIndicatorEvent (SERIALPORT_structObject *serialport, unsigned short timeout_ms, BOOL *ring_detected) |
|
The serial port behaviour during read operations.
Definition at line 153 of file serialport.h.
serial port parity enumeration. refer http://msdn.microsoft.com/en-us/library/aa363214(VS.85).aspx
Definition at line 72 of file serialport.h.
serial port stop bits enumeration refer http://msdn.microsoft.com/en-us/library/aa363214(VS.85).aspx
Definition at line 97 of file serialport.h.
BOOL SERIALPORT_Close | ( | SERIALPORT_structObject * | serialport | ) |
BOOL SERIALPORT_Initialize | ( | SERIALPORT_structObject * | serialport | ) |
Initialize a serial port 'object'. This does not open the serial port. Call this function after the declaration of the struct.
Definition at line 50 of file serialport.c.
BOOL SERIALPORT_Open | ( | SERIALPORT_structObject * | serialport | ) |
BOOL SERIALPORT_Read | ( | SERIALPORT_structObject * | serialport, | |
unsigned char * | buffer, | |||
const unsigned int | bytesAvailableInBuffer, | |||
unsigned int * | bytesRead | |||
) |
serialport | The serial port 'object'. |
buffer | A valid buffer in which to place data. |
bytesAvailableInBuffer | The maximum number of bytes avaiable in the buffer [bytes]. |
bytesRead | The number of bytes read and stored in the buffer [bytes]. |
Definition at line 310 of file serialport.c.
BOOL SERIALPORT_WaitOnRingIndicatorEvent | ( | SERIALPORT_structObject * | serialport, | |
unsigned short | timeout_ms, | |||
BOOL * | ring_detected | |||
) |
serialport | The serial port 'object'. |
timeout_ms | Wait for up to this timeout value [ms]. |
ring_detected | A boolean to indicate if a ring signal was detected. |
Definition at line 449 of file serialport.c.
BOOL SERIALPORT_Write | ( | SERIALPORT_structObject * | serialport, | |
const unsigned char * | buffer, | |||
const unsigned int | numberOfBytesToWrite | |||
) |
serialport | The serial port 'object'. |
buffer | A valid buffer containing the data to write. |
numberOfBytesToWrite | The number of bytes to write [bytes]. |
Definition at line 361 of file serialport.c.