summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVadim Yanitskiy <axilirator@gmail.com>2017-07-14 06:25:37 +0700
committerVadim Yanitskiy <axilirator@gmail.com>2017-11-19 17:35:07 +0700
commitef31f1bff220e025660554cc930055418b8cf98c (patch)
tree48ff7fb81bea103f4edd78d889e21d864352f18d
parent798e2b148cca4540245658730c3a51ff7acd6bd9 (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 91d2a655..a9c7d68a 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")