|
Robot Agent
1.0
|
#include <stdio.h>#include <string.h>#include <stdlib.h>#include <unistd.h>#include <fcntl.h>#include <errno.h>#include <termios.h>#include "serialport.h"#include "def.h"Go to the source code of this file.
Functions | |
| serialport_t * | serialport_open (const char *name) |
| int | serialport_close (serialport_t *sps) |
| int | serialport_config (serialport_t *sps, unsigned int baud) |
| int | serialport_write (serialport_t *sps, unsigned char *data, unsigned int bytes) |
| int | serialport_byte (serialport_t *sps, unsigned char byte) |
| int | serialport_flush_input (serialport_t *sps) |
| int serialport_byte | ( | serialport_t * | sps, |
| unsigned char | byte | ||
| ) |
Write byte to serial port
| sps | Pointer to serial port structure |
| byte | Byte to be written |
Definition at line 178 of file serialport.c.
| int serialport_close | ( | serialport_t * | sps | ) |
Close serial port
| sps | Pointer to serial port structure |
Definition at line 58 of file serialport.c.
| int serialport_config | ( | serialport_t * | sps, |
| unsigned int | baud | ||
| ) |
Configure serial port
| sps | Pointer to serial port structure |
| baud | Baudrate of serial port communication |
Definition at line 82 of file serialport.c.
| int serialport_flush_input | ( | serialport_t * | sps | ) |
Flush input buffer
| sps | Pointer to serial port structure |
Definition at line 189 of file serialport.c.
| serialport_t* serialport_open | ( | const char * | name | ) |
Open serial port
| name | Serial port name ("/dev/tty...") |
Definition at line 33 of file serialport.c.
| int serialport_write | ( | serialport_t * | sps, |
| unsigned char * | data, | ||
| unsigned int | bytes | ||
| ) |
Write data to serial port
| sps | Pointer to serial port structure |
| data | Data to be written |
| bytes | Number of bytes to be written |
Definition at line 166 of file serialport.c.
1.8.5