亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? serial_connect.c

?? 主要用于無線傳感網絡的編寫的書籍.對于初學者有著很大的用處
?? C
字號:
#include <stdio.h>   /* Standard input/output definitions */#include <string.h>  /* String function definitions */#include <unistd.h>  /* UNIX standard function definitions */#include <fcntl.h>   /* File control definitions */#include <errno.h>   /* Error number definitions */#include <termios.h> /* POSIX terminal control definitions */#include "../../debug/debug.h"   /* includes definitions for dbprintf */#include "serial_connect.h"/* see serial_connect.h for description */int g_serial_connect_port_open = SERIAL_PORT_CLOSED;int openSerialPort(char *serial_port_filepath) {  struct termios options;  int serial_port_fd;  if (g_serial_connect_port_open != SERIAL_PORT_CLOSED) {    return g_serial_connect_port_open;  }  if ((serial_port_fd = open(serial_port_filepath, O_RDWR | O_NOCTTY | O_NDELAY)) == -1) {    dbg(DBG_PHYSICAL, CRITICAL, "FATAL ERROR: open_port: Unable to open %s\n", serial_port_filepath);    serial_port_fd = -1;    return -1;  }  fcntl(serial_port_fd, F_SETFL, 0);  tcgetattr(serial_port_fd, &options); // get the current options for the port  cfsetispeed(&options, B57600);  // set input baud rate to 57600  cfsetospeed(&options, B57600);  // set output baud rate to 57600  options.c_cflag |= (CLOCAL | CREAD); // enable the receiver and set local mode  /* setting character size, not a straighforward thing */  options.c_cflag &= ~CSIZE; /* Mask the character size bits */  options.c_cflag |= CS8;    /* Select 8 data bits */  /* setting up parity: also not straightforward: options available are:     No parity (8N1):      options.c_cflag &= ~PARENB     options.c_cflag &= ~CSTOPB     options.c_cflag &= ~CSIZE;     options.c_cflag |= CS8;             Even parity (7E1):      options.c_cflag |= PARENB     options.c_cflag &= ~PARODD     options.c_cflag &= ~CSTOPB     options.c_cflag &= ~CSIZE;     options.c_cflag |= CS7;               Odd parity (7O1):      options.c_cflag |= PARENB     options.c_cflag |= PARODD     options.c_cflag &= ~CSTOPB     options.c_cflag &= ~CSIZE;     options.c_cflag |= CS7;               Space parity is setup the same as no parity (7S1):      options.c_cflag &= ~PARENB     options.c_cflag &= ~CSTOPB     options.c_cflag &= ~CSIZE;     options.c_cflag |= CS8;     I want no parity for MICA2 */  options.c_cflag &= ~PARENB;  options.c_cflag &= ~CSTOPB;  options.c_cflag &= ~CSIZE;  options.c_cflag |= CS8;#ifdef CNEW_RTSCTS  options.c_cflag &= ~CNEW_RTSCTS; // disable hardware flow control (to enable, remove the negation and change to |=)#endif  options.c_lflag &= ~(ICANON | ECHO | ECHOE | ISIG);  // make sure no processing is done on data: instead of "canonical" I want "raw"  /* Control input processing: the c_iflag     INPCK Enable parity check      IGNPAR Ignore parity errors      PARMRK Mark parity errors      ISTRIP Strip parity bits      IXON Enable software flow control (outgoing)      IXOFF Enable software flow control (incoming)      IXANY Allow any character to start flow again      IGNBRK Ignore break condition      BRKINT Send a SIGINT when a break condition is detected      INLCR Map NL to CR      IGNCR Ignore CR      ICRNL Map CR to NL      IUCLC Map uppercase to lowercase      IMAXBEL Echo BEL on input line too long  */  options.c_iflag &= ~(INPCK | IXON | IXOFF | ICRNL | INLCR | IMAXBEL | IGNBRK | ISTRIP);  options.c_iflag |= (IGNPAR | IXANY | IGNCR);  options.c_oflag &= ~OPOST; // for raw output, mask OPOST bit and all other flags (there are many) are ignored  /* NOTE: c_cc character array defines the bytecodes for various control characters: we don't care about them since we     masked the OPOST bit above */  /* timeouts: NOTE: Timeouts are ignored in canonical input mode or when the NDELAY option is set on the file via open or fcntl.     The VMIN and VTIME elements of the c_cc character array, are important since they     control how timeouts and minimum number of chracters work.     VMIN = minimum number of characters to read: if 0, then VTIME is taken as maximum time per character     VTIME = time to wait for first character if VMIN != 0, otherwise it specifies the time (in tenths of seconds) to wait for              incoming characters (set it to 0 if you want to block indefinitely)  */  options.c_cc[VMIN] = 0;  options.c_cc[VTIME] = BYTETIMEOUT;  /* Set the new options for the port...     TCSANOW: moke changes NOW, regardless of Tx or Rx state of port     TCSADRAIN: Wait until all transmission has finished to make changes     TCSAFLUSH: flush the input and output buffers, then make the change */  tcsetattr(serial_port_fd, TCSAFLUSH, &options);  g_serial_connect_port_open = serial_port_fd;  tcflush(serial_port_fd, TCIOFLUSH);  return serial_port_fd;}int closeSerialPort(int serial_port_fd) {  if (g_serial_connect_port_open == serial_port_fd && g_serial_connect_port_open != SERIAL_PORT_CLOSED) {    close(serial_port_fd);    return SUCCESS;  }  return FAILURE;}int flushInputPort(int serial_port_fd) {  tcflush(serial_port_fd, TCIFLUSH);  return SUCCESS;}int flushOutputPort(int serial_port_fd) {  tcflush(serial_port_fd, TCOFLUSH);  return SUCCESS;}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
精品视频一区二区三区免费| 欧美激情资源网| 欧美日本一区二区在线观看| 日本高清成人免费播放| 色偷偷成人一区二区三区91 | 91麻豆swag| 99精品桃花视频在线观看| 成人av在线播放网址| 亚洲国产精品高清| 亚洲一区二区精品视频| 日韩精品专区在线| 精品国产乱码久久久久久蜜臀| 日韩欧美一区中文| 日韩女同互慰一区二区| 欧美精品一区二区三区蜜桃 | 国产欧美综合在线| 国产精品进线69影院| 亚洲天堂av老司机| 一区二区三区在线观看动漫 | 99精品黄色片免费大全| 一本高清dvd不卡在线观看 | 国产女同性恋一区二区| 亚洲桃色在线一区| 亚洲综合成人网| 日韩高清在线电影| 国产在线视视频有精品| 不卡一区中文字幕| 色哟哟欧美精品| 91精品国模一区二区三区| 精品不卡在线视频| 国产精品久久久久一区| 亚洲综合色自拍一区| 日韩av一区二区三区| 国产麻豆9l精品三级站| 色诱亚洲精品久久久久久| 5566中文字幕一区二区电影| 2021久久国产精品不只是精品| 中文一区二区在线观看| 一区二区三区四区中文字幕| 免费一级片91| 成人动漫精品一区二区| 欧美剧情电影在线观看完整版免费励志电影| 欧美日韩免费视频| 久久99精品久久久久久| 成人午夜碰碰视频| 7878成人国产在线观看| 国产精品美女久久久久久久 | 99久久久免费精品国产一区二区| 欧美日韩国产系列| 国产亚洲精品免费| 图片区小说区区亚洲影院| 国产乱妇无码大片在线观看| 日本二三区不卡| 欧美精品一区二区三区在线| 亚洲三级理论片| 九九**精品视频免费播放| 91亚洲精品乱码久久久久久蜜桃| 日韩一区和二区| 国产精品第四页| 久久99精品一区二区三区三区| 91亚洲国产成人精品一区二三| 日韩午夜激情视频| 一区二区三区免费看视频| 国产精一品亚洲二区在线视频| 欧美最猛性xxxxx直播| 久久精品视频免费| 五月婷婷激情综合网| 99re成人精品视频| 久久美女高清视频| 日韩精品免费专区| 91偷拍与自偷拍精品| 亚洲精品一区二区三区精华液| 亚洲精品国产精品乱码不99| 国产夫妻精品视频| 日韩一区二区三区视频在线观看| 亚洲另类春色国产| 成人av网在线| 久久精品一二三| 毛片av一区二区| 欧美日本国产视频| 亚洲女厕所小便bbb| 国产一区视频网站| 欧美成人精品福利| 日韩福利视频网| 在线看日韩精品电影| 国产精品超碰97尤物18| 国产超碰在线一区| wwww国产精品欧美| 久久97超碰国产精品超碰| 91超碰这里只有精品国产| 亚洲自拍偷拍欧美| 91国偷自产一区二区三区成为亚洲经典| 欧美韩国一区二区| 国产成人在线观看免费网站| 精品美女在线播放| 久久se精品一区精品二区| 91麻豆精品91久久久久久清纯 | 91网址在线看| 亚洲图片欧美激情| a4yy欧美一区二区三区| 国产精品久久国产精麻豆99网站| 国产精品白丝jk黑袜喷水| 久久综合色鬼综合色| 久久影院午夜片一区| 精品一区二区在线播放| 欧美刺激午夜性久久久久久久| 免费在线看成人av| 亚洲精品一区二区三区香蕉| 久久99国产精品尤物| 久久一二三国产| 粉嫩av一区二区三区在线播放 | 国产suv精品一区二区883| 337p粉嫩大胆噜噜噜噜噜91av| 麻豆成人91精品二区三区| 91精品国产91久久综合桃花| 午夜激情一区二区| 欧美成人三级在线| 国产一区二区福利| 国产精品乱码一区二区三区软件| 成人午夜激情视频| 亚洲欧洲成人精品av97| 91麻豆国产自产在线观看| 国产精品久久影院| 色婷婷亚洲一区二区三区| 亚洲午夜一区二区三区| 色激情天天射综合网| 亚洲成a人片在线观看中文| 欧美日本高清视频在线观看| 奇米一区二区三区av| 精品对白一区国产伦| 成人avav在线| 亚洲综合免费观看高清完整版在线| 欧美日韩国产综合一区二区三区| 男女视频一区二区| 国产色91在线| 91香蕉视频mp4| 日韩黄色片在线观看| 精品乱人伦小说| 成人手机在线视频| 夜夜嗨av一区二区三区中文字幕| 欧美福利视频导航| 国产精品亚洲午夜一区二区三区 | 欧美日韩大陆一区二区| 久久99国内精品| 亚洲欧洲日产国产综合网| 欧洲一区在线电影| 精品一区二区在线观看| 亚洲欧美一区二区三区国产精品 | 国产黄色精品网站| 亚洲精品国产精品乱码不99| 欧美一区二区在线观看| 成人在线一区二区三区| 亚洲一区二区三区激情| 777a∨成人精品桃花网| 成人午夜视频网站| 日本中文字幕一区二区视频 | 成人综合婷婷国产精品久久免费| 亚洲综合一二三区| 国产欧美一区二区精品秋霞影院 | 国产精品丝袜91| 亚洲国产一区视频| 国产精品素人视频| 欧美高清性hdvideosex| 99re热这里只有精品免费视频| 日韩影视精彩在线| 最新国产成人在线观看| 337p亚洲精品色噜噜噜| 成人免费高清视频| 激情六月婷婷久久| 亚洲午夜电影在线观看| 欧美激情一区二区三区蜜桃视频| 日韩一区二区不卡| 日本韩国精品在线| 成人精品视频一区二区三区尤物| 欧美aaaaa成人免费观看视频| 国产精品久久久久精k8 | 九九视频精品免费| 亚洲在线视频网站| 日韩一区在线看| 久久久综合网站| 欧美一区二区在线视频| 一本大道久久a久久综合婷婷| 国产成人精品综合在线观看| 奇米影视一区二区三区小说| 一区二区三区日韩欧美| 国产精品女人毛片| 亚洲精品一区二区三区精华液| 制服.丝袜.亚洲.另类.中文| 91在线观看地址| 国产mv日韩mv欧美| 国产一区二区伦理| 蜜桃视频在线观看一区二区| 亚洲444eee在线观看| 亚洲欧美日韩国产综合在线| 中文字幕精品一区| www久久精品| 欧美va亚洲va| 精品国产91洋老外米糕| 欧美一区二区三区喷汁尤物| 欧美区一区二区三区|