mirror of
https://github.com/timmbogner/Farm-Data-Relay-System
synced 2024-11-08 13:10:29 +00:00
fixed error with nodes sending esp-now
It wasn't clearing the buffer of readings after sending, now it does.
This commit is contained in:
parent
ceb0641c88
commit
6e2f64a2e8
@ -409,13 +409,16 @@ bool sendFDRS() {
|
||||
DBG("Sending FDRS Packet!");
|
||||
#ifdef USE_ESPNOW
|
||||
esp_now_send(gatewayAddress, (uint8_t *) &fdrsData, data_count * sizeof(DataReading));
|
||||
|
||||
esp_now_ack_flag = CRC_NULL;
|
||||
while(esp_now_ack_flag == CRC_NULL){
|
||||
delay(0);
|
||||
}
|
||||
if (esp_now_ack_flag == CRC_OK){
|
||||
data_count = 0;
|
||||
return true;
|
||||
} else {
|
||||
data_count = 0;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user