mobile-sensebox/libraries/Lora_Serialization/src/LoraMessage.h
noerw ada3c1ea8c add lora-gps sketch
GPS tracked SDS011 sensor, transmitting data

via Lora through TTN to opensensemap.org

based on Arduino Mega
2017-09-23 16:23:19 +02:00

32 lines
843 B
C++

#ifndef _LORA_MESSAGE_H_
#define _LORA_MESSAGE_H_
#if ARDUINO >= 100
#include "Arduino.h"
#else
#include <stdint.h>
typedef uint8_t byte;
#endif
#include "LoraEncoder.h"
class LoraMessage {
public:
LoraMessage();
~LoraMessage();
LoraMessage& addUnixtime(uint32_t unixtime);
LoraMessage& addLatLng(double latitude, double longitude);
LoraMessage& addUint16(uint16_t i);
LoraMessage& addTemperature(float temperature);
LoraMessage& addUint8(uint8_t i);
LoraMessage& addHumidity(float humidity);
LoraMessage& addBitmap(bool a, bool b, bool c, bool d, bool e, bool f, bool g, bool h);
byte* getBytes();
int getLength();
private:
LoraEncoder _reallocBuffer(int delta);
byte* _buffer;
int _currentSize;
};
#endif