有人可以建议我用于串行端口通信的c ++库,它可以在x86和x86_64版本的OS上运行吗?

时间:2011-08-12 09:01:15

标签: c++ qt serial-port

有人可以建议我用于串口通信的c ++库,它可以在x86和x86_64版本的OS上运行吗?我使用过Java SerialIO但它在x86_64版本上崩溃了。

3 个答案:

答案 0 :(得分:2)

如果你想要c ++,那么QextSerialPort就是你的选择。

答案 1 :(得分:1)

在Linux上,也许,你会尝试“termios”

#include <termios.h>
#include <unistd.h> 

int tcgetattr(int fd, struct termios *termios_p); 

int tcsetattr(int fd, int optional_actions, const struct termios *termios_p); 

int tcsendbreak(int fd, int duration); 

int tcdrain(int fd); 

int tcflush(int fd, int queue_selector); 

int tcflow(int fd, int action); 

void cfmakeraw(struct termios *termios_p); 

speed_t cfgetispeed(const struct termios *termios_p); 

speed_t cfgetospeed(const struct termios *termios_p); 

int cfsetispeed(struct termios *termios_p, speed_t speed); 

int cfsetospeed(struct termios *termios_p, speed_t speed); 

答案 2 :(得分:1)