File tree 2 files changed +5
-2
lines changed 2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change 1
1
#!/usr/bin/env python
2
2
3
3
import time
4
+
4
5
import can
5
6
6
7
7
8
def main ():
8
- with can .Bus (receive_own_messages = True ) as bus :
9
+ with can .Bus (interface = "virtual" , receive_own_messages = True ) as bus :
9
10
print_listener = can .Printer ()
10
- can .Notifier (bus , [print_listener ])
11
+ notifier = can .Notifier (bus , [print_listener ])
11
12
12
13
bus .send (can .Message (arbitration_id = 1 , is_extended_id = True ))
13
14
bus .send (can .Message (arbitration_id = 2 , is_extended_id = True ))
14
15
bus .send (can .Message (arbitration_id = 1 , is_extended_id = False ))
15
16
16
17
time .sleep (1.0 )
18
+ notifier .stop ()
17
19
18
20
19
21
if __name__ == "__main__" :
Original file line number Diff line number Diff line change @@ -25,6 +25,7 @@ def main():
25
25
bus .send (can .Message (arbitration_id = 1 , is_extended_id = False ))
26
26
27
27
time .sleep (1.0 )
28
+ notifier .stop ()
28
29
29
30
30
31
if __name__ == "__main__" :
You can’t perform that action at this time.
0 commit comments