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: TimeoutPrompt/TimeoutPrompt.h
- Revision:
- 0:a5d13af495af
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/TimeoutPrompt/TimeoutPrompt.h Wed Dec 21 22:29:59 2011 +0000 @@ -0,0 +1,30 @@ +#ifndef TIMEOUTPROMPT_H_INCLUDED +#define TIMEOUTPROMPT_H_INCLUDED + +#include "mbed.h" + +class TimeoutPrompt { +public: + + TimeoutPrompt(Serial & serialInOut, int defaultTimeoutSeconds); + + /** + * Output the given prompt for timeoutSeconds. If a character is input that matches + * one of the validChars, then return it. Otherwise, if no valid character is + * pressed within the timeout, then return NULL. + */ + char prompt(int timeoutSeconds, char *promptString, char* validChars); + + /** + * Overloaded method that uses defaultTimeoutSeconds. + */ + char prompt(char *promptString, char* validChars); + +private: + + Serial & _serialInOut; + int _defaultTimeoutSeconds; + Timer _timer; +}; + +#endif // TIMEOUTPROMPT_H_INCLUDED