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
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