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: 7 additions & 2 deletions bumble/device.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
from pyee import EventEmitter

from .colors import color
from .att import ATT_CID, ATT_DEFAULT_MTU, ATT_PDU
from .att import ATT_CID, ATT_DEFAULT_MTU, ATT_PDU, Attribute
from .gatt import Characteristic, Descriptor, Service
from .hci import (
HCI_AUTHENTICATED_COMBINATION_KEY_GENERATED_FROM_P_192_TYPE,
Expand Down Expand Up @@ -3531,7 +3531,12 @@ def add_default_services(self, generic_access_service=True):
async def notify_subscriber(self, connection, attribute, value=None, force=False):
await self.gatt_server.notify_subscriber(connection, attribute, value, force)

async def notify_subscribers(self, attribute, value=None, force=False):
async def notify_subscribers(
self,
attribute: Attribute,
value: Optional[bytes] = None,
force: bool = False,
) -> None:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added type annotations based on poking around at the callers, but since of course the type info isn't pervasive I'm not sure these are right

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is good. We want to eventually have everything type, incrementally.

await self.gatt_server.notify_subscribers(attribute, value, force)

async def indicate_subscriber(self, connection, attribute, value=None, force=False):
Expand Down
2 changes: 1 addition & 1 deletion bumble/gatt_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,7 @@ async def notify_subscribers(
attribute: Attribute,
value: Optional[bytes] = None,
force: bool = False,
):
) -> None:
return await self.notify_or_indicate_subscribers(False, attribute, value, force)

async def indicate_subscribers(
Expand Down
1 change: 1 addition & 0 deletions bumble/transport/tcp_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@

# -----------------------------------------------------------------------------


# A pass-through function to ease mock testing.
async def _create_server(*args, **kw_args):
await asyncio.get_running_loop().create_server(*args, **kw_args)
Expand Down
7 changes: 7 additions & 0 deletions rust/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# Next

- GATT server support
- Tests w/ rootcanal
- Battery service example
- Address is now pure Rust that's convertible to its Python equivalent rather than just holding a PyObject

# 0.2.0

- Code-gen company ID table
Expand Down
Loading