A simple program that connects to University of Queensland's Lora network and requests a joke, then prints the joke to usb serial.
Dependencies: fota-mdot libmDot MTS-Serial
DebugTerminal.h
00001 /** 00002 * A class that runs a terminal to help debug the program. It handles storing 00003 * received characters in a buffer until a command is read and executing that 00004 * command. 00005 * Usage: 00006 * mts::DebugTerminal* term = new mts::DebugTerminal(dot, UART_TX, UART_RX); 00007 * term->baud(115200); 00008 * term->start(); 00009 */ 00010 #ifndef DEBUG_TERMINAL_H 00011 #define DEBUG_TERMINAL_H 00012 00013 #include "mDot.h" 00014 #include "MTSSerial.h" 00015 #include "MTSBufferedIO.h" 00016 00017 namespace mts { 00018 00019 class DebugTerminal : public MTSSerial { 00020 public: 00021 DebugTerminal(mDot* dot, PinName TXD, PinName RXD, int txBufferSize = 256, 00022 int rxBufferSize = 256); 00023 virtual ~DebugTerminal(); 00024 00025 // Handle terminal reads in a loop 00026 void start(); 00027 00028 // Called after the user presses return. 00029 // Parameter is a line without \r or \n 00030 void handleCommand(std::string command); 00031 00032 protected: 00033 00034 private: 00035 mDot* dot; 00036 }; 00037 00038 } // namespace 00039 #endif // Header guard */
Generated on Sun Jul 17 2022 22:41:36 by 1.7.2