diff --git a/adafruit_ble/__init__.py b/adafruit_ble/__init__.py index b4e24ba..47c2e21 100644 --- a/adafruit_ble/__init__.py +++ b/adafruit_ble/__init__.py @@ -33,7 +33,7 @@ **Hardware:** - inline format: "* `Adafruit Feather nRF52840 Express `_" + Adafruit Feather nRF52840 Express **Software and Dependencies:** diff --git a/adafruit_ble/beacon.py b/adafruit_ble/beacon.py index 601304b..c5a9e3b 100644 --- a/adafruit_ble/beacon.py +++ b/adafruit_ble/beacon.py @@ -74,7 +74,7 @@ def __init__(self, company_id, uuid, major, minor, rssi, interval=1.0): Example:: from adafruit_ble.beacon import LocationBeacon - from adafruit_ble.uuid import UUID + from bleio import UUID test_uuid = UUID('12345678-1234-1234-1234-123456789abc') test_company = 0xFFFF b = LocationBeacon(test_company, test_uuid, 123, 234, -54) diff --git a/adafruit_ble/uart.py b/adafruit_ble/uart.py index 0c16058..70a83c3 100644 --- a/adafruit_ble/uart.py +++ b/adafruit_ble/uart.py @@ -69,8 +69,6 @@ def __init__(self, timeout=1.0, buffer_size=64): self._rx_buffer = CharacteristicBuffer(self._nus_rx_char, timeout=timeout, buffer_size=buffer_size) - self._periph.start_advertising() - def start_advertising(self): """Start advertising the service. When a client connects, advertising will stop. When the client disconnects, restart advertising by calling ``start_advertising()`` again. diff --git a/docs/api.rst b/docs/api.rst index 6d61798..4a6cc0e 100644 --- a/docs/api.rst +++ b/docs/api.rst @@ -6,3 +6,12 @@ .. automodule:: adafruit_ble :members: + +.. automodule:: adafruit_ble.advertising + :members: + +.. automodule:: adafruit_ble.beacon + :members: + +.. automodule:: adafruit_ble.uart + :members: diff --git a/examples/ble_uart_echo_test.py b/examples/ble_uart_echo_test.py index 15222ff..9a1502c 100644 --- a/examples/ble_uart_echo_test.py +++ b/examples/ble_uart_echo_test.py @@ -7,8 +7,9 @@ while not uart.connected: pass +# When the client disconnects, the program will exit. while uart.connected: # Returns b'' if nothing was read. one_byte = uart.read(1) if one_byte: - uart.write(bytes([one_byte])) + uart.write(one_byte)