dotbot.adapter module
Module containing classes for interfacing with the DotBot gateway.
-
class dotbot.adapter.GatewayAdapterBase[source]
Bases: ABC
Base class for interface adapters.
-
abstract close()[source]
Close the interface.
-
abstract send_payload(destination, payload)[source]
Send payload to the interface.
- Parameters:
destination (int)
payload (Payload)
-
abstract async start(on_frame_received)[source]
Initialize the interface.
- Parameters:
on_frame_received (callable)
-
class dotbot.adapter.MarilibCloudAdapter(host, port, use_tls, network_id)[source]
Bases: GatewayAdapterBase
Class used to interface with Marilib.
- Parameters:
host (str)
port (int)
use_tls (bool)
network_id (int)
-
close()[source]
Close the interface.
-
send_payload(destination, payload)[source]
Send payload to the interface.
- Parameters:
destination (int)
payload (Payload)
-
async start(on_frame_received)[source]
Initialize the interface.
- Parameters:
on_frame_received (callable)
-
class dotbot.adapter.MarilibEdgeAdapter(port, baudrate, verbose=False)[source]
Bases: GatewayAdapterBase
Class used to interface with Marilib.
- Parameters:
port (str)
baudrate (int)
verbose (bool)
-
close()[source]
Close the interface.
-
send_payload(destination, payload)[source]
Send payload to the interface.
- Parameters:
destination (int)
payload (Payload)
-
async start(on_frame_received)[source]
Initialize the interface.
- Parameters:
on_frame_received (callable)
-
class dotbot.adapter.SerialAdapter(port, baudrate)[source]
Bases: GatewayAdapterBase
Class used to interface with the serial port.
- Parameters:
port (str)
baudrate (int)
-
close()[source]
Close the interface.
-
on_byte_received(byte)[source]
- Parameters:
byte (bytes)
-
send_payload(destination, payload)[source]
Send payload to the interface.
- Parameters:
destination (int)
payload (Payload)
-
async start(on_frame_received)[source]
Initialize the interface.
- Parameters:
on_frame_received (callable)