Exemple #1
0
    def test_le_connect_list_connection_cert_advertises(self):
        self.dut_hal.set_random_le_address('0D:05:04:03:02:01')
        self.dut_hal.add_to_connect_list('0C:05:04:03:02:01')
        self.dut_hal.initiate_le_connection_by_connect_list(
            'BA:D5:A4:A3:A2:A1')

        advertisement = self.cert_hal.create_advertisement(
            1,
            '0C:05:04:03:02:01',
            min_interval=512,
            max_interval=768,
            peer_address='A6:A5:A4:A3:A2:A1',
            tx_power=0x7F,
            sid=0)
        advertisement.set_data(b'Im_A_Cert')
        advertisement.start()

        assertThat(self.cert_hal.get_hci_event_stream()).emits(
            HciMatchers.LeConnectionComplete())
        assertThat(self.dut_hal.get_hci_event_stream()).emits(
            HciMatchers.LeConnectionComplete())
Exemple #2
0
 def LeConnectionCompleteCapture():
     return Capture(
         HciMatchers.LeConnectionComplete(), lambda packet: HciMatchers.
         ExtractLeConnectionComplete(packet.event))