@@ -66,8 +66,10 @@ def __init__(
66
66
Any backend dependent configurations are passed in this dictionary
67
67
68
68
:raises ValueError: If parameters are out of range
69
- :raises can.CanInterfaceNotImplementedError: If the driver cannot be accessed
70
- :raises can.CanInitializationError: If the bus cannot be initialized
69
+ :raises ~can.exceptions.CanInterfaceNotImplementedError:
70
+ If the driver cannot be accessed
71
+ :raises ~can.exceptions.CanInitializationError:
72
+ If the bus cannot be initialized
71
73
"""
72
74
self ._periodic_tasks : List [_SelfRemovingCyclicTask ] = []
73
75
self .set_filters (can_filters )
@@ -81,9 +83,11 @@ def recv(self, timeout: Optional[float] = None) -> Optional[Message]:
81
83
:param timeout:
82
84
seconds to wait for a message or None to wait indefinitely
83
85
84
- :return: ``None`` on timeout or a :class:`Message` object.
86
+ :return:
87
+ :obj:`None` on timeout or a :class:`~can.Message` object.
85
88
86
- :raises can.CanOperationError: If an error occurred while reading
89
+ :raises ~can.exceptions.CanOperationError:
90
+ If an error occurred while reading
87
91
"""
88
92
start = time ()
89
93
time_left = timeout
@@ -148,7 +152,8 @@ def _recv_internal(
148
152
2. a bool that is True if message filtering has already
149
153
been done and else False
150
154
151
- :raises can.CanOperationError: If an error occurred while reading
155
+ :raises ~can.exceptions.CanOperationError:
156
+ If an error occurred while reading
152
157
:raises NotImplementedError:
153
158
if the bus provides it's own :meth:`~can.BusABC.recv`
154
159
implementation (legacy implementation)
@@ -171,7 +176,8 @@ def send(self, msg: Message, timeout: Optional[float] = None) -> None:
171
176
Might not be supported by all interfaces.
172
177
None blocks indefinitely.
173
178
174
- :raises can.CanOperationError: If an error occurred while sending
179
+ :raises ~can.exceptions.CanOperationError:
180
+ If an error occurred while sending
175
181
"""
176
182
raise NotImplementedError ("Trying to write to a readonly bus?" )
177
183
@@ -189,8 +195,8 @@ def send_periodic(
189
195
- the (optional) duration expires
190
196
- the Bus instance goes out of scope
191
197
- the Bus instance is shutdown
192
- - :meth:`BusABC. stop_all_periodic_tasks() ` is called
193
- - the task's :meth:`CyclicTask.stop() ` method is called.
198
+ - :meth:`stop_all_periodic_tasks` is called
199
+ - the task's :meth:`~can.broadcastmanager. CyclicTask.stop` method is called.
194
200
195
201
:param msgs:
196
202
Message(s) to transmit
@@ -204,7 +210,8 @@ def send_periodic(
204
210
Disable to instead manage tasks manually.
205
211
:return:
206
212
A started task instance. Note the task can be stopped (and depending on
207
- the backend modified) by calling the task's :meth:`stop` method.
213
+ the backend modified) by calling the task's
214
+ :meth:`~can.broadcastmanager.CyclicTask.stop` method.
208
215
209
216
.. note::
210
217
@@ -274,8 +281,8 @@ def _send_periodic_internal(
274
281
no duration is provided, the task will continue indefinitely.
275
282
:return:
276
283
A started task instance. Note the task can be stopped (and
277
- depending on the backend modified) by calling the :meth:`stop`
278
- method.
284
+ depending on the backend modified) by calling the
285
+ :meth:`~can.broadcastmanager.CyclicTask.stop` method.
279
286
"""
280
287
if not hasattr (self , "_lock_send_periodic" ):
281
288
# Create a send lock for this bus, but not for buses which override this method
@@ -288,7 +295,7 @@ def _send_periodic_internal(
288
295
return task
289
296
290
297
def stop_all_periodic_tasks (self , remove_tasks : bool = True ) -> None :
291
- """Stop sending any messages that were started using **bus. send_periodic** .
298
+ """Stop sending any messages that were started using :meth:` send_periodic` .
292
299
293
300
.. note::
294
301
The result is undefined if a single task throws an exception while being stopped.
0 commit comments