@@ -14,23 +14,26 @@ class Message:
14
14
def __init__ (self , id , data , extended = False ):
15
15
"""Create a `Message` to send
16
16
17
- Args:
18
- id (int): The numeric ID of the message
19
- data (bytes): The content of the message
20
- extended (bool): True if the
21
- Raises:
22
- AttributeError: If `data` of type `bytes` is not provided for a non-RTR message
23
- AttributeError: If `data` is larger than 8 bytes
17
+ :param int id: The numeric ID of the message
18
+ :param bytes data: The content of the message, from 0 to 8 bytes of data
19
+ :param bool extended: True if the message has an extended identifier,
20
+ False if it has a standard identifier
24
21
"""
25
22
26
23
self ._data = None
27
24
self .id = id
28
25
self .data = data
29
26
self .extended = extended
30
27
28
+ id : int
29
+ """The numeric ID of the message"""
30
+
31
+ extended : bool
32
+ """Indicates whether the the message has an extended identifier"""
33
+
31
34
@property
32
35
def data (self ):
33
- """The content of the message, or dummy content in the case of an rtr """
36
+ """The content of the message"""
34
37
return self ._data
35
38
36
39
@data .setter
@@ -56,16 +59,24 @@ def __init__(self, id: int, length: int, *, extended: bool = False):
56
59
"""Construct a RemoteTransmissionRequest to send on a CAN bus
57
60
58
61
Args:
59
- id (int): The numeric ID of the requested message
60
- length (int): The length of the requested message
61
- extended (bool, optional): True if the message has an extended identifier, False if it\
62
- has a standard identifier. Defaults to False.
63
-
62
+ :param int id: The numeric ID of the message
63
+ :param length int: The length of the requested message
64
+ :param bool extended: True if the message has an extended identifier,
65
+ False if it has a standard identifier
64
66
"""
65
67
self .id = id
66
68
self .length = length
67
69
self .extended = extended
68
70
71
+ id : int
72
+ """The numeric ID of the message"""
73
+
74
+ extended : bool
75
+ """Indicates whether the the message has an extended identifier"""
76
+
77
+ length : int
78
+ """The length of the requested message, from 0 to 8"""
79
+
69
80
70
81
# Replace the above implementation with core canio implementation if it is available
71
82
try :
0 commit comments