-
Notifications
You must be signed in to change notification settings - Fork 219
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
If the HidApi disconnects, the instance will still exist but can no longer be used. We need a new instance, but only a single one can exist at a time. So we're locking it in a mutex to ensure mutable safety. Then if at some point communication errors because the instance is stale we will drop the existing instance by re-assignment of the inner struct field, and create a new working instance.
- Loading branch information
Showing
2 changed files
with
43 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters