Skip to content

Commit 596abab

Browse files
Florian GeyerFlorian Geyer
authored andcommitted
fix thread overload while waiting for uds response
1 parent 5f17bb4 commit 596abab

3 files changed

Lines changed: 4 additions & 2 deletions

File tree

uds/uds_communications/TransportProtocols/Can/CanConnection.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ def __init__(self, callback, filter, bus, is_external=False):
2222
self.__is_external = is_external
2323
listener = can.Listener()
2424
listener.on_message_received = callback
25-
self.__notifier = can.Notifier(self.__bus, [listener], 0)
25+
self.__notifier = can.Notifier(self.__bus, [listener], 1.0)
2626
self.__listeners = [listener]
2727
self.addFilter(filter)
2828

uds/uds_communications/TransportProtocols/Can/CanConnectionFactory.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ def __call__(callback=None, filter=None, configPath=None, **kwargs):
8484
if CanConnectionFactory.bus:
8585
CanConnectionFactory.connections[connectionKey] = CanConnection(callback, filter, CanConnectionFactory.bus, True)
8686
else:
87-
serial = None;
87+
serial = None
8888
if 'serial' in CanConnectionFactory.config['vector']:
8989
if str(CanConnectionFactory.config['vector']['serial']).upper() == "AUTO":
9090
serial = CanConnectionFactory.detectVectorSerial()

uds/uds_communications/TransportProtocols/Can/CanTp.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -359,6 +359,8 @@ def decode_isotp(self, timeout_s=1, received_data=None, use_external_snd_rcv_fun
359359
timeoutTimer.restart()
360360
else:
361361
raise Exception("Unexpected PDU received")
362+
else:
363+
sleep(0.01)
362364

363365
if state == CanTpState.SEND_FLOW_CONTROL:
364366
txPdu[N_PCI_INDEX] = 0x30

0 commit comments

Comments
 (0)