mirror of
https://github.com/google/bumble.git
synced 2026-05-08 03:58:01 +00:00
Add Device::add_default_services()
This will allow a test to: a: add services to a device b: reset services via `Server()` c: add the default services back
This commit is contained in:
committed by
Alan Rosenthal
parent
4417eb636c
commit
a8eff737e6
@@ -797,9 +797,7 @@ class Device(CompositeEventEmitter):
|
||||
# Register the SDP server with the L2CAP Channel Manager
|
||||
self.sdp_server.register(self.l2cap_channel_manager)
|
||||
|
||||
# Add a GAP Service if requested
|
||||
if generic_access_service:
|
||||
self.gatt_server.add_service(GenericAccessService(self.name))
|
||||
self.add_default_services(generic_access_service)
|
||||
self.l2cap_channel_manager.register_fixed_channel(ATT_CID, self.on_gatt_pdu)
|
||||
|
||||
# Forward some events
|
||||
@@ -1886,6 +1884,11 @@ class Device(CompositeEventEmitter):
|
||||
def add_services(self, services):
|
||||
self.gatt_server.add_services(services)
|
||||
|
||||
def add_default_services(self, generic_access_service=True):
|
||||
# Add a GAP Service if requested
|
||||
if generic_access_service:
|
||||
self.gatt_server.add_service(GenericAccessService(self.name))
|
||||
|
||||
async def notify_subscriber(self, connection, attribute, value=None, force=False):
|
||||
await self.gatt_server.notify_subscriber(connection, attribute, value, force)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user