1#!/usr/bin/env python3 2# 3# Copyright 2021 - The Android Open Source Project 4# 5# Licensed under the Apache License, Version 2.0 (the "License"); 6# you may not use this file except in compliance with the License. 7# You may obtain a copy of the License at 8# 9# http://www.apache.org/licenses/LICENSE-2.0 10# 11# Unless required by applicable law or agreed to in writing, software 12# distributed under the License is distributed on an "AS IS" BASIS, 13# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14# See the License for the specific language governing permissions and 15# limitations under the License. 16 17import logging 18 19from blueberry.tests.gd.cert.closable import Closable 20from blueberry.tests.gd.cert.py_le_iso import PyLeIso 21 22 23class CertLeIso(Closable): 24 25 def __init__(self, device): 26 self._device = device 27 self._le_iso = PyLeIso(device) 28 29 def close(self): 30 logging.info("DUT: close") 31 self._le_iso.close() 32 33 def le_set_cig_parameters(self, cig_id, sdu_interval_m_to_s, sdu_interval_s_to_m, peripherals_clock_accuracy, 34 packing, framing, max_transport_latency_m_to_s, max_transport_latency_s_to_m, cis_id, 35 max_sdu_m_to_s, max_sdu_s_to_m, phy_m_to_s, phy_s_to_m, rtn_m_to_s, rtn_s_to_m): 36 return self._le_iso.le_set_cig_parameters( 37 cig_id, sdu_interval_m_to_s, sdu_interval_s_to_m, peripherals_clock_accuracy, packing, framing, 38 max_transport_latency_m_to_s, max_transport_latency_s_to_m, cis_id, max_sdu_m_to_s, max_sdu_s_to_m, 39 phy_m_to_s, phy_s_to_m, rtn_m_to_s, rtn_s_to_m) 40 41 def le_set_cig_parameters_test(self, cig_id, sdu_interval_m_to_s, sdu_interval_s_to_m, ft_m_to_s, ft_s_to_m, 42 iso_interval, peripherals_clock_accuracy, packing, framing, 43 max_transport_latency_m_to_s, max_transport_latency_s_to_m, cis_configs): 44 return self._le_iso.le_set_cig_parameters_test(cig_id, sdu_interval_m_to_s, sdu_interval_s_to_m, ft_m_to_s, 45 ft_s_to_m, iso_interval, peripherals_clock_accuracy, packing, 46 framing, max_transport_latency_m_to_s, 47 max_transport_latency_s_to_m, cis_configs) 48 49 def wait_le_set_cig_parameters_complete(self): 50 return self._le_iso.wait_le_set_cig_parameters_complete() 51 52 def le_cretate_cis(self, cis_and_acl_handle_array): 53 self._le_iso.le_create_cis(cis_and_acl_handle_array) 54 55 def wait_le_cis_established(self): 56 return self._le_iso.wait_le_cis_established() 57