mirror of
https://github.com/google/bumble.git
synced 2026-04-18 00:45:32 +00:00
Replace HCI member import in device.py
This commit is contained in:
855
bumble/device.py
855
bumble/device.py
File diff suppressed because it is too large
Load Diff
@@ -39,7 +39,6 @@ from bumble.device import (
|
|||||||
AdvertisingEventProperties,
|
AdvertisingEventProperties,
|
||||||
AdvertisingType,
|
AdvertisingType,
|
||||||
Device,
|
Device,
|
||||||
Phy,
|
|
||||||
)
|
)
|
||||||
from bumble.gatt import Service
|
from bumble.gatt import Service
|
||||||
from bumble.hci import (
|
from bumble.hci import (
|
||||||
@@ -47,6 +46,7 @@ from bumble.hci import (
|
|||||||
HCI_PAGE_TIMEOUT_ERROR,
|
HCI_PAGE_TIMEOUT_ERROR,
|
||||||
HCI_REMOTE_USER_TERMINATED_CONNECTION_ERROR,
|
HCI_REMOTE_USER_TERMINATED_CONNECTION_ERROR,
|
||||||
Address,
|
Address,
|
||||||
|
Phy,
|
||||||
)
|
)
|
||||||
from google.protobuf import any_pb2 # pytype: disable=pyi-error
|
from google.protobuf import any_pb2 # pytype: disable=pyi-error
|
||||||
from google.protobuf import empty_pb2 # pytype: disable=pyi-error
|
from google.protobuf import empty_pb2 # pytype: disable=pyi-error
|
||||||
|
|||||||
@@ -80,7 +80,7 @@ impl Address {
|
|||||||
/// Creates a new [Address] object.
|
/// Creates a new [Address] object.
|
||||||
pub fn new(address: &str, address_type: AddressType) -> PyResult<Self> {
|
pub fn new(address: &str, address_type: AddressType) -> PyResult<Self> {
|
||||||
Python::with_gil(|py| {
|
Python::with_gil(|py| {
|
||||||
PyModule::import(py, intern!(py, "bumble.device"))?
|
PyModule::import(py, intern!(py, "bumble.hci"))?
|
||||||
.getattr(intern!(py, "Address"))?
|
.getattr(intern!(py, "Address"))?
|
||||||
.call1((address, address_type))
|
.call1((address, address_type))
|
||||||
.map(|any| Self(any.into()))
|
.map(|any| Self(any.into()))
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ install_requires =
|
|||||||
pyserial-asyncio >= 0.5; platform_system!='Emscripten'
|
pyserial-asyncio >= 0.5; platform_system!='Emscripten'
|
||||||
pyserial >= 3.5; platform_system!='Emscripten'
|
pyserial >= 3.5; platform_system!='Emscripten'
|
||||||
pyusb >= 1.2; platform_system!='Emscripten'
|
pyusb >= 1.2; platform_system!='Emscripten'
|
||||||
websockets >= 12.0; platform_system!='Emscripten'
|
websockets == 13.1; platform_system!='Emscripten'
|
||||||
|
|
||||||
[options.entry_points]
|
[options.entry_points]
|
||||||
console_scripts =
|
console_scripts =
|
||||||
|
|||||||
Reference in New Issue
Block a user