You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/library/ubluetooth.rst
+82-48Lines changed: 82 additions & 48 deletions
Original file line number
Diff line number
Diff line change
@@ -6,8 +6,8 @@
6
6
7
7
This module provides an interface to a Bluetooth controller on a board.
8
8
Currently this supports Bluetooth Low Energy (BLE) in Central, Peripheral,
9
-
Broadcaster, and Observer roles, and a device may operate in multiple
10
-
roles concurrently.
9
+
Broadcaster, and Observer roles, as well as GATT Server and Client. A device
10
+
may operate in multiple roles concurrently.
11
11
12
12
This API is intended to match the low-level Bluetooth protocol and provide
13
13
building-blocks for higher-level abstractions such as specific device types.
@@ -70,8 +70,7 @@ Configuration
70
70
incoming events. This buffer is global to the entire BLE driver and so
71
71
handles incoming data for all events, including all characteristics.
72
72
Increasing this allows better handling of bursty incoming data (for
73
-
example scan results) and the ability for a central role to receive
74
-
larger characteristic values.
73
+
example scan results) and the ability to receive larger characteristic values.
75
74
76
75
Event Handling
77
76
--------------
@@ -99,10 +98,10 @@ Event Handling
99
98
# A central has disconnected from this peripheral.
100
99
conn_handle, addr_type, addr = data
101
100
elif event == _IRQ_GATTS_WRITE:
102
-
# A central has written to this characteristic or descriptor.
101
+
# A client has written to this characteristic or descriptor.
103
102
conn_handle, attr_handle = data
104
103
elif event == _IRQ_GATTS_READ_REQUEST:
105
-
# A central has issued a read. Note: this is a hard IRQ.
104
+
# A client has issued a read. Note: this is a hard IRQ.
106
105
# Return None to deny the read.
107
106
# Note: This event is not supported on ESP32.
108
107
conn_handle, attr_handle = data
@@ -153,13 +152,13 @@ Event Handling
153
152
# Note: Status will be zero on success, implementation-specific value otherwise.
154
153
conn_handle, value_handle, status = data
155
154
elif event == _IRQ_GATTC_NOTIFY:
156
-
# A peripheral has sent a notify request.
155
+
# A server has sent a notify request.
157
156
conn_handle, value_handle, notify_data = data
158
157
elif event == _IRQ_GATTC_INDICATE:
159
-
# A peripheral has sent an indicate request.
158
+
# A server has sent an indicate request.
160
159
conn_handle, value_handle, notify_data = data
161
160
elif event == _IRQ_GATTS_INDICATE_DONE:
162
-
# A central has acknowledged the indication.
161
+
# A client has acknowledged the indication.
163
162
# Note: Status will be zero on successful acknowledgment, implementation-specific value otherwise.
164
163
conn_handle, value_handle, status = data
165
164
@@ -249,28 +248,74 @@ Observer Role (Scanner)
249
248
explicitly stopped), the ``_IRQ_SCAN_DONE`` event will be raised.
250
249
251
250
252
-
Peripheral Role (GATT Server)
253
-
-----------------------------
251
+
Central Role
252
+
------------
253
+
254
+
A central device can connect to peripherals that it has discovered using the observer role (see :meth:`gap_scan<BLE.gap_scan>`) or with a known address.
0 commit comments