stucancommon.node module

CanNode.__init__(driver, address)[source]

Initialize Thread

Parameters:
  • driver (PythonCanDriver) – Relying can interface
  • address (int) – Node CAN address
class stucancommon.node.CanNode(driver, address)[source]

Bases: threading.Thread

This base class let a can node run in a single thread

driver

access low-level CAN bus

Type:PythonCanDriver
address

CAN node address

Type:int
services

a list of services

Type:list
isRunning

state of the CAN node

Type:boolean
add_service(handler)[source]

Add service handler to the CAN node

run()[source]

Override method from Thread to permanently read data on the CAN bus if CanNode.isRunning is True

stop()[source]

Set CanNode.isRunning boolean class variable to False

class stucancommon.node.Service[source]

Bases: object

This base class represents a service

classmethod from_bytes(buffer)[source]

Unpack Service data buffer

handle(source_address, destination_address, exeption=None)[source]

Method intended to be overriden by childs

exception stucancommon.node.Timeout[source]

Bases: Exception

This class rises timeout exceptions