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@27:7664225b6036, 2015-03-27 (annotated)
- Committer:
 - mlucas82
 - Date:
 - Fri Mar 27 20:58:05 2015 +0000
 - Revision:
 - 27:7664225b6036
 - Parent:
 - 22:a06c7bb05008
 - Child:
 - 38:132e83a591d0
 
Added different LOGs when resetting
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 ... "; | 
| mlucas82 | 22:a06c7bb05008 | 19 | static const char *PMEDLOG_STARTED = " Started Protegemed ! "; | 
| mlucas82 | 22:a06c7bb05008 | 20 | static const char *PMEDLOG_WRONGCODE = " Oops... wrong code, a reset may be expected "; | 
| mlucas82 | 27:7664225b6036 | 21 | static const char *PMEDLOG_RESET = " No reason given "; | 
| mlucas82 | 22:a06c7bb05008 | 22 | static const char *PMEDLOG_DEFAULTS = " Loaded defaults in Settings ! "; | 
| mlucas82 | 22:a06c7bb05008 | 23 | |
| mlucas82 | 27:7664225b6036 | 24 | static const char *PMEDLOG_RESETTELNET = " by telnet reset "; | 
| mlucas82 | 27:7664225b6036 | 25 | static const char *PMEDLOG_UPDATETELNET = " by telnet update "; | 
| mlucas82 | 27:7664225b6036 | 26 | |
| mlucas82 | 27:7664225b6036 | 27 | static const char *PMEDLOG_HTTP_CONNECT = "On HTTP_POST - Connect"; | 
| mlucas82 | 27:7664225b6036 | 28 | static const char *PMEDLOG_HTTP_SEND = "On HTTP_POST - Send"; | 
| mlucas82 | 27:7664225b6036 | 29 | |
| mlucas82 | 11:2b79016076dc | 30 | class PmedLog | 
| mlucas82 | 11:2b79016076dc | 31 | { | 
| mlucas82 | 11:2b79016076dc | 32 | |
| mlucas82 | 11:2b79016076dc | 33 | protected: | 
| mlucas82 | 11:2b79016076dc | 34 | |
| mlucas82 | 11:2b79016076dc | 35 | static int m_entry; | 
| mlucas82 | 11:2b79016076dc | 36 | static time_t m_lastMark; | 
| mlucas82 | 11:2b79016076dc | 37 | |
| mlucas82 | 11:2b79016076dc | 38 | public: | 
| mlucas82 | 11:2b79016076dc | 39 | |
| mlucas82 | 11:2b79016076dc | 40 | PmedLog(); | 
| mlucas82 | 11:2b79016076dc | 41 | |
| mlucas82 | 11:2b79016076dc | 42 | // Control the marks behavior in log file | 
| mlucas82 | 11:2b79016076dc | 43 | static bool get_LogMarks() { return Settings::get_LogMarks(); } | 
| mlucas82 | 11:2b79016076dc | 44 | static void set_LogMarks(bool value) { Settings::set_LogMarks(value); } | 
| mlucas82 | 11:2b79016076dc | 45 | static int get_LogMarksInterval() { return Settings::get_LogMarksInterval(); } | 
| mlucas82 | 11:2b79016076dc | 46 | static void set_LogMarksInterval(int value) { Settings::set_LogMarksInterval(value); } | 
| mlucas82 | 11:2b79016076dc | 47 | |
| mlucas82 | 22:a06c7bb05008 | 48 | static void WriteEntry(const char *value); | 
| mlucas82 | 11:2b79016076dc | 49 | static void Mark(); | 
| mlucas82 | 11:2b79016076dc | 50 | |
| mlucas82 | 11:2b79016076dc | 51 | }; | 
| mlucas82 | 11:2b79016076dc | 52 | |
| mlucas82 | 22:a06c7bb05008 | 53 | #endif //#ifndef PMEDLOGS_H | 
| mlucas82 | 22:a06c7bb05008 | 54 | 
