bumble 0.0.219__py3-none-any.whl → 0.0.220__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/auracast.py +7 -13
- bumble/audio/io.py +3 -3
- bumble/controller.py +588 -302
- bumble/device.py +107 -183
- bumble/link.py +68 -165
- bumble/lmp.py +324 -0
- bumble/snoop.py +10 -4
- bumble/utils.py +1 -5
- {bumble-0.0.219.dist-info → bumble-0.0.220.dist-info}/METADATA +2 -2
- {bumble-0.0.219.dist-info → bumble-0.0.220.dist-info}/RECORD +15 -14
- {bumble-0.0.219.dist-info → bumble-0.0.220.dist-info}/WHEEL +0 -0
- {bumble-0.0.219.dist-info → bumble-0.0.220.dist-info}/entry_points.txt +0 -0
- {bumble-0.0.219.dist-info → bumble-0.0.220.dist-info}/licenses/LICENSE +0 -0
- {bumble-0.0.219.dist-info → bumble-0.0.220.dist-info}/top_level.txt +0 -0
bumble/_version.py
CHANGED
|
@@ -28,7 +28,7 @@ version_tuple: VERSION_TUPLE
|
|
|
28
28
|
commit_id: COMMIT_ID
|
|
29
29
|
__commit_id__: COMMIT_ID
|
|
30
30
|
|
|
31
|
-
__version__ = version = '0.0.
|
|
32
|
-
__version_tuple__ = version_tuple = (0, 0,
|
|
31
|
+
__version__ = version = '0.0.220'
|
|
32
|
+
__version_tuple__ = version_tuple = (0, 0, 220)
|
|
33
33
|
|
|
34
34
|
__commit_id__ = commit_id = None
|
bumble/apps/auracast.py
CHANGED
|
@@ -742,10 +742,9 @@ async def run_receive(
|
|
|
742
742
|
]
|
|
743
743
|
packet_stats = [0, 0]
|
|
744
744
|
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
try:
|
|
745
|
+
async with contextlib.AsyncExitStack() as stack:
|
|
746
|
+
audio_output = await audio_io.create_audio_output(output)
|
|
747
|
+
stack.push_async_callback(audio_output.aclose)
|
|
749
748
|
await audio_output.open(
|
|
750
749
|
audio_io.PcmFormat(
|
|
751
750
|
audio_io.PcmFormat.Endianness.LITTLE,
|
|
@@ -793,8 +792,6 @@ async def run_receive(
|
|
|
793
792
|
terminated = asyncio.Event()
|
|
794
793
|
big_sync.on(big_sync.Event.TERMINATION, lambda _: terminated.set())
|
|
795
794
|
await terminated.wait()
|
|
796
|
-
finally:
|
|
797
|
-
await audio_output.aclose()
|
|
798
795
|
|
|
799
796
|
|
|
800
797
|
async def run_transmit(
|
|
@@ -891,11 +888,10 @@ async def run_transmit(
|
|
|
891
888
|
print('Start Periodic Advertising')
|
|
892
889
|
await advertising_set.start_periodic()
|
|
893
890
|
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
try:
|
|
891
|
+
async with contextlib.AsyncExitStack() as stack:
|
|
892
|
+
audio_input = await audio_io.create_audio_input(input, input_format)
|
|
893
|
+
pcm_format = await audio_input.open()
|
|
894
|
+
stack.push_async_callback(audio_input.aclose)
|
|
899
895
|
if pcm_format.channels != 2:
|
|
900
896
|
print("Only 2 channels PCM configurations are supported")
|
|
901
897
|
return
|
|
@@ -967,8 +963,6 @@ async def run_transmit(
|
|
|
967
963
|
await iso_queues[1].write(lc3_frame[mid:])
|
|
968
964
|
|
|
969
965
|
frame_count += 1
|
|
970
|
-
finally:
|
|
971
|
-
await audio_input.aclose()
|
|
972
966
|
|
|
973
967
|
|
|
974
968
|
def run_async(async_command: Coroutine) -> None:
|
bumble/audio/io.py
CHANGED
|
@@ -19,13 +19,13 @@ from __future__ import annotations
|
|
|
19
19
|
|
|
20
20
|
import abc
|
|
21
21
|
import asyncio
|
|
22
|
+
import concurrent.futures
|
|
22
23
|
import dataclasses
|
|
23
24
|
import enum
|
|
24
25
|
import logging
|
|
25
26
|
import pathlib
|
|
26
27
|
import sys
|
|
27
28
|
import wave
|
|
28
|
-
from concurrent.futures import ThreadPoolExecutor
|
|
29
29
|
from typing import TYPE_CHECKING, AsyncGenerator, BinaryIO
|
|
30
30
|
|
|
31
31
|
from bumble.colors import color
|
|
@@ -176,7 +176,7 @@ class ThreadedAudioOutput(AudioOutput):
|
|
|
176
176
|
"""
|
|
177
177
|
|
|
178
178
|
def __init__(self) -> None:
|
|
179
|
-
self._thread_pool = ThreadPoolExecutor(1)
|
|
179
|
+
self._thread_pool = concurrent.futures.ThreadPoolExecutor(1)
|
|
180
180
|
self._pcm_samples: asyncio.Queue[bytes] = asyncio.Queue()
|
|
181
181
|
self._write_task = asyncio.create_task(self._write_loop())
|
|
182
182
|
|
|
@@ -405,7 +405,7 @@ class ThreadedAudioInput(AudioInput):
|
|
|
405
405
|
"""Base class for AudioInput implementation where reading samples may block."""
|
|
406
406
|
|
|
407
407
|
def __init__(self) -> None:
|
|
408
|
-
self._thread_pool = ThreadPoolExecutor(1)
|
|
408
|
+
self._thread_pool = concurrent.futures.ThreadPoolExecutor(1)
|
|
409
409
|
self._pcm_samples: asyncio.Queue[bytes] = asyncio.Queue()
|
|
410
410
|
|
|
411
411
|
@abc.abstractmethod
|