senddata.cpp: fix missing }

This commit is contained in:
cyberman54 2022-11-06 15:16:28 +01:00
parent 4015e9e989
commit e5cc72fb1c

View File

@ -96,9 +96,8 @@ void sendData() {
#if !(PAYLOAD_OPENSENSEBOX) #if !(PAYLOAD_OPENSENSEBOX)
payload.addCount(count.wifi_count, MAC_SNIFF_WIFI); payload.addCount(count.wifi_count, MAC_SNIFF_WIFI);
if (cfg.blescan) { if (cfg.blescan)
payload.addCount(count.ble_count, MAC_SNIFF_BLE); payload.addCount(count.ble_count, MAC_SNIFF_BLE);
}
#endif #endif
#if (HAS_GPS) #if (HAS_GPS)
@ -114,116 +113,116 @@ void sendData() {
#if (PAYLOAD_OPENSENSEBOX) #if (PAYLOAD_OPENSENSEBOX)
payload.addCount(count.wifi_count, MAC_SNIFF_WIFI); payload.addCount(count.wifi_count, MAC_SNIFF_WIFI);
if (cfg.blescan) { if (cfg.blescan)
payload.addCount(count.ble_count, MAC_SNIFF_BLE); payload.addCount(count.ble_count, MAC_SNIFF_BLE);
#endif #endif
#if (HAS_SDS011) #if (HAS_SDS011)
sds011_store(&sds_status); sds011_store(&sds_status);
payload.addSDS(sds_status); payload.addSDS(sds_status);
#endif #endif
#ifdef HAS_DISPLAY #ifdef HAS_DISPLAY
dp_plotCurve(count.pax, true); dp_plotCurve(count.pax, true);
#endif #endif
#if (HAS_SDCARD) #if (HAS_SDCARD)
sdcardWriteData(count.wifi_count, count.ble_count sdcardWriteData(count.wifi_count, count.ble_count
#if (defined BAT_MEASURE_ADC || defined HAS_PMU) #if (defined BAT_MEASURE_ADC || defined HAS_PMU)
, ,
read_voltage() read_voltage()
#endif #endif
); );
#endif // HAS_SDCARD #endif // HAS_SDCARD
SendPayload(COUNTERPORT); SendPayload(COUNTERPORT);
break; // case COUNTDATA break; // case COUNTDATA
#endif // ((WIFICOUNTER) || (BLECOUNTER)) #endif // ((WIFICOUNTER) || (BLECOUNTER))
#if (HAS_BME) #if (HAS_BME)
case MEMS_DATA: case MEMS_DATA:
payload.reset(); payload.reset();
payload.addBME(bme_status); payload.addBME(bme_status);
SendPayload(BMEPORT); SendPayload(BMEPORT);
break; break;
#endif #endif
#if (HAS_GPS) #if (HAS_GPS)
case GPS_DATA: case GPS_DATA:
if (GPSPORT != COUNTERPORT) { if (GPSPORT != COUNTERPORT) {
// send GPS position only if we have a fix // send GPS position only if we have a fix
if (gps_hasfix()) { if (gps_hasfix()) {
gps_storelocation(&gps_status); gps_storelocation(&gps_status);
payload.reset(); payload.reset();
payload.addGPS(gps_status); payload.addGPS(gps_status);
SendPayload(GPSPORT); SendPayload(GPSPORT);
} else } else
ESP_LOGD(TAG, "No valid GPS position"); ESP_LOGD(TAG, "No valid GPS position");
} }
break; break;
#endif #endif
#if (HAS_SENSORS) #if (HAS_SENSORS)
#if (HAS_SENSOR_1) #if (HAS_SENSOR_1)
case SENSOR1_DATA: case SENSOR1_DATA:
payload.reset(); payload.reset();
payload.addSensor(sensor_read(1)); payload.addSensor(sensor_read(1));
SendPayload(SENSOR1PORT); SendPayload(SENSOR1PORT);
break; break;
#endif #endif
#if (HAS_SENSOR_2) #if (HAS_SENSOR_2)
case SENSOR2_DATA: case SENSOR2_DATA:
payload.reset(); payload.reset();
payload.addSensor(sensor_read(2)); payload.addSensor(sensor_read(2));
SendPayload(SENSOR2PORT); SendPayload(SENSOR2PORT);
break; break;
#endif #endif
#if (HAS_SENSOR_3) #if (HAS_SENSOR_3)
case SENSOR3_DATA: case SENSOR3_DATA:
payload.reset(); payload.reset();
payload.addSensor(sensor_read(3)); payload.addSensor(sensor_read(3));
SendPayload(SENSOR3PORT); SendPayload(SENSOR3PORT);
break; break;
#endif #endif
#endif #endif
#if (defined BAT_MEASURE_ADC || defined HAS_PMU) #if (defined BAT_MEASURE_ADC || defined HAS_PMU)
case BATT_DATA: case BATT_DATA:
payload.reset(); payload.reset();
payload.addVoltage(read_voltage()); payload.addVoltage(read_voltage());
SendPayload(BATTPORT); SendPayload(BATTPORT);
break; break;
#endif #endif
} // switch } // switch
bitmask &= ~mask; bitmask &= ~mask;
mask <<= 1; mask <<= 1;
} // while (bitmask) } // while (bitmask)
} // sendData() } // sendData()
void flushQueues(void) { void flushQueues(void) {
rcmd_queuereset(); rcmd_queuereset();
#if (HAS_LORA) #if (HAS_LORA)
lora_queuereset(); lora_queuereset();
#endif #endif
#ifdef HAS_SPI #ifdef HAS_SPI
spi_queuereset(); spi_queuereset();
#endif #endif
#ifdef HAS_MQTT #ifdef HAS_MQTT
mqtt_queuereset(); mqtt_queuereset();
#endif #endif
} }
bool allQueuesEmtpy(void) { bool allQueuesEmtpy(void) {
uint32_t rc = rcmd_queuewaiting(); uint32_t rc = rcmd_queuewaiting();
#if (HAS_LORA) #if (HAS_LORA)
rc += lora_queuewaiting(); rc += lora_queuewaiting();
#endif #endif
#ifdef HAS_SPI #ifdef HAS_SPI
rc += spi_queuewaiting(); rc += spi_queuewaiting();
#endif #endif
#ifdef HAS_MQTT #ifdef HAS_MQTT
rc += mqtt_queuewaiting(); rc += mqtt_queuewaiting();
#endif #endif
return (rc == 0) ? true : false; return (rc == 0) ? true : false;
} }