B
boost_newbie
Hi
I'm implementing a serial RS232 communication centered application
using boost in Windows.
The user actions are translated to ASCII commands to be sent to some
serial devices connected to the serial ports, but as they are quite
slow, I had to implement a command queue, so that as soon as a command
gets its answer, it is cleared and the next one is sent, up to the end
of the queue (of course).
Using boost serial communication features, I realized that I needed an
extra time-out, because the devices are real slow.
So that this low speed doesn't lock up anything, the command queue
runs in a separate thread and I would like another thread to run a
timer, that could be activated when the command is send by the queue
thread, and deactivated by the same thread if it detects an answer
comming from the device in response to its command. If the timer is
due, it shoud send a signal or call a callback function in the queue
thread so it knows that the last command timed-out and it shoud re-
send it again.
All the queue things are OK (so it seems for now), I just need the
timer.
The ASIO timer is quite strange to me, I didn't manage to make it
work.
Any ideas?
Thanks a lot in advance
Francisco
I'm implementing a serial RS232 communication centered application
using boost in Windows.
The user actions are translated to ASCII commands to be sent to some
serial devices connected to the serial ports, but as they are quite
slow, I had to implement a command queue, so that as soon as a command
gets its answer, it is cleared and the next one is sent, up to the end
of the queue (of course).
Using boost serial communication features, I realized that I needed an
extra time-out, because the devices are real slow.
So that this low speed doesn't lock up anything, the command queue
runs in a separate thread and I would like another thread to run a
timer, that could be activated when the command is send by the queue
thread, and deactivated by the same thread if it detects an answer
comming from the device in response to its command. If the timer is
due, it shoud send a signal or call a callback function in the queue
thread so it knows that the last command timed-out and it shoud re-
send it again.
All the queue things are OK (so it seems for now), I just need the
timer.
The ASIO timer is quite strange to me, I didn't manage to make it
work.
Any ideas?
Thanks a lot in advance
Francisco