bumble 0.0.214__py3-none-any.whl → 0.0.215__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 +280 -278
  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.215.dist-info}/METADATA +2 -1
  117. bumble-0.0.215.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.215.dist-info}/WHEEL +0 -0
  120. {bumble-0.0.214.dist-info → bumble-0.0.215.dist-info}/entry_points.txt +0 -0
  121. {bumble-0.0.214.dist-info → bumble-0.0.215.dist-info}/licenses/LICENSE +0 -0
  122. {bumble-0.0.214.dist-info → bumble-0.0.215.dist-info}/top_level.txt +0 -0
bumble/_version.py CHANGED
@@ -1,7 +1,14 @@
1
1
  # file generated by setuptools-scm
2
2
  # don't change, don't track in version control
3
3
 
4
- __all__ = ["__version__", "__version_tuple__", "version", "version_tuple"]
4
+ __all__ = [
5
+ "__version__",
6
+ "__version_tuple__",
7
+ "version",
8
+ "version_tuple",
9
+ "__commit_id__",
10
+ "commit_id",
11
+ ]
5
12
 
6
13
  TYPE_CHECKING = False
7
14
  if TYPE_CHECKING:
@@ -9,13 +16,19 @@ if TYPE_CHECKING:
9
16
  from typing import Union
10
17
 
11
18
  VERSION_TUPLE = Tuple[Union[int, str], ...]
19
+ COMMIT_ID = Union[str, None]
12
20
  else:
13
21
  VERSION_TUPLE = object
22
+ COMMIT_ID = object
14
23
 
15
24
  version: str
16
25
  __version__: str
17
26
  __version_tuple__: VERSION_TUPLE
18
27
  version_tuple: VERSION_TUPLE
28
+ commit_id: COMMIT_ID
29
+ __commit_id__: COMMIT_ID
19
30
 
20
- __version__ = version = '0.0.214'
21
- __version_tuple__ = version_tuple = (0, 0, 214)
31
+ __version__ = version = '0.0.215'
32
+ __version_tuple__ = version_tuple = (0, 0, 215)
33
+
34
+ __commit_id__ = commit_id = None
bumble/a2dp.py CHANGED
@@ -17,37 +17,36 @@
17
17
  # -----------------------------------------------------------------------------
18
18
  from __future__ import annotations
19
19
 
20
- from collections.abc import AsyncGenerator
21
20
  import dataclasses
22
21
  import enum
23
22
  import logging
24
23
  import struct
24
+ from collections.abc import AsyncGenerator
25
25
  from typing import Awaitable, Callable
26
- from typing_extensions import ClassVar, Self
27
26
 
27
+ from typing_extensions import ClassVar, Self
28
28
 
29
29
  from bumble.codecs import AacAudioRtpPacket
30
30
  from bumble.company_ids import COMPANY_IDENTIFIERS
31
- from bumble.sdp import (
32
- DataElement,
33
- ServiceAttribute,
34
- SDP_PUBLIC_BROWSE_ROOT,
35
- SDP_BROWSE_GROUP_LIST_ATTRIBUTE_ID,
36
- SDP_SERVICE_RECORD_HANDLE_ATTRIBUTE_ID,
37
- SDP_SERVICE_CLASS_ID_LIST_ATTRIBUTE_ID,
38
- SDP_PROTOCOL_DESCRIPTOR_LIST_ATTRIBUTE_ID,
39
- SDP_BLUETOOTH_PROFILE_DESCRIPTOR_LIST_ATTRIBUTE_ID,
40
- )
41
31
  from bumble.core import (
42
- BT_L2CAP_PROTOCOL_ID,
43
- BT_AUDIO_SOURCE_SERVICE,
32
+ BT_ADVANCED_AUDIO_DISTRIBUTION_SERVICE,
44
33
  BT_AUDIO_SINK_SERVICE,
34
+ BT_AUDIO_SOURCE_SERVICE,
45
35
  BT_AVDTP_PROTOCOL_ID,
46
- BT_ADVANCED_AUDIO_DISTRIBUTION_SERVICE,
36
+ BT_L2CAP_PROTOCOL_ID,
47
37
  name_or_number,
48
38
  )
49
39
  from bumble.rtp import MediaPacket
