Serial port binary transfer changes carriage return

后端 未结 1 1902
遥遥无期
遥遥无期 2021-01-02 06:37

I have been trying to implement a primitive serial file transfer protocol in C this past week and I\'ve come across a really weird problem which I can\'t seem to find the so

相关标签:
1条回答
  • 2021-01-02 06:50

    Thank you so much it worked!! I never knew that there was the ICRNL option which translates line feeds to carriage returns. Once I set that and others off with

    tty.c_iflag &= ~(IGNBRK | BRKINT | PARMRK | ISTRIP | INLCR | IGNCR | ICRNL | IXON); //tty is the name of the struct termios
    

    it was golden.

    0 讨论(0)
提交回复
热议问题