summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVadim Yanitskiy <axilirator@gmail.com>2017-07-14 06:25:37 +0700
committerVadim Yanitskiy <axilirator@gmail.com>2017-10-23 22:05:49 +0330
commita11815672dd95176204eb5fff1babc1bd56258ff (patch)
tree58e400810d2a72294686cace4fe57aea3154ee28
parent1736fb8f2306e2d911409e3fc5f7d94a9f5d2d69 (diff)
fake_trx/ctrl_cmd.py: print response to stdout
-rwxr-xr-xsrc/target/fake_trx/ctrl_cmd.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/target/fake_trx/ctrl_cmd.py b/src/target/fake_trx/ctrl_cmd.py
index 91d2a65..a9c7d68 100755
--- a/src/target/fake_trx/ctrl_cmd.py
+++ b/src/target/fake_trx/ctrl_cmd.py
@@ -44,7 +44,7 @@ class Application:
self.print_prompt()
# Wait until we get any data on any socket
- socks = [sys.stdin]
+ socks = [sys.stdin, self.ctrl_link.sock]
r_event, w_event, x_event = select.select(socks, [], [])
# Check for incoming CTRL commands
@@ -52,6 +52,11 @@ class Application:
cmd = sys.stdin.readline()
self.handle_cmd(cmd)
+ if self.ctrl_link.sock in r_event:
+ data, addr = self.ctrl_link.sock.recvfrom(128)
+ sys.stdout.write("\r%s\n" % data)
+ sys.stdout.flush()
+
def handle_cmd(self, cmd):
# Strip spaces, tabs, etc.
cmd = cmd.strip().strip("\0")