Пример #1
0
    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)
Пример #2
0
    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)
Пример #3
0
    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)
Пример #4
0
    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)
Пример #5
0
    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)
Пример #6
0
    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)
Пример #7
0
 def kill_forward_all(self, target=Target.ANY):
     cmd = host_command(target, "killforward-all")
     with self.socket.Connect():
         return self._command_bool(cmd)
Пример #8
0
 def kill_forward(self, local, target=Target.ANY):
     cmd = host_command(target, "killforward:" + local)
     with self.socket.Connect():
         return self._command_bool(cmd)
Пример #9
0
 def get_state(self, target=Target.ANY):
     cmd = host_command(target, "get-state")
     with self.socket.Connect():
         return self._command(cmd)
Пример #10
0
 def get_devpath(self, target=Target.ANY):
     cmd = host_command(target, "get-devpath")
     with self.socket.Connect():
         return self._command(cmd)
Пример #11
0
 def kill_forward_all(self, target=Target.ANY):
     cmd = host_command(target, "killforward-all")
     with self.socket.Connect():
         return self._command_bool(cmd)
Пример #12
0
 def kill_forward(self, local, target=Target.ANY):
     cmd = host_command(target, "killforward:" + local)
     with self.socket.Connect():
         return self._command_bool(cmd)
Пример #13
0
 def get_state(self, target=Target.ANY):
     cmd = host_command(target, "get-state")
     with self.socket.Connect():
         return self._command(cmd)
Пример #14
0
 def get_devpath(self, target=Target.ANY):
     cmd = host_command(target, "get-devpath")
     with self.socket.Connect():
         return self._command(cmd)
Пример #15
0
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"
Пример #16
0
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"