SRK Version of mDot LoRa_Sensormode_SRK

Dependencies:   libmDot mbed-rtos mbed

Fork of mDot_LoRa_Sensornode by Adrian Mitevski

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers MAX44009Message.cpp Source File

MAX44009Message.cpp

00001 /*
00002  * MAX44009Message.cpp
00003  *
00004  *  Created on: Jun 1, 2016
00005  *      Author: Adrian
00006  */
00007 
00008 #include "MAX44009Message.h "
00009 #include "main.h"
00010 
00011 MAX44009Message::MAX44009Message() {
00012     this->loraMessageId.push_back(MAX44009_MESSAGE_ID);
00013 }
00014 
00015 MAX44009Message::~MAX44009Message() {
00016     // TODO Auto-generated destructor stub
00017 }
00018 
00019 void MAX44009Message::setLux(float lux){
00020     this->lux = lux;
00021 
00022 }
00023 
00024 float MAX44009Message::getLux(){
00025     return lux;
00026 }
00027 
00028 char* MAX44009Message::getLoRaMessageString(){
00029     loraMessage.clear();
00030     char buffer[20];
00031     sprintf(buffer,"%s:%.2f,",loraMessageId.at(0).c_str(),getLux());
00032     loraMessage.append(buffer);
00033     return (char*) loraMessage.c_str();
00034 }
00035