Skip to content
Merged
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
6 changes: 4 additions & 2 deletions sdbus_async/bluez/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
from __future__ import annotations

from .adapter_api import AdapterInterfaceAsync
from .agent_api import AgentManagerInterfaceAsync
from .agent_api import AgentInterfaceAsync, AgentManagerInterfaceAsync
from .battery_api import BatteryInterfaceAsync
from .device_api import DeviceInterfaceAsync
from .gatt_api import (
Expand All @@ -30,11 +30,12 @@
)
from .media_api import MediaInterfaceAsync
from .network_api import NetworkServerInterfaceAsync
from .profile_api import ProfileManagerInterfaceAsync
from .profile_api import ProfileInterfaceAsync, ProfileManagerInterfaceAsync

__all__ = (
'AdapterInterfaceAsync',

'AgentInterfaceAsync',
'AgentManagerInterfaceAsync',

'BatteryInterfaceAsync',
Expand All @@ -49,5 +50,6 @@

'NetworkServerInterfaceAsync',

'ProfileInterfaceAsync',
'ProfileManagerInterfaceAsync',
)
25 changes: 25 additions & 0 deletions sdbus_async/bluez/agent_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,28 @@ async def request_default_agent(
agent_path: str,
) -> None:
raise NotImplementedError


class AgentInterfaceAsync(
DbusInterfaceCommonAsync,
interface_name='org.bluez.Agent1',
):
@dbus_method_async()
async def cancel(self) -> None:
raise NotImplementedError

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

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

@dbus_method_async(
input_signature='o',
)
async def request_authorization(self, device: str) -> None:
raise NotImplementedError
12 changes: 12 additions & 0 deletions sdbus_block/bluez/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,15 @@
# 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 .adapter_api import AdapterInterface
from .agent_api import AgentManagerInterface
from .profile_api import ProfileInterface, ProfileManagerInterface

__all__ = (
'AdapterInterface',
'AgentManagerInterface',

'ProfileInterface',
'ProfileManagerInterface',
)
156 changes: 156 additions & 0 deletions sdbus_block/bluez/adapter_api.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,156 @@
# 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 (
DbusInterfaceCommon,
dbus_method,
dbus_property,
)


class AdapterInterface(
DbusInterfaceCommon,
interface_name='org.bluez.Adapter1',
):
@dbus_method()
def start_discovery(
self,
) -> None:
raise NotImplementedError

@dbus_method()
def stop_discovery(
self,
) -> None:
raise NotImplementedError

@dbus_method(
input_signature='o',
)
def remove_device(
self,
device_path: str,
) -> None:
raise NotImplementedError

@dbus_method(
input_signature='a{sv}',
)
def set_discovery_filter(
self,
properties: Dict[str, Tuple[str, Any]],
) -> None:
raise NotImplementedError

@dbus_method(
result_signature='as',
)
def get_discovery_filters(
self,
) -> List[str]:
raise NotImplementedError

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

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

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

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

@dbus_property(property_signature='u', property_name='Class')
def device_class(self) -> int:
raise NotImplementedError

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

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

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

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

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

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

@dbus_property(
property_signature='as',
property_name='UUIDs',
)
def uuids(self) -> List[str]:
raise NotImplementedError

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

@dbus_property(property_signature='as')
def roles(self) -> List[str]:
raise NotImplementedError

@dbus_property(property_signature='as')
def experimental_features(self) -> List[str]:
raise NotImplementedError
58 changes: 58 additions & 0 deletions sdbus_block/bluez/agent_api.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# 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 sdbus import (
DbusInterfaceCommon,
dbus_method,
)


class AgentManagerInterface(
DbusInterfaceCommon,
interface_name='org.bluez.AgentManager1',
):
@dbus_method(
input_signature='os',
)
def register_agent(
self,
agent_path: str,
capability: str,
) -> None:
raise NotImplementedError

@dbus_method(
input_signature='o',
)
def unregister_agent(
self,
agent_path: str,
) -> None:
raise NotImplementedError

@dbus_method(
input_signature='o',
)
def request_default_agent(
self,
agent_path: str,
) -> None:
raise NotImplementedError
79 changes: 79 additions & 0 deletions sdbus_block/bluez/profile_api.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
# 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, Tuple

from sdbus import DbusInterfaceCommon, dbus_method


class ProfileManagerInterface(
DbusInterfaceCommon,
interface_name='org.bluez.ProfileManager1',
):

@dbus_method(
input_signature='osa{sv}',
)
def register_profile(
self,
profile_path: str,
uuid: str,
options: Dict[str, Tuple[str, Any]],
) -> None:
raise NotImplementedError

@dbus_method(
input_signature='o',
)
def unregister_profile(
self,
profile_path: str,
) -> None:
raise NotImplementedError

class ProfileInterface(
DbusInterfaceCommon,
interface_name='org.bluez.Profile1',
):

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

@dbus_method(
input_signature='oha{sv}',
)
def new_connection(
self,
device: str,
fd: int,
fd_properties: Dict[str, Tuple[str, Any]],
) -> None:
raise NotImplementedError

@dbus_method(
input_signature='o',
)
def request_disconnection(
self,
device: str,
) -> None:
raise NotImplementedError