Skip to content
Snippets Groups Projects
Commit 0422152e authored by burneykb's avatar burneykb
Browse files

testing pending responses

parent 1febe4cc
No related branches found
No related tags found
No related merge requests found
......@@ -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"
};
......
......@@ -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);
......
......@@ -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
......@@ -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 */
......
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