bumble 0.0.212__py3-none-any.whl → 0.0.214__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.
Files changed (92) hide show
  1. bumble/_version.py +2 -2
  2. bumble/a2dp.py +6 -0
  3. bumble/apps/README.md +0 -3
  4. bumble/apps/auracast.py +14 -11
  5. bumble/apps/bench.py +482 -37
  6. bumble/apps/console.py +3 -3
  7. bumble/apps/controller_info.py +44 -12
  8. bumble/apps/controller_loopback.py +7 -7
  9. bumble/apps/controllers.py +4 -5
  10. bumble/apps/device_info.py +4 -5
  11. bumble/apps/gatt_dump.py +5 -5
  12. bumble/apps/gg_bridge.py +5 -5
  13. bumble/apps/hci_bridge.py +5 -4
  14. bumble/apps/l2cap_bridge.py +5 -5
  15. bumble/apps/lea_unicast/app.py +8 -3
  16. bumble/apps/pair.py +19 -11
  17. bumble/apps/pandora_server.py +2 -2
  18. bumble/apps/player/player.py +2 -3
  19. bumble/apps/rfcomm_bridge.py +3 -4
  20. bumble/apps/scan.py +4 -5
  21. bumble/apps/show.py +6 -4
  22. bumble/apps/speaker/speaker.html +1 -0
  23. bumble/apps/speaker/speaker.js +113 -62
  24. bumble/apps/speaker/speaker.py +123 -19
  25. bumble/apps/unbond.py +2 -3
  26. bumble/apps/usb_probe.py +2 -3
  27. bumble/at.py +4 -4
  28. bumble/att.py +2 -6
  29. bumble/avc.py +7 -7
  30. bumble/avctp.py +3 -3
  31. bumble/avdtp.py +16 -20
  32. bumble/avrcp.py +42 -54
  33. bumble/colors.py +2 -2
  34. bumble/controller.py +174 -45
  35. bumble/device.py +398 -182
  36. bumble/drivers/__init__.py +2 -2
  37. bumble/drivers/common.py +0 -2
  38. bumble/drivers/intel.py +37 -40
  39. bumble/drivers/rtk.py +28 -35
  40. bumble/gatt.py +4 -4
  41. bumble/gatt_adapters.py +4 -5
  42. bumble/gatt_client.py +26 -31
  43. bumble/gatt_server.py +7 -11
  44. bumble/hci.py +2648 -2909
  45. bumble/helpers.py +4 -5
  46. bumble/hfp.py +32 -37
  47. bumble/host.py +104 -35
  48. bumble/keys.py +5 -5
  49. bumble/l2cap.py +312 -409
  50. bumble/link.py +16 -280
  51. bumble/logging.py +65 -0
  52. bumble/pairing.py +23 -20
  53. bumble/pandora/__init__.py +2 -2
  54. bumble/pandora/config.py +2 -2
  55. bumble/pandora/device.py +6 -6
  56. bumble/pandora/host.py +27 -28
  57. bumble/pandora/l2cap.py +2 -2
  58. bumble/pandora/security.py +6 -6
  59. bumble/pandora/utils.py +3 -3
  60. bumble/profiles/ams.py +404 -0
  61. bumble/profiles/ascs.py +142 -131
  62. bumble/profiles/asha.py +2 -2
  63. bumble/profiles/bap.py +3 -4
  64. bumble/profiles/csip.py +2 -2
  65. bumble/profiles/device_information_service.py +2 -2
  66. bumble/profiles/gap.py +2 -2
  67. bumble/profiles/hap.py +34 -33
  68. bumble/profiles/le_audio.py +4 -4
  69. bumble/profiles/mcp.py +4 -4
  70. bumble/profiles/vcs.py +3 -5
  71. bumble/rfcomm.py +10 -10
  72. bumble/rtp.py +1 -2
  73. bumble/sdp.py +2 -2
  74. bumble/smp.py +62 -63
  75. bumble/tools/intel_util.py +3 -2
  76. bumble/tools/rtk_util.py +6 -5
  77. bumble/transport/__init__.py +2 -16
  78. bumble/transport/android_netsim.py +5 -5
  79. bumble/transport/common.py +4 -4
  80. bumble/transport/pyusb.py +2 -2
  81. bumble/utils.py +2 -5
  82. bumble/vendor/android/hci.py +118 -200
  83. bumble/vendor/zephyr/hci.py +32 -27
  84. {bumble-0.0.212.dist-info → bumble-0.0.214.dist-info}/METADATA +4 -3
  85. {bumble-0.0.212.dist-info → bumble-0.0.214.dist-info}/RECORD +89 -90
  86. {bumble-0.0.212.dist-info → bumble-0.0.214.dist-info}/WHEEL +1 -1
  87. {bumble-0.0.212.dist-info → bumble-0.0.214.dist-info}/entry_points.txt +0 -1
  88. bumble/apps/link_relay/__init__.py +0 -0
  89. bumble/apps/link_relay/link_relay.py +0 -289
  90. bumble/apps/link_relay/logging.yml +0 -21
  91. {bumble-0.0.212.dist-info → bumble-0.0.214.dist-info}/licenses/LICENSE +0 -0
  92. {bumble-0.0.212.dist-info → bumble-0.0.214.dist-info}/top_level.txt +0 -0
bumble/_version.py CHANGED
@@ -17,5 +17,5 @@ __version__: str
17
17
  __version_tuple__: VERSION_TUPLE
18
18
  version_tuple: VERSION_TUPLE
19
19
 
