#include <errno.h>
#include <fcntl.h>
#include <string.h>
#include <termios.h>
#include <unistd.h>
Go to the source code of this file.
|
enum | SerialBaud {
SPABAUD_50 = B50,
SPABAUD_110 = B110,
SPABAUD_300 = B300,
SPABAUD_600 = B600,
SPABAUD_1200 = B1200,
SPABAUD_2400 = B2400,
SPABAUD_4800 = B4800,
SPABAUD_9600 = B9600,
SPABAUD_19200 = B19200,
SPABAUD_38400 = B38400,
SPABAUD_57600 = B57600,
SPABAUD_115200 = B115200
} |
|
enum | SerialDatabits { SPADATABITS_5 = CS5,
SPADATABITS_6 = CS6,
SPADATABITS_7 = CS7,
SPADATABITS_8 = CS8
} |
|
enum | SerialParity { SPAPARITY_NONE = 0,
SPAPARITY_ODD = PARODD | PARENB,
SPAPARITY_EVEN = PARENB
} |
|
enum | SerialProtocol { SPAPROTOCOL_NONE = 0,
SPAPROTOCOL_RTS_CTS = 9999,
SPAPROTOCOL_XON_XOFF = IXOFF | IXON
} |
|
enum | SerialStopbits { SPASTOPBITS_1 = 0,
SPASTOPBITS_2 = CSTOPB
} |
|
|
void | SerialFree (struct serial *sn) |
|
static enum SerialParity | SerialGetParity (const char *buf, int *ressize) |
|
static enum SerialProtocol | SerialGetProtocol (const char *buf, int *ressize) |
|
const char * | SerialInit (struct serial *sn, const char *Device, enum SerialBaud Baud, enum SerialStopbits StopBits, enum SerialProtocol Protocol, enum SerialParity Parity, enum SerialDatabits DataBits, int dowrite) |
|
int | SerialRead (struct serial *sn, char *buffer, size_t size) |
|
int | SerialWrite (struct serial *sn, const char *buffer, size_t size) |
|
#define SERIALDEFAULTDEVICE "/dev/ttyS0" |
Enumerator |
---|
SPABAUD_50 |
|
SPABAUD_110 |
|
SPABAUD_300 |
|
SPABAUD_600 |
|
SPABAUD_1200 |
|
SPABAUD_2400 |
|
SPABAUD_4800 |
|
SPABAUD_9600 |
|
SPABAUD_19200 |
|
SPABAUD_38400 |
|
SPABAUD_57600 |
|
SPABAUD_115200 |
|
Definition at line 10 of file serial.h.
Enumerator |
---|
SPADATABITS_5 |
|
SPADATABITS_6 |
|
SPADATABITS_7 |
|
SPADATABITS_8 |
|
Definition at line 15 of file serial.h.
Enumerator |
---|
SPAPARITY_NONE |
|
SPAPARITY_ODD |
|
SPAPARITY_EVEN |
|
Definition at line 19 of file serial.h.
Enumerator |
---|
SPAPROTOCOL_NONE |
|
SPAPROTOCOL_RTS_CTS |
|
SPAPROTOCOL_XON_XOFF |
|
Definition at line 21 of file serial.h.
Enumerator |
---|
SPASTOPBITS_1 |
|
SPASTOPBITS_2 |
|
Definition at line 17 of file serial.h.
void SerialFree |
( |
struct serial * |
sn | ) |
|
static enum SerialParity SerialGetParity |
( |
const char * |
buf, |
|
|
int * |
ressize |
|
) |
| |
|
static |
static enum SerialProtocol SerialGetProtocol |
( |
const char * |
buf, |
|
|
int * |
ressize |
|
) |
| |
|
static |
int SerialRead |
( |
struct serial * |
sn, |
|
|
char * |
buffer, |
|
|
size_t |
size |
|
) |
| |
int SerialWrite |
( |
struct serial * |
sn, |
|
|
const char * |
buffer, |
|
|
size_t |
size |
|
) |
| |