19. cc_virtual_can

19.1. Virtual Can Communication Channel

module:

cc_virtual_can

synopsis:

CChannel implementation for victual CAN using UDP multicast API from python-can

class pykiso.lib.connectors.cc_virtual_can.CCVirtualCan(channel='239.74.163.2', receive_own_messages=False, is_fd=True, enable_brs=False, is_extended_id=False, **kwargs)[source]

Constructor.

Parameters:
  • processing – deprecated, will not be taken into account.

  • auto_open – determine if the channel is automatically open.

_cc_close()[source]

Close the current can bus channel.

Return type:

None

_cc_open()[source]

Open a can bus channel.

Return type:

None

_cc_receive(timeout=0.0001)[source]

Receive a can message using configured filters.

Parameters:

timeout (float) – timeout applied on reception

Return type:

Dict[str, Union[bytes, int, None]]

Returns:

the received data and the source can id

_cc_send(msg, remote_id=None, **kwargs)[source]

Send a CAN message at the configured id.

If remote_id parameter is not given take configured ones

Parameters:
  • msg (bytes) – data to send

  • remote_id (Optional[int]) – destination can id used

  • kwargs – named arguments

Return type:

None