forked from YourproductSmarter/KISSLoRa-demo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathLoraMessage.h
32 lines (28 loc) · 792 Bytes
/
LoraMessage.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#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& addUint64(uint64_t i);
LoraMessage& addHumidity(float humidity);
byte* getBytes();
int getLength();
private:
LoraEncoder _reallocBuffer(int delta);
byte* _buffer;
int _currentSize;
};
#endif