def hdl_wid_206(desc): stack = get_stack() passkey = btp.parse_passkey_description(desc) stack.gap.passkey.data = passkey btp.gap_passkey_entry_req_ev() return True
def hdl_wid_206(params: WIDParams): stack = get_stack() passkey = btp.parse_passkey_description(params.description) stack.gap.passkey.data = passkey btp.gap_passkey_entry_req_ev() return True
def test_SMP_Client_SC_Passkey_Entry(self, iut, valid): btp.gap_set_io_cap(iut, IOCap.keyboard_display) btp.gap_conn(iut, self.config.tester_addr) btp.gap_wait_for_connection(iut) future = btp.gap_passkey_entry_req_ev(iut) try: wait_futures([future], timeout=EV_TIMEOUT) btp.gap_passkey_entry_rsp(iut, self.config.tester_addr, self.config.tester_passkey) except (TimeoutError, BTPErrorInvalidStatus) as e: if valid: raise e
def test_btp_GAP_CONN_PAIR_3(self): """ Verify the IUT1 can perform the authenticated pairing procedure (Keyboard Input) as the initiator. The IUT1 is operating in the Central role and is the initiator performing the pairing procedure; the IUT2 is operating in the Peripheral role and is the responder. """ btp.gap_set_io_cap(self.iut1, IOCap.keyboard_only) btp.gap_set_io_cap(self.iut2, IOCap.display_only) connection_procedure(self, central=self.iut1, peripheral=self.iut2) btp.gap_pair(self.iut1, self.iut2.stack.gap.iut_addr_get()) iut2_addr = self.iut2.stack.gap.iut_addr_get() future_slave = btp.gap_passkey_disp_ev(self.iut2) future_master = btp.gap_passkey_entry_req_ev(self.iut1) wait_futures([future_master, future_slave], timeout=EV_TIMEOUT) results_slave = future_slave.result() pk_iut2 = results_slave[1] self.assertIsNotNone(pk_iut2) btp.gap_passkey_entry_rsp(self.iut1, iut2_addr, pk_iut2) future_master = btp.gap_sec_level_changed_ev(self.iut1) future_slave = btp.gap_sec_level_changed_ev(self.iut2) wait_futures([future_master, future_slave], timeout=EV_TIMEOUT) _, level = future_master.result() self.assertEqual(level, 3) _, level = future_slave.result() self.assertEqual(level, 3) disconnection_procedure(self, central=self.iut1, peripheral=self.iut2)