def test_local_hci_cmd_and_event(self): # Loopback mode responds with ACL and SCO connection complete self.dut_hci.register_for_events(EventCode.LOOPBACK_COMMAND) self.dut_hci.send_command( WriteLoopbackModeBuilder(LoopbackMode.ENABLE_LOCAL)) self.dut_hci.send_command(ReadLocalNameBuilder()) assertThat(self.dut_hci.get_event_stream()).emits( HciMatchers.LoopbackOf(ReadLocalNameBuilder()))
def test_loopback_hci_command(self): self.dut_hal.send_hci_command( hci_packets.WriteLoopbackModeBuilder( hci_packets.LoopbackMode.ENABLE_LOCAL)) command = hci_packets.LeAddDeviceToConnectListBuilder( hci_packets.ConnectListAddressType.RANDOM, '0C:05:04:03:02:01') self.dut_hal.send_hci_command(command) assertThat(self.dut_hal.get_hci_event_stream()).emits( HciMatchers.LoopbackOf(command))