Erick / Mbed 2 deprecated ICE_BLE_TEST

Dependencies:   NaturalTinyShell_ice libmDot-12Sept mbed-rtos mbed

Fork of ICE by Erick

src/ControlTask/ControlTask.cpp

Committer:
davidjhoward
Date:
2016-09-19
Revision:
78:5a2e019036a4
Parent:
51:66b820f203a5
Child:
97:5cf6ab71dcd0

File content as of revision 78:5a2e019036a4:

#include "ControlTask.h"
#include <stdio.h>
#include "rtos.h"
#include "ConfigurationHandler.h"
#include "CloudDataLoggerApi.h"
#include "MTSLog.h"

/*****************************************************************************
 * Function:            ControlTask()
 * Description:         show the controls
 *
 * @param               msg
 * @return              none
 *****************************************************************************/
void ControlTask(void const *args)
{
    std::string log_string;
    bool status;
    
    printf("\r%s has started...\n", __func__);

    while ( true ) {
        // service the setpoint controls
        if ( !setpointTable.empty() ) {
            StringSetpointMap::iterator pos;
            for ( pos = setpointTable.begin(); pos != setpointTable.end(); ++pos ) {
                pos->second->update();
            }
        }
        // service the timer controls
        if ( !timerTable.empty() ) {
            StringTimerMap::iterator pos;
            for ( pos = timerTable.begin(); pos != timerTable.end(); ++pos ) {
                //pos->second->update();
            }
        }
        
        log_string = "this is a log message";
        status = CloudDataLoggerApi( &log_string );
        
        // TODO: service the manual controls 
        Thread::wait(2500);
    }
}