File tree Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -68,8 +68,11 @@ def on_message_received(self, msg):
6868 def get_message (self , timeout = 0.5 ):
6969 """
7070 Attempts to retrieve the latest message received by the instance. If no message is
71- available it blocks for 0.5 seconds or until a message is received (whichever
72- is shorter), and returns the message if there is one, or None if there is not.
71+ available it blocks for given timeout or until a message is received (whichever
72+ is shorter),
73+
74+ :param float timeout: The number of seconds to wait for a new message.
75+ :return: the :class:`~can.Message` if there is one, or None if there is not.
7376 """
7477 try :
7578 return self .buffer .get (block = True , timeout = timeout )
Original file line number Diff line number Diff line change @@ -46,11 +46,9 @@ def testLogger(self):
4646
4747 def testBufferedListenerReceives (self ):
4848 a_listener = can .BufferedReader ()
49- notifier = can .Notifier (self .bus , [a_listener ], 0.1 )
50- self .bus .send (generate_message (0xDADADA ))
49+ a_listener (generate_message (0xDADADA ))
5150 m = a_listener .get_message (0.2 )
5251 self .assertIsNotNone (m )
53- notifier .stop ()
5452
5553 def testAscListener (self ):
5654 a_listener = can .ASCWriter ("test.asc" )
You can’t perform that action at this time.
0 commit comments