Topic : Legato TTY API sets ISTRIP for 8-bit parity framing with parity check
Tested on: FX30s (R13.1.001 & R14.04.002 firmware)
Legato versions: 16.10.1_eea67704afa1ebc0450d230baa84ac28_modified,
If serial device is opened in raw mode with 8bit parity checking with the Legato TTY api as in the below:
SerialPortFd = le_tty_Open( “/dev/ttyHSL0” , O_RDWR | O_NOCTTY | O_NDELAY );
le_tty_SetRaw(SerialPortFd, 1, 0);
le_tty_SetFraming(SerialPortFd, ‘E’, 8, 1);
…it will cause ISTRIP to be set for the device, which means the high bit will be cleared in read input - for example, the byte 0xAB will read out as 0x2B
This has been tested with modbus device in RS485 mode on fx30s. The sequence in which framing and raw mode is set doesn’t seem to matter.
I am not aware of a way to work around this problem from the legato TTY API, outside manually setting -istrip for the device from the command line.
Steps to reproduce:
Problem was encountered reading modbus device from legato app, but for the purpose of reproducing, it should be enough to set framing 8, ‘E’, 1 and raw mode (as per above), and verify with “stty -F /dev/ttyHSL0 -a” that istrip is enabled.
Using “stty -F /dev/ttyHSL0 -istrip” from the command line will cause incorrect readings to be correct when my legato app is running.