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

Committer:
WilliamAF
Date:
Sat Sep 28 00:56:31 2019 +0000
Revision:
1:ca2d24ec97ba
Parent:
0:fa546fb96b80
Copy and paste the right mbed-os and libmdot

Who changed what in which revision?

UserRevisionLine numberNew contents of line
WilliamAF 0:fa546fb96b80 1 /**
WilliamAF 0:fa546fb96b80 2 * A class that runs a terminal to help debug the program. It handles storing
WilliamAF 0:fa546fb96b80 3 * received characters in a buffer until a command is read and executing that
WilliamAF 0:fa546fb96b80 4 * command.
WilliamAF 0:fa546fb96b80 5 * Usage:
WilliamAF 0:fa546fb96b80 6 * mts::DebugTerminal* term = new mts::DebugTerminal(dot, UART_TX, UART_RX);
WilliamAF 0:fa546fb96b80 7 * term->baud(115200);
WilliamAF 0:fa546fb96b80 8 * term->start();
WilliamAF 0:fa546fb96b80 9 */
WilliamAF 0:fa546fb96b80 10 #ifndef DEBUG_TERMINAL_H
WilliamAF 0:fa546fb96b80 11 #define DEBUG_TERMINAL_H
WilliamAF 0:fa546fb96b80 12
WilliamAF 0:fa546fb96b80 13 #include "mDot.h"
WilliamAF 0:fa546fb96b80 14 #include "MTSSerial.h"
WilliamAF 0:fa546fb96b80 15 #include "MTSBufferedIO.h"
WilliamAF 0:fa546fb96b80 16
WilliamAF 0:fa546fb96b80 17 namespace mts {
WilliamAF 0:fa546fb96b80 18
WilliamAF 0:fa546fb96b80 19 class DebugTerminal : public MTSSerial {
WilliamAF 0:fa546fb96b80 20 public:
WilliamAF 0:fa546fb96b80 21 DebugTerminal(mDot* dot, PinName TXD, PinName RXD, int txBufferSize = 256,
WilliamAF 0:fa546fb96b80 22 int rxBufferSize = 256);
WilliamAF 0:fa546fb96b80 23 virtual ~DebugTerminal();
WilliamAF 0:fa546fb96b80 24
WilliamAF 0:fa546fb96b80 25 // Handle terminal reads in a loop
WilliamAF 0:fa546fb96b80 26 void start();
WilliamAF 0:fa546fb96b80 27
WilliamAF 0:fa546fb96b80 28 // Called after the user presses return.
WilliamAF 0:fa546fb96b80 29 // Parameter is a line without \r or \n
WilliamAF 0:fa546fb96b80 30 void handleCommand(std::string command);
WilliamAF 0:fa546fb96b80 31
WilliamAF 0:fa546fb96b80 32 protected:
WilliamAF 0:fa546fb96b80 33
WilliamAF 0:fa546fb96b80 34 private:
WilliamAF 0:fa546fb96b80 35 mDot* dot;
WilliamAF 0:fa546fb96b80 36 };
WilliamAF 0:fa546fb96b80 37
WilliamAF 0:fa546fb96b80 38 } // namespace
WilliamAF 0:fa546fb96b80 39 #endif // Header guard */