Skip to content
Snippets Groups Projects
Commit 79654d42 authored by Moritz Perschke's avatar Moritz Perschke
Browse files

fixed return value in Time, implemented build_messages for dr26 and scd30

parent c8cf9fa5
No related branches found
No related tags found
4 merge requests!39Merge Develop into Main,!19development into master,!17Inital Host, initial Client,!6Espnow
......@@ -46,7 +46,11 @@ void ForteDR26 ::changeGain(adsGain_t gain)
std::list<Message> ForteDR26::buildMessages()
{
throw "Not implemented";
std::list<Message> messages;
float data = readData();
MeasurementData IncrementData{data, 0, {}, "CIRCUMFERENCE_INCREMENT"};
messages.emplace_back((IncrementData, sensorInformation, Time::getInstance().getEpochSeconds()));
return messages;
}
SensorInformation ForteDR26::getSensorInformation() const
{
......
......@@ -24,8 +24,20 @@ out_data_scd30 ForteSCD30 ::readData()
std::list<Message> ForteSCD30::buildMessages()
{
throw "Not yet implemented";
std::list<Message> messages;
out_data_scd30 data = readData();
MeasurementData CO2Data{data.C02, 0, {}, "CO2"};
MeasurementData TempData{data.Temperature, 0, {}, "Temperature"};
MeasurementData HumidData{data.Humidity, 0, {}, "Humidity"};
messages.emplace_back(Message(CO2Data, sensorInformation, Time::getInstance().getEpochSeconds()));
messages.emplace_back(Message(TempData, sensorInformation, Time::getInstance().getEpochSeconds()));
messages.emplace_back(Message(HumidData, sensorInformation, Time::getInstance().getEpochSeconds()));
return messages;
}
SensorInformation ForteSCD30::getSensorInformation() const
{
return sensorInformation;
......
......@@ -17,7 +17,7 @@ String Time::getTime(String format)
{
return this->rtc.getTime(std::move(format));
}
long Time::getEpochSeconds()
unsigned long Time::getEpochSeconds()
{
return this->rtc.getEpoch();
}
......
......@@ -45,7 +45,7 @@ class Time {
/*!
@brief get the current epoch seconds as long
*/
long getEpochSeconds();
unsigned long getEpochSeconds();
/*!
@brief get the current milliseconds as long
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment