#include"serial.h"intserial_connect(constchar*devpath,longbaudrate){intfd;structtermiostty;// struct termios tty_old;// open deviceif((fd=open(devpath,O_RDWR|O_NOCTTY))<0){return-1;}// set parametersif(tcgetattr(fd,&tty)!=0){return-1;}// cfsetospeed(&tty, returnfd;}