bumble 0.0.203__py3-none-any.whl → 0.0.204__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/apps/bench.py +2 -1
- bumble/apps/pair.py +13 -8
- bumble/apps/show.py +6 -6
- bumble/att.py +10 -11
- bumble/drivers/common.py +2 -0
- bumble/drivers/intel.py +593 -24
- bumble/gatt.py +32 -6
- bumble/gatt_server.py +12 -1
- bumble/hci.py +46 -23
- bumble/host.py +4 -1
- bumble/pairing.py +3 -0
- bumble/profiles/aics.py +34 -50
- bumble/profiles/bass.py +4 -7
- bumble/profiles/device_information_service.py +4 -1
- bumble/profiles/heart_rate_service.py +5 -6
- bumble/profiles/vocs.py +330 -0
- bumble/smp.py +7 -2
- bumble/tools/intel_fw_download.py +130 -0
- bumble/tools/intel_util.py +154 -0
- bumble/transport/usb.py +8 -2
- bumble/utils.py +20 -5
- bumble/vendor/android/hci.py +29 -4
- {bumble-0.0.203.dist-info → bumble-0.0.204.dist-info}/METADATA +1 -1
- {bumble-0.0.203.dist-info → bumble-0.0.204.dist-info}/RECORD +29 -26
- {bumble-0.0.203.dist-info → bumble-0.0.204.dist-info}/entry_points.txt +2 -0
- {bumble-0.0.203.dist-info → bumble-0.0.204.dist-info}/LICENSE +0 -0
- {bumble-0.0.203.dist-info → bumble-0.0.204.dist-info}/WHEEL +0 -0
- {bumble-0.0.203.dist-info → bumble-0.0.204.dist-info}/top_level.txt +0 -0
bumble/_version.py
CHANGED
bumble/apps/bench.py
CHANGED
|
@@ -199,7 +199,7 @@ def log_stats(title, stats, precision=2):
|
|
|
199
199
|
stats_min = min(stats)
|
|
200
200
|
stats_max = max(stats)
|
|
201
201
|
stats_avg = statistics.mean(stats)
|
|
202
|
-
stats_stdev = statistics.stdev(stats)
|
|
202
|
+
stats_stdev = statistics.stdev(stats) if len(stats) >= 2 else 0
|
|
203
203
|
logging.info(
|
|
204
204
|
color(
|
|
205
205
|
(
|
|
@@ -468,6 +468,7 @@ class Ping:
|
|
|
468
468
|
|
|
469
469
|
for run in range(self.repeat + 1):
|
|
470
470
|
self.done.clear()
|
|
471
|
+
self.ping_times = []
|
|
471
472
|
|
|
472
473
|
if run > 0 and self.repeat and self.repeat_delay:
|
|
473
474
|
logging.info(color(f'*** Repeat delay: {self.repeat_delay}', 'green'))
|
bumble/apps/pair.py
CHANGED
|
@@ -373,7 +373,9 @@ async def pair(
|
|
|
373
373
|
shared_data = (
|
|
374
374
|
None
|
|
375
375
|
if oob == '-'
|
|
376
|
-
else OobData.from_ad(
|
|
376
|
+
else OobData.from_ad(
|
|
377
|
+
AdvertisingData.from_bytes(bytes.fromhex(oob))
|
|
378
|
+
).shared_data
|
|
377
379
|
)
|
|
378
380
|
legacy_context = OobLegacyContext()
|
|
379
381
|
oob_contexts = PairingConfig.OobConfig(
|
|
@@ -381,16 +383,19 @@ async def pair(
|
|
|
381
383
|
peer_data=shared_data,
|
|
382
384
|
legacy_context=legacy_context,
|
|
383
385
|
)
|
|
384
|
-
oob_data = OobData(
|
|
385
|
-
address=device.random_address,
|
|
386
|
-
shared_data=shared_data,
|
|
387
|
-
legacy_context=legacy_context,
|
|
388
|
-
)
|
|
389
386
|
print(color('@@@-----------------------------------', 'yellow'))
|
|
390
387
|
print(color('@@@ OOB Data:', 'yellow'))
|
|
391
|
-
|
|
388
|
+
if shared_data is None:
|
|
389
|
+
oob_data = OobData(
|
|
390
|
+
address=device.random_address, shared_data=our_oob_context.share()
|
|
391
|
+
)
|
|
392
|
+
print(
|
|
393
|
+
color(
|
|
394
|
+
f'@@@ SHARE: {bytes(oob_data.to_ad()).hex()}',
|
|
395
|
+
'yellow',
|
|
396
|
+
)
|
|
397
|
+
)
|
|
392
398
|
print(color(f'@@@ TK={legacy_context.tk.hex()}', 'yellow'))
|
|
393
|
-
print(color(f'@@@ HEX: ({bytes(oob_data.to_ad()).hex()})', 'yellow'))
|
|
394
399
|
print(color('@@@-----------------------------------', 'yellow'))
|
|
395
400
|
else:
|
|
396
401
|
oob_contexts = None
|
bumble/apps/show.py
CHANGED
|
@@ -144,18 +144,18 @@ class Printer:
|
|
|
144
144
|
help='Format of the input file',
|
|
145
145
|
)
|
|
146
146
|
@click.option(
|
|
147
|
-
'--
|
|
147
|
+
'--vendor',
|
|
148
148
|
type=click.Choice(['android', 'zephyr']),
|
|
149
149
|
multiple=True,
|
|
150
150
|
help='Support vendor-specific commands (list one or more)',
|
|
151
151
|
)
|
|
152
152
|
@click.argument('filename')
|
|
153
153
|
# pylint: disable=redefined-builtin
|
|
154
|
-
def main(format,
|
|
155
|
-
for
|
|
156
|
-
if
|
|
154
|
+
def main(format, vendor, filename):
|
|
155
|
+
for vendor_name in vendor:
|
|
156
|
+
if vendor_name == 'android':
|
|
157
157
|
import bumble.vendor.android.hci
|
|
158
|
-
elif
|
|
158
|
+
elif vendor_name == 'zephyr':
|
|
159
159
|
import bumble.vendor.zephyr.hci
|
|
160
160
|
|
|
161
161
|
input = open(filename, 'rb')
|
|
@@ -180,7 +180,7 @@ def main(format, vendors, filename):
|
|
|
180
180
|
else:
|
|
181
181
|
printer.print(color("[TRUNCATED]", "red"))
|
|
182
182
|
except Exception as error:
|
|
183
|
-
logger.exception()
|
|
183
|
+
logger.exception('')
|
|
184
184
|
print(color(f'!!! {error}', 'red'))
|
|
185
185
|
|
|
186
186
|
|
bumble/att.py
CHANGED
|
@@ -57,6 +57,7 @@ if TYPE_CHECKING:
|
|
|
57
57
|
# pylint: disable=line-too-long
|
|
58
58
|
|
|
59
59
|
ATT_CID = 0x04
|
|
60
|
+
ATT_PSM = 0x001F
|
|
60
61
|
|
|
61
62
|
ATT_ERROR_RESPONSE = 0x01
|
|
62
63
|
ATT_EXCHANGE_MTU_REQUEST = 0x02
|
|
@@ -756,13 +757,13 @@ class AttributeValue:
|
|
|
756
757
|
def __init__(
|
|
757
758
|
self,
|
|
758
759
|
read: Union[
|
|
759
|
-
Callable[[Optional[Connection]],
|
|
760
|
-
Callable[[Optional[Connection]], Awaitable[
|
|
760
|
+
Callable[[Optional[Connection]], Any],
|
|
761
|
+
Callable[[Optional[Connection]], Awaitable[Any]],
|
|
761
762
|
None,
|
|
762
763
|
] = None,
|
|
763
764
|
write: Union[
|
|
764
|
-
Callable[[Optional[Connection],
|
|
765
|
-
Callable[[Optional[Connection],
|
|
765
|
+
Callable[[Optional[Connection], Any], None],
|
|
766
|
+
Callable[[Optional[Connection], Any], Awaitable[None]],
|
|
766
767
|
None,
|
|
767
768
|
] = None,
|
|
768
769
|
):
|
|
@@ -821,13 +822,13 @@ class Attribute(EventEmitter):
|
|
|
821
822
|
READ_REQUIRES_AUTHORIZATION = Permissions.READ_REQUIRES_AUTHORIZATION
|
|
822
823
|
WRITE_REQUIRES_AUTHORIZATION = Permissions.WRITE_REQUIRES_AUTHORIZATION
|
|
823
824
|
|
|
824
|
-
value:
|
|
825
|
+
value: Any
|
|
825
826
|
|
|
826
827
|
def __init__(
|
|
827
828
|
self,
|
|
828
829
|
attribute_type: Union[str, bytes, UUID],
|
|
829
830
|
permissions: Union[str, Attribute.Permissions],
|
|
830
|
-
value:
|
|
831
|
+
value: Any = b'',
|
|
831
832
|
) -> None:
|
|
832
833
|
EventEmitter.__init__(self)
|
|
833
834
|
self.handle = 0
|
|
@@ -845,11 +846,7 @@ class Attribute(EventEmitter):
|
|
|
845
846
|
else:
|
|
846
847
|
self.type = attribute_type
|
|
847
848
|
|
|
848
|
-
|
|
849
|
-
if isinstance(value, str):
|
|
850
|
-
self.value = bytes(value, 'utf-8')
|
|
851
|
-
else:
|
|
852
|
-
self.value = value
|
|
849
|
+
self.value = value
|
|
853
850
|
|
|
854
851
|
def encode_value(self, value: Any) -> bytes:
|
|
855
852
|
return value
|
|
@@ -892,6 +889,8 @@ class Attribute(EventEmitter):
|
|
|
892
889
|
else:
|
|
893
890
|
value = self.value
|
|
894
891
|
|
|
892
|
+
self.emit('read', connection, value)
|
|
893
|
+
|
|
895
894
|
return self.encode_value(value)
|
|
896
895
|
|
|
897
896
|
async def write_value(self, connection: Connection, value_bytes: bytes) -> None:
|
bumble/drivers/common.py
CHANGED