11 #include <sys/types.h> 15 #include <sys/timeb.h> 106 if (
state_ != 0) {
return -1; }
130 std::string str_data = (
char *)data;
132 if (size != len) {
return -1; }
152 for (
int i = 0; i < len; i++) {
static void recv_proc_(void *arg)
int read_frame(unsigned char *data)
unsigned char UXBUS_PROT_FROMID_
int write_char(unsigned char ch)
int write_frame(unsigned char *data, int len)
void setTimeout(Timeout &timeout)
void parse_put(unsigned char *data, int len)
void setBaudrate(uint32_t baudrate)
unsigned char UXBUS_PROT_TOID_
unsigned char rx_buf_[128]
int read_char(unsigned char *ch)
int modbus_crc(unsigned char *data, int len)
SerialPort(const char *port, int baud, int que_num, int que_maxlen)
static Timeout simpleTimeout(uint32_t timeout)
int init_serial(const char *port, int baud)
void setPort(const std::string &port)
size_t read(uint8_t *buffer, size_t size)
size_t write(const uint8_t *data, size_t size)