FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
usbbluetooth-python/examples/reset_controllers.py at main · usbbluetooth/usbbluetooth-python · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
usbbluetooth
/
usbbluetooth-python
Public
Notifications
You must be signed in to change notification settings
Fork
2
Star
3
Code
Issues
2
Pull requests
0
Actions
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Security and quality
Insights
Expand file tree
Breadcrumbs
usbbluetooth-python
/
examples
/
reset_controllers.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
27 lines (22 loc) · 789 Bytes
Breadcrumbs
usbbluetooth-python
/
examples
/
reset_controllers.py
Copy path
File metadata and controls
27 lines (22 loc) · 789 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/usr/bin/env python
#
# SPDX-License-Identifier: GPL-3.0-only
# SPDX-FileCopyrightText: 2025 Antonio Vázquez Blanco <antoniovazquezblanco@gmail.com>
#
import
usbbluetooth
from
usbbluetooth
import
WrongDriverException
def
reset_controller
(
dev
):
try
:
with
dev
as
open_dev
:
print
(
f"Sending reset to
{
dev
}
"
)
# Send a reset command
open_dev
.
write
(
b"
\x01
\x03
\x0c
\x00
"
)
# Read the respose
response
=
open_dev
.
read
()
print
(
f"Got response:
{
response
}
"
)
except
WrongDriverException
:
print
(
f"Could not open
{
dev
}
, wrong driver. Use Zadig to install WinUSB driver."
)
# Get a list of all the available devices
devices
=
usbbluetooth
.
list_controllers
()
for
dev
in
devices
:
reset_controller
(
dev
)
Back
|
FazBrowse Home
|
New Git URL