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: NaturalTinyShell_ice libmDot-12Sept mbed-rtos mbed
Fork of ICE by
Diff: src/ConfigurationHandler/Controls/TimerControl.h
- Revision:
- 122:4db48b933115
- Parent:
- 35:6235ef67faa1
- Child:
- 126:c85ac6a8e9af
--- a/src/ConfigurationHandler/Controls/TimerControl.h Fri Sep 23 12:45:49 2016 +0000 +++ b/src/ConfigurationHandler/Controls/TimerControl.h Fri Sep 23 15:13:04 2016 +0000 @@ -8,36 +8,53 @@ #define TIMERCONTROL_H #include <string> - -using namespace std; +#include <stdio.h> class TimerControl { private: - string controlFile; // name of the control file - string id; // identifier - string name; // friendly name - unsigned int priority; // control priority - string output; - unsigned int dayOfWeek; // days of the week - unsigned int startWeek; // starting week - unsigned int freq; - typedef struct tod_tag { - unsigned int start; - unsigned int interval; - } Tod_t; - Tod_t tod; - + std::string controlFile; + std::string id; + unsigned int priority; + unsigned int dow; + unsigned int startw; + std::string output; + unsigned int startHour; + unsigned int startMinute; + unsigned int duration; + public: TimerControl() {}; ~TimerControl() { printf("\r%s destructor invoked\n", __func__); } // load a control from the control file - bool load(string filename); - string getControlFile(void) { + bool load(std::string filename); + + void display(void); + + std::string getControlFile(void) { return controlFile; } }; +#define DAY_SUNDAY_MASK (1 << 0) +#define DAY_MONDAY_MASK (1 << 1) +#define DAY_TUESDAY_MASK (1 << 2) +#define DAY_WEDNESDAY_MASK (1 << 3) +#define DAY_THURSDAY_MASK (1 << 4) +#define DAY_FRIDAY_MASK (1 << 5) +#define DAY_SATURDAY_MASK (1 << 6) + +// used to decipher starting week +typedef enum +{ + EVERY_WEEK = 0, + FIRST_WEEK = 1, + SECOND_WEEK = 2, + THIRD_WEEK = 3, + FOURTH_WEEK = 4, + LAST_WEEK = 5, + EVERY_OTHER_WEEK = 6 +} WEEKLY_CHOICES; #endif