Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d3622e9e authored by Girts Folkmanis's avatar Girts Folkmanis Committed by Mike Lockwood
Browse files

Disable output processing when opening serial port.

If post processing is not disabled, we end up translating LF to CRLF, which
makes binary protocols sad.
parent 28087c63
Loading
Loading
Loading
Loading
+2 −0
Original line number Original line Diff line number Diff line
@@ -146,6 +146,8 @@ android_hardware_SerialPort_open(JNIEnv *env, jobject thiz, jobject fileDescript
        memset(&tio, 0, sizeof(tio));
        memset(&tio, 0, sizeof(tio));


    tio.c_cflag =  speed | CS8 | CLOCAL | CREAD;
    tio.c_cflag =  speed | CS8 | CLOCAL | CREAD;
    // Disable output processing, including messing with end-of-line characters.
    tio.c_oflag &= ~OPOST;
    tio.c_iflag = IGNPAR;
    tio.c_iflag = IGNPAR;
    tio.c_lflag = 0; /* turn of CANON, ECHO*, etc */
    tio.c_lflag = 0; /* turn of CANON, ECHO*, etc */
    /* no timeout but request at least one character per read */
    /* no timeout but request at least one character per read */