1. Connector Interface
1.1. Interface Definition for Connectors, CChannels and Flasher
- module
connector
- synopsis
Interface for a channel
- class pykiso.connector.CChannel(processing=False, **kwargs)[source]
Abstract class for coordination channel.
Constructor.
- Parameters
processing – if multiprocessing object is used.
- abstract _cc_receive(timeout, raw=False)[source]
How to receive something from the channel.
- Parameters
timeout (
float
) – Time to wait in second for a message to be receivedraw (
bool
) – send raw message without further work (default: False)
- Return type
dict
- Returns
message.Message() - If one received / None - If not
- abstract _cc_send(msg, raw=False, **kwargs)[source]
Sends the message on the channel.
- Parameters
msg (
Union
[Message
,bytes
,str
]) – Message to send outraw (
bool
) – send raw message without further work (default: False)kwargs – named arguments
- Return type
None
- cc_receive(timeout=0.1, raw=False)[source]
Read a thread-safe message on the channel and send an acknowledgement.
- Parameters
timeout (
float
) – time in second to wait for reading a messageraw (
bool
) – should the message be returned as pykiso.Message or sent as it is
- Return type
dict
- Returns
the received message
- cc_send(msg, raw=False, **kwargs)[source]
Send a thread-safe message on the channel and wait for an acknowledgement.
- Parameters
msg (
Union
[Message
,bytes
,str
]) – message to sendraw (
bool
) – should the message be converted as pykiso.Message or sent as it iskwargs – named arguments
- Return type
None
- class pykiso.connector.Connector(name=None)[source]
Abstract interface for all connectors to inherit from.
Defines hooks for opening and closing the connector and also defines a contextmanager interface.
Constructor.
- Parameters
name (
Optional
[str
]) – alias for the connector, used forrepr
and logging.
- class pykiso.connector.Flasher(binary=None, **kwargs)[source]
Interface for devices that can flash firmware on our targets.
Constructor.
- Parameters
binary (
Union
[str
,Path
,None
]) – binary firmware file- Raises
ValueError – if binary doesn’t exist or is not a file
TypeError – if given binary is None