V1.10.4 - prevent multiple uploads of new telemetry to Sondehub

master
Dave Akerman 2023-09-13 14:35:50 +01:00
rodzic 563e1bb31b
commit 1175b8183d
3 zmienionych plików z 21 dodań i 5 usunięć

Wyświetl plik

@ -296,6 +296,12 @@ Many thanks to David Brooke for coding this feature and the AFC.
Change History
==============
## 14/9/2023 - V1.10.4
Clear InUse flag in SH upload so new telemetry is only uploaded once
## 2/9/2023 - V1.10.3
Limit to 5 retries on SH upload
## 24/8/2023 - V1.10.2
UKHAS Telemetry is CRC16 checked before being used/uploaded, in addition to the existing LoRa CRC check

Wyświetl plik

@ -45,7 +45,7 @@
#include "udpclient.h"
#include "lifo_buffer.h"
#define VERSION "V1.10.3"
#define VERSION "V1.10.4"
bool run = TRUE;
// RFM98

Wyświetl plik

@ -392,28 +392,38 @@ void *SondehubLoop( void *vars )
static long ListenerCountdown = 0;
int Channel;
// Copy from incoming to active
pthread_mutex_lock(&crit); // lock the critical section
for (Channel=0; Channel<=1; Channel++)
{
// Copy new incoming payload, if there is one
if (IncomingSondehubPayloads[Channel].InUse)
{
pthread_mutex_lock(&crit); // lock the critical section
// copy from incoming to active
memcpy(&ActiveSondehubPayloads[Channel], &IncomingSondehubPayloads[Channel], sizeof(struct TPayload));
pthread_mutex_unlock(&crit); // unlock once you are done
IncomingSondehubPayloads[Channel].InUse = 0;
}
}
pthread_mutex_unlock(&crit); // unlock once you are done
// Upload from active section
for (Channel=0; Channel<=1; Channel++)
{
// Try to upload active payload, if there is one
if (ActiveSondehubPayloads[Channel].InUse)
{
UploadSondehubPosition(Channel); // Upload, with limited retries ifd needed
ChannelPrintf(Channel, 6, 1, "SH");
UploadSondehubPosition(Channel); // Upload, with limited retries if needed
ActiveSondehubPayloads[Channel].InUse = 0;
ChannelPrintf(Channel, 6, 1, " ");
}
}
// Listener position uploads
if ((Config.latitude >= -90) && (Config.latitude <= 90) && (Config.longitude >= -180) && (Config.longitude <= 180))
{
if (--ListenerCountdown <= 0)