Public Member Functions | Private Member Functions | Private Attributes | List of all members
pyuavcan_v0.driver.slcan.SLCAN Class Reference
Inheritance diagram for pyuavcan_v0.driver.slcan.SLCAN:
Inheritance graph
[legend]

Public Member Functions

def __del__ (self)
 
def __init__ (self, device_name, kwargs)
 
def close (self)
 
def execute_cli_command (self, command, callback, timeout=None)
 
def receive (self, timeout=None)
 
def send (self, message_id, message, extended=False)
 
- Public Member Functions inherited from pyuavcan_v0.driver.common.AbstractDriver
def __init__ (self)
 
def add_io_hook (self, hook)
 

Private Member Functions

def _check_alive (self)
 
def _logging_proxy_loop (self)
 

Private Attributes

 _cli_command_requests
 
 _log_queue
 
 _logging_thread
 
 _proc
 
 _rx_queue
 
 _stopping
 
 _tx_queue
 

Additional Inherited Members

- Static Public Attributes inherited from pyuavcan_v0.driver.common.AbstractDriver
string FRAME_DIRECTION_INCOMING = 'rx'
 
string FRAME_DIRECTION_OUTGOING = 'tx'
 

Detailed Description

Driver for SLCAN-compatible CAN bus adapters, with extension to support CLI commands.

Some info on SLCAN can be found here:
    - Linux tree: drivers/net/can/slcan.c (http://lxr.free-electrons.com/source/drivers/net/can/slcan.c)
    - https://files.zubax.com/docs/Generic_SLCAN_API.pdf
    - http://www.can232.com/docs/canusb_manual.pdf
    - http://www.fischl.de/usbtin/

The CLI extension allows to execute arbitrary CLI commands on the adapter. The commands differ from regular SLCAN
exchange in the following ways:
    - CLI commands are echoed back.
    - Every output line of a CLI command, including echo, is terminated with CR LF (\r\n).
    - After the last line follows the ASCII End Of Text character (ETX, ^C, ASCII code 0x03) on a separate
      line (terminated with CR LF).
    - CLI commands must not begin with whitespace characters.
Example:
    Input command "stat\r\n" may produce the following output lines:
    - Echo: "stat\r\n"
    - Data: "First line\r\n", "Second line\r\n", ...
    - End Of Text marker: "\x03\r\n"
Refer to https://kb.zubax.com for more info.

Definition at line 588 of file slcan.py.

Constructor & Destructor Documentation

◆ __init__()

def pyuavcan_v0.driver.slcan.SLCAN.__init__ (   self,
  device_name,
  kwargs 
)

Definition at line 613 of file slcan.py.

◆ __del__()

def pyuavcan_v0.driver.slcan.SLCAN.__del__ (   self)

Definition at line 707 of file slcan.py.

Member Function Documentation

◆ _check_alive()

def pyuavcan_v0.driver.slcan.SLCAN._check_alive (   self)
private

Definition at line 711 of file slcan.py.

◆ _logging_proxy_loop()

def pyuavcan_v0.driver.slcan.SLCAN._logging_proxy_loop (   self)
private

Definition at line 669 of file slcan.py.

◆ close()

def pyuavcan_v0.driver.slcan.SLCAN.close (   self)

Definition at line 685 of file slcan.py.

◆ execute_cli_command()

def pyuavcan_v0.driver.slcan.SLCAN.execute_cli_command (   self,
  command,
  callback,
  timeout = None 
)
Executes an arbitrary CLI command on the SLCAN adapter, assuming that the adapter supports CLI commands.
The callback will be invoked from the method receive() using same thread.
If the command times out, the callback will be invoked anyway, with 'expired' flag set.
Args:
    command:    Command as unicode string or bytes
    callback:   A callable that accepts one argument.
        The argument is an instance of IPCCommandLineExecutionResponse
    timeout:    Timeout in seconds. None to use default timeout.

Definition at line 778 of file slcan.py.

◆ receive()

def pyuavcan_v0.driver.slcan.SLCAN.receive (   self,
  timeout = None 
)

Definition at line 715 of file slcan.py.

◆ send()

def pyuavcan_v0.driver.slcan.SLCAN.send (   self,
  message_id,
  message,
  extended = False 
)

Definition at line 769 of file slcan.py.

Member Data Documentation

◆ _cli_command_requests

pyuavcan_v0.driver.slcan.SLCAN._cli_command_requests
private

Definition at line 625 of file slcan.py.

◆ _log_queue

pyuavcan_v0.driver.slcan.SLCAN._log_queue
private

Definition at line 623 of file slcan.py.

◆ _logging_thread

pyuavcan_v0.driver.slcan.SLCAN._logging_thread
private

Definition at line 628 of file slcan.py.

◆ _proc

pyuavcan_v0.driver.slcan.SLCAN._proc
private

Definition at line 643 of file slcan.py.

◆ _rx_queue

pyuavcan_v0.driver.slcan.SLCAN._rx_queue
private

Definition at line 621 of file slcan.py.

◆ _stopping

pyuavcan_v0.driver.slcan.SLCAN._stopping
private

Definition at line 619 of file slcan.py.

◆ _tx_queue

pyuavcan_v0.driver.slcan.SLCAN._tx_queue
private

Definition at line 622 of file slcan.py.


The documentation for this class was generated from the following file:


uavcan_communicator
Author(s):
autogenerated on Wed Jan 11 2023 03:59:40