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 1bc0f75 + 82c00ac commit 52f7488Copy full SHA for 52f7488
examples/ble_uart_echo_test.py
@@ -1,15 +1,19 @@
1
from adafruit_ble.uart import UARTServer
2
3
uart = UARTServer()
4
-uart.start_advertising()
5
-
6
-# Wait for a connection
7
-while not uart.connected:
8
- pass
9
10
-# When the client disconnects, the program will exit.
11
-while uart.connected:
12
- # Returns b'' if nothing was read.
13
- one_byte = uart.read(1)
14
- if one_byte:
15
- uart.write(one_byte)
+
+while True:
+ uart.start_advertising()
+ # Wait for a connection
+ while not uart.connected:
+ pass
+ while uart.connected:
+ # Returns b'' if nothing was read.
+ one_byte = uart.read(1)
+ if one_byte:
16
+ uart.write(one_byte)
17
18
+ # When disconnected, arrive here. Go back to the top
19
+ # and start advertising again.
0 commit comments