Skip to content

Commit

Permalink
Make pause after sending SDO request configurable (#429)
Browse files Browse the repository at this point in the history
  • Loading branch information
sveinse committed May 16, 2024
1 parent d38045f commit 6817066
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion canopen/sdo/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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

Expand Down

0 comments on commit 6817066

Please sign in to comment.