From: dave p. <dpe...@gm...> - 2023-01-16 13:03:00
|
Hi Stefan, It looks like in your case the slave board was already addressed as a listener before you started slave_test which is why you got the timeout. Here is a new version that deals with this case. It loops until it reads a string when addressed as a listener and then writes back that string when addressed as talker. If the read times out it prints "read timeout" and goes back to the loop. On the master side once a string has been written the response must be read before writing another. Are you using ibterm on the master or something else ? $ ./slave_test2 read timeout read timeout Got hello Got bye Got quit slave done $ cheers, -Dave On Sun, 15 Jan 2023 at 09:46, Stefan Olejnik <ste...@jh...> wrote: > Hi, Dave > > Thanks a lot for Your effort. > > I have tested Your program, but it is almost the same as I have used. The > result are as follows: > > root@imx8mm-var-dart:/home/stefan/bin# > root@imx8mm-var-dart:/home/stefan/bin# ./slave_test > [ 124.896503] tnt4882: minor 0 read timed out > [ 124.900712] tnt4882: read timed out > Got hello > [ 127.968496] tnt4882: write timed out > error: ibwrt fail > - EABO 6: Operation aborted > root@imx8mm-var-dart:/home/stefan/bin# ./slave_test > [ 187.105354] tnt4882: minor 0 read timed out > [ 187.109563] tnt4882: read timed out > Got *IDN? > > [ 190.177371] tnt4882: write timed out > error: ibwrt fail > - EABO 6: Operation aborted > root@imx8mm-var-dart:/home/stefan/bin# > > READING: > > Interesting is that during "ibrd" even read timeout is coming from > TNT4882, the data are read OK. I am using reading per char, till END or > END-OF-STRING => "\n" and I am getting no time-out during reading. > > WRITTING: > > First "ibwrt" is always time-outed, the second also, but data are > delivered, as I am already described. Therefore I am using short TIMO ( > e.g. 10ms ) for ibwrt, and on the receiver device is TIMO set to 3s, and I > am getting the data. Of course from second "ibwrt". > > Stefan. > > > |