24 #ifndef HEMISSON_SERIAL_H
25 #define HEMISSON_SERIAL_H
30 #define HEMISSON_BAUDRATE "115200"
31 #define HEMISSON_DEFAULT_SERIAL_PORT "/dev/rfcomm0"
32 #define HEMISSON_BUFFER_LEN 255
33 #define HEMISSON_SERIAL_TIMEOUT_USECS 100000
35 #define TTYBUFFLEN 255
36 #define TTYBUFFSIZE (TTYBUFFLEN + 1)
41 HemissonSerial(
int debug = 0,
const char * port = HEMISSON_DEFAULT_SERIAL_PORT,
const char * rate = HEMISSON_BAUDRATE);
44 bool Open() {
return fd >0; };
45 int HemissonCommand(
char command,
int InCount,
int * InValues,
int OutCount,
int * OutValues);
51 char buffer[HEMISSON_BUFFER_LEN + 1];
53 int WriteInts(
char command,
int Count = 0,
int * Values = NULL);
54 int ReadInts(
char Header,
int Count = 0,
int * Values = NULL);
59 char ttybuf[TTYBUFFSIZE];
61 struct termios savetty;
64 char * m_gets(
int fd,
int tmout);
65 int m_getchar(
int fd,
int tmout);
66 void m_puts(
int fd,
const char * s);
67 void m_putchar(
int fd,
int chr);
68 void m_dtrtoggle(
int fd,
int sec);
72 void m_setparms(
int fd,
const char * baudr,
const char * par,
const char * bits,
const char * stopb,
int hwf,
int swf);
73 int serial_open(
const char * devname);
74 void serial_close(
int fd);
76 void m_sethwf(
int fd,
int on);
77 void m_setrts(
int fd);
78 void m_savestate(
int fd);
79 void m_restorestate(
int fd);
80 void m_nohang(
int fd);
81 void m_hupcl(
int fd,
int on);
Definition: hemisson_serial.h:39
static bool MatchMessage(player_msghdr_t *hdr, int type, int subtype, player_devaddr_t addr)
Helper for message processing.
Definition: message.h:159
A rectangular bounding box, used to define the size of an object.
Definition: player.h:255
double ReadFloat(int section, const char *name, double value)
Read a floating point (double) value.
Generic message header.
Definition: player.h:162
virtual int MainSetup(void)
Sets up the resources needed by the driver thread.
Definition: driver.h:658
virtual void MainQuit(void)
Cleanup method for driver thread (called when main exits)
Definition: driver.h:664
const char * ReadString(int section, const char *name, const char *value)
Read a string value.
virtual void Main(void)=0
Main method for driver thread.
int ReadInt(int section, const char *name, int value)
Read an integer value.
#define PLAYER_MSGTYPE_DATA
A data message.
Definition: player.h:95
#define PLAYER_MSGTYPE_RESP_ACK
A positive response message.
Definition: player.h:112
virtual int ProcessMessage(QueuePointer &resp_queue, player_msghdr *hdr, void *data)
Message handler.
#define PLAYER_MSGTYPE_REQ
A request message.
Definition: player.h:106
int ReadDeviceAddr(player_devaddr_t *addr, int section, const char *name, int code, int index, const char *key)
Read a device id.
Class for loading configuration file information.
Definition: configfile.h:197
A device address.
Definition: player.h:146
An autopointer for the message queue.
Definition: message.h:74
A pose in space.
Definition: player.h:229
#define PLAYER_ERROR(msg)
Definition: error.h:81
Base class for drivers which oeprate with a thread.
Definition: driver.h:553
#define PLAYER_MSGTYPE_CMD
A command message.
Definition: player.h:99
Base class for all drivers.
Definition: driver.h:109
#define PLAYER_WARN4(msg, a, b, c, d)
Definition: error.h:93
#define PLAYER_MSGQUEUE_DEFAULT_MAXLEN
Default maximum length for a message queue.
Definition: player.h:76