Erick / Mbed 2 deprecated ICE_BLE_TEST

Dependencies:   NaturalTinyShell_ice libmDot-12Sept mbed-rtos mbed

Fork of ICE by Erick

Committer:
jmarkel44
Date:
Fri Sep 30 21:05:11 2016 +0000
Revision:
164:7cecd731882e
Parent:
131:a290a3934132
Child:
217:d5a2ff093319
composite control skeleton

Who changed what in which revision?

UserRevisionLine numberNew contents of line
jmarkel44 96:807f04bd5256 1 /******************************************************************************
jmarkel44 96:807f04bd5256 2 *
jmarkel44 96:807f04bd5256 3 * File: ManualControl.h
jmarkel44 96:807f04bd5256 4 * Desciption: ICE Manual Control Class
jmarkel44 96:807f04bd5256 5 *
jmarkel44 96:807f04bd5256 6 *****************************************************************************/
jmarkel44 96:807f04bd5256 7 #ifndef MANUALCONTROL_H
jmarkel44 96:807f04bd5256 8 #define MANUALCONTROL_H
jmarkel44 96:807f04bd5256 9
jmarkel44 96:807f04bd5256 10 #include <string>
jmarkel44 96:807f04bd5256 11
jmarkel44 96:807f04bd5256 12 using namespace std;
jmarkel44 96:807f04bd5256 13
jmarkel44 96:807f04bd5256 14 class ManualControl
jmarkel44 96:807f04bd5256 15 {
jmarkel44 96:807f04bd5256 16 private:
jmarkel44 96:807f04bd5256 17 string controlFile; // name of the control file
jmarkel44 96:807f04bd5256 18 string id; // identifier
jmarkel44 97:5cf6ab71dcd0 19 string output; // output
jmarkel44 96:807f04bd5256 20 unsigned int type; // timed, continuous, setpoint
jmarkel44 96:807f04bd5256 21 unsigned int priority; // control priority
jmarkel44 96:807f04bd5256 22 unsigned int duration;
jmarkel44 96:807f04bd5256 23 float setpoint;
jmarkel44 97:5cf6ab71dcd0 24 unsigned int state; // ON or OFF
jmarkel44 96:807f04bd5256 25 unsigned int percent; // analog/manual value
jmarkel44 96:807f04bd5256 26
jmarkel44 97:5cf6ab71dcd0 27 enum State {
jmarkel44 131:a290a3934132 28 STATE_INIT,
jmarkel44 97:5cf6ab71dcd0 29 STATE_STARTUP,
jmarkel44 97:5cf6ab71dcd0 30 STATE_CONTROL_ON,
jmarkel44 97:5cf6ab71dcd0 31 STATE_CONTROL_OFF
jmarkel44 97:5cf6ab71dcd0 32 };
jmarkel44 97:5cf6ab71dcd0 33 State currentState;
jmarkel44 97:5cf6ab71dcd0 34
jmarkel44 96:807f04bd5256 35 public:
jmarkel44 96:807f04bd5256 36 ManualControl() {};
jmarkel44 96:807f04bd5256 37 ~ManualControl() {
jmarkel44 96:807f04bd5256 38 printf("\r%s destructor invoked\n", __func__);
jmarkel44 96:807f04bd5256 39 }
jmarkel44 96:807f04bd5256 40 // load a control from the control file
jmarkel44 96:807f04bd5256 41 bool load(string filename);
jmarkel44 96:807f04bd5256 42 string getControlFile(void) const {
jmarkel44 96:807f04bd5256 43 return controlFile;
jmarkel44 96:807f04bd5256 44 }
jmarkel44 96:807f04bd5256 45
jmarkel44 97:5cf6ab71dcd0 46 void start(void);
jmarkel44 97:5cf6ab71dcd0 47 int update(void);
jmarkel44 164:7cecd731882e 48 int powerOutput(void);
jmarkel44 97:5cf6ab71dcd0 49 int unregisterControl();
jmarkel44 97:5cf6ab71dcd0 50 void display(void);
jmarkel44 96:807f04bd5256 51 };
jmarkel44 96:807f04bd5256 52
jmarkel44 96:807f04bd5256 53 #endif