Erick / Mbed 2 deprecated ICE_BLE_TEST

Dependencies:   NaturalTinyShell_ice libmDot-12Sept mbed-rtos mbed

Fork of ICE by Erick

Committer:
jmarkel44
Date:
Wed Sep 21 16:17:12 2016 +0000
Revision:
97:5cf6ab71dcd0
Parent:
96:807f04bd5256
Child:
131:a290a3934132
initial spin of manual controls ; included create-manual command; verifies the output task map of vectors data struct; ;

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 97:5cf6ab71dcd0 28 STATE_STARTUP,
jmarkel44 97:5cf6ab71dcd0 29 STATE_CONTROL_ON,
jmarkel44 97:5cf6ab71dcd0 30 STATE_CONTROL_OFF
jmarkel44 97:5cf6ab71dcd0 31 };
jmarkel44 97:5cf6ab71dcd0 32 State currentState;
jmarkel44 97:5cf6ab71dcd0 33
jmarkel44 96:807f04bd5256 34 public:
jmarkel44 96:807f04bd5256 35 ManualControl() {};
jmarkel44 96:807f04bd5256 36 ~ManualControl() {
jmarkel44 96:807f04bd5256 37 printf("\r%s destructor invoked\n", __func__);
jmarkel44 96:807f04bd5256 38 }
jmarkel44 96:807f04bd5256 39 // load a control from the control file
jmarkel44 96:807f04bd5256 40 bool load(string filename);
jmarkel44 96:807f04bd5256 41 string getControlFile(void) const {
jmarkel44 96:807f04bd5256 42 return controlFile;
jmarkel44 96:807f04bd5256 43 }
jmarkel44 96:807f04bd5256 44
jmarkel44 97:5cf6ab71dcd0 45 void start(void);
jmarkel44 97:5cf6ab71dcd0 46 int update(void);
jmarkel44 97:5cf6ab71dcd0 47 int triggerOutput(void);
jmarkel44 97:5cf6ab71dcd0 48 int unregisterControl();
jmarkel44 97:5cf6ab71dcd0 49 void display(void);
jmarkel44 96:807f04bd5256 50 };
jmarkel44 96:807f04bd5256 51
jmarkel44 96:807f04bd5256 52 #endif