kopia lustrzana https://github.com/pjalocha/esp32-ogn-tracker
Print (some) parameters on the console in NMEA form in response to an empty
rodzic
e4d4e7e524
commit
83a8585224
|
@ -84,7 +84,9 @@ static void ReadParameters(void) // read parameters requested by the user in th
|
|||
if(NMEA.Parms==0) // if no parameter given
|
||||
{ xSemaphoreTake(CONS_Mutex, portMAX_DELAY); // print a help message
|
||||
// Format_String(CONS_UART_Write, "$POGNS,<aircraft-type>,<addr-type>,<address>,<RFM69(H)W>,<Tx-power[dBm]>,<freq.corr.[kHz]>,<console baudrate[bps]>,<RF temp. corr.[degC]>,<pressure corr.[Pa]>\n");
|
||||
Format_String(CONS_UART_Write, "$POGNS[,<Name>=<Value>]\n");
|
||||
// Format_String(CONS_UART_Write, "$POGNS[,<Name>=<Value>]\n");
|
||||
Parameters.WritePOGNS(Line);
|
||||
Format_String(CONS_UART_Write, Line);
|
||||
xSemaphoreGive(CONS_Mutex); //
|
||||
return; }
|
||||
Parameters.ReadPOGNS(NMEA);
|
||||
|
@ -151,6 +153,8 @@ static void ProcessCtrlV(void)
|
|||
|
||||
static void ProcessCtrlC(void) // print system state to the console
|
||||
{ xSemaphoreTake(CONS_Mutex, portMAX_DELAY);
|
||||
// Parameters.WritePOGNS(Line);
|
||||
// Format_String(CONS_UART_Write, Line);
|
||||
Parameters.Print(Line);
|
||||
Format_String(CONS_UART_Write, Line);
|
||||
Format_String(CONS_UART_Write, "GPS: ");
|
||||
|
|
|
@ -457,6 +457,28 @@ uint16_t StratuxPort;
|
|||
Line[Len]=0;
|
||||
return Len; }
|
||||
|
||||
uint8_t WritePOGNS(char *Line)
|
||||
{ uint8_t Len=0;
|
||||
Len+=Format_String(Line+Len, "$POGNS,CPU=0x");
|
||||
uint64_t CPU=getUniqueID();
|
||||
Len+=Format_Hex(Line+Len, (uint16_t)(CPU>>32));
|
||||
Len+=Format_Hex(Line+Len, (uint32_t)CPU);
|
||||
Len+=Format_String(Line+Len, ",Address=0x");
|
||||
Len+=Format_Hex(Line+Len, Address, 6);
|
||||
Len+=Format_String(Line+Len, ",AddrType=");
|
||||
Line[Len++]='0'+AddrType;
|
||||
Len+=Format_String(Line+Len, ",AcftType=0x");
|
||||
Line[Len++]=HexDigit(AcftType);
|
||||
Len+=Format_String(Line+Len, ",FreqPlan=");
|
||||
Line[Len++]='0'+FreqPlan;
|
||||
Len+=Format_String(Line+Len, ",Pilot=");
|
||||
Len+=Format_String(Line+Len, Pilot);
|
||||
Len+=Format_String(Line+Len, ",Reg=");
|
||||
Len+=Format_String(Line+Len, Reg);
|
||||
Len+=NMEA_AppendCheckCRNL(Line, Len);
|
||||
Line[Len]=0;
|
||||
return Len; }
|
||||
|
||||
int ReadPOGNS(NMEA_RxMsg &NMEA)
|
||||
{ int Count=0;
|
||||
for(uint8_t Idx=0; ; Idx++)
|
||||
|
|
Ładowanie…
Reference in New Issue