#include "BMISensor.h"
#include <iostream>
-#include <stdlib.h>
+#include <cmath>
+#include <cstdlib>
#include "SysTimer.h"
#ifdef __ANDROID__
int BMISensor::executeBMISensorLogic(std::map<std::string, std::string> *pInputData,
std::string *pOutput)
{
- BMIResult result;
+ BMIResult result = ERROR;
if (pInputData->find("weight") != pInputData->end())
{
*/
BMIResult BMISensor::makeBMI(void)
{
- double BMIvalue, timediffsecond;
- double dWeight, dHeight;
+ double BMIvalue = 0.0;
+ double timediffsecond = 0.0;
+ double dWeight = 0.0;
+ double dHeight = 0.0;
- int BMIResult;
+ int BMIResult = 0;
if (!m_weight.empty() && !m_height.empty())
{
dWeight = std::stod(m_weight);
dHeight = std::stod(m_height);
- timediffsecond = abs(difftime(m_timepstampW, m_timepstampH));
+ timediffsecond = std::abs(difftime(m_timepstampW, m_timepstampH));
// check if time difference between weight data and height data is valid
if (timediffsecond > DIFFTIME)
}
return ERROR;
-}
\ No newline at end of file
+}