From 681706657f02fc3b41285678209f786562bc49be Mon Sep 17 00:00:00 2001 From: Svein Seldal Date: Thu, 16 May 2024 13:54:40 +0200 Subject: [PATCH] Make pause after sending SDO request configurable (#429) --- canopen/sdo/client.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/canopen/sdo/client.py b/canopen/sdo/client.py index 888d3af7..77b7ac9f 100644 --- a/canopen/sdo/client.py +++ b/canopen/sdo/client.py @@ -25,6 +25,9 @@ class SdoClient(SdoBase): #: Seconds to wait before sending a request, for rate limiting PAUSE_BEFORE_SEND = 0.0 + #: Seconds to wait after sending a request + PAUSE_AFTER_SEND = 0.1 + def __init__(self, rx_cobid, tx_cobid, od): """ :param int rx_cobid: @@ -53,7 +56,8 @@ def send_request(self, request): if not retries_left: raise logger.info(str(e)) - time.sleep(0.1) + if self.PAUSE_AFTER_SEND: + time.sleep(self.PAUSE_AFTER_SEND) else: break