Skip to content
Snippets Groups Projects
Commit 1b9adf12 authored by burneykb's avatar burneykb
Browse files

making final changes to virt_quad. It workes now!

parent 9e920c1d
No related branches found
No related tags found
No related merge requests found
......@@ -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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment