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.
Files changed (95) 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 +11 -9
  5. bumble/apps/bench.py +482 -31
  6. bumble/apps/console.py +5 -5
  7. bumble/apps/controller_info.py +47 -10
  8. bumble/apps/controller_loopback.py +7 -3
  9. bumble/apps/controllers.py +2 -2
  10. bumble/apps/device_info.py +2 -2
  11. bumble/apps/gatt_dump.py +2 -2
  12. bumble/apps/gg_bridge.py +2 -2
  13. bumble/apps/hci_bridge.py +2 -2
  14. bumble/apps/l2cap_bridge.py +2 -2
  15. bumble/apps/lea_unicast/app.py +6 -1
  16. bumble/apps/pair.py +204 -43
  17. bumble/apps/pandora_server.py +2 -2
  18. bumble/apps/rfcomm_bridge.py +1 -1
  19. bumble/apps/scan.py +2 -2
  20. bumble/apps/show.py +4 -2
  21. bumble/apps/speaker/speaker.html +1 -0
  22. bumble/apps/speaker/speaker.js +113 -62
  23. bumble/apps/speaker/speaker.py +126 -18
  24. bumble/at.py +4 -4
  25. bumble/att.py +15 -18
  26. bumble/avc.py +7 -7
  27. bumble/avctp.py +5 -5
  28. bumble/avdtp.py +138 -88
  29. bumble/avrcp.py +52 -58
  30. bumble/colors.py +2 -2
  31. bumble/controller.py +84 -23
  32. bumble/core.py +13 -7
  33. bumble/{crypto.py → crypto/__init__.py} +11 -95
  34. bumble/crypto/builtin.py +652 -0
  35. bumble/crypto/cryptography.py +84 -0
  36. bumble/device.py +688 -345
  37. bumble/drivers/__init__.py +2 -2
  38. bumble/drivers/common.py +0 -2
  39. bumble/drivers/intel.py +40 -40
  40. bumble/drivers/rtk.py +28 -35
  41. bumble/gatt.py +7 -9
  42. bumble/gatt_adapters.py +4 -5
  43. bumble/gatt_client.py +31 -34
  44. bumble/gatt_server.py +15 -17
  45. bumble/hci.py +2635 -2878
  46. bumble/helpers.py +4 -5
  47. bumble/hfp.py +76 -57
  48. bumble/hid.py +24 -12
  49. bumble/host.py +117 -34
  50. bumble/keys.py +68 -52
  51. bumble/l2cap.py +329 -403
  52. bumble/link.py +6 -270
  53. bumble/pairing.py +23 -20
  54. bumble/pandora/__init__.py +1 -1
  55. bumble/pandora/config.py +2 -2
  56. bumble/pandora/device.py +6 -6
  57. bumble/pandora/host.py +38 -39
  58. bumble/pandora/l2cap.py +4 -4
  59. bumble/pandora/security.py +73 -57
  60. bumble/pandora/utils.py +3 -3
  61. bumble/profiles/aics.py +3 -5
  62. bumble/profiles/ancs.py +3 -1
  63. bumble/profiles/ascs.py +143 -136
  64. bumble/profiles/asha.py +13 -8
  65. bumble/profiles/bap.py +3 -4
  66. bumble/profiles/csip.py +3 -5
  67. bumble/profiles/device_information_service.py +2 -2
  68. bumble/profiles/gap.py +2 -2
  69. bumble/profiles/gatt_service.py +1 -3
  70. bumble/profiles/hap.py +42 -58
  71. bumble/profiles/le_audio.py +4 -4
  72. bumble/profiles/mcp.py +16 -13
  73. bumble/profiles/vcs.py +8 -10
  74. bumble/profiles/vocs.py +6 -9
  75. bumble/rfcomm.py +27 -18
  76. bumble/rtp.py +1 -2
  77. bumble/sdp.py +2 -2
  78. bumble/smp.py +71 -69
  79. bumble/tools/rtk_util.py +2 -2
  80. bumble/transport/__init__.py +2 -16
  81. bumble/transport/android_netsim.py +5 -5
  82. bumble/transport/common.py +4 -4
  83. bumble/transport/pyusb.py +2 -2
  84. bumble/utils.py +2 -5
  85. bumble/vendor/android/hci.py +118 -200
  86. bumble/vendor/zephyr/hci.py +32 -27
  87. {bumble-0.0.211.dist-info → bumble-0.0.213.dist-info}/METADATA +5 -5
  88. {bumble-0.0.211.dist-info → bumble-0.0.213.dist-info}/RECORD +92 -93
  89. {bumble-0.0.211.dist-info → bumble-0.0.213.dist-info}/WHEEL +1 -1
  90. {bumble-0.0.211.dist-info → bumble-0.0.213.dist-info}/entry_points.txt +0 -1
  91. bumble/apps/link_relay/__init__.py +0 -0
  92. bumble/apps/link_relay/link_relay.py +0 -289
  93. bumble/apps/link_relay/logging.yml +0 -21
  94. {bumble-0.0.211.dist-info → bumble-0.0.213.dist-info}/licenses/LICENSE +0 -0
  95. {bumble-0.0.211.dist-info → bumble-0.0.213.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.211'
21
- __version_tuple__ = version_tuple = (0, 0, 211)
20
+ __version__ = version = '0.0.213'
21
+ __version_tuple__ = version_tuple = (0, 0, 213)
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
@@ -29,9 +29,7 @@ from typing import (
29
29
  Any,
30
30
  AsyncGenerator,
31
31
  Coroutine,
32
- Deque,
33
32
  Optional,
34
- Tuple,
35
33
  )
36
34
 
37
35
  import click
@@ -130,8 +128,8 @@ class BroadcastScanner(bumble.utils.EventEmitter):
130
128
  broadcast_audio_announcement: Optional[bap.BroadcastAudioAnnouncement] = None
131
129
  basic_audio_announcement: Optional[bap.BasicAudioAnnouncement] = None
132
130
  appearance: Optional[core.Appearance] = None
133
- biginfo: Optional[bumble.device.BIGInfoAdvertisement] = None
134
- manufacturer_data: Optional[Tuple[str, bytes]] = None
131
+ biginfo: Optional[bumble.device.BigInfoAdvertisement] = None
132
+ manufacturer_data: Optional[tuple[str, bytes]] = None
135
133
 
136
134
  def __post_init__(self) -> None:
137
135
  super().__init__()
@@ -257,8 +255,10 @@ class BroadcastScanner(bumble.utils.EventEmitter):
257
255
  print(color(' SDU Interval: ', 'magenta'), self.biginfo.sdu_interval)
258
256
  print(color(' Max SDU: ', 'magenta'), self.biginfo.max_sdu)
259
257
  print(color(' PHY: ', 'magenta'), self.biginfo.phy.name)
260
- print(color(' Framed: ', 'magenta'), self.biginfo.framed)
261
- print(color(' Encrypted: ', 'magenta'), self.biginfo.encrypted)
258
+ print(color(' Framing: ', 'magenta'), self.biginfo.framing.name)
259
+ print(
260
+ color(' Encryption: ', 'magenta'), self.biginfo.encryption.name
261
+ )
262
262
 
263
263
  def on_sync_establishment(self) -> None:
264
264
  self.emit('sync_establishment')
@@ -288,7 +288,7 @@ class BroadcastScanner(bumble.utils.EventEmitter):
288
288
  self.emit('change')
289
289
 
290
290
  def on_biginfo_advertisement(
291
- self, advertisement: bumble.device.BIGInfoAdvertisement
291
+ self, advertisement: bumble.device.BigInfoAdvertisement
292
292
  ) -> None:
293
293
  self.biginfo = advertisement
294
294
  self.emit('change')
@@ -748,7 +748,9 @@ async def run_receive(
748
748
  sample_rate_hz=sampling_frequency.hz,
749
749
  num_channels=num_bis,
750
750
  )
751
- lc3_queues: list[Deque[bytes]] = [collections.deque() for i in range(num_bis)]
751
+ lc3_queues: list[collections.deque[bytes]] = [
752
+ collections.deque() for i in range(num_bis)
753
+ ]
752
754
  packet_stats = [0, 0]
753
755
 
754
756
  audio_output = await audio_io.create_audio_output(output)
@@ -764,7 +766,7 @@ async def run_receive(
764
766
  )
765
767
  )
766
768
 
767
- def sink(queue: Deque[bytes], packet: hci.HCI_IsoDataPacket):
769
+ def sink(queue: collections.deque[bytes], packet: hci.HCI_IsoDataPacket):
768
770
  # TODO: re-assemble fragments and detect errors
769
771
  queue.append(packet.iso_sdu_fragment)
770
772