20
- __version__ = version = '0.0.212'
21
- __version_tuple__ = version_tuple = (0, 0, 212)
20
+ __version__ = version = '0.0.214'
21
+ __version_tuple__ = version_tuple = (0, 0, 214)
bumble/a2dp.py CHANGED
@@ -479,6 +479,12 @@ class OpusMediaCodecInformation(VendorSpecificMediaCodecInformation):
479
479
  class SamplingFrequency(enum.IntFlag):
480
480
  SF_48000 = 1 << 0
481
481
 
482
+ @classmethod
483
+ def from_int(cls, sampling_frequency: int) -> Self:
484
+ if sampling_frequency != 48000:
485
+ raise ValueError("no such sampling frequency")
486
+ return cls(1)
487
+
482
488
  VENDOR_ID: ClassVar[int] = 0x000000E0
483
489
  CODEC_ID: ClassVar[int] = 0x0001
484
490
 
bumble/apps/README.md CHANGED
@@ -12,9 +12,6 @@ Apps
12
12
  ## `show.py`
13
13
  Parse a file with HCI packets and print the details of each packet in a human readable form
14
14
 
15
- ## `link_relay.py`
16
- Simple WebSocket relay for virtual RemoteLink instances to communicate with each other through.
17
-
18
15
  ## `hci_bridge.py`
19
16
  This app acts as a simple bridge between two HCI transports, with a host on one side and
20
17
  a controller on the other. All the HCI packets bridged between the two are printed on the console
bumble/apps/auracast.py CHANGED
@@ -23,15 +23,12 @@ import contextlib
23
23
  import dataclasses
24
24
  import functools
25
25
  import logging
26
- import os
27
26
  import struct
28
27
  from typing import (
29
28
  Any,
30
29
  AsyncGenerator,
31
30
  Coroutine,
32
- Deque,
33
31
  Optional,
34
- Tuple,
35
32
  )
36
33
 
37
34
  import click
@@ -56,6 +53,8 @@ from bumble.profiles import bass
56
53
  import bumble.device
57
54
  import bumble.transport
58
55
  import bumble.utils
56
+ import bumble.logging
57
+
59
58
 
60
59
  # -----------------------------------------------------------------------------
61
60
  # Logging
@@ -130,8 +129,8 @@ class BroadcastScanner(bumble.utils.EventEmitter):
130
129
  broadcast_audio_announcement: Optional[bap.BroadcastAudioAnnouncement] = None
131
130
  basic_audio_announcement: Optional[bap.BasicAudioAnnouncement] = None
132
131
  appearance: Optional[core.Appearance] = None
133
- biginfo: Optional[bumble.device.BIGInfoAdvertisement] = None
134
- manufacturer_data: Optional[Tuple[str, bytes]] = None
132
+ biginfo: Optional[bumble.device.BigInfoAdvertisement] = None
133
+ manufacturer_data: Optional[tuple[str, bytes]] = None
135
134
 
136
135
  def __post_init__(self) -> None:
137
136
  super().__init__()
@@ -257,8 +256,10 @@ class BroadcastScanner(bumble.utils.EventEmitter):
257
256
  print(color(' SDU Interval: ', 'magenta'), self.biginfo.sdu_interval)
258
257
  print(color(' Max SDU: ', 'magenta'), self.biginfo.max_sdu)
259
258
  print(color(' PHY: ', 'magenta'), self.biginfo.phy.name)
260
- print(color(' Framed: ', 'magenta'), self.biginfo.framed)
261
- print(color(' Encrypted: ', 'magenta'), self.biginfo.encrypted)
259
+ print(color(' Framing: ', 'magenta'), self.biginfo.framing.name)
260
+ print(
261
+ color(' Encryption: ', 'magenta'), self.biginfo.encryption.name
262
+ )
262
263
 
263
264
  def on_sync_establishment(self) -> None:
264
265
  self.emit('sync_establishment')
@@ -288,7 +289,7 @@ class BroadcastScanner(bumble.utils.EventEmitter):
288
289
  self.emit('change')
289
290
 
290
291
  def on_biginfo_advertisement(
291
- self, advertisement: bumble.device.BIGInfoAdvertisement
292
+ self, advertisement: bumble.device.BigInfoAdvertisement
292
293
  ) -> None:
293
294
  self.biginfo = advertisement
294
295
  self.emit('change')
@@ -748,7 +749,9 @@ async def run_receive(
748
749
  sample_rate_hz=sampling_frequency.hz,
749
750
  num_channels=num_bis,
750
751
  )
751
- lc3_queues: list[Deque[bytes]] = [collections.deque() for i in range(num_bis)]
752
+ lc3_queues: list[collections.deque[bytes]] = [
753
+ collections.deque() for i in range(num_bis)
754
+ ]
752
755
  packet_stats = [0, 0]
753
756
 
754
757
  audio_output = await audio_io.create_audio_output(output)
@@ -764,7 +767,7 @@ async def run_receive(
764
767
  )
765
768
  )
766
769
 
767
- def sink(queue: Deque[bytes], packet: hci.HCI_IsoDataPacket):
770
+ def sink(queue: collections.deque[bytes], packet: hci.HCI_IsoDataPacket):
768
771
  # TODO: re-assemble fragments and detect errors
769
772
  queue.append(packet.iso_sdu_fragment)
770
773
 
@@ -1233,7 +1236,7 @@ def transmit(
1233
1236
 
1234
1237
 
1235
1238
  def main():
1236
- logging.basicConfig(level=os.environ.get('BUMBLE_LOGLEVEL', 'INFO').upper())
1239
+ bumble.logging.setup_basic_logging()
1237
1240
  auracast()
1238
1241
 
1239
1242