bumble 0.0.211__py3-none-any.whl → 0.0.213__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- bumble/_version.py +2 -2
- bumble/a2dp.py +6 -0
- bumble/apps/README.md +0 -3
- bumble/apps/auracast.py +11 -9
- bumble/apps/bench.py +482 -31
- bumble/apps/console.py +5 -5
- bumble/apps/controller_info.py +47 -10
- bumble/apps/controller_loopback.py +7 -3
- bumble/apps/controllers.py +2 -2
- bumble/apps/device_info.py +2 -2
- bumble/apps/gatt_dump.py +2 -2
- bumble/apps/gg_bridge.py +2 -2
- bumble/apps/hci_bridge.py +2 -2
- bumble/apps/l2cap_bridge.py +2 -2
- bumble/apps/lea_unicast/app.py +6 -1
- bumble/apps/pair.py +204 -43
- bumble/apps/pandora_server.py +2 -2
- bumble/apps/rfcomm_bridge.py +1 -1
- bumble/apps/scan.py +2 -2
- bumble/apps/show.py +4 -2
- bumble/apps/speaker/speaker.html +1 -0
- bumble/apps/speaker/speaker.js +113 -62
- bumble/apps/speaker/speaker.py +126 -18
- bumble/at.py +4 -4
- bumble/att.py +15 -18
- bumble/avc.py +7 -7
- bumble/avctp.py +5 -5
- bumble/avdtp.py +138 -88
- bumble/avrcp.py +52 -58
- bumble/colors.py +2 -2
- bumble/controller.py +84 -23
- bumble/core.py +13 -7
- bumble/{crypto.py → crypto/__init__.py} +11 -95
- bumble/crypto/builtin.py +652 -0
- bumble/crypto/cryptography.py +84 -0
- bumble/device.py +688 -345
- bumble/drivers/__init__.py +2 -2
- bumble/drivers/common.py +0 -2
- bumble/drivers/intel.py +40 -40
- bumble/drivers/rtk.py +28 -35
- bumble/gatt.py +7 -9
- bumble/gatt_adapters.py +4 -5
- bumble/gatt_client.py +31 -34
- bumble/gatt_server.py +15 -17
- bumble/hci.py +2635 -2878
- bumble/helpers.py +4 -5
- bumble/hfp.py +76 -57
- bumble/hid.py +24 -12
- bumble/host.py +117 -34
- bumble/keys.py +68 -52
- bumble/l2cap.py +329 -403
- bumble/link.py +6 -270
- bumble/pairing.py +23 -20
- bumble/pandora/__init__.py +1 -1
- bumble/pandora/config.py +2 -2
- bumble/pandora/device.py +6 -6
- bumble/pandora/host.py +38 -39
- bumble/pandora/l2cap.py +4 -4
- bumble/pandora/security.py +73 -57
- bumble/pandora/utils.py +3 -3
- bumble/profiles/aics.py +3 -5
- bumble/profiles/ancs.py +3 -1
- bumble/profiles/ascs.py +143 -136
- bumble/profiles/asha.py +13 -8
- bumble/profiles/bap.py +3 -4
- bumble/profiles/csip.py +3 -5
- bumble/profiles/device_information_service.py +2 -2
- bumble/profiles/gap.py +2 -2
- bumble/profiles/gatt_service.py +1 -3
- bumble/profiles/hap.py +42 -58
- bumble/profiles/le_audio.py +4 -4
- bumble/profiles/mcp.py +16 -13
- bumble/profiles/vcs.py +8 -10
- bumble/profiles/vocs.py +6 -9
- bumble/rfcomm.py +27 -18
- bumble/rtp.py +1 -2
- bumble/sdp.py +2 -2
- bumble/smp.py +71 -69
- bumble/tools/rtk_util.py +2 -2
- bumble/transport/__init__.py +2 -16
- bumble/transport/android_netsim.py +5 -5
- bumble/transport/common.py +4 -4
- bumble/transport/pyusb.py +2 -2
- bumble/utils.py +2 -5
- bumble/vendor/android/hci.py +118 -200
- bumble/vendor/zephyr/hci.py +32 -27
- {bumble-0.0.211.dist-info → bumble-0.0.213.dist-info}/METADATA +5 -5
- {bumble-0.0.211.dist-info → bumble-0.0.213.dist-info}/RECORD +92 -93
- {bumble-0.0.211.dist-info → bumble-0.0.213.dist-info}/WHEEL +1 -1
- {bumble-0.0.211.dist-info → bumble-0.0.213.dist-info}/entry_points.txt +0 -1
- bumble/apps/link_relay/__init__.py +0 -0
- bumble/apps/link_relay/link_relay.py +0 -289
- bumble/apps/link_relay/logging.yml +0 -21
- {bumble-0.0.211.dist-info → bumble-0.0.213.dist-info}/licenses/LICENSE +0 -0
- {bumble-0.0.211.dist-info → bumble-0.0.213.dist-info}/top_level.txt +0 -0
bumble/gatt_server.py
CHANGED
|
@@ -29,13 +29,9 @@ import logging
|
|
|
29
29
|
from collections import defaultdict
|
|
30
30
|
import struct
|
|
31
31
|
from typing import (
|
|
32
|
-
Dict,
|
|
33
32
|
Iterable,
|
|
34
|
-
List,
|
|
35
33
|
Optional,
|
|
36
|
-
Tuple,
|
|
37
34
|
TypeVar,
|
|
38
|
-
Type,
|
|
39
35
|
TYPE_CHECKING,
|
|
40
36
|
)
|
|
41
37
|
|
|
@@ -103,13 +99,15 @@ GATT_SERVER_DEFAULT_MAX_MTU = 517
|
|
|
103
99
|
# GATT Server
|
|
104
100
|
# -----------------------------------------------------------------------------
|
|
105
101
|
class Server(utils.EventEmitter):
|
|
106
|
-
attributes:
|
|
107
|
-
services:
|
|
108
|
-
attributes_by_handle:
|
|
109
|
-
subscribers:
|
|
102
|
+
attributes: list[Attribute]
|
|
103
|
+
services: list[Service]
|
|
104
|
+
attributes_by_handle: dict[int, Attribute]
|
|
105
|
+
subscribers: dict[int, dict[int, bytes]]
|
|
110
106
|
indication_semaphores: defaultdict[int, asyncio.Semaphore]
|
|
111
107
|
pending_confirmations: defaultdict[int, Optional[asyncio.futures.Future]]
|
|
112
108
|
|
|
109
|
+
EVENT_CHARACTERISTIC_SUBSCRIPTION = "characteristic_subscription"
|
|
110
|
+
|
|
113
111
|
def __init__(self, device: Device) -> None:
|
|
114
112
|
super().__init__()
|
|
115
113
|
self.device = device
|
|
@@ -134,7 +132,7 @@ class Server(utils.EventEmitter):
|
|
|
134
132
|
def next_handle(self) -> int:
|
|
135
133
|
return 1 + len(self.attributes)
|
|
136
134
|
|
|
137
|
-
def get_advertising_service_data(self) ->
|
|
135
|
+
def get_advertising_service_data(self) -> dict[Attribute, bytes]:
|
|
138
136
|
return {
|
|
139
137
|
attribute: data
|
|
140
138
|
for attribute in self.attributes
|
|
@@ -158,7 +156,7 @@ class Server(utils.EventEmitter):
|
|
|
158
156
|
AttributeGroupType = TypeVar('AttributeGroupType', Service, Characteristic)
|
|
159
157
|
|
|
160
158
|
def get_attribute_group(
|
|
161
|
-
self, handle: int, group_type:
|
|
159
|
+
self, handle: int, group_type: type[AttributeGroupType]
|
|
162
160
|
) -> Optional[AttributeGroupType]:
|
|
163
161
|
return next(
|
|
164
162
|
(
|
|
@@ -184,7 +182,7 @@ class Server(utils.EventEmitter):
|
|
|
184
182
|
|
|
185
183
|
def get_characteristic_attributes(
|
|
186
184
|
self, service_uuid: UUID, characteristic_uuid: UUID
|
|
187
|
-
) -> Optional[
|
|
185
|
+
) -> Optional[tuple[CharacteristicDeclaration, Characteristic]]:
|
|
188
186
|
service_handle = self.get_service_attribute(service_uuid)
|
|
189
187
|
if not service_handle:
|
|
190
188
|
return None
|
|
@@ -313,11 +311,8 @@ class Server(utils.EventEmitter):
|
|
|
313
311
|
self.add_service(service)
|
|
314
312
|
|
|
315
313
|
def read_cccd(
|
|
316
|
-
self, connection:
|
|
314
|
+
self, connection: Connection, characteristic: Characteristic
|
|
317
315
|
) -> bytes:
|
|
318
|
-
if connection is None:
|
|
319
|
-
return bytes([0, 0])
|
|
320
|
-
|
|
321
316
|
subscribers = self.subscribers.get(connection.handle)
|
|
322
317
|
cccd = None
|
|
323
318
|
if subscribers:
|
|
@@ -347,10 +342,13 @@ class Server(utils.EventEmitter):
|
|
|
347
342
|
notify_enabled = value[0] & 0x01 != 0
|
|
348
343
|
indicate_enabled = value[0] & 0x02 != 0
|
|
349
344
|
characteristic.emit(
|
|
350
|
-
|
|
345
|
+
characteristic.EVENT_SUBSCRIPTION,
|
|
346
|
+
connection,
|
|
347
|
+
notify_enabled,
|
|
348
|
+
indicate_enabled,
|
|
351
349
|
)
|
|
352
350
|
self.emit(
|
|
353
|
-
|
|
351
|
+
self.EVENT_CHARACTERISTIC_SUBSCRIPTION,
|
|
354
352
|
connection,
|
|
355
353
|
characteristic,
|
|
356
354
|
notify_enabled,
|