Implemented plugin support for handling WYPT commands.

This commit is contained in:
Jason Watkins
2015-04-09 09:42:26 -07:00
parent 8fed5d916c
commit 1a83517bee
5 changed files with 121 additions and 18 deletions

View File

@@ -47,6 +47,27 @@
float flaps;
char aircraft;
} xpcCtrl;
typedef struct
{
double latitude;
double longitude;
double altitude;
} Waypoint;
typedef enum
{
xpc_WYPT_ADD = 1,
xpc_WYPT_DEL = 2,
xpc_WYPT_CLR = 3
} WYPT_OP;
typedef struct
{
WYPT_OP op;
Waypoint points[20];
size_t numPoints;
} xpcWypt;
// Basic Functions
struct xpcSocket openUDP(unsigned short port, const char *xpIP, unsigned short xpPort);
@@ -83,6 +104,10 @@
short parseRequest(const char my_message[], float *resultArray[], short arraySizes[]);
short readRequest(struct xpcSocket recfd, float *dataRef[], short arraySizes[], struct sockaddr *recvaddr);
// Waypoints
xpcWypt parseWYPT(const char data[]);
short sendWYPT(struct xpcSocket sendfd, WYPT_OP op, float points[], int numPoints);
// Screen Text
short sendTEXT(struct xpcSocket sendfd, char* msg, int x, int y);