Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: EthernetInterface mbed-rtos mbed NTPClient
Headers/PmedLog.h@38:132e83a591d0, 2016-01-07 (annotated)
- Committer:
- rebonatto
- Date:
- Thu Jan 07 18:44:44 2016 +0000
- Revision:
- 38:132e83a591d0
- Parent:
- 27:7664225b6036
Vers?o est?vel com DMA e FFT.
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| mlucas82 | 11:2b79016076dc | 1 | /* |
| mlucas82 | 11:2b79016076dc | 2 | * Settings.h |
| mlucas82 | 11:2b79016076dc | 3 | * |
| mlucas82 | 11:2b79016076dc | 4 | * Created on: 19/jan/2015 |
| mlucas82 | 11:2b79016076dc | 5 | * Author: Marcos A. Lucas |
| mlucas82 | 11:2b79016076dc | 6 | */ |
| mlucas82 | 11:2b79016076dc | 7 | |
| mlucas82 | 11:2b79016076dc | 8 | #ifndef PMEDLOG_H |
| mlucas82 | 11:2b79016076dc | 9 | #define PMEDLOG_H |
| mlucas82 | 11:2b79016076dc | 10 | |
| mlucas82 | 11:2b79016076dc | 11 | #include "mbed.h" |
| mlucas82 | 11:2b79016076dc | 12 | #include "Settings.h" |
| mlucas82 | 11:2b79016076dc | 13 | |
| mlucas82 | 11:2b79016076dc | 14 | #define LOGFILE "/local/pmedlog.txt" |
| mlucas82 | 11:2b79016076dc | 15 | |
| mlucas82 | 22:a06c7bb05008 | 16 | |
| mlucas82 | 22:a06c7bb05008 | 17 | //define as constant some log entries |
| mlucas82 | 22:a06c7bb05008 | 18 | static const char *PMEDLOG_INITIALIZING = " Initializing Protegemed ... "; |
| rebonatto | 38:132e83a591d0 | 19 | static const char *PMEDLOG_INITIALIZINGWDT = " Initializing Protegemed by WhatchDog Timer... "; |
| mlucas82 | 22:a06c7bb05008 | 20 | static const char *PMEDLOG_STARTED = " Started Protegemed ! "; |
| mlucas82 | 22:a06c7bb05008 | 21 | static const char *PMEDLOG_WRONGCODE = " Oops... wrong code, a reset may be expected "; |
| mlucas82 | 27:7664225b6036 | 22 | static const char *PMEDLOG_RESET = " No reason given "; |
| mlucas82 | 22:a06c7bb05008 | 23 | static const char *PMEDLOG_DEFAULTS = " Loaded defaults in Settings ! "; |
| mlucas82 | 22:a06c7bb05008 | 24 | |
| mlucas82 | 27:7664225b6036 | 25 | static const char *PMEDLOG_RESETTELNET = " by telnet reset "; |
| mlucas82 | 27:7664225b6036 | 26 | static const char *PMEDLOG_UPDATETELNET = " by telnet update "; |
| mlucas82 | 27:7664225b6036 | 27 | |
| mlucas82 | 27:7664225b6036 | 28 | static const char *PMEDLOG_HTTP_CONNECT = "On HTTP_POST - Connect"; |
| mlucas82 | 27:7664225b6036 | 29 | static const char *PMEDLOG_HTTP_SEND = "On HTTP_POST - Send"; |
| mlucas82 | 27:7664225b6036 | 30 | |
| mlucas82 | 11:2b79016076dc | 31 | class PmedLog |
| mlucas82 | 11:2b79016076dc | 32 | { |
| mlucas82 | 11:2b79016076dc | 33 | |
| mlucas82 | 11:2b79016076dc | 34 | protected: |
| mlucas82 | 11:2b79016076dc | 35 | |
| mlucas82 | 11:2b79016076dc | 36 | static int m_entry; |
| mlucas82 | 11:2b79016076dc | 37 | static time_t m_lastMark; |
| mlucas82 | 11:2b79016076dc | 38 | |
| mlucas82 | 11:2b79016076dc | 39 | public: |
| mlucas82 | 11:2b79016076dc | 40 | |
| mlucas82 | 11:2b79016076dc | 41 | PmedLog(); |
| mlucas82 | 11:2b79016076dc | 42 | |
| mlucas82 | 11:2b79016076dc | 43 | // Control the marks behavior in log file |
| mlucas82 | 11:2b79016076dc | 44 | static bool get_LogMarks() { return Settings::get_LogMarks(); } |
| mlucas82 | 11:2b79016076dc | 45 | static void set_LogMarks(bool value) { Settings::set_LogMarks(value); } |
| mlucas82 | 11:2b79016076dc | 46 | static int get_LogMarksInterval() { return Settings::get_LogMarksInterval(); } |
| mlucas82 | 11:2b79016076dc | 47 | static void set_LogMarksInterval(int value) { Settings::set_LogMarksInterval(value); } |
| mlucas82 | 11:2b79016076dc | 48 | |
| mlucas82 | 22:a06c7bb05008 | 49 | static void WriteEntry(const char *value); |
| mlucas82 | 11:2b79016076dc | 50 | static void Mark(); |
| mlucas82 | 11:2b79016076dc | 51 | |
| mlucas82 | 11:2b79016076dc | 52 | }; |
| mlucas82 | 11:2b79016076dc | 53 | |
| mlucas82 | 22:a06c7bb05008 | 54 | #endif //#ifndef PMEDLOGS_H |
| mlucas82 | 22:a06c7bb05008 | 55 |
