new payload encoder (experimental)

This commit is contained in:
Klaus K Wilting 2018-06-17 00:05:26 +02:00
parent a6642ea8b6
commit 095334a2a6
2 changed files with 3 additions and 4 deletions

View File

@ -41,9 +41,9 @@
#define SEND_SECS 30 // [seconds/2] -> 60 sec. #define SEND_SECS 30 // [seconds/2] -> 60 sec.
#define MEM_LOW 2048 // [Bytes] low memory threshold triggering a send cycle #define MEM_LOW 2048 // [Bytes] low memory threshold triggering a send cycle
#define RETRANSMIT_RCMD 5 // [seconds] wait time before retransmitting rcommand results #define RETRANSMIT_RCMD 5 // [seconds] wait time before retransmitting rcommand results
#define PAYLOAD_ENCODER 3 // select payload encoder: 1 = Plain [default], 2 = Lora-serialized, 3 = CayenneLPP #define PAYLOAD_ENCODER 1 // select payload encoder: 1 = Plain [default], 2 = Lora-serialized, 3 = CayenneLPP
#define PAYLOAD_BUFFER_SIZE 51 // maximum size of payload block per transmit #define PAYLOAD_BUFFER_SIZE 51 // maximum size of payload block per transmit
#define CAYENNE_LPP 1 // uncomment this, if you need Cayenne LPP payload encoding //#define CAYENNE_LPP 1 // uncomment this, if you need Cayenne LPP payload encoding
// Default LoRa Spreadfactor // Default LoRa Spreadfactor
#define LORASFDEFAULT 9 // 7 ... 12 SF, according to LoRaWAN specs #define LORASFDEFAULT 9 // 7 ... 12 SF, according to LoRaWAN specs

View File

@ -81,12 +81,11 @@ void TTNplain::addStatus(uint16_t voltage, uint64_t uptime, float cputemp) {
TTNserialized::TTNserialized(uint8_t size) { TTNserialized::TTNserialized(uint8_t size) {
buffer = (uint8_t *)malloc(size); buffer = (uint8_t *)malloc(size);
// LoraEncoder message(buffer);
} }
TTNserialized::~TTNserialized(void) { free(buffer); } TTNserialized::~TTNserialized(void) { free(buffer); }
void TTNserialized::reset(void) { delete buffer; } void TTNserialized::reset(void) { }
uint8_t TTNserialized::getSize(void) { return sizeof(buffer); } uint8_t TTNserialized::getSize(void) { return sizeof(buffer); }