The xplane_io (X-Plane I/O) program is used to establish network communications, via UDP, with the X-Plane flight simulator running on a computer. The code consists of class libraries that abstract the lower-level UDP packet encoding and decoding details, according to the UDP protocol specifications in X-Plane version 9. Any X-Plane DATA packets can be sent and received, and any X-Plane DataRefs can be set by sending DREF packets to X-Plane.
Dependencies: EthernetNetIf mbed ConfigFile
Diff: XPlaneIO/XPlaneIO_diag.cpp
- Revision:
- 0:a5d13af495af
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/XPlaneIO/XPlaneIO_diag.cpp Wed Dec 21 22:29:59 2011 +0000 @@ -0,0 +1,43 @@ +#include "XPlaneIO.h" +#include "TimeoutPrompt.h" + +void XPlaneIO::diagnostics(Serial & serialInOut) { + + TimeoutPrompt top(serialInOut, 2); + + if (top.prompt("\nPress 'd' within 2 seconds for interactive diagnostics", "Dd") == NULL) { + return; + } + + char c; + + while ((c = top.prompt(30, "\n 1. Analog Input \n 2. \n 3. \n q. Quit \n Select within 30 seconds", "123Qq")) != NULL + && c != 'q' && c != 'Q') + { + serialInOut.printf("%c was typed \n\n", c); + + switch (c) { + case '1': + for (int i = 0; i < _xpAnalogInCount; i++) { + pollAnalogIn(); + serialInOut.printf("Analog Input #%d: ", i + 1); + _xpAnalogIn[i]->toString(serialInOut); + serialInOut.printf("\n"); + } + break; + /* + case '2': + break; + case '3': + break; + case 'a': + case 'A': + break; + */ + default: + serialInOut.printf("%c is not an option \n"); + } + } + + serialInOut.printf("Done \n"); +}