50
-
40
+ from bumble.sdp import (
41
+ SDP_BLUETOOTH_PROFILE_DESCRIPTOR_LIST_ATTRIBUTE_ID,
42
+ SDP_BROWSE_GROUP_LIST_ATTRIBUTE_ID,
43
+ SDP_PROTOCOL_DESCRIPTOR_LIST_ATTRIBUTE_ID,
44
+ SDP_PUBLIC_BROWSE_ROOT,
45
+ SDP_SERVICE_CLASS_ID_LIST_ATTRIBUTE_ID,
46
+ SDP_SERVICE_RECORD_HANDLE_ATTRIBUTE_ID,
47
+ DataElement,
48
+ ServiceAttribute,
49
+ )
51
50
 
52
51
  # -----------------------------------------------------------------------------
53
52
  # Logging
bumble/apps/auracast.py CHANGED
@@ -24,12 +24,7 @@ import dataclasses
24
24
  import functools
25
25
  import logging
26
26
  import struct
27
- from typing import (
28
- Any,
29
- AsyncGenerator,
30
- Coroutine,
31
- Optional,
32
- )
27
+ from typing import Any, AsyncGenerator, Coroutine, Optional
33
28
 
34
29
  import click
35
30
 
@@ -40,21 +35,14 @@ except ImportError as e:
40
35
  "Try `python -m pip install \"git+https://github.com/google/liblc3.git\"`."
41
36
  ) from e
42
37
 
43
- from bumble.audio import io as audio_io
44
- from bumble.colors import color
45
- from bumble import company_ids
46
- from bumble import core
47
- from bumble import gatt
48
- from bumble import hci
49
- from bumble.profiles import bap
50
- from bumble.profiles import le_audio
51
- from bumble.profiles import pbp
52
- from bumble.profiles import bass
53
38
  import bumble.device
39
+ import bumble.logging
54
40
  import bumble.transport
55
41
  import bumble.utils
56
- import bumble.logging
57
-
42
+ from bumble import company_ids, core, data_types, gatt, hci
43
+ from bumble.audio import io as audio_io
44
+ from bumble.colors import color
45
+ from bumble.profiles import bap, bass, le_audio, pbp
58
46
 
59
47
  # -----------------------------------------------------------------------------
60
48
  # Logging
@@ -871,21 +859,13 @@ async def run_transmit(
871
859
  )
872
860
  broadcast_audio_announcement = bap.BroadcastAudioAnnouncement(broadcast_id)
873
861
 
