kopia lustrzana https://github.com/pjalocha/esp32-ogn-tracker
Have two G-records in the IGC: 1st with SHA256, 2nd with the signature
rodzic
f5efa9b7f3
commit
d6f262512c
|
@ -11,7 +11,7 @@ inline uint8_t NMEA_AppendCheckCRNL(char *NMEA, uint8_t Len) { return NMEA_Appen
|
||||||
|
|
||||||
class NMEA_RxMsg // receiver for the NMEA sentences
|
class NMEA_RxMsg // receiver for the NMEA sentences
|
||||||
{ public:
|
{ public:
|
||||||
static const uint8_t MaxLen=104; // maximum length
|
static const uint8_t MaxLen=120; // maximum length
|
||||||
static const uint8_t MaxParms=24; // maximum number of parameters (commas)
|
static const uint8_t MaxParms=24; // maximum number of parameters (commas)
|
||||||
uint8_t Data[MaxLen]; // the message itself
|
uint8_t Data[MaxLen]; // the message itself
|
||||||
uint8_t Len; // number of bytes
|
uint8_t Len; // number of bytes
|
||||||
|
|
|
@ -277,8 +277,11 @@ static void IGC_Check(void) // check if
|
||||||
int SigLen = IGC_SignKey.Sign_MD5_SHA256(Sig, IGC_Digest, IGC_Digest_Size);
|
int SigLen = IGC_SignKey.Sign_MD5_SHA256(Sig, IGC_Digest, IGC_Digest_Size);
|
||||||
int Len=0;
|
int Len=0;
|
||||||
Line[Len++]='G'; // produce G-record with SH256
|
Line[Len++]='G'; // produce G-record with SH256
|
||||||
// for(int Idx=0; Idx<IGC_Digest_Size; Idx++) // 32 SHA256 bytes
|
for(int Idx=0; Idx<IGC_Digest_Size; Idx++) // 32 SHA256 bytes
|
||||||
// Len+=Format_Hex(Line+Len, IGC_Digest[Idx]); // printed as hex
|
Len+=Format_Hex(Line+Len, IGC_Digest[Idx]); // printed as hex
|
||||||
|
Line[Len++]='\n'; Line[Len]=0; // end-of-line, end-of-string
|
||||||
|
IGC_LogLine(Line, Len);
|
||||||
|
Len=1; // 2nd G-record with the signature
|
||||||
for(int Idx=0; Idx<SigLen; Idx++) // signature bytes
|
for(int Idx=0; Idx<SigLen; Idx++) // signature bytes
|
||||||
Len+=Format_Hex(Line+Len, Sig[Idx]); // printed as hex
|
Len+=Format_Hex(Line+Len, Sig[Idx]); // printed as hex
|
||||||
Line[Len++]='\n'; Line[Len]=0; // end-of-line, end-of-string
|
Line[Len++]='\n'; Line[Len]=0; // end-of-line, end-of-string
|
||||||
|
|
Ładowanie…
Reference in New Issue