diff --git a/autopts/wid/hap.py b/autopts/wid/hap.py index 1b4628882d..557f050beb 100644 --- a/autopts/wid/hap.py +++ b/autopts/wid/hap.py @@ -14,16 +14,34 @@ # import logging +from argparse import Namespace from autopts.pybtp import btp from autopts.ptsprojects.stack import get_stack from autopts.ptsprojects.testcase import MMI +from autopts.pybtp.defs import AUDIO_METADATA_STREAMING_AUDIO_CONTEXTS from autopts.pybtp.types import * from autopts.pybtp.btp.btp import pts_addr_get, pts_addr_type_get from autopts.wid import generic_wid_hdl log = logging.debug +def create_default_config(): + return Namespace(addr=pts_addr_get(), + addr_type=pts_addr_type_get(), + vid=0x0000, + cid=0x0000, + coding_format=0x06, + frames_per_sdu=0x01, + audio_locations=0x01, + cig_id=0x00, + cis_id=0x00, + presentation_delay=40000, + qos_config=None, + codec_set_name=None, + codec_ltvs=None, + metadata_ltvs=None, + mono=None) def hap_wid_hdl(wid, description, test_case_name): log(f'{hap_wid_hdl.__name__}, {wid}, {description}, {test_case_name}') @@ -86,13 +104,30 @@ def hdl_wid_482(_: WIDParams): addr_type = pts_addr_type_get() stack = get_stack() - # TODO: Rewrite this test to use CAP API instead - audio_dir = AudioDir.SINK coding_format = 0x06 audio_location_list = [defs.PACS_AUDIO_LOCATION_FRONT_LEFT, defs.PACS_AUDIO_LOCATION_FRONT_RIGHT] ase_ids = [] + default_config = create_default_config() + default_config.codec_set_name = '24_1' + default_config.qos_set_name = '24_1_1' + default_config.metadata_ltvs = struct.pack('