We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents a0433b3 + aefb063 commit 630b949Copy full SHA for 630b949
examples/ble_advertising_simpletest.py
@@ -0,0 +1,25 @@
1
+# SPDX-FileCopyrightText: 2022 Scott Shawcroft for Adafruit Industries
2
+# SPDX-License-Identifier: MIT
3
+
4
+"""
5
+Simple connectable name advertisement. No services.
6
7
8
+from adafruit_ble import BLERadio
9
10
+from adafruit_ble.advertising import Advertisement
11
12
+ble = BLERadio()
13
+advertisement = Advertisement()
14
+advertisement.short_name = "HELLO"
15
+advertisement.connectable = True
16
17
+while True:
18
+ print(advertisement)
19
+ ble.start_advertising(advertisement, scan_response=b"")
20
+ while not ble.connected:
21
+ pass
22
+ print("connected")
23
+ while ble.connected:
24
25
+ print("disconnected")
0 commit comments