lora sensnode
Dependencies: libmDot mbed-rtos mbed
Fork of mDot_LoRa_Sensornode by
Diff: app/SI1143ProximityMessage.cpp
- Revision:
- 0:f2815503561f
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/app/SI1143ProximityMessage.cpp Wed Jul 06 20:40:36 2016 +0000 @@ -0,0 +1,36 @@ +/* + * SI1143Message.cpp + * + * Created on: 02.06.2016 + * Author: Adrian + */ + +#include "SI1143ProximityMessage.h" + +SI1143ProximityMessage::SI1143ProximityMessage() { + loraMessageId.push_back(SI1143_PROXIMITY_MESSAGE_ID); + +} + +SI1143ProximityMessage::~SI1143ProximityMessage() { + // TODO Auto-generated destructor stub +} + +void SI1143ProximityMessage::setProximity(uint16_t proximity){ + this->proximity = proximity; +} + +uint16_t SI1143ProximityMessage::getProximity(){ + return proximity; +} + +char* SI1143ProximityMessage::getLoRaMessageString(){ + loraMessage.clear(); + char buffer[20]; + sprintf(buffer,"%s:%d,",loraMessageId.at(0).c_str(),getProximity()); + loraMessage.append(buffer); + return (char*) loraMessage.c_str(); +} + + +