874
- advertising_manufacturer_data = (
875
- b''
876
- if manufacturer_data is None
877
- else bytes(
878
- core.AdvertisingData(
879
- [
880
- (
881
- core.AdvertisingData.MANUFACTURER_SPECIFIC_DATA,
882
- struct.pack('<H', manufacturer_data[0])
883
- + manufacturer_data[1],
884
- )
885
- ]
886
- )
862
+ advertising_data_types: list[core.DataType] = [
863
+ data_types.BroadcastName(broadcast_name)
864
+ ]
865
+ if manufacturer_data is not None:
866
+ advertising_data_types.append(
867
+ data_types.ManufacturerSpecificData(*manufacturer_data)
887
868
  )
888
- )
889
869
 
890
870
  advertising_set = await device.create_advertising_set(
891
871
  advertising_parameters=bumble.device.AdvertisingParameters(
@@ -897,12 +877,7 @@ async def run_transmit(
897
877
  ),
898
878
  advertising_data=(
899
879
  broadcast_audio_announcement.get_advertising_data()
900
- + bytes(
901
- core.AdvertisingData(
902
- [(core.AdvertisingData.BROADCAST_NAME, broadcast_name.encode())]
903
- )
904
- )
905
- + advertising_manufacturer_data
880
+ + bytes(core.AdvertisingData(advertising_data_types))
906
881
  ),
907
882
  periodic_advertising_parameters=bumble.device.PeriodicAdvertisingParameters(
908
883
  periodic_advertising_interval_min=80,
bumble/apps/bench.py CHANGED
@@ -26,16 +26,19 @@ from typing import Optional
26
26
 
27
27
  import click
28
28
 
29
+ import bumble.core
30
+ import bumble.logging
31
+ import bumble.rfcomm
29
32
  from bumble import l2cap
33
+ from bumble.colors import color
30
34
  from bumble.core import (
31
- PhysicalTransport,
32
35
  BT_L2CAP_PROTOCOL_ID,
33
36
  BT_RFCOMM_PROTOCOL_ID,
34
37
  UUID,
35
38
  CommandTimeoutError,
39
+ ConnectionPHY,
40
+ PhysicalTransport,
36
41
  )
37
- from bumble.colors import color
38
- from bumble.core import ConnectionPHY
39
42
  from bumble.device import (
40
43
  CigParameters,
41
44
  CisLink,
@@ -49,12 +52,13 @@ from bumble.hci import (
49
52
  HCI_LE_1M_PHY,
50
53
  HCI_LE_2M_PHY,
51
54
  HCI_LE_CODED_PHY,
52
- Role,
53
55
  HCI_Constant,
54
56
  HCI_Error,
55
- HCI_StatusError,
56
57
  HCI_IsoDataPacket,
58
+ HCI_StatusError,
59
+ Role,
57
60
  )
61
+ from bumble.pairing import PairingConfig
58
62
  from bumble.sdp import (
59
63
  SDP_BROWSE_GROUP_LIST_ATTRIBUTE_ID,
60
64
  SDP_PROTOCOL_DESCRIPTOR_LIST_ATTRIBUTE_ID,
@@ -65,12 +69,7 @@ from bumble.sdp import (
65
69
  ServiceAttribute,
66
70
  )
67
71
  from bumble.transport import open_transport
68
- import bumble.rfcomm
69
- import bumble.core
70
72
  from bumble.utils import AsyncRunner
71
- from bumble.pairing import PairingConfig
72
- import bumble.logging
73
-
74
73
 
75
74
  # -----------------------------------------------------------------------------
76
75
  # Logging
@@ -13,6 +13,7 @@
13
13
  # limitations under the License.
14
14
 
15
15
  import click
16
+
16
17
  from bumble.colors import color
17
18
  from bumble.hci import Address
18
19
  from bumble.helpers import generate_irk, verify_rpa_with_irk
bumble/apps/console.py CHANGED
@@ -23,58 +23,55 @@ import asyncio
23
23
  import logging
24
24
  import os
25
25
  import re
26
- import humanize
27
- from typing import Optional, Union
28
26
  from collections import OrderedDict
27
+ from typing import Optional, Union
29
28
 
30
29
  import click
30
+ import humanize
31
31
  from prettytable import PrettyTable
32
-
33
32
  from prompt_toolkit import Application
34
- from prompt_toolkit.history import FileHistory
35
33
  from prompt_toolkit.completion import Completer, Completion, NestedCompleter
36
- from prompt_toolkit.key_binding import KeyBindings
37
- from prompt_toolkit.formatted_text import ANSI
38
- from prompt_toolkit.styles import Style
39
- from prompt_toolkit.filters import Condition
40
- from prompt_toolkit.widgets import TextArea, Frame
41
- from prompt_toolkit.widgets.toolbars import FormattedTextToolbar
42
34
  from prompt_toolkit.data_structures import Point
35
+ from prompt_toolkit.filters import Condition
36
+ from prompt_toolkit.formatted_text import ANSI
37
+ from prompt_toolkit.history import FileHistory
38
+ from prompt_toolkit.key_binding import KeyBindings
43
39
  from prompt_toolkit.layout import (
44
- Layout,
45
- HSplit,
46
- Window,
47
40
  CompletionsMenu,
48
- Float,
49
- FormattedTextControl,
50
- FloatContainer,
51
41
  ConditionalContainer,
52
42
  Dimension,
43
+ Float,
44
+ FloatContainer,
45
+ FormattedTextControl,
46
+ HSplit,
47
+ Layout,
48
+ Window,
53
49
  )
50
+ from prompt_toolkit.styles import Style
51
+ from prompt_toolkit.widgets import Frame, TextArea
52
+ from prompt_toolkit.widgets.toolbars import FormattedTextToolbar
54
53
 
55
- from bumble import __version__
56
54
  import bumble.core
57
- from bumble import colors
55
+ from bumble import __version__, colors
58
56
  from bumble.core import UUID, AdvertisingData
59
57
  from bumble.device import (
58
+ Connection,
60
59
  ConnectionParametersPreferences,
61
60
  ConnectionPHY,
62
61
  Device,
63
- Connection,
64
62
  Peer,
65
63
  )
66
- from bumble.utils import AsyncRunner
67
- from bumble.transport import open_transport
68
- from bumble.gatt import Characteristic, Service, CharacteristicDeclaration, Descriptor
64
+ from bumble.gatt import Characteristic, CharacteristicDeclaration, Descriptor, Service
69
65
  from bumble.gatt_client import CharacteristicProxy
70
66
  from bumble.hci import (
71
- Address,
72
- HCI_Constant,
73
67
  HCI_LE_1M_PHY,
74
68
  HCI_LE_2M_PHY,
75
69
  HCI_LE_CODED_PHY,
70
+ Address,
71
+ HCI_Constant,
76
72
  )
77
-
73
+ from bumble.transport import open_transport
74
+ from bumble.utils import AsyncRunner
78
75
 
79
76
  # -----------------------------------------------------------------------------
80
77
  # Constants
@@ -20,44 +20,44 @@ import time
20
20
 
21
21
  import click
22
22
 
23
- from bumble.company_ids import COMPANY_IDENTIFIERS
23
+ import bumble.logging
24
24
  from bumble.colors import color
25
+ from bumble.company_ids import COMPANY_IDENTIFIERS
25
26
  from bumble.core import name_or_number
26
27
  from bumble.hci import (
27
- map_null_terminated_utf8_string,
28
- CodecID,
29
- LeFeature,
28
+ HCI_LE_READ_BUFFER_SIZE_COMMAND,
29
+ HCI_LE_READ_BUFFER_SIZE_V2_COMMAND,
30
+ HCI_LE_READ_MAXIMUM_ADVERTISING_DATA_LENGTH_COMMAND,
31
+ HCI_LE_READ_MAXIMUM_DATA_LENGTH_COMMAND,
32
+ HCI_LE_READ_NUMBER_OF_SUPPORTED_ADVERTISING_SETS_COMMAND,
33
+ HCI_LE_READ_SUGGESTED_DEFAULT_DATA_LENGTH_COMMAND,
34
+ HCI_READ_BD_ADDR_COMMAND,
35
+ HCI_READ_BUFFER_SIZE_COMMAND,
36
+ HCI_READ_LOCAL_NAME_COMMAND,
30
37
  HCI_SUCCESS,
31
38
  HCI_VERSION_NAMES,
32
39
  LMP_VERSION_NAMES,
40
+ CodecID,
33
41
  HCI_Command,
34
42
  HCI_Command_Complete_Event,
35
43
  HCI_Command_Status_Event,
36
- HCI_READ_BUFFER_SIZE_COMMAND,
37
- HCI_Read_Buffer_Size_Command,
38
- HCI_LE_READ_BUFFER_SIZE_V2_COMMAND,
39
- HCI_LE_Read_Buffer_Size_V2_Command,
40
- HCI_READ_BD_ADDR_COMMAND,
41
- HCI_Read_BD_ADDR_Command,
42
- HCI_READ_LOCAL_NAME_COMMAND,
43
- HCI_Read_Local_Name_Command,
44
- HCI_LE_READ_BUFFER_SIZE_COMMAND,
45
44
  HCI_LE_Read_Buffer_Size_Command,
46
- HCI_LE_READ_MAXIMUM_DATA_LENGTH_COMMAND,
45
+ HCI_LE_Read_Buffer_Size_V2_Command,
46
+ HCI_LE_Read_Maximum_Advertising_Data_Length_Command,
47
47
  HCI_LE_Read_Maximum_Data_Length_Command,
48
- HCI_LE_READ_NUMBER_OF_SUPPORTED_ADVERTISING_SETS_COMMAND,
49
48
  HCI_LE_Read_Number_Of_Supported_Advertising_Sets_Command,
50
- HCI_LE_READ_MAXIMUM_ADVERTISING_DATA_LENGTH_COMMAND,
51
- HCI_LE_Read_Maximum_Advertising_Data_Length_Command,
52
- HCI_LE_READ_SUGGESTED_DEFAULT_DATA_LENGTH_COMMAND,
53
49
  HCI_LE_Read_Suggested_Default_Data_Length_Command,
50
+ HCI_Read_BD_ADDR_Command,
51
+ HCI_Read_Buffer_Size_Command,
52
+ HCI_Read_Local_Name_Command,
54
53
  HCI_Read_Local_Supported_Codecs_Command,
55
54
  HCI_Read_Local_Supported_Codecs_V2_Command,
56
55
  HCI_Read_Local_Version_Information_Command,
56
+ LeFeature,
57
+ map_null_terminated_utf8_string,
57
58
  )
58
59
  from bumble.host import Host
59
60
  from bumble.transport import open_transport
60
- import bumble.logging
61
61
 
62
62
 
63
63
  # -----------------------------------------------------------------------------
@@ -21,17 +21,17 @@ from typing import Optional
21
21
 
22
22
  import click
23
23
 
24
+ import bumble.logging
24
25
  from bumble.colors import color
25
26
  from bumble.hci import (
26
27
  HCI_READ_LOOPBACK_MODE_COMMAND,
27
- HCI_Read_Loopback_Mode_Command,
28
28
  HCI_WRITE_LOOPBACK_MODE_COMMAND,
29
+ HCI_Read_Loopback_Mode_Command,
29
30
  HCI_Write_Loopback_Mode_Command,
30
31
  LoopbackMode,
31
32
  )
32
33
  from bumble.host import Host
33
34
  from bumble.transport import open_transport
34
- import bumble.logging
35
35
 
36
36
 
37
37
  class Loopback:
@@ -18,10 +18,10 @@
18
18
  import asyncio
19
19
  import sys
20
20
 
21
+ import bumble.logging
21
22
  from bumble.controller import Controller
22
23
  from bumble.link import LocalLink
23
24
  from bumble.transport import open_transport
24
- import bumble.logging
25
25
 
26
26
 
27
27
  # -----------------------------------------------------------------------------
@@ -20,18 +20,18 @@ from typing import Callable, Iterable, Optional
20
20
 
21
21
  import click
22
22
 
23
- from bumble.core import ProtocolError
23
+ import bumble.logging
24
24
  from bumble.colors import color
25
+ from bumble.core import ProtocolError
25
26
  from bumble.device import Device, Peer
26
27
  from bumble.gatt import Service
27
- from bumble.profiles.device_information_service import DeviceInformationServiceProxy
28
28
  from bumble.profiles.battery_service import BatteryServiceProxy
29
+ from bumble.profiles.device_information_service import DeviceInformationServiceProxy
29
30
  from bumble.profiles.gap import GenericAccessServiceProxy
30
31
  from bumble.profiles.pacs import PublishedAudioCapabilitiesServiceProxy
31
32
  from bumble.profiles.tmap import TelephonyAndMediaAudioServiceProxy
32
33
  from bumble.profiles.vcs import VolumeControlServiceProxy
33
34
  from bumble.transport import open_transport
34
- import bumble.logging
35
35
 
36
36
 
37
37
  # -----------------------------------------------------------------------------
bumble/apps/gatt_dump.py CHANGED
@@ -20,11 +20,11 @@ import asyncio
20
20
  import click
21
21
 
22
22
  import bumble.core
23
+ import bumble.logging
23
24
  from bumble.colors import color
24
25
  from bumble.device import Device, Peer
25
26
  from bumble.gatt import show_services
26
27
  from bumble.transport import open_transport
27
- import bumble.logging
28
28
 
29
29
 
30
30
  # -----------------------------------------------------------------------------
bumble/apps/gg_bridge.py CHANGED
@@ -20,16 +20,15 @@ import struct
20
20
 
21
21
  import click
22
22
 
23
+ import bumble.logging
23
24
  from bumble import l2cap
24
25
  from bumble.colors import color
25
- from bumble.device import Device, Peer
26
26
  from bumble.core import AdvertisingData
27
- from bumble.gatt import Service, Characteristic, CharacteristicValue
28
- from bumble.utils import AsyncRunner
29
- from bumble.transport import open_transport
27
+ from bumble.device import Device, Peer
28
+ from bumble.gatt import Characteristic, CharacteristicValue, Service
30
29
  from bumble.hci import HCI_Constant
31
- import bumble.logging
32
-
30
+ from bumble.transport import open_transport
31
+ from bumble.utils import AsyncRunner
33
32
 
34
33
  # -----------------------------------------------------------------------------
35
34
  # Constants
bumble/apps/hci_bridge.py CHANGED
@@ -12,17 +12,17 @@
12
12
  # See the License for the specific language governing permissions and
13
13
  # limitations under the License.
14
14
 
15
+ import asyncio
16
+
15
17
  # -----------------------------------------------------------------------------
16
18
  # Imports
17
19
  # -----------------------------------------------------------------------------
18
20
  import logging
19
- import asyncio
20
21
  import sys
21
22
 
23
+ import bumble.logging
22
24
  from bumble import hci, transport
23
25
  from bumble.bridge import HCI_Bridge
24
- import bumble.logging
25
-
26
26
 
27
27
  # -----------------------------------------------------------------------------
28
28
  # Logging
@@ -19,13 +19,13 @@ import asyncio
19
19
 
20
20
  import click
21
21
 
22
+ import bumble.logging
22
23
  from bumble import l2cap
23
24
  from bumble.colors import color
24
- from bumble.transport import open_transport
25
25
  from bumble.device import Device
26
- from bumble.utils import FlowControlAsyncPipe
27
26
  from bumble.hci import HCI_Constant
28
- import bumble.logging
27
+ from bumble.transport import open_transport
28
+ from bumble.utils import FlowControlAsyncPipe
29
29
 
30
30
 
31
31
  # -----------------------------------------------------------------------------
@@ -20,31 +20,30 @@ from __future__ import annotations
20
20
  import asyncio
21
21
  import datetime
22
22
  import functools
23
- from importlib import resources
24
23
  import json
25
24
  import logging
26
25
  import pathlib
27
- import weakref
28
26
  import wave
27
+ import weakref
28
+ from importlib import resources
29
29
 
30
30
  try:
31
31
  import lc3 # type: ignore # pylint: disable=E0401
32
32
  except ImportError as e:
33
33
  raise ImportError("Try `python -m pip install \".[lc3]\"`.") from e
34
34
 
35
- import click
36
35
  import aiohttp.web
36
+ import click
37
37
 
38
38
  import bumble
39
- from bumble import utils
40
- from bumble.core import AdvertisingData
39
+ import bumble.logging
40
+ from bumble import data_types, utils
41
41
  from bumble.colors import color
42
- from bumble.device import Device, DeviceConfiguration, AdvertisingParameters, CisLink
43
- from bumble.transport import open_transport
44
- from bumble.profiles import ascs, bap, pacs
42
+ from bumble.core import AdvertisingData
43
+ from bumble.device import AdvertisingParameters, CisLink, Device, DeviceConfiguration
45
44
  from bumble.hci import Address, CodecID, CodingFormat, HCI_IsoDataPacket
46
- import bumble.logging
47
-
45
+ from bumble.profiles import ascs, bap, pacs
46
+ from bumble.transport import open_transport
48
47
 
49
48
  # -----------------------------------------------------------------------------
50
49
  # Logging
@@ -331,22 +330,13 @@ class Speaker:
331
330
  advertising_data = bytes(
332
331
  AdvertisingData(
333
332
  [
334
- (
335
- AdvertisingData.COMPLETE_LOCAL_NAME,
336
- bytes(device_config.name, 'utf-8'),
337
- ),
338
- (
339
- AdvertisingData.FLAGS,
340
- bytes(
341
- [
342
- AdvertisingData.LE_GENERAL_DISCOVERABLE_MODE_FLAG
343
- | AdvertisingData.BR_EDR_NOT_SUPPORTED_FLAG
344
- ]
345
- ),
333
+ data_types.CompleteLocalName(device_config.name),
334
+ data_types.Flags(
335
+ AdvertisingData.Flags.LE_GENERAL_DISCOVERABLE_MODE
336
+ | AdvertisingData.Flags.BR_EDR_NOT_SUPPORTED
346
337
  ),
347
- (
348
- AdvertisingData.INCOMPLETE_LIST_OF_16_BIT_SERVICE_CLASS_UUIDS,
349
- bytes(pacs.PublishedAudioCapabilitiesService.UUID),
338
+ data_types.IncompleteListOf16BitServiceUUIDs(
339
+ [pacs.PublishedAudioCapabilitiesService.UUID]
350
340
  ),
351
341
  ]
352
342
  )