PAW extension but without Time field which upset the original decoder

pull/30/head
Pawel Jalocha 2020-12-20 15:38:54 +01:00
rodzic 4fc23fadcc
commit 6c77030821
1 zmienionych plików z 4 dodań i 3 usunięć

Wyświetl plik

@ -74,7 +74,7 @@ class PAW_Packet
// uint32_t getAddress(void) const { return Address>>8; } // remove the sync '$' // uint32_t getAddress(void) const { return Address>>8; } // remove the sync '$'
// void setAddress(uint32_t Addr) { Address = (Addr<<8) | 0x24; } // set new address and set the '$' sync char // void setAddress(uint32_t Addr) { Address = (Addr<<8) | 0x24; } // set new address and set the '$' sync char
int Copy(const OGN1_Packet &Packet, bool Ext=0) int Copy(const OGN1_Packet &Packet, bool Ext=1)
{ Clear(); { Clear();
Address = Packet.Header.Address; // [24-bit] Address = Packet.Header.Address; // [24-bit]
if(Packet.Header.NonPos) return 0; // encode only position packets if(Packet.Header.NonPos) return 0; // encode only position packets
@ -88,12 +88,13 @@ class PAW_Packet
{ OGN=1; // extended data flag { OGN=1; // extended data flag
AddrType = Packet.Header.AddrType; // [2-bit] AddrType = Packet.Header.AddrType; // [2-bit]
Relay = Packet.Header.Relay; // relay flag Relay = Packet.Header.Relay; // relay flag
Time = Packet.Position.Time; // [sec] // Time = Packet.Position.Time; // [sec]
int32_t ClimbRate = Packet.DecodeClimbRate(); // [0.1m/s] int32_t ClimbRate = Packet.DecodeClimbRate(); // [0.1m/s]
ClimbRate = (ClimbRate*315+512)>>10; // [64fpm] ClimbRate = (ClimbRate*315+512)>>10; // [64fpm]
if(ClimbRate>127) ClimbRate=127; if(ClimbRate>127) ClimbRate=127;
else if(ClimbRate<(-127)) ClimbRate=(-127); else if(ClimbRate<(-127)) ClimbRate=(-127);
Climb = ClimbRate; } Climb = ClimbRate;
}
SeqMsg = 0; SeqMsg = 0;
setCRC(); return 1; } setCRC(); return 1; }