소스 검색

Merge pull request #17 from Scanomat/master

Disabled input processing
Yeo Kheng Meng 6 년 전
부모
커밋
46a834e147
1개의 변경된 파일3개의 추가작업 그리고 0개의 파일을 삭제
  1. 3 0
      Sources/SwiftSerial.swift

+ 3 - 0
Sources/SwiftSerial.swift

@@ -299,6 +299,9 @@ public class SerialPort {
         settings.c_cflag &= ~tcflag_t(CSIZE)
         settings.c_cflag |= dataBitsSize.flagValue
 
+        //Disable input mapping of CR to NL, mapping of NL into CR, and ignoring CR
+        settings.c_iflag &= ~tcflag_t(ICRNL | INLCR | IGNCR)
+
         // Set hardware flow control flag
     #if os(Linux)
         if useHardwareFlowControl {