bumble 0.0.213__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.
- bumble/_version.py +16 -3
- bumble/a2dp.py +15 -16
- bumble/apps/auracast.py +14 -38
- bumble/apps/bench.py +10 -15
- bumble/apps/ble_rpa_tool.py +1 -0
- bumble/apps/console.py +22 -25
- bumble/apps/controller_info.py +20 -25
- bumble/apps/controller_loopback.py +6 -10
- bumble/apps/controllers.py +2 -3
- bumble/apps/device_info.py +4 -5
- bumble/apps/gatt_dump.py +3 -3
- bumble/apps/gg_bridge.py +7 -8
- bumble/apps/hci_bridge.py +4 -3
- bumble/apps/l2cap_bridge.py +5 -5
- bumble/apps/lea_unicast/app.py +16 -26
- bumble/apps/pair.py +30 -43
- bumble/apps/pandora_server.py +5 -4
- bumble/apps/player/player.py +20 -24
- bumble/apps/rfcomm_bridge.py +4 -10
- bumble/apps/scan.py +17 -8
- bumble/apps/show.py +4 -5
- bumble/apps/speaker/speaker.py +23 -27
- bumble/apps/unbond.py +3 -3
- bumble/apps/usb_probe.py +2 -4
- bumble/att.py +241 -246
- bumble/audio/io.py +5 -9
- bumble/avc.py +2 -2
- bumble/avctp.py +6 -7
- bumble/avdtp.py +19 -22
- bumble/avrcp.py +1097 -589
- bumble/codecs.py +2 -0
- bumble/controller.py +142 -35
- bumble/core.py +567 -248
- bumble/crypto/__init__.py +2 -2
- bumble/crypto/builtin.py +1 -1
- bumble/crypto/cryptography.py +2 -4
- bumble/data_types.py +1025 -0
- bumble/device.py +319 -267
- bumble/drivers/__init__.py +3 -2
- bumble/drivers/intel.py +3 -4
- bumble/drivers/rtk.py +26 -9
- bumble/gap.py +4 -4
- bumble/gatt.py +3 -2
- bumble/gatt_adapters.py +3 -11
- bumble/gatt_client.py +69 -81
- bumble/gatt_server.py +124 -124
- bumble/hci.py +114 -18
- bumble/helpers.py +19 -26
- bumble/hfp.py +10 -21
- bumble/hid.py +22 -16
- bumble/host.py +191 -103
- bumble/keys.py +5 -3
- bumble/l2cap.py +138 -104
- bumble/link.py +18 -19
- bumble/logging.py +65 -0
- bumble/pairing.py +7 -6
- bumble/pandora/__init__.py +9 -8
- bumble/pandora/config.py +3 -1
- bumble/pandora/device.py +3 -2
- bumble/pandora/host.py +38 -36
- bumble/pandora/l2cap.py +22 -21
- bumble/pandora/security.py +15 -15
- bumble/pandora/utils.py +5 -3
- bumble/profiles/aics.py +11 -11
- bumble/profiles/ams.py +403 -0
- bumble/profiles/ancs.py +6 -7
- bumble/profiles/ascs.py +14 -9
- bumble/profiles/asha.py +8 -12
- bumble/profiles/bap.py +11 -23
- bumble/profiles/bass.py +2 -7
- bumble/profiles/battery_service.py +3 -4
- bumble/profiles/cap.py +1 -2
- bumble/profiles/csip.py +2 -6
- bumble/profiles/device_information_service.py +2 -2
- bumble/profiles/gap.py +4 -4
- bumble/profiles/gatt_service.py +1 -4
- bumble/profiles/gmap.py +5 -5
- bumble/profiles/hap.py +62 -59
- bumble/profiles/heart_rate_service.py +5 -4
- bumble/profiles/le_audio.py +3 -1
- bumble/profiles/mcp.py +3 -7
- bumble/profiles/pacs.py +3 -6
- bumble/profiles/pbp.py +2 -0
- bumble/profiles/tmap.py +2 -3
- bumble/profiles/vcs.py +2 -8
- bumble/profiles/vocs.py +8 -8
- bumble/rfcomm.py +11 -14
- bumble/rtp.py +1 -0
- bumble/sdp.py +10 -8
- bumble/smp.py +151 -159
- bumble/snoop.py +5 -5
- bumble/tools/generate_company_id_list.py +1 -0
- bumble/tools/intel_fw_download.py +3 -3
- bumble/tools/intel_util.py +5 -4
- bumble/tools/rtk_fw_download.py +6 -3
- bumble/tools/rtk_util.py +26 -8
- bumble/transport/__init__.py +19 -15
- bumble/transport/android_emulator.py +8 -13
- bumble/transport/android_netsim.py +19 -18
- bumble/transport/common.py +12 -15
- bumble/transport/file.py +1 -1
- bumble/transport/hci_socket.py +4 -6
- bumble/transport/pty.py +5 -6
- bumble/transport/pyusb.py +7 -10
- bumble/transport/serial.py +2 -1
- bumble/transport/tcp_client.py +2 -2
- bumble/transport/tcp_server.py +11 -14
- bumble/transport/udp.py +3 -3
- bumble/transport/unix.py +67 -1
- bumble/transport/usb.py +6 -6
- bumble/transport/vhci.py +0 -1
- bumble/transport/ws_client.py +2 -1
- bumble/transport/ws_server.py +3 -2
- bumble/utils.py +20 -5
- bumble/vendor/android/hci.py +1 -2
- bumble/vendor/zephyr/hci.py +0 -1
- {bumble-0.0.213.dist-info → bumble-0.0.215.dist-info}/METADATA +4 -2
- bumble-0.0.215.dist-info/RECORD +183 -0
- bumble-0.0.213.dist-info/RECORD +0 -180
- {bumble-0.0.213.dist-info → bumble-0.0.215.dist-info}/WHEEL +0 -0
- {bumble-0.0.213.dist-info → bumble-0.0.215.dist-info}/entry_points.txt +0 -0
- {bumble-0.0.213.dist-info → bumble-0.0.215.dist-info}/licenses/LICENSE +0 -0
- {bumble-0.0.213.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__ = [
|
|
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.
|
|
21
|
-
__version_tuple__ = version_tuple = (0, 0,
|
|
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
|
-
|
|
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
|
-
|
|
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
|
@@ -23,14 +23,8 @@ import contextlib
|
|
|
23
23
|
import dataclasses
|
|
24
24
|
import functools
|
|
25
25
|
import logging
|
|
26
|
-
import os
|
|
27
26
|
import struct
|
|
28
|
-
from typing import
|
|
29
|
-
Any,
|
|
30
|
-
AsyncGenerator,
|
|
31
|
-
Coroutine,
|
|
32
|
-
Optional,
|
|
33
|
-
)
|
|
27
|
+
from typing import Any, AsyncGenerator, Coroutine, Optional
|
|
34
28
|
|
|
35
29
|
import click
|
|
36
30
|
|
|
@@ -41,19 +35,14 @@ except ImportError as e:
|
|
|
41
35
|
"Try `python -m pip install \"git+https://github.com/google/liblc3.git\"`."
|
|
42
36
|
) from e
|
|
43
37
|
|
|
44
|
-
from bumble.audio import io as audio_io
|
|
45
|
-
from bumble.colors import color
|
|
46
|
-
from bumble import company_ids
|
|
47
|
-
from bumble import core
|
|
48
|
-
from bumble import gatt
|
|
49
|
-
from bumble import hci
|
|
50
|
-
from bumble.profiles import bap
|
|
51
|
-
from bumble.profiles import le_audio
|
|
52
|
-
from bumble.profiles import pbp
|
|
53
|
-
from bumble.profiles import bass
|
|
54
38
|
import bumble.device
|
|
39
|
+
import bumble.logging
|
|
55
40
|
import bumble.transport
|
|
56
41
|
import bumble.utils
|
|
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
|
|
57
46
|
|
|
58
47
|
# -----------------------------------------------------------------------------
|
|
59
48
|
# Logging
|
|
@@ -870,21 +859,13 @@ async def run_transmit(
|
|
|
870
859
|
)
|
|
871
860
|
broadcast_audio_announcement = bap.BroadcastAudioAnnouncement(broadcast_id)
|
|
872
861
|
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
(
|
|
880
|
-
core.AdvertisingData.MANUFACTURER_SPECIFIC_DATA,
|
|
881
|
-
struct.pack('<H', manufacturer_data[0])
|
|
882
|
-
+ manufacturer_data[1],
|
|
883
|
-
)
|
|
884
|
-
]
|
|
885
|
-
)
|
|
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)
|
|
886
868
|
)
|
|
887
|
-
)
|
|
888
869
|
|
|
889
870
|
advertising_set = await device.create_advertising_set(
|
|
890
871
|
advertising_parameters=bumble.device.AdvertisingParameters(
|
|
@@ -896,12 +877,7 @@ async def run_transmit(
|
|
|
896
877
|
),
|
|
897
878
|
advertising_data=(
|
|
898
879
|
broadcast_audio_announcement.get_advertising_data()
|
|
899
|
-
+ bytes(
|
|
900
|
-
core.AdvertisingData(
|
|
901
|
-
[(core.AdvertisingData.BROADCAST_NAME, broadcast_name.encode())]
|
|
902
|
-
)
|
|
903
|
-
)
|
|
904
|
-
+ advertising_manufacturer_data
|
|
880
|
+
+ bytes(core.AdvertisingData(advertising_data_types))
|
|
905
881
|
),
|
|
906
882
|
periodic_advertising_parameters=bumble.device.PeriodicAdvertisingParameters(
|
|
907
883
|
periodic_advertising_interval_min=80,
|
|
@@ -1235,7 +1211,7 @@ def transmit(
|
|
|
1235
1211
|
|
|
1236
1212
|
|
|
1237
1213
|
def main():
|
|
1238
|
-
logging.
|
|
1214
|
+
bumble.logging.setup_basic_logging()
|
|
1239
1215
|
auracast()
|
|
1240
1216
|
|
|
1241
1217
|
|
bumble/apps/bench.py
CHANGED
|
@@ -19,7 +19,6 @@ import asyncio
|
|
|
19
19
|
import dataclasses
|
|
20
20
|
import enum
|
|
21
21
|
import logging
|
|
22
|
-
import os
|
|
23
22
|
import statistics
|
|
24
23
|
import struct
|
|
25
24
|
import time
|
|
@@ -27,16 +26,19 @@ from typing import Optional
|
|
|
27
26
|
|
|
28
27
|
import click
|
|
29
28
|
|
|
29
|
+
import bumble.core
|
|
30
|
+
import bumble.logging
|
|
31
|
+
import bumble.rfcomm
|
|
30
32
|
from bumble import l2cap
|
|
33
|
+
from bumble.colors import color
|
|
31
34
|
from bumble.core import (
|
|
32
|
-
PhysicalTransport,
|
|
33
35
|
BT_L2CAP_PROTOCOL_ID,
|
|
34
36
|
BT_RFCOMM_PROTOCOL_ID,
|
|
35
37
|
UUID,
|
|
36
38
|
CommandTimeoutError,
|
|
39
|
+
ConnectionPHY,
|
|
40
|
+
PhysicalTransport,
|
|
37
41
|
)
|
|
38
|
-
from bumble.colors import color
|
|
39
|
-
from bumble.core import ConnectionPHY
|
|
40
42
|
from bumble.device import (
|
|
41
43
|
CigParameters,
|
|
42
44
|
CisLink,
|
|
@@ -50,12 +52,13 @@ from bumble.hci import (
|
|
|
50
52
|
HCI_LE_1M_PHY,
|
|
51
53
|
HCI_LE_2M_PHY,
|
|
52
54
|
HCI_LE_CODED_PHY,
|
|
53
|
-
Role,
|
|
54
55
|
HCI_Constant,
|
|
55
56
|
HCI_Error,
|
|
56
|
-
HCI_StatusError,
|
|
57
57
|
HCI_IsoDataPacket,
|
|
58
|
+
HCI_StatusError,
|
|
59
|
+
Role,
|
|
58
60
|
)
|
|
61
|
+
from bumble.pairing import PairingConfig
|
|
59
62
|
from bumble.sdp import (
|
|
60
63
|
SDP_BROWSE_GROUP_LIST_ATTRIBUTE_ID,
|
|
61
64
|
SDP_PROTOCOL_DESCRIPTOR_LIST_ATTRIBUTE_ID,
|
|
@@ -66,11 +69,7 @@ from bumble.sdp import (
|
|
|
66
69
|
ServiceAttribute,
|
|
67
70
|
)
|
|
68
71
|
from bumble.transport import open_transport
|
|
69
|
-
import bumble.rfcomm
|
|
70
|
-
import bumble.core
|
|
71
72
|
from bumble.utils import AsyncRunner
|
|
72
|
-
from bumble.pairing import PairingConfig
|
|
73
|
-
|
|
74
73
|
|
|
75
74
|
# -----------------------------------------------------------------------------
|
|
76
75
|
# Logging
|
|
@@ -2321,11 +2320,7 @@ def peripheral(ctx, transport):
|
|
|
2321
2320
|
|
|
2322
2321
|
|
|
2323
2322
|
def main():
|
|
2324
|
-
logging.
|
|
2325
|
-
level=os.environ.get('BUMBLE_LOGLEVEL', 'INFO').upper(),
|
|
2326
|
-
format="[%(asctime)s.%(msecs)03d] %(levelname)s:%(name)s:%(message)s",
|
|
2327
|
-
datefmt="%H:%M:%S",
|
|
2328
|
-
)
|
|
2323
|
+
bumble.logging.setup_basic_logging('INFO')
|
|
2329
2324
|
bench()
|
|
2330
2325
|
|
|
2331
2326
|
|
bumble/apps/ble_rpa_tool.py
CHANGED
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.
|
|
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
|
bumble/apps/controller_info.py
CHANGED
|
@@ -16,46 +16,45 @@
|
|
|
16
16
|
# Imports
|
|
17
17
|
# -----------------------------------------------------------------------------
|
|
18
18
|
import asyncio
|
|
19
|
-
import os
|
|
20
|
-
import logging
|
|
21
19
|
import time
|
|
22
20
|
|
|
23
21
|
import click
|
|
24
22
|
|
|
25
|
-
|
|
23
|
+
import bumble.logging
|
|
26
24
|
from bumble.colors import color
|
|
25
|
+
from bumble.company_ids import COMPANY_IDENTIFIERS
|
|
27
26
|
from bumble.core import name_or_number
|
|
28
27
|
from bumble.hci import (
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
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,
|
|
32
37
|
HCI_SUCCESS,
|
|
33
38
|
HCI_VERSION_NAMES,
|
|
34
39
|
LMP_VERSION_NAMES,
|
|
40
|
+
CodecID,
|
|
35
41
|
HCI_Command,
|
|
36
42
|
HCI_Command_Complete_Event,
|
|
37
43
|
HCI_Command_Status_Event,
|
|
38
|
-
HCI_READ_BUFFER_SIZE_COMMAND,
|
|
39
|
-
HCI_Read_Buffer_Size_Command,
|
|
40
|
-
HCI_LE_READ_BUFFER_SIZE_V2_COMMAND,
|
|
41
|
-
HCI_LE_Read_Buffer_Size_V2_Command,
|
|
42
|
-
HCI_READ_BD_ADDR_COMMAND,
|
|
43
|
-
HCI_Read_BD_ADDR_Command,
|
|
44
|
-
HCI_READ_LOCAL_NAME_COMMAND,
|
|
45
|
-
HCI_Read_Local_Name_Command,
|
|
46
|
-
HCI_LE_READ_BUFFER_SIZE_COMMAND,
|
|
47
44
|
HCI_LE_Read_Buffer_Size_Command,
|
|
48
|
-
|
|
45
|
+
HCI_LE_Read_Buffer_Size_V2_Command,
|
|
46
|
+
HCI_LE_Read_Maximum_Advertising_Data_Length_Command,
|
|
49
47
|
HCI_LE_Read_Maximum_Data_Length_Command,
|
|
50
|
-
HCI_LE_READ_NUMBER_OF_SUPPORTED_ADVERTISING_SETS_COMMAND,
|
|
51
48
|
HCI_LE_Read_Number_Of_Supported_Advertising_Sets_Command,
|
|
52
|
-
HCI_LE_READ_MAXIMUM_ADVERTISING_DATA_LENGTH_COMMAND,
|
|
53
|
-
HCI_LE_Read_Maximum_Advertising_Data_Length_Command,
|
|
54
|
-
HCI_LE_READ_SUGGESTED_DEFAULT_DATA_LENGTH_COMMAND,
|
|
55
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,
|
|
56
53
|
HCI_Read_Local_Supported_Codecs_Command,
|
|
57
54
|
HCI_Read_Local_Supported_Codecs_V2_Command,
|
|
58
55
|
HCI_Read_Local_Version_Information_Command,
|
|
56
|
+
LeFeature,
|
|
57
|
+
map_null_terminated_utf8_string,
|
|
59
58
|
)
|
|
60
59
|
from bumble.host import Host
|
|
61
60
|
from bumble.transport import open_transport
|
|
@@ -342,11 +341,7 @@ async def async_main(
|
|
|
342
341
|
)
|
|
343
342
|
@click.argument('transport')
|
|
344
343
|
def main(latency_probes, latency_probe_interval, latency_probe_command, transport):
|
|
345
|
-
logging.
|
|
346
|
-
level=os.environ.get('BUMBLE_LOGLEVEL', 'INFO').upper(),
|
|
347
|
-
format="[%(asctime)s.%(msecs)03d] %(levelname)s:%(name)s:%(message)s",
|
|
348
|
-
datefmt="%H:%M:%S",
|
|
349
|
-
)
|
|
344
|
+
bumble.logging.setup_basic_logging()
|
|
350
345
|
asyncio.run(
|
|
351
346
|
async_main(
|
|
352
347
|
latency_probes, latency_probe_interval, latency_probe_command, transport
|
|
@@ -16,21 +16,22 @@
|
|
|
16
16
|
# Imports
|
|
17
17
|
# -----------------------------------------------------------------------------
|
|
18
18
|
import asyncio
|
|
19
|
-
import logging
|
|
20
|
-
import os
|
|
21
19
|
import time
|
|
22
20
|
from typing import Optional
|
|
21
|
+
|
|
22
|
+
import click
|
|
23
|
+
|
|
24
|
+
import bumble.logging
|
|
23
25
|
from bumble.colors import color
|
|
24
26
|
from bumble.hci import (
|
|
25
27
|
HCI_READ_LOOPBACK_MODE_COMMAND,
|
|
26
|
-
HCI_Read_Loopback_Mode_Command,
|
|
27
28
|
HCI_WRITE_LOOPBACK_MODE_COMMAND,
|
|
29
|
+
HCI_Read_Loopback_Mode_Command,
|
|
28
30
|
HCI_Write_Loopback_Mode_Command,
|
|
29
31
|
LoopbackMode,
|
|
30
32
|
)
|
|
31
33
|
from bumble.host import Host
|
|
32
34
|
from bumble.transport import open_transport
|
|
33
|
-
import click
|
|
34
35
|
|
|
35
36
|
|
|
36
37
|
class Loopback:
|
|
@@ -194,12 +195,7 @@ class Loopback:
|
|
|
194
195
|
)
|
|
195
196
|
@click.argument('transport')
|
|
196
197
|
def main(packet_size, packet_count, transport):
|
|
197
|
-
logging.
|
|
198
|
-
level=os.environ.get('BUMBLE_LOGLEVEL', 'INFO').upper(),
|
|
199
|
-
format="[%(asctime)s.%(msecs)03d] %(levelname)s:%(name)s:%(message)s",
|
|
200
|
-
datefmt="%H:%M:%S",
|
|
201
|
-
)
|
|
202
|
-
|
|
198
|
+
bumble.logging.setup_basic_logging()
|
|
203
199
|
loopback = Loopback(packet_size, packet_count, transport)
|
|
204
200
|
asyncio.run(loopback.run())
|
|
205
201
|
|
bumble/apps/controllers.py
CHANGED
|
@@ -15,11 +15,10 @@
|
|
|
15
15
|
# -----------------------------------------------------------------------------
|
|
16
16
|
# Imports
|
|
17
17
|
# -----------------------------------------------------------------------------
|
|
18
|
-
import logging
|
|
19
18
|
import asyncio
|
|
20
19
|
import sys
|
|
21
|
-
import os
|
|
22
20
|
|
|
21
|
+
import bumble.logging
|
|
23
22
|
from bumble.controller import Controller
|
|
24
23
|
from bumble.link import LocalLink
|
|
25
24
|
from bumble.transport import open_transport
|
|
@@ -62,7 +61,7 @@ async def async_main():
|
|
|
62
61
|
|
|
63
62
|
# -----------------------------------------------------------------------------
|
|
64
63
|
def main():
|
|
65
|
-
logging.
|
|
64
|
+
bumble.logging.setup_basic_logging()
|
|
66
65
|
asyncio.run(async_main())
|
|
67
66
|
|
|
68
67
|
|
bumble/apps/device_info.py
CHANGED
|
@@ -16,18 +16,17 @@
|
|
|
16
16
|
# Imports
|
|
17
17
|
# -----------------------------------------------------------------------------
|
|
18
18
|
import asyncio
|
|
19
|
-
import os
|
|
20
|
-
import logging
|
|
21
19
|
from typing import Callable, Iterable, Optional
|
|
22
20
|
|
|
23
21
|
import click
|
|
24
22
|
|
|
25
|
-
|
|
23
|
+
import bumble.logging
|
|
26
24
|
from bumble.colors import color
|
|
25
|
+
from bumble.core import ProtocolError
|
|
27
26
|
from bumble.device import Device, Peer
|
|
28
27
|
from bumble.gatt import Service
|
|
29
|
-
from bumble.profiles.device_information_service import DeviceInformationServiceProxy
|
|
30
28
|
from bumble.profiles.battery_service import BatteryServiceProxy
|
|
29
|
+
from bumble.profiles.device_information_service import DeviceInformationServiceProxy
|
|
31
30
|
from bumble.profiles.gap import GenericAccessServiceProxy
|
|
32
31
|
from bumble.profiles.pacs import PublishedAudioCapabilitiesServiceProxy
|
|
33
32
|
from bumble.profiles.tmap import TelephonyAndMediaAudioServiceProxy
|
|
@@ -267,7 +266,7 @@ def main(device_config, encrypt, transport, address_or_name):
|
|
|
267
266
|
Dump the GATT database on a remote device. If ADDRESS_OR_NAME is not specified,
|
|
268
267
|
wait for an incoming connection.
|
|
269
268
|
"""
|
|
270
|
-
logging.
|
|
269
|
+
bumble.logging.setup_basic_logging()
|
|
271
270
|
asyncio.run(async_main(device_config, encrypt, transport, address_or_name))
|
|
272
271
|
|
|
273
272
|
|
bumble/apps/gatt_dump.py
CHANGED
|
@@ -16,11 +16,11 @@
|
|
|
16
16
|
# Imports
|
|
17
17
|
# -----------------------------------------------------------------------------
|
|
18
18
|
import asyncio
|
|
19
|
-
|
|
20
|
-
import logging
|
|
19
|
+
|
|
21
20
|
import click
|
|
22
21
|
|
|
23
22
|
import bumble.core
|
|
23
|
+
import bumble.logging
|
|
24
24
|
from bumble.colors import color
|
|
25
25
|
from bumble.device import Device, Peer
|
|
26
26
|
from bumble.gatt import show_services
|
|
@@ -112,7 +112,7 @@ def main(device_config, encrypt, transport, address_or_name):
|
|
|
112
112
|
Dump the GATT database on a remote device. If ADDRESS_OR_NAME is not specified,
|
|
113
113
|
wait for an incoming connection.
|
|
114
114
|
"""
|
|
115
|
-
logging.
|
|
115
|
+
bumble.logging.setup_basic_logging()
|
|
116
116
|
asyncio.run(async_main(device_config, encrypt, transport, address_or_name))
|
|
117
117
|
|
|
118
118
|
|
bumble/apps/gg_bridge.py
CHANGED
|
@@ -16,20 +16,19 @@
|
|
|
16
16
|
# Imports
|
|
17
17
|
# -----------------------------------------------------------------------------
|
|
18
18
|
import asyncio
|
|
19
|
-
import os
|
|
20
19
|
import struct
|
|
21
|
-
|
|
20
|
+
|
|
22
21
|
import click
|
|
23
22
|
|
|
23
|
+
import bumble.logging
|
|
24
24
|
from bumble import l2cap
|
|
25
25
|
from bumble.colors import color
|
|
26
|
-
from bumble.device import Device, Peer
|
|
27
26
|
from bumble.core import AdvertisingData
|
|
28
|
-
from bumble.
|
|
29
|
-
from bumble.
|
|
30
|
-
from bumble.transport import open_transport
|
|
27
|
+
from bumble.device import Device, Peer
|
|
28
|
+
from bumble.gatt import Characteristic, CharacteristicValue, Service
|
|
31
29
|
from bumble.hci import HCI_Constant
|
|
32
|
-
|
|
30
|
+
from bumble.transport import open_transport
|
|
31
|
+
from bumble.utils import AsyncRunner
|
|
33
32
|
|
|
34
33
|
# -----------------------------------------------------------------------------
|
|
35
34
|
# Constants
|
|
@@ -383,6 +382,7 @@ def main(
|
|
|
383
382
|
receive_host,
|
|
384
383
|
receive_port,
|
|
385
384
|
):
|
|
385
|
+
bumble.logging.setup_basic_logging('WARNING')
|
|
386
386
|
asyncio.run(
|
|
387
387
|
run(
|
|
388
388
|
hci_transport,
|
|
@@ -397,6 +397,5 @@ def main(
|
|
|
397
397
|
|
|
398
398
|
|
|
399
399
|
# -----------------------------------------------------------------------------
|
|
400
|
-
logging.basicConfig(level=os.environ.get('BUMBLE_LOGLEVEL', 'WARNING').upper())
|
|
401
400
|
if __name__ == '__main__':
|
|
402
401
|
main()
|
bumble/apps/hci_bridge.py
CHANGED
|
@@ -12,14 +12,15 @@
|
|
|
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
|
-
import os
|
|
21
21
|
import sys
|
|
22
22
|
|
|
23
|
+
import bumble.logging
|
|
23
24
|
from bumble import hci, transport
|
|
24
25
|
from bumble.bridge import HCI_Bridge
|
|
25
26
|
|
|
@@ -100,7 +101,7 @@ async def async_main():
|
|
|
100
101
|
|
|
101
102
|
# -----------------------------------------------------------------------------
|
|
102
103
|
def main():
|
|
103
|
-
logging.
|
|
104
|
+
bumble.logging.setup_basic_logging()
|
|
104
105
|
asyncio.run(async_main())
|
|
105
106
|
|
|
106
107
|
|
bumble/apps/l2cap_bridge.py
CHANGED
|
@@ -16,16 +16,16 @@
|
|
|
16
16
|
# Imports
|
|
17
17
|
# -----------------------------------------------------------------------------
|
|
18
18
|
import asyncio
|
|
19
|
-
|
|
20
|
-
import os
|
|
19
|
+
|
|
21
20
|
import click
|
|
22
21
|
|
|
22
|
+
import bumble.logging
|
|
23
23
|
from bumble import l2cap
|
|
24
24
|
from bumble.colors import color
|
|
25
|
-
from bumble.transport import open_transport
|
|
26
25
|
from bumble.device import Device
|
|
27
|
-
from bumble.utils import FlowControlAsyncPipe
|
|
28
26
|
from bumble.hci import HCI_Constant
|
|
27
|
+
from bumble.transport import open_transport
|
|
28
|
+
from bumble.utils import FlowControlAsyncPipe
|
|
29
29
|
|
|
30
30
|
|
|
31
31
|
# -----------------------------------------------------------------------------
|
|
@@ -356,6 +356,6 @@ def client(context, bluetooth_address, tcp_host, tcp_port):
|
|
|
356
356
|
|
|
357
357
|
|
|
358
358
|
# -----------------------------------------------------------------------------
|
|
359
|
-
logging.basicConfig(level=os.environ.get('BUMBLE_LOGLEVEL', 'WARNING').upper())
|
|
360
359
|
if __name__ == '__main__':
|
|
360
|
+
bumble.logging.setup_basic_logging('WARNING')
|
|
361
361
|
cli(obj={}) # pylint: disable=no-value-for-parameter
|