From 1b9adf12972b9a3958b04ddab9fff67416b692ef Mon Sep 17 00:00:00 2001 From: burneykb <burneykb@iastate.edu> Date: Mon, 27 Mar 2017 03:52:25 -0500 Subject: [PATCH] making final changes to virt_quad. It workes now! --- quad/src/virt_quad/hw_impl_unix_uart.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/quad/src/virt_quad/hw_impl_unix_uart.c b/quad/src/virt_quad/hw_impl_unix_uart.c index 9d1001ee2..27bdfcb8d 100644 --- a/quad/src/virt_quad/hw_impl_unix_uart.c +++ b/quad/src/virt_quad/hw_impl_unix_uart.c @@ -41,17 +41,18 @@ int unix_uart_reset(struct UARTDriver *self) { err(-1, "listen"); } + printf("Waiting for backend to connect\n"); + while (1) { client = accept(backendSocket, NULL, NULL); if (client > 0) break; } - printf(" accpet() returned with %d\n", client); + printf("backend connection found on socket %d.\n", client); return 0; } int unix_uart_write(struct UARTDriver *self, unsigned char c) { - printf("sending [%c]\n", c); send(client, &c, 1, MSG_DONTWAIT); return 0; } @@ -62,10 +63,8 @@ int unix_uart_read(struct UARTDriver *self, unsigned char *c) { if (bytes_available > 0) { int bytes = recv(client, c, 1, 0); - printf("read in %d byte [%X]\n", bytes, *c); return 0; } else { return 1; } - } \ No newline at end of file -- GitLab