Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions sdbus_async/bluez/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,17 @@
from __future__ import annotations

from .adapter_api import AdapterInterfaceAsync
from .advertising_api import (
LEAdvertisementInterfaceAsync,
LEAdvertisingManagerInterfaceAsync,
)
from .agent_api import AgentInterfaceAsync, AgentManagerInterfaceAsync
from .battery_api import BatteryInterfaceAsync
from .device_api import DeviceInterfaceAsync
from .gatt_api import (
GattCharacteristicInterfaceAsync,
GattDescriptorInterfaceAsync,
GattManagerInterfaceAsync,
GattServiceInterfaceAsync,
)
from .media_api import MediaInterfaceAsync
Expand All @@ -45,6 +50,10 @@
'GattServiceInterfaceAsync',
'GattCharacteristicInterfaceAsync',
'GattDescriptorInterfaceAsync',
'GattManagerInterfaceAsync',

'LEAdvertisementInterfaceAsync',
'LEAdvertisingManagerInterfaceAsync',

'MediaInterfaceAsync',

Expand Down
204 changes: 204 additions & 0 deletions sdbus_async/bluez/advertising_api.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,204 @@
# SPDX-License-Identifier: LGPL-2.1-or-later

# Copyright (C) 2022 igo95862

# This file is part of python-sdbus

# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.

# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.

# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
from __future__ import annotations

from typing import Any, Dict, List, Tuple

from sdbus import (
DbusInterfaceCommonAsync,
dbus_method_async,
dbus_property_async,
)


class LEAdvertisingManagerInterfaceAsync(
DbusInterfaceCommonAsync,
interface_name='org.bluez.LEAdvertisingManager1',
):

@dbus_method_async(
input_signature='oa{sv}',
)
async def register_advertisement(
self,
advertisement: str,
options: Dict[str, Tuple[str, Any]],
) -> None:
raise NotImplementedError

@dbus_method_async(
input_signature='o',
)
async def unregister_advertisement(
self,
advertisement: str,
) -> None:
raise NotImplementedError

@dbus_property_async(
property_signature='y',
)
def active_instances(self) -> int:
raise NotImplementedError

@dbus_property_async(
property_signature='y',
)
def supported_instances(self) -> int:
raise NotImplementedError

@dbus_property_async(
property_signature='as',
)
def supported_includes(self) -> List[str]:
raise NotImplementedError

@dbus_property_async(
property_signature='as',
)
def supported_secondary_channels(self) -> List[str]:
raise NotImplementedError

@dbus_property_async(
property_signature='a{sv}',
)
def supported_capabilities(self) -> Dict[str, Tuple[str, Any]]:
raise NotImplementedError

@dbus_property_async(
property_signature='as',
)
def supported_features(self) -> List[str]:
raise NotImplementedError


class LEAdvertisementInterfaceAsync(
DbusInterfaceCommonAsync,
interface_name='org.bluez.LEAdvertisement1',
):

@dbus_method_async()
async def release(self) -> None:
raise NotImplementedError

@dbus_property_async(
property_signature='s',
property_name='Type',
)
def advertisement_type(self) -> str:
raise NotImplementedError

@dbus_property_async(
property_signature='as',
property_name='ServiceUUIDs',
)
def service_uuids(self) -> List[str]:
raise NotImplementedError

@dbus_property_async(
property_signature='a{qv}',
)
def manufacturer_data(self) -> Dict[int, Tuple[str, Any]]:
raise NotImplementedError

@dbus_property_async(
property_signature='as',
property_name='SolicitUUIDs',
)
def solicit_uuids(self) -> List[str]:
raise NotImplementedError

@dbus_property_async(
property_signature='a{sv}',
)
def service_data(self) -> Dict[str, Tuple[str, Any]]:
raise NotImplementedError

@dbus_property_async(
property_signature='a{yv}',
)
def data(self) -> Dict[int, Tuple[str, Any]]:
raise NotImplementedError

@dbus_property_async(
property_signature='b',
)
def discoverable(self) -> bool:
raise NotImplementedError

@dbus_property_async(
property_signature='q',
)
def discoverable_timeout(self) -> int:
raise NotImplementedError

@dbus_property_async(
property_signature='as',
)
def includes(self) -> List[str]:
raise NotImplementedError

@dbus_property_async(
property_signature='s',
)
def local_name(self) -> str:
raise NotImplementedError

@dbus_property_async(
property_signature='q',
)
def appearance(self) -> int:
raise NotImplementedError

@dbus_property_async(
property_signature='q',
)
def duration(self) -> int:
raise NotImplementedError

@dbus_property_async(
property_signature='q',
)
def timeout(self) -> int:
raise NotImplementedError

@dbus_property_async(
property_signature='s',
)
def secondary_channel(self) -> str:
raise NotImplementedError

@dbus_property_async(
property_signature='u',
)
def min_interval(self) -> int:
raise NotImplementedError

@dbus_property_async(
property_signature='u',
)
def max_interval(self) -> int:
raise NotImplementedError

@dbus_property_async(
property_signature='n',
)
def tx_power(self) -> int:
raise NotImplementedError
45 changes: 41 additions & 4 deletions sdbus_async/bluez/agent_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,21 +61,58 @@ class AgentInterfaceAsync(
interface_name='org.bluez.Agent1',
):
@dbus_method_async()
async def cancel(self) -> None:
async def release(self) -> None:
raise NotImplementedError

@dbus_method_async()
async def release(self) -> None:
@dbus_method_async(
input_signature='o',
result_signature='s',
)
async def request_pin_code(self, device: str) -> str:
raise NotImplementedError

@dbus_method_async(
input_signature='os',
)
async def authorize_service(self, device: str, uuid: str) -> None:
async def display_pin_code(self, device: str, pincode: str) -> None:
raise NotImplementedError

@dbus_method_async(
input_signature='o',
result_signature='u',
)
async def request_passkey(self, device: str) -> int:
raise NotImplementedError

@dbus_method_async(
input_signature='ouq',
)
async def display_passkey(
self,
device: str,
passkey: int,
entered: int,
) -> None:
raise NotImplementedError

@dbus_method_async(
input_signature='ou',
)
async def request_confirmation(self, device: str, passkey: int) -> None:
raise NotImplementedError

@dbus_method_async(
input_signature='o',
)
async def request_authorization(self, device: str) -> None:
raise NotImplementedError

@dbus_method_async(
input_signature='os',
)
async def authorize_service(self, device: str, uuid: str) -> None:
raise NotImplementedError

@dbus_method_async()
async def cancel(self) -> None:
raise NotImplementedError
25 changes: 25 additions & 0 deletions sdbus_async/bluez/gatt_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,31 @@
)


class GattManagerInterfaceAsync(
DbusInterfaceCommonAsync,
interface_name='org.bluez.GattManager1',
):

@dbus_method_async(
input_signature='oa{sv}',
)
async def register_application(
self,
application: str,
options: Dict[str, Tuple[str, Any]],
) -> None:
raise NotImplementedError

@dbus_method_async(
input_signature='o',
)
async def unregister_application(
self,
application: str,
) -> None:
raise NotImplementedError


class GattServiceInterfaceAsync(
DbusInterfaceCommonAsync,
interface_name='org.bluez.GattService1',
Expand Down