SimpleRPC

class simple_rpc.simple_rpc.Interface(device: str, baudrate: int = 9600, wait: int = 2, autoconnect: bool = True, load: TextIO = None)

Generic simpleRPC interface wrapper.

Parameters
  • device – Device name.

  • baudrate – Baud rate.

  • wait – Time in seconds before communication starts.

  • autoconnect – Automatically connect.

  • load – Load interface definition from file.

class simple_rpc.simple_rpc.SerialInterface(device, baudrate=9600, wait=2, autoconnect=True, load=None)

Serial simpleRPC interface.

Parameters
  • device (str) – Device name.

  • baudrate (int) – Baud rate.

  • wait (int) – Time in seconds before communication starts.

  • autoconnect (bool) – Automatically connect.

  • load (Optional[TextIO]) – Load interface definition from file.

call_method(name, *args)

Execute a method.

Parameters
  • name (str) – Method name.

  • args (Any) – Method parameters.

Return type

Any

Returns

Return value of the method.

close()

Disconnect from device.

Return type

None

is_open()

Query interface state.

Return type

bool

open(handle=None)

Connect to device.

Parameters

handle (Optional[TextIO]) – Open file handle.

Return type

None

save(handle)

Save the interface definition to a file.

Parameters

handle (TextIO) – Open file handle.

Return type

None

class simple_rpc.simple_rpc.SocketInterface(device, baudrate=9600, wait=2, autoconnect=True, load=None)

Socket simpleRPC interface.

Parameters
  • device (str) – Device name.

  • baudrate (int) – Baud rate.

  • wait (int) – Time in seconds before communication starts.

  • autoconnect (bool) – Automatically connect.

  • load (Optional[TextIO]) – Load interface definition from file.

call_method(name, *args)

Execute a method.

Parameters
  • name (str) – Method name.

  • args (Any) – Method parameters.

Return type

Any

Returns

Return value of the method.

close()

Disconnect from device.

Return type

None

is_open()

Query interface state.

Return type

bool

open(handle=None)

Connect to device.

Parameters

handle (Optional[TextIO]) – Open file handle.

Return type

None

save(handle)

Save the interface definition to a file.

Parameters

handle (TextIO) – Open file handle.

Return type

None