summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--passthru.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/passthru.c b/passthru.c
index 1124a03..a40fb9e 100644
--- a/passthru.c
+++ b/passthru.c
@@ -37,6 +37,7 @@
#include <string.h>
#include <syslog.h>
+#include <ctype.h>
struct sob_config {
uint32_t baud;
@@ -341,7 +342,7 @@ int main (int argc, char **argv)
while ((i = read(ser_fd1, &c, sizeof(c))) > 0) {
char buf[20];
write(ser_fd2, &c, sizeof(c));
- sprintf(buf, "1> 0x%02x \n", c);
+ sprintf(buf, "1> 0x%02x '%c'\n", c, isprint(c)? c : '.' );
write(fileno(stdout), buf, strlen(buf));
}
}
@@ -351,7 +352,7 @@ int main (int argc, char **argv)
while ((i = read(ser_fd2, &c, sizeof(c))) > 0) {
char buf[20];
write(ser_fd1, &c, sizeof(c));
- sprintf(buf, "2> 0x%02x \n", c);
+ sprintf(buf, "2> 0x%02x '%c'\n", c, isprint(c)? c : '.' );
write(fileno(stdout), buf, strlen(buf));
}
}