From 0422152e1ae78f159bdefa8c8712c0a13ef9e037 Mon Sep 17 00:00:00 2001 From: Kris Burney <burneykb@iastate.edu> Date: Thu, 17 Nov 2016 14:37:04 -0600 Subject: [PATCH] testing pending responses --- groundStation/src/cli/cli.h | 4 ++-- groundStation/src/cli/cli_monitor.c | 7 +++++-- groundStation/src/cli/cli_monitor.h | 3 --- groundStation/src/frontend/frontend_common.c | 4 ++-- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/groundStation/src/cli/cli.h b/groundStation/src/cli/cli.h index 455e5e600..2951fd8d4 100644 --- a/groundStation/src/cli/cli.h +++ b/groundStation/src/cli/cli.h @@ -16,15 +16,15 @@ enum CommandNameIds{ typedef int (*cli_function_ptr)(struct backend_conn *, int, char **); static cli_function_ptr cli_functions[2] = { &cli_monitor, - // &cli_setpid, &cli_getpid + // &cli_setpid, // &cli_getimu }; static char* commandNames[MAX_COMMANDS] = { "monitor", - "setPid", "getPid", + "setPid", "getImu" }; diff --git a/groundStation/src/cli/cli_monitor.c b/groundStation/src/cli/cli_monitor.c index 0d433c7ba..7ce0d3314 100644 --- a/groundStation/src/cli/cli_monitor.c +++ b/groundStation/src/cli/cli_monitor.c @@ -8,6 +8,8 @@ #include "cli_monitor.h" +static void timespec_diff(struct timespec *start, struct timespec *result); + int cli_monitor(struct backend_conn * conn, int argc, char **argv) { int c, result; int timeFlag = 0; @@ -17,7 +19,6 @@ int cli_monitor(struct backend_conn * conn, int argc, char **argv) { static struct timespec lastChecked; static int nsecs, rate = 10; - while ((c = getopt(argc, argv, "t:r:")) != -1) { switch(c) { case 't' : @@ -63,10 +64,12 @@ int monitor(struct backend_conn * conn) { return 1; } + //TODO : HANDLE RETURN DATA + return 0; } -void timespec_diff(struct timespec *start, struct timespec *result) +static void timespec_diff(struct timespec *start, struct timespec *result) { struct timespec stop; clock_gettime(CLOCK_REALTIME, &stop); diff --git a/groundStation/src/cli/cli_monitor.h b/groundStation/src/cli/cli_monitor.h index fc3cbef43..308721bb8 100644 --- a/groundStation/src/cli/cli_monitor.h +++ b/groundStation/src/cli/cli_monitor.h @@ -11,7 +11,4 @@ int cli_monitor(struct backend_conn * conn, int argc, char **argv); // Return 0 on success and 1 otherwise int monitor(struct backend_conn * conn); - - -void timespec_diff(struct timespec *start, struct timespec *result); #endif \ No newline at end of file diff --git a/groundStation/src/frontend/frontend_common.c b/groundStation/src/frontend/frontend_common.c index 2492822ac..cbedbe42a 100644 --- a/groundStation/src/frontend/frontend_common.c +++ b/groundStation/src/frontend/frontend_common.c @@ -56,8 +56,8 @@ struct backend_conn * ucart_backendConnect() perror("fdopen"); goto fail_malloc_conn; } - if (setbuf(conn->socket, NULL, _IONBF)) { - warn("setbuf"); + if (setvbuf(conn->socket, NULL, _IONBF, 0)) { + warn("setvbuf"); } /* success */ -- GitLab