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/profiles/mcp.py CHANGED
@@ -22,16 +22,12 @@ import asyncio
22
22
  import dataclasses
23
23
  import enum
24
24
  import struct
25
+ from typing import TYPE_CHECKING, ClassVar, Optional
25
26
 
26
- from bumble import core
27
- from bumble import device
28
- from bumble import gatt
29
- from bumble import gatt_client
30
- from bumble import utils
31
-
32
- from typing import Optional, ClassVar, TYPE_CHECKING
33
27
  from typing_extensions import Self
34
28
 
29
+ from bumble import core, device, gatt, gatt_client, utils
30
+
35
31
  # -----------------------------------------------------------------------------
36
32
  # Constants
37
33
  # -----------------------------------------------------------------------------
bumble/profiles/pacs.py CHANGED
@@ -17,18 +17,15 @@
17
17
  # Imports
18
18
  # -----------------------------------------------------------------------------
19
19
  from __future__ import annotations
20
+
20
21
  import dataclasses
21
22
  import logging
22
23
  import struct
23
24
  from typing import Optional, Sequence, Union
24
25
 
25
- from bumble.profiles.bap import AudioLocation, CodecSpecificCapabilities, ContextType
26
+ from bumble import gatt, gatt_adapters, gatt_client, hci
26
27
  from bumble.profiles import le_audio
27
- from bumble import gatt
28
- from bumble import gatt_adapters
29
- from bumble import gatt_client
30
- from bumble import hci
31
-
28
+ from bumble.profiles.bap import AudioLocation, CodecSpecificCapabilities, ContextType
32
29
 
33
30
  # -----------------------------------------------------------------------------
34
31
  # Logging
bumble/profiles/pbp.py CHANGED
@@ -16,8 +16,10 @@
16
16
  # Imports
17
17
  # -----------------------------------------------------------------------------
18
18
  from __future__ import annotations
19
+
19
20
  import dataclasses
20
21
  import enum
22
+
21
23
  from typing_extensions import Self
22
24
 
23
25
  from bumble.profiles import le_audio
bumble/profiles/tmap.py CHANGED
@@ -22,15 +22,14 @@ import logging
22
22
  import struct
23
23
 
24
24
  from bumble.gatt import (
25
- TemplateService,
26
- Characteristic,
27
25
  GATT_TELEPHONY_AND_MEDIA_AUDIO_SERVICE,
28
26
  GATT_TMAP_ROLE_CHARACTERISTIC,
27
+ Characteristic,
28
+ TemplateService,
29
29
  )
30
30
  from bumble.gatt_adapters import DelegatedCharacteristicProxyAdapter
31
31
  from bumble.gatt_client import CharacteristicProxy, ProfileServiceProxy, ServiceProxy
32
32
 
33
-
34
33
  # -----------------------------------------------------------------------------
35
34
  # Logging
36
35
  # -----------------------------------------------------------------------------
bumble/profiles/vcs.py CHANGED
@@ -17,18 +17,12 @@
17
17
  # Imports
18
18
  # -----------------------------------------------------------------------------
19
19
  from __future__ import annotations
20
+
20
21
  import dataclasses
21
22
  import enum
22
-
23
23
  from typing import Sequence
24
24
 
25
- from bumble import att
26
- from bumble import utils
27
- from bumble import device
28
- from bumble import gatt
29
- from bumble import gatt_adapters
30
- from bumble import gatt_client
31
-
25
+ from bumble import att, device, gatt, gatt_adapters, gatt_client, utils
32
26
 
33
27
  # -----------------------------------------------------------------------------
34
28
  # Constants
bumble/profiles/vocs.py CHANGED
@@ -20,17 +20,18 @@ import struct
20
20
  from dataclasses import dataclass
21
21
  from typing import Optional
22
22
 
23
- from bumble.device import Connection
23
+ from bumble import utils
24
24
  from bumble.att import ATT_Error
25
+ from bumble.device import Connection
25
26
  from bumble.gatt import (
26
- Characteristic,
27
- TemplateService,
28
- CharacteristicValue,
29
- GATT_VOLUME_OFFSET_CONTROL_SERVICE,
30
- GATT_VOLUME_OFFSET_STATE_CHARACTERISTIC,
31
27
  GATT_AUDIO_LOCATION_CHARACTERISTIC,
32
- GATT_VOLUME_OFFSET_CONTROL_POINT_CHARACTERISTIC,
33
28
  GATT_AUDIO_OUTPUT_DESCRIPTION_CHARACTERISTIC,
29
+ GATT_VOLUME_OFFSET_CONTROL_POINT_CHARACTERISTIC,
30
+ GATT_VOLUME_OFFSET_CONTROL_SERVICE,
31
+ GATT_VOLUME_OFFSET_STATE_CHARACTERISTIC,
32
+ Characteristic,
33
+ CharacteristicValue,
34
+ TemplateService,
34
35
  )
