diff --git a/groundStation/src/microcart_cli.c b/groundStation/src/microcart_cli.c index 224875c3420f2037d6e640dfa8c86525e0784e36..c9527e92e1841e5467f1511170008b4f91342beb 100644 --- a/groundStation/src/microcart_cli.c +++ b/groundStation/src/microcart_cli.c @@ -24,6 +24,8 @@ #include <errno.h> #include <string.h> #include <sys/ioctl.h> +#include <sys/types.h> +#include <netinet/tcp.h> //user created includes #include "communication.h" @@ -36,7 +38,7 @@ #define QUAD_BT_ADDR "00:06:66:64:61:D6" #define QUAD_BT_CHANNEL 0x01 #define CMD_MAX_LENGTH 1024 -#define MAX_HASH_SIZE 15 +#define MAX_HASH_SIZE 50 // function prototypes void readAndPrint(void); @@ -99,7 +101,6 @@ modular_structs_t structs; // Callback to be ran whenever the tracker receives data. // Currently doing much more than it should. It will be slimmed down // in the future. - static void cb(struct ucart_vrpn_TrackerData * td) { static int count = 0; @@ -445,6 +446,8 @@ int connectToZybo() { } else { + // int result = setsockopt(sock, IPPROTO_TCP, TCP_NODELAY, (int[]){1}, sizeof(int)); + // printf("result = %d\n", result); printf("connection successful!...\n"); return sock; } @@ -480,6 +483,7 @@ static ssize_t writeQuad(const char * buf, size_t count) { if (pthread_mutex_lock(&quadSocketMutex)) { err(-2, "pthrtead_mutex_lock (%s:%d):", __FILE__, __LINE__); } + //setsockopt(zyboSocket, IPPROTO_TCP, TCP_QUICKACK, (int[]){1}, sizeof(int)); retval = write(zyboSocket, buf, count); if (pthread_mutex_unlock(&quadSocketMutex)) { err(-2, "pthrtead_mutex_unlock (%s:%d):", __FILE__, __LINE__); @@ -494,6 +498,9 @@ static ssize_t readQuad(char * buf, size_t count) { err(-2, "pthrtead_mutex_lock (%s:%d):", __FILE__, __LINE__); } retval = read(zyboSocket, buf, count); + //int result = setsockopt(zyboSocket, IPPROTO_TCP, TCP_QUICKACK, (int[]){1}, sizeof(int)); + //printf("result = %d\n", result); + if (pthread_mutex_unlock(&quadSocketMutex)) { err(-2, "pthrtead_mutex_unlock (%s:%d):", __FILE__, __LINE__); }