Skip to content

do not start advertising automatically; update examples; fix doc issues #8

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 24, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion adafruit_ble/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@

**Hardware:**

inline format: "* `Adafruit Feather nRF52840 Express <https://www.adafruit.com/product/4062>`_"
Adafruit Feather nRF52840 Express <https://www.adafruit.com/product/4062>

**Software and Dependencies:**

Expand Down
2 changes: 1 addition & 1 deletion adafruit_ble/beacon.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 0 additions & 2 deletions adafruit_ble/uart.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
9 changes: 9 additions & 0 deletions docs/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,12 @@

.. automodule:: adafruit_ble
:members:

.. automodule:: adafruit_ble.advertising
:members:

.. automodule:: adafruit_ble.beacon
:members:

.. automodule:: adafruit_ble.uart
:members:
3 changes: 2 additions & 1 deletion examples/ble_uart_echo_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)