2. communication_auxiliary

2.1. CommunicationAuxiliary

module:

communication_auxiliary

synopsis:

Auxiliary used to send raw bytes via a connector instead of pykiso.Messages

class pykiso.lib.auxiliaries.communication_auxiliary.CommunicationAuxiliary(com, **kwargs)[source]

Auxiliary used to send raw bytes via a connector instead of pykiso.Messages.

Constructor.

Parameters:

com (CChannel) – CChannel that supports raw communication

clear_buffer()[source]

Clear buffer from old stacked objects

Return type:

None

receive_message(blocking=True, timeout_in_s=None)[source]

Receive a raw message.

Parameters:
  • blocking (bool) – wait for message till timeout elapses?

  • timeout_in_s (float) – maximum time in second to wait for a response

Return type:

Optional[bytes]

Returns:

raw message

run_command(cmd_message, cmd_data=None, blocking=True, timeout_in_s=None)[source]

Send a request by transmitting it through queue_in and populate queue_tx with the command verdict (successful or not).

Parameters:
  • cmd_message (Any) – command to send

  • cmd_data (Any) – data you would like to populate the command with

  • blocking (bool) – If you want the command request to be blocking or not

  • timeout_in_s (int) – Number of time (in s) you want to wait for an answer

Return type:

bool

Returns:

True if the request is correctly executed otherwise False

send_message(raw_msg, **kwargs)[source]

Send a raw message (bytes) via the communication channel.

Parameters:
  • raw_msg (bytes) – message to send

  • kwargs – additional arguments to be passed to the underlying connector

Return type:

bool

Returns:

True if command was executed otherwise False