QModbus how to drive RS485 TX direction
Unsolved
Mobile and Embedded
-
As for Chai18 in this topic
Re: Using 485 for QmodbusServer library
I'm working on a custom yocto linux embedded board that acts as modbus master by the use of QModbusRtuSerialMaster.
The code below works fine with direct access to the RS485 port:
void gpio::WriteData(QString stringa, int baud)
{
if(WaitFdWriteable(fd232))
{
setPin(uart1_dir,ON);
write(fd232,stringa.toLatin1().data(),stringa.length());
//tcdrain(fd232);
tcflush(fd232, TCIFLUSH);
QThread::usleep(10000000*stringa.length()/baud);
setPin(uart1_dir,OFF);
}
}
How can I drive the hardware "uart1_dir" GPIO pin for TX - RX direction in a similar way in QModbus libraries?
Thanks