From b1839f80a21e4aa4836b3fd86da19f5a30018413 Mon Sep 17 00:00:00 2001 From: Felix Divo Date: Mon, 15 Jul 2019 12:24:47 +0200 Subject: [PATCH] Document socketcan Adds some internal comments for the socketcan module. Removes a TODO that was placed there previously. --- can/interfaces/socketcan/socketcan.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/can/interfaces/socketcan/socketcan.py b/can/interfaces/socketcan/socketcan.py index b99124719..a0ee5c595 100644 --- a/can/interfaces/socketcan/socketcan.py +++ b/can/interfaces/socketcan/socketcan.py @@ -1,5 +1,12 @@ # coding: utf-8 +""" +The main module of the socketcan interface containing most user-facing classes and methods +along some internal methods. + +At the end of the file the usage of the internal methods is shown. +""" + import logging import ctypes import ctypes.util @@ -726,15 +733,14 @@ def _detect_available_configs(): if __name__ == "__main__": - # TODO move below to examples? - - # Create two sockets on vcan0 to test send and receive + # This example demonstrates how to use the internal methods of this module. + # It creates two sockets on vcan0 to test sending and receiving. # # If you want to try it out you can do the following (possibly using sudo): # # modprobe vcan # ip link add dev vcan0 type vcan - # ifconfig vcan0 up + # ip link set vcan0 up # log.setLevel(logging.DEBUG)