summaryrefslogtreecommitdiffstats
path: root/src/host/osmocon/osmocon.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/host/osmocon/osmocon.c')
-rw-r--r--src/host/osmocon/osmocon.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/host/osmocon/osmocon.c b/src/host/osmocon/osmocon.c
index 76f6037..f62f5a4 100644
--- a/src/host/osmocon/osmocon.c
+++ b/src/host/osmocon/osmocon.c
@@ -1470,6 +1470,16 @@ int main(int argc, char **argv)
exit(1);
}
+ /* Reset ready to read/write */
+ fprintf(stderr, "Clearing DTR bit\n");
+ int v24 = TIOCM_DTR | TIOCM_RTS;
+ if (ioctl(dnload.serial_fd.fd, TIOCMBIC, &v24) < 0)
+ fprintf(stderr, "ioctl(TIOCMBIC) %d", errno);
+ usleep(5*1000*1000);
+ fprintf(stderr, "Setting DTR bit\n");
+ if (ioctl(dnload.serial_fd.fd, TIOCMBIS, &v24) < 0)
+ fprintf(stderr, "ioctl(TIOCMBIS) %d", errno);
+
if (osmo_fd_register(&dnload.serial_fd) != 0) {
fprintf(stderr, "Failed to register the serial.\n");
exit(1);