From 509b8b6cd338da16354d5d3b92a4be77e78f7891 Mon Sep 17 00:00:00 2001 From: Klaus K Wilting Date: Sat, 16 Jun 2018 19:54:48 +0200 Subject: [PATCH] finishing new payload converter structure --- src/globals.h | 8 ++++---- src/main.cpp | 12 +++++------- src/paxcounter.conf | 2 +- 3 files changed, 10 insertions(+), 12 deletions(-) diff --git a/src/globals.h b/src/globals.h index 37567dfd..e9290285 100644 --- a/src/globals.h +++ b/src/globals.h @@ -46,12 +46,12 @@ extern TinyGPSPlus gps; // Make TinyGPS++ instance globally availabe #endif // payload encoder -#if (PAYLOAD_ENCODER == 3) -// externe CayenneLPP payload; +#if (PAYLOAD_ENCODER == 1) +extern TTNplain payload; #elif (PAYLOAD_ENCODER == 2) extern TTNserialized payload; -#elif (PAYLOAD_ENCODER == 1) -extern TTNplain payload; +#elif (PAYLOAD_ENCODER == 3) +//extern CayenneLPP payload; #else #error "No valid payload converter defined" #endif \ No newline at end of file diff --git a/src/main.cpp b/src/main.cpp index 8dee0c0e..5a3a6589 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -70,19 +70,17 @@ portMUX_TYPE timerMux = std::set macs; // associative container holds total of unique MAC // adress hashes (Wifi + BLE) -// select payload encoder -#if (PAYLOAD_ENCODER == 3) -// CayenneLPP payload(PAYLOAD_BUFFER_SIZE); +// initialize payload encoder +#if (PAYLOAD_ENCODER == 1) +TTNplain payload(PAYLOAD_BUFFER_SIZE); #elif (PAYLOAD_ENCODER == 2) TTNserialized payload(PAYLOAD_BUFFER_SIZE); -#elif (PAYLOAD_ENCODER == 1) -TTNplain payload(PAYLOAD_BUFFER_SIZE); +#elif (PAYLOAD_ENCODER == 3) +//CayenneLPP payload(PAYLOAD_BUFFER_SIZE); #else #error "No valid payload converter defined" #endif -// TTNplain payload(PAYLOAD_BUFFER_SIZE); - // this variables will be changed in the ISR, and read in main loop static volatile int ButtonPressedIRQ = 0, DisplayTimerIRQ = 0, ChannelTimerIRQ = 0; diff --git a/src/paxcounter.conf b/src/paxcounter.conf index 0c3dad85..9e550d01 100644 --- a/src/paxcounter.conf +++ b/src/paxcounter.conf @@ -39,7 +39,7 @@ #define SEND_SECS 30 // [seconds/2] -> 60 sec. #define MEM_LOW 2048 // [Bytes] low memory threshold triggering a send cycle #define RETRANSMIT_RCMD 5 // [seconds] wait time before retransmitting rcommand results -#define PAYLOAD_ENCODER 2 // select payload encoder: 1 = Plain [default], 2 = Lora-hserialized, 3 = Cayenne LPP +#define PAYLOAD_ENCODER 1 // select payload encoder: 1 = Plain [default], 2 = Lora-hserialized, 3 = Cayenne LPP #define PAYLOAD_BUFFER_SIZE 51 // maximum size of payload block per transmit // Default LoRa Spreadfactor