开发者

Can somebody suggest me c++ library for serial port communicaiton which works on x86 and x86_64 versions of OS?

开发者 https://www.devze.com 2023-03-27 20:36 出处:网络
Can somebody suggest me c++ library for serial port communicaiton which works on x86 and x86_64 versions of OS ? I have used JavaSerialIO but it crashed o开发者_StackOverflown x86_64 versions.If you w

Can somebody suggest me c++ library for serial port communicaiton which works on x86 and x86_64 versions of OS ? I have used Java SerialIO but it crashed o开发者_StackOverflown x86_64 versions.


If you want c++ then QextSerialPort is your choise.


On linux ,maybe, u'll try "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); 


You can use the serial port interface of boost::asio

http://www.boost.org/doc/libs/1_47_0/doc/html/boost_asio/overview/serial_ports.html

0

精彩评论

暂无评论...
验证码 换一张
取 消