Erick / Mbed 2 deprecated ICE_BLE_TEST

Dependencies:   NaturalTinyShell_ice libmDot-12Sept mbed-rtos mbed

Fork of ICE by Erick

src/OutputTask/OutputTask.h

Committer:
jmarkel44
Date:
2016-09-19
Revision:
74:03ccf04998b5
Parent:
72:3754b352f156
Child:
77:43e0a3d9e536

File content as of revision 74:03ccf04998b5:

#ifndef OUTPUTTASK_H
#define OUTPUTTASK_H

#include <string>
#include <stdio.h>

void OutputTask(void const *args);
void DisplayOutputs(void);

#define OUTPUT_STR  "output"

typedef enum {
    CONTROL_OFF = 0,
    CONTROL_ON  = 1
} ControlState;


/*****************************************************************************
 * Control class 
 ****************************************************************************/
class Control
{
private:
    std::string          id;
    unsigned int    priority;
    ControlState    state;
public:
    Control(std::string id, unsigned int priority, ControlState state) :
        id(id), priority(priority), state(state) {}
    void display() {
        printf("[%s | %s | %u]",
               id.c_str(), (state == CONTROL_ON) ? "ON" : "OFF", priority);
    }
    //void setId(string id) id(id) { }
    std::string getId() {
        return id;
    }
    void setState(ControlState _state) {
        state = _state;
    }
};
#endif