[docs]classBusABC(object,metaclass=abc.ABCMeta):"""A base CAN bus."""def__init__(self,*args,**kwargs):pass
[docs]asyncdefopen(self,*args,**kwargs)->bool:"""Starts the bus. This method call the ``_open_internal`` method in the subclass bus, if present. It's meant mainly to initialise any process that needs to be run as a coroutine. Must return `True` if the connection was successful, `False` or an error otherwise. """returnawaitself._open_internal(*args,**kwargs)
asyncdef_open_internal(self):returnTrue
[docs]@abc.abstractmethodasyncdefget(self):"""Receives messages from the bus."""pass
[docs]@abc.abstractmethoddefsend(self,msg:Message,**kwargs):"""Sends a message to the bus."""pass