diff --git a/main/ogn.h b/main/ogn.h index 9fdc4f4..c14ab65 100644 --- a/main/ogn.h +++ b/main/ogn.h @@ -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