flopz.listener.links package
Submodules
flopz.listener.links.all_links module
- get_all_links()
- get_link_by_name(name)
- Parameters
name (
str
) –
flopz.listener.links.socketcan_link module
- class SocketCanRxProcess(bound_socket, rx_queue, stop_event)
Bases:
multiprocessing.context.Process
Use a separate process to handle reading from the raw socket
- Parameters
rx_queue (
Queue
) –stop_event (
Event
) –
- run()
Method to be run in sub-process; can be overridden in sub-class
- class SocketcanLink(flopz_config, arg_parser)
Bases:
flopz.listener.link.Link
- Parameters
flopz_config (
dict
) –arg_parser (
Namespace
) –
- static add_argparse(parser)
Add a Link-specific argument group and arguments :type parser:
ArgumentParser
:param parser: :return: nothing
- get()
No matter if FD or not, the return value of this will always be the same binary format Protocols need to handle decoding the ID, length etc. :rtype:
bytes
:return: [4 byte id][1 byte lenght][$length bytes payload]
- static name()
override this to return a unique name for your link :rtype:
str
:return: a string containing a unique name for this link class
- put(payload)
Send some data over CAN. Make sure to format extended IDs correctly (needs arb_id |= 0x80000000) :type payload:
bytes
:param payload: bytes in the same binary format as get() returns :rtype:int
:return: number of bytes transferred
- start()
A non-blocking call that tells the Link to start listening and sending. Once the link has been started, it is ready to be used. :rtype:
None
:return: nothing
- stop()
A non-blocking call that tells the Link to stop Note that only when ‘state’ != RUNNING, the link can be considered fully stopped. :rtype:
None
:return: nothing
- exception SocketcanLinkException
Bases:
Exception