File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 88and reside in the same process will receive the same messages.
99"""
1010
11- import copy
11+ from copy import deepcopy
1212import logging
1313import time
1414try :
@@ -40,6 +40,8 @@ class VirtualBus(BusABC):
4040 Implements :meth:`can.BusABC._detect_available_configs`; see
4141 :meth:`can.VirtualBus._detect_available_configs` for how it
4242 behaves here.
43+
44+ The timeout when sending a message applies to each receiver.
4345 """
4446
4547 def __init__ (self , channel = None , receive_own_messages = False ,
@@ -82,13 +84,12 @@ def _recv_internal(self, timeout):
8284
8385 def send (self , msg , timeout = None ):
8486 self ._check_if_open ()
85- # Create a shallow copy for this channel
86- msg_copy = copy . copy (msg )
87+
88+ msg_copy = deepcopy (msg )
8789 msg_copy .timestamp = time .time ()
88- msg_copy .data = bytearray (msg .data )
89- msg_copy .channel = self .channel_id
90- all_sent = True
90+
9191 # Add message to all listening on this channel
92+ all_sent = True
9293 for bus_queue in self .channel :
9394 if bus_queue is not self .queue or self .receive_own_messages :
9495 try :
You can’t perform that action at this time.
0 commit comments