Unsolved Using 485 for QmodbusServer library
I am using the QModbusServer library for implementation of slave device. I have tested this library and receive signal from the master device. However there is an issue regarding 485. Since it is a half duplex protocol, we need to switch the mode using GPIO pin.
Using the sample application which is given here . I am using imx6ul series embedded device with a custom Yocto build .
I am receiving correct signal from the master, I am not able to respond because I am not able to switch 485 into transmit mode.
How do I modify this code for 485 communication.
@jsulm where in the code do I switch the GPIO pin?
@jsulm Ok, let me rephrase it . QMobusRtuSerial is handling low level serial communication. The class is emitting a signal whenever it receives a frame. Is there a way to modify this behaviour.
In a nutshell where exactly in the code do I put my GPIO pin switch code.
Maybe you can override QModbusServer::processRequest() and do all work there.