V1.8.39 - changes to hab.link protocol

pull/67/head
Dave Akerman 2020-11-25 15:19:17 +00:00
rodzic 570f804dd4
commit f60a041985
4 zmienionych plików z 23 dodań i 2 usunięć

Wyświetl plik

@ -250,6 +250,12 @@ Many thanks to David Brooke for coding this feature and the AFC.
Change History Change History
============== ==============
25/11/2020 - V1.8.39
--------------------
Send callsign, listener type (LoRa Gateway) and version to hab.link server
Don't include callsign with telemetry messages to hab.link server
06/05/2020 - V1.8.38 06/05/2020 - V1.8.38
-------------------- --------------------

Wyświetl plik

@ -46,7 +46,7 @@
#include "udpclient.h" #include "udpclient.h"
#include "lifo_buffer.h" #include "lifo_buffer.h"
#define VERSION "V1.8.38" #define VERSION "V1.8.39"
bool run = TRUE; bool run = TRUE;
// RFM98 // RFM98
@ -2599,6 +2599,7 @@ int main( int argc, char **argv )
// Clear config to zeroes so we only have to set non-zero defaults // Clear config to zeroes so we only have to set non-zero defaults
memset((void *)&Config, 0, sizeof(Config)); memset((void *)&Config, 0, sizeof(Config));
strcpy(Config.Version, VERSION);
if ( prog_count( "gateway" ) > 1 ) if ( prog_count( "gateway" ) > 1 )
{ {

Wyświetl plik

@ -139,6 +139,7 @@ struct TConfig
char antenna[64]; char antenna[64];
int EnableDev; int EnableDev;
char UplinkCode[64]; char UplinkCode[64];
char Version[16];
}; };
typedef struct { typedef struct {

Wyświetl plik

@ -25,7 +25,18 @@ void UploadSentence(int sockfd, char *Sentence)
char Message[300]; char Message[300];
// Create message to upload // Create message to upload
sprintf(Message, "POSITION:CALLSIGN=%s,SENTENCE=%s\n", Config.Tracker, Sentence); // sprintf(Message, "POSITION:CALLSIGN=%s,SENTENCE=%s\n", Config.Tracker, Sentence);
sprintf(Message, "POSITION:SENTENCE=%s\n", Sentence);
write(sockfd, Message, strlen(Message));
}
void UploadListener(int sockfd)
{
char Message[100];
// Create message to upload
sprintf(Message, "LISTENER:TYPE=LoRa Gateway,VERSION=%s,CALLSIGN=%s\n", Config.Version, Config.Tracker);
write(sockfd, Message, strlen(Message)); write(sockfd, Message, strlen(Message));
} }
@ -92,6 +103,8 @@ void *HablinkLoop( void *vars )
if (sockfd >= 0) if (sockfd >= 0)
{ {
LogMessage("Connected to hab.link\n"); LogMessage("Connected to hab.link\n");
UploadListener(sockfd);
} }
else else
{ {