Added check to beginning of C example to ensure that the client is connected to X-Plane.

This commit is contained in:
Jason Watkins
2015-05-01 14:20:44 -07:00
parent 00efb7e089
commit 472ed4feac

View File

@@ -23,6 +23,13 @@ int main()
// Open Socket
const char* IP = "127.0.0.1"; //IP Address of computer running X-Plane
XPCSocket sock = openUDP(IP);
float tVal[1];
int tSize;
if (getDREF(sock, "sim/test/test_float", tVal, &tSize) < 0)
{
printf("Error establishing connecting. Unable to read data from X-Plane.");
return EXIT_FAILURE;
}
// Set Location/Orientation (sendPOSI)
// Set Up Position Array