bumble 0.0.214__py3-none-any.whl → 0.0.216__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 (122) hide show
  1. bumble/_version.py +16 -3
  2. bumble/a2dp.py +15 -16
  3. bumble/apps/auracast.py +13 -38
  4. bumble/apps/bench.py +9 -10
  5. bumble/apps/ble_rpa_tool.py +1 -0
  6. bumble/apps/console.py +22 -25
  7. bumble/apps/controller_info.py +19 -19
  8. bumble/apps/controller_loopback.py +2 -2
  9. bumble/apps/controllers.py +1 -1
  10. bumble/apps/device_info.py +3 -3
  11. bumble/apps/gatt_dump.py +1 -1
  12. bumble/apps/gg_bridge.py +5 -6
  13. bumble/apps/hci_bridge.py +3 -3
  14. bumble/apps/l2cap_bridge.py +3 -3
  15. bumble/apps/lea_unicast/app.py +15 -25
  16. bumble/apps/pair.py +30 -43
  17. bumble/apps/pandora_server.py +5 -4
  18. bumble/apps/player/player.py +19 -22
  19. bumble/apps/rfcomm_bridge.py +3 -8
  20. bumble/apps/scan.py +16 -6
  21. bumble/apps/show.py +3 -4
  22. bumble/apps/speaker/speaker.py +22 -22
  23. bumble/apps/unbond.py +2 -1
  24. bumble/apps/usb_probe.py +1 -2
  25. bumble/att.py +241 -246
  26. bumble/audio/io.py +5 -9
  27. bumble/avc.py +2 -2
  28. bumble/avctp.py +6 -7
  29. bumble/avdtp.py +19 -22
  30. bumble/avrcp.py +1096 -588
  31. bumble/codecs.py +2 -0
  32. bumble/controller.py +52 -13
  33. bumble/core.py +567 -248
  34. bumble/crypto/__init__.py +2 -2
  35. bumble/crypto/builtin.py +1 -1
  36. bumble/crypto/cryptography.py +2 -4
  37. bumble/data_types.py +1025 -0
  38. bumble/device.py +318 -279
  39. bumble/drivers/__init__.py +3 -2
  40. bumble/drivers/intel.py +3 -4
  41. bumble/drivers/rtk.py +26 -9
  42. bumble/gap.py +4 -4
  43. bumble/gatt.py +3 -2
  44. bumble/gatt_adapters.py +3 -11
  45. bumble/gatt_client.py +69 -81
  46. bumble/gatt_server.py +124 -124
  47. bumble/hci.py +67 -18
  48. bumble/helpers.py +19 -26
  49. bumble/hfp.py +10 -21
  50. bumble/hid.py +22 -16
  51. bumble/host.py +181 -103
  52. bumble/keys.py +5 -3
  53. bumble/l2cap.py +121 -74
  54. bumble/link.py +8 -9
  55. bumble/pairing.py +7 -6
  56. bumble/pandora/__init__.py +8 -7
  57. bumble/pandora/config.py +3 -1
  58. bumble/pandora/device.py +3 -2
  59. bumble/pandora/host.py +38 -36
  60. bumble/pandora/l2cap.py +22 -21
  61. bumble/pandora/security.py +15 -15
  62. bumble/pandora/utils.py +5 -3
  63. bumble/profiles/aics.py +11 -11
  64. bumble/profiles/ams.py +7 -8
  65. bumble/profiles/ancs.py +6 -7
  66. bumble/profiles/ascs.py +4 -9
  67. bumble/profiles/asha.py +8 -12
  68. bumble/profiles/bap.py +11 -23
  69. bumble/profiles/bass.py +2 -7
  70. bumble/profiles/battery_service.py +3 -4
  71. bumble/profiles/cap.py +1 -2
  72. bumble/profiles/csip.py +2 -6
  73. bumble/profiles/device_information_service.py +2 -2
  74. bumble/profiles/gap.py +4 -4
  75. bumble/profiles/gatt_service.py +1 -4
  76. bumble/profiles/gmap.py +5 -5
  77. bumble/profiles/hap.py +62 -59
  78. bumble/profiles/heart_rate_service.py +5 -4
  79. bumble/profiles/le_audio.py +3 -1
  80. bumble/profiles/mcp.py +3 -7
  81. bumble/profiles/pacs.py +3 -6
  82. bumble/profiles/pbp.py +2 -0
  83. bumble/profiles/tmap.py +2 -3
  84. bumble/profiles/vcs.py +2 -8
  85. bumble/profiles/vocs.py +8 -8
  86. bumble/rfcomm.py +11 -14
  87. bumble/rtp.py +1 -0
  88. bumble/sdp.py +10 -8
  89. bumble/smp.py +142 -153
  90. bumble/snoop.py +5 -5
  91. bumble/tools/generate_company_id_list.py +1 -0
  92. bumble/tools/intel_fw_download.py +3 -3
  93. bumble/tools/intel_util.py +4 -4
  94. bumble/tools/rtk_fw_download.py +6 -3
  95. bumble/tools/rtk_util.py +24 -7
  96. bumble/transport/__init__.py +19 -15
  97. bumble/transport/android_emulator.py +8 -13
  98. bumble/transport/android_netsim.py +19 -18
  99. bumble/transport/common.py +12 -15
  100. bumble/transport/file.py +1 -1
  101. bumble/transport/hci_socket.py +4 -6
  102. bumble/transport/pty.py +5 -6
  103. bumble/transport/pyusb.py +7 -10
  104. bumble/transport/serial.py +2 -1
  105. bumble/transport/tcp_client.py +2 -2
  106. bumble/transport/tcp_server.py +11 -14
  107. bumble/transport/udp.py +3 -3
  108. bumble/transport/unix.py +67 -1
  109. bumble/transport/usb.py +6 -6
  110. bumble/transport/vhci.py +0 -1
  111. bumble/transport/ws_client.py +2 -1
  112. bumble/transport/ws_server.py +3 -2
  113. bumble/utils.py +20 -5
  114. bumble/vendor/android/hci.py +1 -2
  115. bumble/vendor/zephyr/hci.py +0 -1
  116. {bumble-0.0.214.dist-info → bumble-0.0.216.dist-info}/METADATA +2 -1
  117. bumble-0.0.216.dist-info/RECORD +183 -0
  118. bumble-0.0.214.dist-info/RECORD +0 -182
  119. {bumble-0.0.214.dist-info → bumble-0.0.216.dist-info}/WHEEL +0 -0
  120. {bumble-0.0.214.dist-info → bumble-0.0.216.dist-info}/entry_points.txt +0 -0
  121. {bumble-0.0.214.dist-info → bumble-0.0.216.dist-info}/licenses/LICENSE +0 -0
  122. {bumble-0.0.214.dist-info → bumble-0.0.216.dist-info}/top_level.txt +0 -0