35
36
  from bumble.gatt_adapters import (
36
37
  DelegatedCharacteristicProxyAdapter,
@@ -38,7 +39,6 @@ from bumble.gatt_adapters import (
38
39
  UTF8CharacteristicProxyAdapter,
39
40
  )
40
41
  from bumble.gatt_client import ProfileServiceProxy, ServiceProxy
41
- from bumble import utils
42
42
  from bumble.profiles.bap import AudioLocation
43
43
 
44
44
  # -----------------------------------------------------------------------------
bumble/rfcomm.py CHANGED
@@ -17,33 +17,30 @@
17
17
  # -----------------------------------------------------------------------------
18
18
  from __future__ import annotations
19
19
 
20
- import logging
21
20
  import asyncio
22
21
  import collections
23
22
  import dataclasses
24
23
  import enum
25
- from typing import Callable, Optional, Union, TYPE_CHECKING
26
- from typing_extensions import Self
24
+ import logging
25
+ from typing import TYPE_CHECKING, Callable, Optional, Union
27
26
 
27
+ from typing_extensions import Self
28
28
 
29
- from bumble import core
30
- from bumble import l2cap
31
- from bumble import sdp
32
- from bumble import utils
29
+ from bumble import core, l2cap, sdp, utils
33
30
  from bumble.colors import color
34
31
  from bumble.core import (
35
- UUID,
36
- BT_RFCOMM_PROTOCOL_ID,
37
- PhysicalTransport,
38
32
  BT_L2CAP_PROTOCOL_ID,
33
+ BT_RFCOMM_PROTOCOL_ID,
34
+ UUID,
39
35
  InvalidArgumentError,
40
- InvalidStateError,
41
36
  InvalidPacketError,
37
+ InvalidStateError,
38
+ PhysicalTransport,
42
39
  ProtocolError,
43
40
  )
44
41
 
45
42
  if TYPE_CHECKING:
46
- from bumble.device import Device, Connection
43
+ from bumble.device import Connection, Device
47
44
 
48
45
  # -----------------------------------------------------------------------------
49
46
  # Logging
@@ -1047,8 +1044,8 @@ class Client:
1047
1044
  self.l2cap_channel = await self.connection.create_l2cap_channel(
1048
1045
  spec=l2cap.ClassicChannelSpec(psm=RFCOMM_PSM, mtu=self.l2cap_mtu)
1049
1046
  )
1050
- except ProtocolError as error:
1051
- logger.warning(f'L2CAP connection failed: {error}')
1047
+ except ProtocolError:
1048
+ logger.exception('L2CAP connection failed')
1052
1049
  raise
1053
1050
 
1054
1051
  assert self.l2cap_channel is not None
bumble/rtp.py CHANGED
@@ -16,6 +16,7 @@
16
16
  # Imports
17
17
  # -----------------------------------------------------------------------------
18
18
  from __future__ import annotations
19
+
19
20
  import struct
20
21
 
21
22
 
bumble/sdp.py CHANGED
@@ -16,24 +16,26 @@
16
16
  # Imports
17
17
  # -----------------------------------------------------------------------------
18
18
  from __future__ import annotations
19
+
19
20
  import asyncio
20
21
  import logging
21
22
  import struct
22
- from typing import Iterable, NewType, Optional, Union, Sequence, TYPE_CHECKING
23
+ from typing import TYPE_CHECKING, Iterable, NewType, Optional, Sequence, Union
24
+
23
25
  from typing_extensions import Self
24
26
 
25
27
  from bumble import core, l2cap
26
28
  from bumble.colors import color
27
29
  from bumble.core import (
28
- InvalidStateError,
29
30
  InvalidArgumentError,
30
31
  InvalidPacketError,
32
+ InvalidStateError,
31
33
  ProtocolError,
32
34
  )
33
- from bumble.hci import HCI_Object, name_or_number, key_with_value
35
+ from bumble.hci import HCI_Object, key_with_value, name_or_number
34
36
 
35
37
  if TYPE_CHECKING:
36
- from bumble.device import Device, Connection
38
+ from bumble.device import Connection, Device
37
39
 
38
40
  # -----------------------------------------------------------------------------
39
41
  # Logging
@@ -1084,8 +1086,8 @@ class Server:
1084
1086
  def on_pdu(self, pdu):
1085
1087
  try:
1086
1088
  sdp_pdu = SDP_PDU.from_bytes(pdu)
1087
- except Exception as error:
1088
- logger.warning(color(f'failed to parse SDP Request PDU: {error}', 'red'))
1089
+ except Exception:
1090
+ logger.exception(color('failed to parse SDP Request PDU', 'red'))
1089
1091
  self.send_response(
1090
1092
  SDP_ErrorResponse(
1091
1093
  transaction_id=0, error_code=SDP_INVALID_REQUEST_SYNTAX_ERROR
@@ -1100,8 +1102,8 @@ class Server:
1100
1102
  if handler:
1101
1103
  try:
1102
1104
  handler(sdp_pdu)
1103
- except Exception as error:
1104
- logger.exception(f'{color("!!! Exception in handler:", "red")} {error}')
1105
+ except Exception:
1106
+ logger.exception(color("!!! Exception in handler:", "red"))
1105
1107
  self.send_response(
1106
1108
  SDP_ErrorResponse(
1107
1109
  transaction_id=sdp_pdu.transaction_id,