kopia lustrzana https://github.com/PiInTheSky/lora-gateway
V1.8.28 - For payloads combined in one packet send all to JSON client
rodzic
23a3fe1778
commit
cfd29f0589
|
@ -229,6 +229,11 @@ Many thanks to David Brooke for coding this feature and the AFC.
|
|||
Change History
|
||||
==============
|
||||
|
||||
09/05/2019 - V1.8.28
|
||||
--------------------
|
||||
|
||||
Store all payloads from combined packet for JSON transmission to client.
|
||||
|
||||
09/05/2019 - V1.8.27
|
||||
--------------------
|
||||
|
||||
|
|
11
gateway.c
11
gateway.c
|
@ -45,7 +45,7 @@
|
|||
#include "udpclient.h"
|
||||
#include "lifo_buffer.h"
|
||||
|
||||
#define VERSION "V1.8.27"
|
||||
#define VERSION "V1.8.28"
|
||||
bool run = TRUE;
|
||||
|
||||
// RFM98
|
||||
|
@ -811,12 +811,11 @@ void RemoveOldPayloads(void)
|
|||
if ((time(NULL) - Config.Payloads[i].LastPacketAt) > 10800)
|
||||
{
|
||||
// More than 3 hours old, so remove it
|
||||
}
|
||||
|
||||
Config.Payloads[i].InUse = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int FindFreePayload(char *Payload)
|
||||
{
|
||||
|
@ -857,7 +856,7 @@ int FindFreePayload(char *Payload)
|
|||
|
||||
strcpy(Config.Payloads[Oldest].Payload, Payload);
|
||||
|
||||
return i;
|
||||
return Oldest;
|
||||
}
|
||||
|
||||
void DoPositionCalcs(int PayloadIndex)
|
||||
|
@ -1040,6 +1039,8 @@ int ProcessTelemetryMessage(int Channel, received_t *Received)
|
|||
|
||||
LogTelemetryPacket(startmessage);
|
||||
|
||||
ProcessLineUKHAS(Channel, startmessage);
|
||||
|
||||
if ((Repeated = (*startmessage == '%')))
|
||||
{
|
||||
*startmessage = '$';
|
||||
|
@ -1565,7 +1566,7 @@ void DIO0_Interrupt( int Channel )
|
|||
strncpy(Received.UKHASstring, Received.Message, Received.Bytes);
|
||||
UDPSend(Received.UKHASstring, Config.UDPPort);
|
||||
Repeated = ProcessTelemetryMessage(Channel, &Received);
|
||||
ProcessLineUKHAS(Channel, Config.LoRaDevices[Channel].Telemetry);
|
||||
// ProcessLineUKHAS(Channel, Config.LoRaDevices[Channel].Telemetry);
|
||||
TestMessageForSMSAcknowledgement( Channel, Received.UKHASstring);
|
||||
CheckForChatContent(Channel, Repeated, Config.LoRaDevices[Channel].Telemetry);
|
||||
strcpy(Config.LoRaDevices[Channel].LocalDataBuffer, Received.UKHASstring);
|
||||
|
|
1
server.c
1
server.c
|
@ -199,6 +199,7 @@ int SendJSON(int connfd)
|
|||
{
|
||||
if (Config.Payloads[PayloadIndex].InUse && Config.Payloads[PayloadIndex].SendToClients)
|
||||
{
|
||||
|
||||
Channel = Config.Payloads[PayloadIndex].Channel;
|
||||
|
||||
sprintf(line, "{\"class\":\"POSN\",\"index\":%d,\"channel\":%d,\"payload\":\"%s\",\"time\":\"%s\",\"lat\":%.5lf,\"lon\":%.5lf,\"alt\":%d,\"rate\":%.1lf,\"snr\":%d,\"rssi\":%d,\"ferr\":%.1lf,\"sentence\":\"%s\"}\r\n",
|
||||
|
|
Ładowanie…
Reference in New Issue