bumble/audio/io.py CHANGED
@@ -17,20 +17,16 @@
17
17
  # -----------------------------------------------------------------------------
18
18
  from __future__ import annotations
19
19
 
20
- import asyncio
21
20
  import abc
22
- from concurrent.futures import ThreadPoolExecutor
21
+ import asyncio
23
22
  import dataclasses
24
23
  import enum
25
24
  import logging
26
25
  import pathlib
27
- from typing import (
28
- AsyncGenerator,
29
- BinaryIO,
30
- TYPE_CHECKING,
31
- )
32
26
  import sys
33
27
  import wave
28
+ from concurrent.futures import ThreadPoolExecutor
29
+ from typing import TYPE_CHECKING, AsyncGenerator, BinaryIO
34
30
 
35
31
  from bumble.colors import color
36
32
 
@@ -230,8 +226,8 @@ class SoundDeviceAudioOutput(ThreadedAudioOutput):
230
226
 
231
227
  try:
232
228
  self._stream.write(pcm_samples)
233
- except Exception as error:
234
- print(f'Sound device error: {error}')
229
+ except Exception:
230
+ logger.exception('Sound device error')
235
231
  raise
236
232
 
237
233
  def _close(self):
bumble/avc.py CHANGED
@@ -16,12 +16,12 @@
16
16
  # Imports
17
17
  # -----------------------------------------------------------------------------
18
18
  from __future__ import annotations
19
+
19
20
  import enum
20
21
  import struct
21
22
  from typing import Union
22
23
 
