def get_product(self, target=Target.ANY): """ Get the product name corresponding to *target*. :returns: The product name """ cmd = host_command(target, "get-product") with self.socket.Connect(): return self._command(cmd)
def get_serialno(self, target=Target.ANY): """ Get the serial number of *target* :returns: The serial number """ cmd = host_command(target, "get-serialno") with self.socket.Connect(): return self._command(cmd)
def forward(self, local, remote, target=Target.ANY, norebind=False): cmd_start = "forward:" if norebind: cmd_start += "norebind:" base_command = cmd_start + local + ";" + remote cmd = host_command(target, base_command) with self.socket.Connect(): return self._command_bool(cmd)
def kill_forward_all(self, target=Target.ANY): cmd = host_command(target, "killforward-all") with self.socket.Connect(): return self._command_bool(cmd)
def kill_forward(self, local, target=Target.ANY): cmd = host_command(target, "killforward:" + local) with self.socket.Connect(): return self._command_bool(cmd)
def get_state(self, target=Target.ANY): cmd = host_command(target, "get-state") with self.socket.Connect(): return self._command(cmd)
def get_devpath(self, target=Target.ANY): cmd = host_command(target, "get-devpath") with self.socket.Connect(): return self._command(cmd)
def test_command(): assert host_command(Target.ANY, "test") == "host:test" assert host_command(Target.EMULATOR, "testing") == "host-local:testing" assert host_command( "950a8ad5", "testing again") == "host-serial:950a8ad5:testing again"
def test_command(): assert host_command(Target.ANY, "test") == "host:test" assert host_command(Target.EMULATOR, "testing") == "host-local:testing" assert host_command("950a8ad5", "testing again") == "host-serial:950a8ad5:testing again"