Add conversion table from OGN aircraft-type to ArduPilot emitter_type

pull/5/head
Pawel Jalocha 2018-05-20 07:27:20 +00:00
rodzic 1394569fdd
commit dcd915f9fd
1 zmienionych plików z 7 dodań i 2 usunięć

Wyświetl plik

@ -251,14 +251,19 @@ class OGN_Packet // Packet structure for the OGN tracker
MAV->ver_velocity = 10*DecodeClimbRate(); // [cm/s]
MAV->flags = 0x1F; // all valid except for Squawk, not simulated
MAV->altitude_type = 1; // GPS altitude
static char Prefix[4] = { 'R', 'I', 'F', 'O' }; // prefix for Random, ICAO, Flarm and OGN address-types
const static char Prefix[4] = { 'R', 'I', 'F', 'O' }; // prefix for Random, ICAO, Flarm and OGN address-types
MAV->callsign[0] = Prefix[Header.AddrType]; // create a call-sign from address-type and address
Format_Hex((char *)MAV->callsign+1, ( uint8_t)(Header.Address>>16)); // highest byte
Format_Hex((char *)MAV->callsign+3, (uint16_t)(Header.Address&0xFFFF)); // two lower bytes
MAV->callsign[7] = 0; // end-of-string for call-sign
MAV->squawk = 0; // what shall we put there for OGN ?
MAV->tslc = 1; // 1sec for now but should be more precise
MAV->emiter_type = 0; // could be more precise
const static uint8_t EmitterType[16] = // conversion table from OGN aircraft-type
{ 0, 9, 2, 7, // unknown, glider, towplane, helicopter
11, 3, 9, 11, // parachute, drop plane, hang-glider, para-glider
2, 3, 15, 10, // powered aircraft, jet aircraft, UFO, balloon
10, 14, 2, 19 }; // airship, UAV, ground vehiele, fixed object
MAV->emiter_type = EmitterType[Position.AcftType]; // convert from the OGN
}
int8_t ReadAPRS(const char *Msg) // read an APRS position message