Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

linux receive miss 0x11 0x13 0x0d #26

Closed
itas109 opened this issue Apr 17, 2020 · 1 comment
Closed

linux receive miss 0x11 0x13 0x0d #26

itas109 opened this issue Apr 17, 2020 · 1 comment
Labels

Comments

@itas109
Copy link
Owner

itas109 commented Apr 17, 2020

Describe the bug
linux receive miss 0x11 0x13 0x0d

Desktop (please complete the following information):

  • OS: [e.g. DeepIn 15.11 64bit
  • Compiler: QT 5.12.6 GCC 6.3.0
  • Version: 4.0.2.200108
@itas109 itas109 added the bug label Apr 17, 2020
@itas109
Copy link
Owner Author

itas109 commented Apr 17, 2020

  • solution :
    because termios not set c_iflag
c_iflag &= ~( ICRNL | IXON);

0x11 VSTART(crtl-Q, ^Q)
0x13 VSTOP(crtl-S, ^S)

ICRNL 将输入的回车转化成换行 (0x0d => 0x0a)
IXON 允许输出时对XON/XOFF流进行控制 (0x11 0x13)

recommend set

term.c_cflag |= CLOCAL | CREAD;
term.c_lflag &= ~(ICANON | ECHO | ECHOE | ISIG);
term.c_oflag &= ~OPOST;
term.c_iflag &= ~(BRKINT | ICRNL | INPCK | ISTRIP | IXON);

termios.h c_cc characters

说 明 控制符
VINTR Interrupt Ctrl-c
VQUIT Quit Ctrl-/
VERASE Erase del
VKILL Kill @
VEOF End-of-file Ctrl-d
VMIN 非规范模式读取时的最小字符数
VEOL 附加的End-of-file CR
VEOL2 附加的End-of-file 2 LF
VTIME 非规范模式读取时的超时时间
VSTART Start Ctrl-q (XON)
VSTOP Stop Ctrl-s(XOFF)
VSUSP Suspend Ctrl-z

control characters

Seq Decimal Hex 缩写 字符名
  00 0x00 NUL Null (空)
^A 01 0x01 SOH Start of Heading (报头开始)
^B 02 0x02 STX Start of Text (正文开始)
^C 03 0x03 ETX End of Text (正文结束)
^D 04 0x04 EOT End of Transmission (传输结束)
^E 05 0x05 ENQ Enquiry (查询)
^F 06 0x06 ACK Acknowledge (确认)
^G 07 0x07 BEL Bell (振铃)
^H 08 0x08 BS Backspace (退格)
^I 09 0x09 HT Horizontal Tab (水平制表)
^J 10 0x0A LF Line Feed (换行)
^K 11 0x0B VT Vertical Tab (垂直制表)
^L 12 0x0C FF Form Feed (换页)
^M 13 0x0D CR Carriage Return (回车)
^N 14 0x0E SO Shift Out (移出)
^O 15 0x0F SI Shift In (移入)
^P 16 0x10 DLE Data Link Escape (数据链路转义)
^Q 17 0x11 DC1 Device Control 1 (设备控制1)
^R 18 0x12 DC2 Device Control 2 (设备控制2)
^S 19 0x13 DC3 Device Control 3 (设备控制3)
^T 20 0x14 DC4 Device Control 4 (设备控制4)
^U 21 0x15 NAK Negative Acknowledge (否认)
^V 22 0x16 SYN Synchronous Idle (同步空闲)
^W 23 0x17 ETB End of Transmission Block (传输块结束)
^X 24 0x18 CAN Cancel (取消)
^Y 25 0x19 EM End of Medium (介质结束)
^Z 26 0x1A SUB Substitute (替换)
^[ 27 0x1B ESC Escape (转义)
^\ 28 0x1C FS File Separator (文件分隔符)
^] 29 0x1D GS Group Separator (分组符)
^^ 30 0x1E RS Record Separator (记录分隔符)
^_ 31 0x1F US Unit Separator (单元分隔符)
  127 0x7F DEL Delete (删除)

itas109 added a commit that referenced this issue Apr 17, 2020
Signed-off-by: itas109 <itas109@qq.com>
@itas109 itas109 closed this as completed Apr 18, 2020
itas109 added a commit that referenced this issue Aug 30, 2020
Signed-off-by: itas109 <itas109@qq.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant