lewis.examples.simple_device
Members
A very simple device with TCP-stream interface |
- class lewis.examples.simple_device.VerySimpleInterface[source]
Bases:
StreamInterface
A very simple device with TCP-stream interface
The device has only one parameter, which can be set to an arbitrary value. The interface consists of five commands which can be invoked via telnet. To connect:
$ telnet host port
After that, typing either of the commands and pressing enter sends them to the server.
The commands are:
V
: Returns the parameter as part of a verbose message.V=something
: Sets the parameter tosomething
.P
: Returns the device parameter unmodified.P=something
: Exactly the same asV=something
.R
orr
: Returns the number 4.
- handle_error(request, error)[source]
Override this method to handle exceptions that are raised during command processing. The default implementation does nothing, so that any errors are silently ignored.
- Parameters:
request – The request that resulted in the error.
error – The exception that was raised.