bugfix payload port
This commit is contained in:
1 parent
019af5ef8c
commit
2e51071d87
7 files changed
+15
-17
No files matched your search
+1
-1
@@ -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 =
|
||||
|
||||
+1
-1
@@ -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
|
||||
|
||||
+6
-6
@@ -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() {
|
||||
|
||||
+1
-1
@@ -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 =
|
||||
|
||||
Reference in new issue
Block a user