Adafruit_CircuitPython_BLE/examples/ble_hid_central.py
Scott Shawcroft 3434bfa5d3
Tweaks based on feedback from Dan and Thea
This renames Smart* to BLE* and removes the smart recognition. It
is replaced by knowing the type of what we're interested at use
time only. Only printing Service lists is now dumber.

Interal variables to _bleio classes are now public as bleio_*
instead so that other classes in the library can access them and
its clearer what they are.
2019-11-01 11:48:34 -07:00

31 lines
695 B
Python

"""
Demonstration of a Bluefruit BLE Central. Connects to the first BLE HID peripheral it finds.
"""
# import time
# import board
# import adafruit_ble
# from adafruit_ble.services.standard.hid import HIDService
# from adafruit_ble.core.scanner import Scanner
# # This hasn't been updated.
# adafruit_ble.detect_service(HIDService)
# scanner = Scanner()
# while True:
# print("scanning")
# results = []
# while not results:
# results = scanner.scan(HIDService, timeout=4)
# peer = results[0].connect(timeout=10, pair=True)
# print(peer)
# print(peer.hid.protocol_mode)
# print(peer.hid.report_map)
# print(peer.hid.devices)
# time.sleep(0.2)