From 55e0c73c77dab17ba62f5f73d629da655805ce8c Mon Sep 17 00:00:00 2001 From: Klaus K Wilting Date: Wed, 27 Feb 2019 00:49:32 +0100 Subject: [PATCH] Log tags changed --- src/battery.cpp | 2 +- src/bme680mems.cpp | 2 +- src/button.cpp | 2 +- src/macsniff.cpp | 2 +- src/ota.cpp | 2 +- src/payload.cpp | 4 +++- src/rcommand.cpp | 2 +- src/senddata.cpp | 10 +++++++++- src/sensor.cpp | 2 +- 9 files changed, 19 insertions(+), 9 deletions(-) diff --git a/src/battery.cpp b/src/battery.cpp index 940e3500..ab15fe4e 100644 --- a/src/battery.cpp +++ b/src/battery.cpp @@ -1,7 +1,7 @@ #include "globals.h" // Local logging tag -static const char TAG[] = "main"; +static const char TAG[] = __FILE__; #ifdef HAS_BATTERY_PROBE esp_adc_cal_characteristics_t *adc_characs = diff --git a/src/bme680mems.cpp b/src/bme680mems.cpp index 924bc656..d0679507 100644 --- a/src/bme680mems.cpp +++ b/src/bme680mems.cpp @@ -3,7 +3,7 @@ #include "bme680mems.h" // Local logging tag -static const char TAG[] = "main"; +static const char TAG[] = __FILE__; bmeStatus_t bme_status; TaskHandle_t BmeTask; diff --git a/src/button.cpp b/src/button.cpp index d7d5c2a4..93201580 100644 --- a/src/button.cpp +++ b/src/button.cpp @@ -4,7 +4,7 @@ #include "button.h" // Local logging tag -static const char TAG[] = "main"; +static const char TAG[] = __FILE__; void readButton() { ESP_LOGI(TAG, "Button pressed"); diff --git a/src/macsniff.cpp b/src/macsniff.cpp index 5cc02c64..c98761cb 100644 --- a/src/macsniff.cpp +++ b/src/macsniff.cpp @@ -7,7 +7,7 @@ #endif // Local logging tag -static const char TAG[] = "main"; +static const char TAG[] = __FILE__; uint16_t salt; diff --git a/src/ota.cpp b/src/ota.cpp index 4210b704..a2623702 100644 --- a/src/ota.cpp +++ b/src/ota.cpp @@ -31,7 +31,7 @@ int volatile contentLength = 0; bool volatile isValidContentType = false; // Local logging tag -static const char TAG[] = "main"; +static const char TAG[] = __FILE__; // helper function to extract header value from header inline String getHeaderValue(String header, String headerName) { diff --git a/src/payload.cpp b/src/payload.cpp index b94c07f3..4e0d0d16 100644 --- a/src/payload.cpp +++ b/src/payload.cpp @@ -290,7 +290,9 @@ void PayloadConvert::writeBitmap(bool a, bool b, bool c, bool d, bool e, bool f, } /* ---------------- Cayenne LPP 2.0 format ---------- */ -// see specs http://community.mydevices.com/t/cayenne-lpp-2-0/7510 +// see specs +// http://community.mydevices.com/t/cayenne-lpp-2-0/7510 (LPP 2.0) +// https://github.com/myDevicesIoT/cayenne-docs/blob/master/docs/LORA.md (LPP 1.0) // PAYLOAD_ENCODER == 3 -> Dynamic Sensor Payload, using channels -> FPort 1 // PAYLOAD_ENCODER == 4 -> Packed Sensor Payload, not using channels -> FPort 2 diff --git a/src/rcommand.cpp b/src/rcommand.cpp index a0c89cc4..2873b9bf 100644 --- a/src/rcommand.cpp +++ b/src/rcommand.cpp @@ -3,7 +3,7 @@ #include "rcommand.h" // Local logging tag -static const char TAG[] = "main"; +static const char TAG[] = __FILE__; // helper function void do_reset() { diff --git a/src/senddata.cpp b/src/senddata.cpp index 386ab6ab..6886117a 100644 --- a/src/senddata.cpp +++ b/src/senddata.cpp @@ -34,9 +34,13 @@ void SendPayload(uint8_t port, sendprio_t prio) { } memcpy(SendBuffer.Message, payload.getBuffer(), payload.getSize()); - // enqueue message in device's send queues +// enqueue message in device's send queues +#ifdef HAS_LORA lora_enqueuedata(&SendBuffer, prio); +#endif +#ifdef HAS_SPI spi_enqueuedata(&SendBuffer, prio); +#endif } // SendPayload @@ -130,6 +134,10 @@ void sendCounter() { } // sendCounter() void flushQueues() { +#ifdef HAS_LORA lora_queuereset(); +#endif +#ifdef HAS_SPI spi_queuereset(); +#endif } \ No newline at end of file diff --git a/src/sensor.cpp b/src/sensor.cpp index 0892f4dd..6b672f0e 100644 --- a/src/sensor.cpp +++ b/src/sensor.cpp @@ -2,7 +2,7 @@ #include "globals.h" // Local logging tag -static const char TAG[] = "main"; +static const char TAG[] = __FILE__; #define SENSORBUFFER \ 10 // max. size of user sensor data buffer in bytes [default=20]