Skip to content
Snippets Groups Projects
Commit 113135af authored by Felix Gerking's avatar Felix Gerking
Browse files

rs485echo: Fix RS485 transmission delays

Before, the delay_rts_before_send delay_rts_after_send fields were not
explicitly initialized. This led to a erroneous transmission behaviour.
Now the RS485 port settings are read before the half duplex
configuration is done. This ensures that the delays are set to 0 or to
a predefined value (device tree).

BCS 746-000908
parent 6c671209
No related branches found
No related tags found
1 merge request!65rs485echo: Fix RS485 transmission delays
...@@ -259,6 +259,14 @@ setup() ...@@ -259,6 +259,14 @@ setup()
} }
if (use_rs485) { if (use_rs485) {
// Read current RS484 config
if (ioctl(fd, TIOCGRS485, &rs485) != 0)
{
tst_brkm(TBROK, cleanup,
"Unable to get RS485 config via ioctl %s. Error:%d, %s\n",
device_name, errno, strerror(errno));
}
// Enable RS485 half duplex mode // Enable RS485 half duplex mode
rs485.flags = SER_RS485_ENABLED | SER_RS485_RTS_ON_SEND; rs485.flags = SER_RS485_ENABLED | SER_RS485_RTS_ON_SEND;
if (ioctl(fd, TIOCSRS485, &rs485) != 0) if (ioctl(fd, TIOCSRS485, &rs485) != 0)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment