More header lines for HTTP IGC and some bugs fixed

pull/36/head
Pawel Jalocha 2021-03-07 16:28:19 +00:00
rodzic 5782113fad
commit 24c0373390
2 zmienionych plików z 37 dodań i 3 usunięć

Wyświetl plik

@ -715,6 +715,37 @@ static esp_err_t SendLog_IGC(httpd_req_t *Req, const char *FileName, uint32_t Fi
{ Len+=Format_String(Line+Len, "HFPLTPilotincharge:");
Len+=Format_String(Line+Len, Parameters.Pilot);
Line[Len++]='\n'; }
if(Parameters.Reg[0])
{ Len+=Format_String(Line+Len, "HFGIDGliderID:");
Len+=Format_String(Line+Len, Parameters.Reg);
Line[Len++]='\n'; }
#ifdef WITH_FollowMe
Len+=Format_String(Line+Len, "HFRHWHardwareVersion:FollowMe\n");
#else
Len+=Format_String(Line+Len, "HFRHWHardwareVersion:ESP32+LoRa\n"); // hardware version
#endif
Len+=Format_String(Line+Len, "HFRFWFirmwareVersion:ESP32-OGN-TRACKER " __DATE__ " " __TIME__ "\n");
#ifdef WITH_BMP180
Len+=Format_String(Line+Len, "HFPRSPressAltSensor:BMP180\n"); // pressure sensor
#endif
#ifdef WITH_BMP280
Len+=Format_String(Line+Len, "HFPRSPressAltSensor:BMP280\n"); // pressure sensor
#endif
#ifdef WITH_BME280
Len+=Format_String(Line+Len, "HFPRSPressAltSensor:BME280/BMP280\n"); // pressure sensor
#endif
Len+=Format_String(Line+Len, "LOGN");
Len+=Format_HHMMSS(Line+Len, FileTime);
Len+=Format_String(Line+Len, "ID ");
Len+=Format_Hex(Line+Len, Parameters.AcftID);
Line[Len++]='\n';
uint64_t MAC = getUniqueID();
Len+=Format_String(Line+Len, "LOGN");
Len+=Format_HHMMSS(Line+Len, FileTime);
Len+=Format_String(Line+Len, "MAC ");
Len+=Format_Hex(Line+Len, (uint16_t)(MAC>>32)); // ESP32 48-bit ID
Len+=Format_Hex(Line+Len, (uint32_t) MAC );
Line[Len++]='\n';
httpd_resp_send_chunk(Req, Line, Len);
mbedtls_md5_update_ret(&MD5, (uint8_t *)Line, Len);
OGN_LogPacket<OGN_Packet> Packet;

Wyświetl plik

@ -204,9 +204,9 @@ static int IGC_Header(const GPS_Position &Pos) // write the
IGC_HeadParm("HFCIDCompetitionID:", Parameters.ID); // competition ID
{
#ifdef WITH_FollowMe
int Len=Format_String(Line, "HFRHWHardwareVersion:FollowMe");
int Len=Format_String(Line, "HFRHWHardwareVersion:FollowMe\n");
#else
int Len=Format_String(Line, "HFRHWHardwareVersion:ESP32-SX1276"); // hardware version
int Len=Format_String(Line, "HFRHWHardwareVersion:ESP32+LoRa\n"); // hardware version
#endif
Line[Len++]='\n'; Line[Len]=0;
IGC_LogLine(Line, Len); }
@ -221,11 +221,14 @@ static int IGC_Header(const GPS_Position &Pos) // write the
IGC_LogLine("HFGPSReceiver:MTK\n"); // GPS sensor
#endif
#endif
#ifdef WITH_BMP180
IGC_LogLine("HFPRSPressAltSensor:BMP180\n"); // pressure sensor
#endif
#ifdef WITH_BMP280
IGC_LogLine("HFPRSPressAltSensor:BMP280\n"); // pressure sensor
#endif
#ifdef WITH_BME280
IGC_LogLine("HFPRSPressAltSensor:BME280\n"); // pressure sensor
IGC_LogLine("HFPRSPressAltSensor:BME280/BMP280\n"); // pressure sensor
#endif
return 0; }