Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: libmDot mbed-rtos mbed
Fork of mDot_LoRa_Sensornode by
Diff: app/BME280HumidityMessage.cpp
- Revision:
- 0:f2815503561f
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/app/BME280HumidityMessage.cpp Wed Jul 06 20:40:36 2016 +0000 @@ -0,0 +1,35 @@ +/* + * BME280HumidityMessage.cpp + * + * Created on: Jun 1, 2016 + * Author: Adrian + */ + +#include "BME280HumidityMessage.h" +#include "main.h" + +BME280HumidityMessage::BME280HumidityMessage() { + loraMessageId.push_back(BME280_HUMIDITY_MESSAGE_ID); +} + +BME280HumidityMessage::~BME280HumidityMessage() { + // TODO Auto-generated destructor stub +} + +void BME280HumidityMessage::setHumidity(float humidity){ + this->humidity = humidity; +} + +float BME280HumidityMessage::getHumidity(){ + return humidity; +} + +char* BME280HumidityMessage::getLoRaMessageString(){ + + char buffer[20]; + sprintf(buffer,"%s:%.2f,",loraMessageId.at(0).c_str(),getHumidity()); + loraMessage.clear(); + loraMessage.append(buffer); + return (char*) loraMessage.c_str(); +} +