Skip to content

Commit 1c8941d

Browse files
committed
Add docstring to __init__
1 parent 9bd4b8c commit 1c8941d

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

can/interfaces/socketcand/socketcand.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,28 @@ def connect_to_server(s, host, port):
7777

7878
class SocketCanDaemonBus(can.BusABC):
7979
def __init__(self, channel, host, port, tcp_tune=False, can_filters=None, **kwargs):
80+
"""Connects to a CAN bus served by socketcand.
81+
82+
It will attempt to connect to the server for up to 10s, after which a
83+
TimeoutError exception will be thrown.
84+
85+
If the handshake with the socketcand server fails, a CanError exception
86+
is thrown.
87+
88+
:param channel:
89+
The can interface name served by socketcand.
90+
An example channel would be 'vcan0' or 'can0'.
91+
:param host:
92+
The host address of the socketcand server.
93+
:param port:
94+
The port of the socketcand server.
95+
:param tcp_tune:
96+
This tunes the TCP socket for low latency (TCP_NODELAY, and
97+
TCP_QUICKACK).
98+
This option is not available under windows.
99+
:param can_filters:
100+
See :meth:`can.BusABC.set_filters`.
101+
"""
80102
self.__host = host
81103
self.__port = port
82104

0 commit comments

Comments
 (0)