def hdl_wid_46(desc):
    """
    :param desc: Please send an L2CAP Connection Parameter Update request using valid parameters.
    :return:
    """
    stack = get_stack()
    bd_addr = btp.pts_addr_get()
    bd_addr_type = btp.pts_addr_type_get()

    new_params = copy.deepcopy(stack.gap.conn_params.data)

    new_params.conn_latency += 1

    btp.gap_conn_param_update(bd_addr, bd_addr_type, new_params.conn_itvl,
                              new_params.conn_itvl, new_params.conn_latency,
                              new_params.supervision_timeout)

    return True
    def test_btp_GAP_CONN_CPUP_2(self):
        """
        Verify the IUT1 can perform the Connection Parameter Update Procedure
        using valid parameters for the peer device; the peer device accepts
        the updated connection parameters.

        The IUT1 is operating in the Central role and is the initiator performing
        the Connection Parameter Update Procedure and the IUT2 is
        operating in the Peripheral role and is the responder.
        """

        connection_procedure(self, central=self.iut1, peripheral=self.iut2)

        conn_params = self.iut1.stack.gap.get_conn_params()
        iut_addr = self.iut1.stack.gap.iut_addr_get()
        iut2_addr = self.iut2.stack.gap.iut_addr_get()

        conn_itvl_min, conn_itvl_max, latency, supervision_timeout = (
            conn_params.conn_itvl, conn_params.conn_itvl,
            conn_params.conn_latency + 2, conn_params.supervision_timeout)

        btp.gap_conn_param_update(self.iut1,
                                  self.iut2.stack.gap.iut_addr_get(),
                                  conn_itvl_min, conn_itvl_max, latency,
                                  supervision_timeout)

        def verify_iut1(args):
            return verify_conn_params(args, iut2_addr, conn_itvl_min,
                                      conn_itvl_max, latency,
                                      supervision_timeout)

        def verify_iut2(args):
            return verify_conn_params(args, iut_addr, conn_itvl_min,
                                      conn_itvl_max, latency,
                                      supervision_timeout)

        wait_futures([
            btp.gap_conn_param_update_ev(self.iut1, verify_iut1),
            btp.gap_conn_param_update_ev(self.iut2, verify_iut2)
        ],
                     timeout=EV_TIMEOUT)

        disconnection_procedure(self, central=self.iut1, peripheral=self.iut2)
Esempio n. 3
0
def hdl_wid_127(desc):
    btp.gap_conn_param_update(btp.pts_addr_get(), btp.pts_addr_type_get(), 720,
                              864, 0, 400)
    return True
Esempio n. 4
0
def hdl_wid_46(desc):
    btp.gap_wait_for_connection()
    bd_addr = btp.pts_addr_get()
    bd_addr_type = btp.pts_addr_type_get()
    btp.gap_conn_param_update(bd_addr, bd_addr_type, 200, 300, 0, 200)
    return True
Esempio n. 5
0
def hdl_wid_59(_: WIDParams):
    btp.gap_conn_param_update(btp.pts_addr_get(), btp.pts_addr_type_get(), 720,
                              864, 0, 400)
    return True