LTAPI
API to access LiveTraffic's aircraft information
Classes | Typedefs | Variables
LTAPI.h File Reference

LiveTraffic API. More...

#include <cstring>
#include <memory>
#include <string>
#include <list>
#include <map>
#include <chrono>
#include "XPLMDataAccess.h"
#include "XPLMGraphics.h"

Go to the source code of this file.

Classes

class  LTAPIAircraft
 Represents one aircraft as controlled by LiveTraffic. More...
 
struct  LTAPIAircraft::LTAPIBulkData
 Bulk data transfer structur for communication with LTAPI. More...
 
struct  LTAPIAircraft::LTAPIBulkData::BulkBitsTy
 
struct  LTAPIAircraft::LTAPIBulkInfoTexts
 Bulk text transfer structur for communication with LTAPI. More...
 
struct  LTAPIAircraft::LTLights
 Structure to return plane's lights status. More...
 
class  LTAPIConnect
 Connects to LiveTraffic's dataRefs and returns aircraft information. More...
 
class  LTDataRef
 Represents a dataRef and covers late binding. More...
 

Typedefs

typedef std::shared_ptr< LTAPIAircraftSPtrLTAPIAircraft
 Smart pointer to an TLAPIAircraft object. More...
 
typedef std::map< std::string, SPtrLTAPIAircraftMapLTAPIAircraft
 Map of all aircrafts stored as smart pointers to LTAPIAircraft objects. More...
 
typedef std::list< SPtrLTAPIAircraftListLTAPIAircraft
 Simple list of smart pointers to LTAPIAircraft objects. More...
 

Variables

constexpr size_t LTAPIBulkData_v120 = 80
 Size of original bulk structure as per LiveTraffic v1.20. More...
 
constexpr size_t LTAPIBulkData_v122 = sizeof(LTAPIAircraft::LTAPIBulkData)
 Size of current bulk structure. More...
 
constexpr size_t LTAPIBulkInfoTexts_v120 = 264
 Size of original bulk info structure as per previous versions of LiveTraffic. More...
 
constexpr size_t LTAPIBulkInfoTexts_v122 = 288
 
constexpr size_t LTAPIBulkInfoTexts_v240 = sizeof(LTAPIAircraft::LTAPIBulkInfoTexts)
 Size of current bulk info structure. More...
 

Detailed Description

LiveTraffic API.

API to access LiveTraffic's aircraft information. Data transfer from LiveTraffic to your plugin is by dataRefs in a fast, efficient way: LiveTraffic copies data of several planes combined into defined structures. LTAPI handles all that in the background and provides you with an array of aircraft information with numerical info like position, heading, speed and textual info like type, registration, call sign, flight number.

See also
https://twinfan.github.io/LTAPI/
Author
Birger Hoppe

Class Documentation

◆ LTAPIAircraft::LTAPIBulkData::BulkBitsTy

struct LTAPIAircraft::LTAPIBulkData::BulkBitsTy
Class Members
bool bcn: 1 beacon light
bool camera: 1 is LiveTraffic's camera on this aircraft?
unsigned filler1: 1 unused
unsigned filler2: 8
unsigned filler3: 32
bool land: 1 landing lights
int multiIdx: 8 multiplayer index if plane reported via sim/multiplayer/position dataRefs, 0 if not
bool nav: 1 navigaton lights
bool onGnd: 1 Is plane on ground?
LTFlightPhase phase: 8 flight phase, see LTAircraft::FlightPhase
bool strb: 1 strobe light
bool taxi: 1 taxi lights

Typedef Documentation

◆ ListLTAPIAircraft

Simple list of smart pointers to LTAPIAircraft objects.

This is used to return aircraft objects which got removed by LiveTraffic, see LTAPIConnect::UpdateAcList()

◆ MapLTAPIAircraft

typedef std::map<std::string,SPtrLTAPIAircraft> MapLTAPIAircraft

Map of all aircrafts stored as smart pointers to LTAPIAircraft objects.

This is what LTAPIConnect::UpdateAcList() returns: a map of all aircrafts. They key into the map is the aircraft's key (most often the ICAO transponder hex code).

The value is a smart pointer to an LTAPIAircraft object. As we use smart pointers, object storage is deallocated as soon as objects are removed from the map. Effectively, the map manages storage.

◆ SPtrLTAPIAircraft

typedef std::shared_ptr<LTAPIAircraft> SPtrLTAPIAircraft

Smart pointer to an TLAPIAircraft object.

Variable Documentation

◆ LTAPIBulkData_v120

constexpr size_t LTAPIBulkData_v120 = 80
constexpr

Size of original bulk structure as per LiveTraffic v1.20.

◆ LTAPIBulkData_v122

constexpr size_t LTAPIBulkData_v122 = sizeof(LTAPIAircraft::LTAPIBulkData)
constexpr

Size of current bulk structure.

◆ LTAPIBulkInfoTexts_v120

constexpr size_t LTAPIBulkInfoTexts_v120 = 264
constexpr

Size of original bulk info structure as per previous versions of LiveTraffic.

◆ LTAPIBulkInfoTexts_v122

constexpr size_t LTAPIBulkInfoTexts_v122 = 288
constexpr

◆ LTAPIBulkInfoTexts_v240

constexpr size_t LTAPIBulkInfoTexts_v240 = sizeof(LTAPIAircraft::LTAPIBulkInfoTexts)
constexpr

Size of current bulk info structure.