mirror of
https://github.com/google/bumble.git
synced 2026-05-08 03:58:01 +00:00
Add ASHA audio status point
This commit is contained in:
@@ -20,6 +20,7 @@ import struct
|
|||||||
import logging
|
import logging
|
||||||
from typing import List
|
from typing import List
|
||||||
from ..core import AdvertisingData
|
from ..core import AdvertisingData
|
||||||
|
from ..device import Device
|
||||||
from ..gatt import (
|
from ..gatt import (
|
||||||
GATT_ASHA_SERVICE,
|
GATT_ASHA_SERVICE,
|
||||||
GATT_ASHA_READ_ONLY_PROPERTIES_CHARACTERISTIC,
|
GATT_ASHA_READ_ONLY_PROPERTIES_CHARACTERISTIC,
|
||||||
@@ -31,7 +32,7 @@ from ..gatt import (
|
|||||||
Characteristic,
|
Characteristic,
|
||||||
CharacteristicValue,
|
CharacteristicValue,
|
||||||
)
|
)
|
||||||
from ..device import Device
|
from ..utils import AsyncRunner
|
||||||
|
|
||||||
# -----------------------------------------------------------------------------
|
# -----------------------------------------------------------------------------
|
||||||
# Logging
|
# Logging
|
||||||
@@ -81,9 +82,13 @@ class AshaService(TemplateService):
|
|||||||
elif opcode == AshaService.OPCODE_STATUS:
|
elif opcode == AshaService.OPCODE_STATUS:
|
||||||
logger.info(f'### STATUS: connected={value[1]}')
|
logger.info(f'### STATUS: connected={value[1]}')
|
||||||
|
|
||||||
# TODO Respond with a status
|
# OPCODE_STATUS does not need audio status point update
|
||||||
# asyncio.create_task(device.notify_subscribers(audio_status_characteristic,
|
if opcode != AshaService.OPCODE_STATUS:
|
||||||
# force=True))
|
AsyncRunner.spawn(
|
||||||
|
device.notify_subscribers(
|
||||||
|
self.audio_status_characteristic, force=True
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
self.read_only_properties_characteristic = Characteristic(
|
self.read_only_properties_characteristic = Characteristic(
|
||||||
GATT_ASHA_READ_ONLY_PROPERTIES_CHARACTERISTIC,
|
GATT_ASHA_READ_ONLY_PROPERTIES_CHARACTERISTIC,
|
||||||
|
|||||||
Reference in New Issue
Block a user