Cleaned up DATA related functions.

- Tweaked signatures to improve consistency and safety.
 - Improved error logging.
 - Removed parseDATA. When merged into readDATA, the meat of parseDATA is only a few lines of code.
This commit is contained in:
Jason Watkins
2015-04-15 15:58:23 -07:00
parent 9f670954cc
commit 4e7e816da1
2 changed files with 72 additions and 53 deletions

View File

@@ -98,10 +98,9 @@ int readUDP(XPCSocket sock, char buffer[], int len, struct sockaddr* recvaddr);
int setCONN(XPCSocket sock);
int pauseSim(XPCSocket sock, char pause);
// UDP DATA
short parseDATA(const char my_message[], short messageLength, float dataRef[][9]);
short readDATA(XPCSocket recfd, float dataRef[][9]);
short sendDATA(XPCSocket recfd, float dataRef[][9], unsigned short rows);
// X-Plane UDP DATA
int readDATA(XPCSocket sock, float dataRef[][9], int rows);
int sendDATA(XPCSocket sock, float dataRef[][9], int rows);
// Position
short parsePOSI(const char my_message[], float resultArray[], int arraySize, float *gear);