3rd Repo, trying to figure this out.
Fork of SOFT253_Template_Weather_OS_54 by
MessageLogger/MessageLogger.h@79:4e6b53eb678b, 2017-04-28 (annotated)
- Committer:
- aburch1
- Date:
- Fri Apr 28 17:17:24 2017 +0000
- Revision:
- 79:4e6b53eb678b
- Parent:
- 77:db3384071634
- Child:
- 80:959151952153
Message logger used to print most messages, bugs including commands failing need to be discussed with nicholas
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
aburch1 | 74:749727490f44 | 1 | #include "mbed.h" |
aburch1 | 74:749727490f44 | 2 | #include "rtos.h" |
aburch1 | 74:749727490f44 | 3 | #include <string> |
aburch1 | 74:749727490f44 | 4 | #include <sstream> |
aburch1 | 74:749727490f44 | 5 | #include <iostream> |
aburch1 | 74:749727490f44 | 6 | |
aburch1 | 74:749727490f44 | 7 | class MessageLogger |
aburch1 | 74:749727490f44 | 8 | { |
aburch1 | 74:749727490f44 | 9 | public: |
aburch1 | 74:749727490f44 | 10 | // constructor |
aburch1 | 75:b44645bbf2d2 | 11 | MessageLogger(); |
aburch1 | 74:749727490f44 | 12 | |
aburch1 | 74:749727490f44 | 13 | // public methods: |
aburch1 | 77:db3384071634 | 14 | void SendError(string errorMessage); |
aburch1 | 79:4e6b53eb678b | 15 | void SendMessage(string message); |
aburch1 | 79:4e6b53eb678b | 16 | void SendMessage(char message); |
aburch1 | 74:749727490f44 | 17 | bool GetError(); |
aburch1 | 74:749727490f44 | 18 | bool GetMessage(); |
aburch1 | 75:b44645bbf2d2 | 19 | void SetThread(Thread* logger); |
aburch1 | 74:749727490f44 | 20 | |
aburch1 | 74:749727490f44 | 21 | private: |
aburch1 | 75:b44645bbf2d2 | 22 | Thread* loggingThread; |
aburch1 | 77:db3384071634 | 23 | ostringstream fatalError; |
aburch1 | 74:749727490f44 | 24 | int messageCount; |
aburch1 | 75:b44645bbf2d2 | 25 | bool hasError; |
aburch1 | 75:b44645bbf2d2 | 26 | osStatus stat; |
aburch1 | 79:4e6b53eb678b | 27 | char c; |
aburch1 | 74:749727490f44 | 28 | |
aburch1 | 74:749727490f44 | 29 | void PrintError(); |
aburch1 | 74:749727490f44 | 30 | void PrintMessage(); |
aburch1 | 74:749727490f44 | 31 | }; |