Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix restart method in radiodriver.py. #504

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion cflib/crtp/radiodriver.py
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,7 @@ def __init__(self):
self.out_queue = None
self._thread = None
self.needs_resending = True
self.rate_limit = None

def connect(self, uri, link_quality_callback, link_error_callback):
"""
Expand All @@ -260,6 +261,7 @@ def connect(self, uri, link_quality_callback, link_error_callback):

devid, channel, datarate, address, rate_limit = self.parse_uri(uri)
self.uri = uri
self.rate_limit = rate_limit

if self._radio is None:
self._radio = RadioManager.open(devid)
Expand Down Expand Up @@ -383,7 +385,8 @@ def restart(self):
self.out_queue,
self.link_quality_callback,
self.link_error_callback,
self)
self,
self.rate_limit)
self._thread.start()

def close(self):
Expand Down
Loading