mirror of
https://github.com/google/bumble.git
synced 2026-04-16 00:25:31 +00:00
Merge pull request #587 from zxzxwu/device
Replace HCI member imports 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,
|
||||
AdvertisingType,
|
||||
Device,
|
||||
Phy,
|
||||
)
|
||||
from bumble.gatt import Service
|
||||
from bumble.hci import (
|
||||
@@ -47,6 +46,7 @@ from bumble.hci import (
|
||||
HCI_PAGE_TIMEOUT_ERROR,
|
||||
HCI_REMOTE_USER_TERMINATED_CONNECTION_ERROR,
|
||||
Address,
|
||||
Phy,
|
||||
)
|
||||
from google.protobuf import any_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.
|
||||
pub fn new(address: &str, address_type: AddressType) -> PyResult<Self> {
|
||||
Python::with_gil(|py| {
|
||||
PyModule::import(py, intern!(py, "bumble.device"))?
|
||||
PyModule::import(py, intern!(py, "bumble.hci"))?
|
||||
.getattr(intern!(py, "Address"))?
|
||||
.call1((address, address_type))
|
||||
.map(|any| Self(any.into()))
|
||||
|
||||
@@ -51,7 +51,7 @@ install_requires =
|
||||
pyserial-asyncio >= 0.5; platform_system!='Emscripten'
|
||||
pyserial >= 3.5; platform_system!='Emscripten'
|
||||
pyusb >= 1.2; platform_system!='Emscripten'
|
||||
websockets >= 12.0; platform_system!='Emscripten'
|
||||
websockets == 13.1; platform_system!='Emscripten'
|
||||
|
||||
[options.entry_points]
|
||||
console_scripts =
|
||||
|
||||
Reference in New Issue
Block a user