Skip to content

Commit e0012f6

Browse files
committed
Document possible exceptions.
1 parent 4014b15 commit e0012f6

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

canopen/sync.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ def transmit(self, count: Optional[int] = None):
2222
2323
:param count:
2424
Counter to add in message.
25+
:raises ValueError:
26+
If the counter value does not fit in one byte.
2527
"""
2628
data = bytes([count]) if count is not None else b""
2729
self.network.send_message(self.cob_id, data)
@@ -31,6 +33,10 @@ def start(self, period: Optional[float] = None):
3133
3234
:param period:
3335
Period of SYNC message in seconds.
36+
:raises RuntimeError:
37+
If a periodic transmission is already started.
38+
:raises ValueError:
39+
If no period is set via argument nor the instance attribute.
3440
"""
3541
if self._task is not None:
3642
raise RuntimeError("Periodic SYNC transmission task already running")

0 commit comments

Comments
 (0)