libHartwer - Documentation
Defines | Enumerations | Functions

bcs_com.h File Reference

Basic COM Port functions. More...

Go to the source code of this file.

Defines

#define BCS_COM_GPS_MOUSE   "/dev/ttyS2"
 Constant for opening the com port with gps mouse connected.
#define BCS_COM_GPS_SPEED   BCS_COM_B4800
 Constant for configuring speed for the "gps com port".
#define BCS_COM_TELEMETRY   "/dev/ttyS0"
 Constant for opening the com port the telemetry client is listening to.

Enumerations

enum  BCS_COM_speeds
 

use this enum to configure speed of a com port


Functions

void BCS_COM_closePort (BCS_comport *filedescriptor)
 Closes given COM port.
void BCS_COM_configSpeed (BCS_comport *filedescriptor, BCS_COM_speeds baudrate)
 Configures COM port with given speed and 8n1 bitmask.
BCS_ERROR BCS_COM_openPort (BCS_comport *fd, const char *port)
 Opens given COM port for input and output.
Int32 BCS_COM_read (BCS_comport *filedescriptor, char *data, size_t bytes)
 Reads available data from a COM port.
BCS_ERROR BCS_COM_write (BCS_comport *filedescriptor, char *data, size_t bytes)
 Writes given data to a COM port.

Detailed Description

Date:
18.03.2009
Author:
Marius Zwicker This file is providing functions to read from and write to COM ports

Function Documentation

void BCS_COM_configSpeed ( BCS_comport filedescriptor,
BCS_COM_speeds  baudrate 
)
Parameters:
filedescriptor
baudrateselected baudrate
BCS_ERROR BCS_COM_openPort ( BCS_comport fd,
const char *  port 
)
Parameters:
fdPointer to an unused BCS filedescriptor
portstring describing port to open
Returns:
BCS_ERR_OK, BCS_ERR_GENERAL, BCS_ERR_KEY_FAILURE
Int32 BCS_COM_read ( BCS_comport filedescriptor,
char *  data,
size_t  bytes 
)

If no data is available, it will wait until data is received.

Parameters:
filedescriptor
datapointer to a char/data array
bytesnumber of bytes you want to read max
Returns:
number of bytes actually read from port buffer, BCS_ERR_GENERAL on failure
BCS_ERROR BCS_COM_write ( BCS_comport filedescriptor,
char *  data,
size_t  bytes 
)
Parameters:
filedescriptor
datapointer to a char/data array
bytesnumber of bytes you want to write
Returns:
BCS_ERR_OK, BCS_ERR_GENERAL, BCS_ERR_SIZE

Generated on Fri Feb 11 2011 18:25:46 for libHartwer by Doxygen 1.7.3
Content © 2009-2011 Elefant Racing Bayreuth & MLBA (About) – Design © 2010 Emzeat. All Rights reserved.