bugfix payload port
This commit is contained in:
parent
019af5ef8c
commit
2e51071d87
@ -26,7 +26,7 @@ void os_getDevEui(u1_t *buf);
|
||||
void showLoraKeys(void);
|
||||
void switch_lora(uint8_t sf, uint8_t tx);
|
||||
void lora_send(osjob_t *job);
|
||||
void lora_enqueuedata(uint8_t messageType, MessageBuffer_t *message);
|
||||
void lora_enqueuedata(MessageBuffer_t *message);
|
||||
void lora_queuereset(void);
|
||||
void lora_housekeeping(void);
|
||||
void user_request_network_time_callback(void *pVoidUserUTCTime,
|
||||
|
@ -28,7 +28,7 @@ licenses. Refer to LICENSE.txt file in repository for more details.
|
||||
|
||||
esp_err_t spi_init();
|
||||
|
||||
void spi_enqueuedata(uint8_t messageType, MessageBuffer_t *message);
|
||||
void spi_enqueuedata(MessageBuffer_t *message);
|
||||
void spi_queuereset();
|
||||
|
||||
void spi_housekeeping();
|
||||
|
@ -29,7 +29,7 @@ description = Paxcounter is a proof-of-concept ESP32 device for metering passeng
|
||||
|
||||
[common]
|
||||
; for release_version use max. 10 chars total, use any decimal format like "a.b.c"
|
||||
release_version = 1.6.63
|
||||
release_version = 1.6.68
|
||||
; DEBUG LEVEL: For production run set to 0, otherwise device will leak RAM while running!
|
||||
; 0=None, 1=Error, 2=Warn, 3=Info, 4=Debug, 5=Verbose
|
||||
debug_level = 0
|
||||
@ -43,6 +43,9 @@ board_build.partitions = min_spiffs.csv
|
||||
monitor_speed = 115200
|
||||
lib_deps_all =
|
||||
ArduinoJson@^5.13.1
|
||||
Adafruit Unified Sensor@^1.0.2
|
||||
Adafruit BME680 Library@^1.0.7
|
||||
Time@>=1.5
|
||||
lib_deps_lora =
|
||||
; MCCI LoRaWAN LMIC library@^2.2.2
|
||||
lib_deps_display =
|
||||
@ -51,10 +54,6 @@ lib_deps_rgbled =
|
||||
SmartLeds@>=1.1.3
|
||||
lib_deps_gps =
|
||||
TinyGPSPlus@>=1.0.2
|
||||
Time@>=1.5
|
||||
lib_deps_sensors =
|
||||
Adafruit Unified Sensor@^1.0.2
|
||||
Adafruit BME680 Library@^1.0.7
|
||||
build_flags =
|
||||
-include $PROJECTSRC_DIR/hal/${PIOENV}.h
|
||||
-include $PROJECTSRC_DIR/paxcounter.conf
|
||||
@ -336,7 +335,6 @@ lib_deps =
|
||||
${common.lib_deps_rgbled}
|
||||
${common.lib_deps_gps}
|
||||
${common.lib_deps_display}
|
||||
${common.lib_deps_sensors}
|
||||
build_flags =
|
||||
${common.build_flags}
|
||||
upload_protocol = ${common.upload_protocol}
|
||||
|
@ -389,7 +389,7 @@ esp_err_t lora_stack_init() {
|
||||
#endif
|
||||
}
|
||||
|
||||
void lora_enqueuedata(uint8_t messageType, MessageBuffer_t *message) {
|
||||
void lora_enqueuedata(MessageBuffer_t *message) {
|
||||
// enqueue message in LORA send queue
|
||||
#ifdef HAS_LORA
|
||||
BaseType_t ret =
|
||||
|
@ -11,7 +11,7 @@
|
||||
|
||||
// Payload send cycle and encoding
|
||||
#define SEND_SECS 30 // payload send cycle [seconds/2] -> 60 sec.
|
||||
#define PAYLOAD_ENCODER 2 // payload encoder: 1=Plain, 2=Packed, 3=CayenneLPP dynamic, 4=CayenneLPP packed
|
||||
#define PAYLOAD_ENCODER 3 // payload encoder: 1=Plain, 2=Packed, 3=CayenneLPP dynamic, 4=CayenneLPP packed
|
||||
|
||||
// Set this to include BLE counting and vendor filter functions
|
||||
#define VENDORFILTER 1 // comment out if you want to count things, not people
|
||||
|
@ -7,14 +7,12 @@ void SendData(uint8_t port) {
|
||||
MessageBuffer_t SendBuffer;
|
||||
|
||||
SendBuffer.MessageSize = payload.getSize();
|
||||
SendBuffer.MessagePort = PAYLOAD_ENCODER <= 2
|
||||
? port
|
||||
: (PAYLOAD_ENCODER == 4 ? LPP2PORT : LPP1PORT);
|
||||
SendBuffer.MessagePort = port;
|
||||
memcpy(SendBuffer.Message, payload.getBuffer(), payload.getSize());
|
||||
|
||||
// enqueue message in device's send queues
|
||||
lora_enqueuedata(port, &SendBuffer);
|
||||
spi_enqueuedata(port, &SendBuffer);
|
||||
lora_enqueuedata(&SendBuffer);
|
||||
spi_enqueuedata(&SendBuffer);
|
||||
|
||||
// clear counter if not in cumulative counter mode
|
||||
if ((port == COUNTERPORT) && (cfg.countermode != 1)) {
|
||||
@ -49,7 +47,9 @@ void sendPayload() {
|
||||
ESP_LOGD(TAG, "No valid GPS position or GPS data mode disabled");
|
||||
}
|
||||
#endif
|
||||
SendData(COUNTERPORT);
|
||||
SendData(PAYLOAD_ENCODER <= 2 ? COUNTERPORT
|
||||
: (PAYLOAD_ENCODER == 4 ? LPP2PORT : LPP1PORT));
|
||||
|
||||
} // sendpayload()
|
||||
|
||||
void flushQueues() {
|
||||
|
@ -149,7 +149,7 @@ esp_err_t spi_init() {
|
||||
#endif
|
||||
}
|
||||
|
||||
void spi_enqueuedata(uint8_t messageType, MessageBuffer_t *message) {
|
||||
void spi_enqueuedata(MessageBuffer_t *message) {
|
||||
// enqueue message in SPI send queue
|
||||
#ifdef HAS_SPI
|
||||
BaseType_t ret =
|
||||
|
Loading…
Reference in New Issue
Block a user