flipback/rmodbus — pull request #31 by steveg-h (2013-11-22 21:59:08+00:00)
Title: Client-side thread safety and increased relience

This is the first of a set of patches to the rmodbus library, based on several years of field experience with rmodbus on embedded ruby platforms.

This commit pulls in 2 main features on the client side (they are intertwined in the way the code is written, which is why they are in a single commit, not in 2 separate commits).
- Thread safety: queries (request / response) lock the interface for the
smallest time possible while the query executes.
- Closer adherence to the modbus specifications in PDU send and receive.
This is necessary as noisy RS485 interfaces can fail at any point. The
revised code is much more resilient to a whole series of failure modes.
Additionally, the code is based on ruby 1.8.7 (as some embedded
platforms I have been working on do not support ruby 1.9 onwards, as
they have not got a working pthreads implementation).

As a result, a small number of tests have been removed as they are no
longer relevant, and other tests have been revised as the serial port
read / write sequences are slightly changes (some single bytes instead
of multiple bytes)

There are further commits to follow:
- server side improvements
- there is currently some ambiguity as I have been using a Logger based
logging in addition to the $stderr based log that the rmodbus library
uses. I plan to upgrade this, but it requires some more rewriting of the
test sequences