modemd (RPC API)#

os.rpc.modem.list()#

List detected modems on all buses.

Returns:

A list of strings representing the modems.

Return type:

sequence

os.rpc.modem.open_(modem_name)#

Open a context to the given modem.

Parameters:

modem_name (string) – The name of the modem to open.

Returns:

A context to the modem.

Return type:

context

os.rpc.modem.modem.get_port_(port)#

Get a port.

Todo

The interest of having a context by port is to emit messages on every ports, so that programs interested in messages for a specific port only get events considering that specific port.

Parameters:

port (any) – The port identifier, as a string or number depending on the modem type.

os.rpc.modem.modem.list_open_ports()#

List opened ports.

Returns:

The list of opened ports.

Return type:

sequence

os.rpc.modem.modem_port.get_status()#

Get the status of the current port.

Returns:

true if the port is opened, false otherwise.

Return type:

bool

os.rpc.modem.modem_port.set_status(is_open)#

Set the status of the current port.

Parameters:

is_open (bool) – Should the port be opened?

os.rpc.modem.modem_port.emit(payload, src_port)#

Emit a non-adressed message to the given port.

Parameters:
  • payload (any) – The payload.

  • src_port (any) – The source port to display.

os.rpc.modem.modem_port.send(address, payload, src_port)#

Emit an adressed message to the given port. Note that all modem types do not support this method.

Parameters:
  • address (any) – Address of the host to which the message should be adressed.

  • payload (any) – The payload.

  • src_port (any) – The source port to display.

Todo

Develop and explain the modemd API.