Initial Commit
This commit is contained in:
commit
eb3dc4338f
1 changed files with 18 additions and 0 deletions
18
main.py
Normal file
18
main.py
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
import sys
|
||||||
|
|
||||||
|
import bluetooth
|
||||||
|
|
||||||
|
def bluetooth_scan():
|
||||||
|
print('Discovering Bluetooth Devices...')
|
||||||
|
|
||||||
|
nearby_devices = bluetooth.discover_devices(duration=10, lookup_names=True, flush_cache=True, lookup_class=False)
|
||||||
|
|
||||||
|
print('Discovered {} devices:'.format(len(nearby_devices)))
|
||||||
|
for device in nearby_devices:
|
||||||
|
print(f'{device[0]}\t{device[1]}')
|
||||||
|
|
||||||
|
def main():
|
||||||
|
bluetooth_scan()
|
||||||
|
|
||||||
|
if (__name__ == "__main__"):
|
||||||
|
sys.exit(main())
|
Loading…
Add table
Reference in a new issue