23
- from bumble import core
24
- from bumble import utils
24
+ from bumble import core, utils
25
25
 
26
26
 
27
27
  # -----------------------------------------------------------------------------
bumble/avctp.py CHANGED
@@ -16,15 +16,14 @@
16
16
  # Imports
17
17
  # -----------------------------------------------------------------------------
18
18
  from __future__ import annotations
19
- from enum import IntEnum
19
+
20
20
  import logging
21
21
  import struct
22
- from typing import Callable, cast, Optional
22
+ from enum import IntEnum
23
+ from typing import Callable, Optional, cast
23
24
 
25
+ from bumble import avc, core, l2cap
24
26
  from bumble.colors import color
25
- from bumble import avc
26
- from bumble import core
27
- from bumble import l2cap
28
27
 
29
28
  # -----------------------------------------------------------------------------
30
29
  # Logging
@@ -137,8 +136,8 @@ class MessageAssembler:
137
136
  self.pid,
138
137
  self.payload,
139
138
  )
140
- except Exception as error:
141
- logger.exception(color(f"!!! exception in callback: {error}", "red"))
139
+ except Exception:
140
+ logger.exception(color("!!! exception in callback", "red"))
142
141
 
143
142
  self.reset()
144
143
 
bumble/avdtp.py CHANGED
@@ -16,31 +16,25 @@
16
16
  # Imports
17
17
  # -----------------------------------------------------------------------------
18
18
  from __future__ import annotations
19
+
19
20
  import asyncio
20
- import time
21
- import logging
22
21
  import enum
22
+ import logging
23
+ import time
23
24
  import warnings
24
25
  from typing import (
25
26
  Any,
27
+ AsyncGenerator,
26
28
  Awaitable,
27
- Optional,
28
29
  Callable,
29
- AsyncGenerator,
30
30
  Iterable,
31
- Union,
31
+ Optional,
32
32
  SupportsBytes,
33
+ Union,
33
34
  cast,
34
35
  )
35
36
 
36
-
37
- from bumble.core import (
38
- BT_ADVANCED_AUDIO_DISTRIBUTION_SERVICE,
39
- InvalidStateError,
40
- ProtocolError,
41
- InvalidArgumentError,
42
- name_or_number,
43
- )
37
+ from bumble import device, l2cap, sdp, utils
44
38
  from bumble.a2dp import (
45
39
  A2DP_CODEC_TYPE_NAMES,
46
40
  A2DP_MPEG_2_4_AAC_CODEC_TYPE,
@@ -51,10 +45,15 @@ from bumble.a2dp import (
51
45
  SbcMediaCodecInformation,
52
46
  VendorSpecificMediaCodecInformation,
53
47
  )
54
- from bumble.rtp import MediaPacket
55
- from bumble import sdp, device, l2cap, utils
56
48
  from bumble.colors import color
57
-
49
+ from bumble.core import (
50
+ BT_ADVANCED_AUDIO_DISTRIBUTION_SERVICE,
51
+ InvalidArgumentError,
52
+ InvalidStateError,
53
+ ProtocolError,
54
+ name_or_number,
55
+ )
56
+ from bumble.rtp import MediaPacket
58
57
 
59
58
  # -----------------------------------------------------------------------------
60
59
  # Logging
@@ -434,8 +433,8 @@ class MessageAssembler:
434
433
  )
435
434
  try:
436
435
  self.callback(self.transaction_label, message)
437
- except Exception as error:
438
- logger.exception(color(f'!!! exception in callback: {error}', 'red'))
436
+ except Exception:
437
+ logger.exception(color('!!! exception in callback', 'red'))
439
438
 
440
439
  self.reset()
441
440
 
@@ -1400,10 +1399,8 @@ class Protocol(utils.EventEmitter):
1400
1399
  try:
1401
1400
  response = handler(message)
1402
1401
  self.send_message(transaction_label, response)
1403
- except Exception as error:
1404
- logger.warning(
1405
- f'{color("!!! Exception in handler:", "red")} {error}'
1406
- )
1402
+ except Exception:
1403
+ logger.exception(color("!!! Exception in handler:", "red"))
1407
1404
  else:
1408
1405
  logger.warning('unhandled command')
1409
1406
  else: