diff --git a/examples/ble_advertising_simpletest.py b/examples/ble_advertising_simpletest.py new file mode 100644 index 0000000..2c2815e --- /dev/null +++ b/examples/ble_advertising_simpletest.py @@ -0,0 +1,25 @@ +# SPDX-FileCopyrightText: 2022 Scott Shawcroft for Adafruit Industries +# SPDX-License-Identifier: MIT + +""" +Simple connectable name advertisement. No services. +""" + +from adafruit_ble import BLERadio + +from adafruit_ble.advertising import Advertisement + +ble = BLERadio() +advertisement = Advertisement() +advertisement.short_name = "HELLO" +advertisement.connectable = True + +while True: + print(advertisement) + ble.start_advertising(advertisement, scan_response=b"") + while not ble.connected: + pass + print("connected") + while ble.connected: + pass + print("disconnected")