Erick / Mbed 2 deprecated ICE_BLE_TEST

Dependencies:   NaturalTinyShell_ice libmDot-12Sept mbed-rtos mbed

Fork of ICE by Erick

src/AnalyticsLogger/AnalyticsLogger.cpp

Committer:
davidjhoward
Date:
2016-09-14
Revision:
58:a4422d19b2ea
Parent:
0:65cfa4873284
Child:
60:96e17fb215a6

File content as of revision 58:a4422d19b2ea:

/******************************************************************************
 *
 * File:                AnalyticsLogger.cpp
 * Desciption:          source for the ICE Analytics Logger
 *
 *****************************************************************************/
#include "global.h"
#include <stdio.h>
#include "AnalyticsLogger.h"
#include "eep.h"

/*****************************************************************************
 * Function:             AnalyticsLogger
 * Description:          entry point for the Analytics Logger
 *
 * @param                (IN) args (user-defined arguments)
 * @return               none
 *****************************************************************************/
void AnalyticsLogger(void const *args)
{
    printf("\r%s has started...\n", __func__);

    while ( true ) {
//        logInfo("Analytics Logger checking for MAIL");
        osEvent evt = AnalyticsLoggerMailBox.get(1000);
        if (evt.status == osEventMail) {
            AnalyticsLoggerReq_t *mail = (AnalyticsLoggerReq_t*)evt.value.p;
            logInfo("Analytics Logger Mail Received: Timestamp: %s, Entry: %s", mail->timestamp, mail->log_entry);
            AnalyticsLoggerMailBox.free(mail);
            break;
        } else {
//            logInfo("Analytics Logger no MAIL");
        }
    }
}