libhomeradareasy collect aircraft information |
20,460,289 registered contacts 173339 unique aircraft records, 7.16% unresolved records |
| ACARS DECODER Planespotting Network Kinetic Avionics AirNav Systems Airframes.org | ||||||
| Home Docu Examples Functions Downloads Database Search API Success Stories News Personal Pages | ||||||
![]() libhomeradar is an easy to use library for all type of programming language which can use libraries. libhomeradar can connect to different sources to collect aircraft informations arround the world with extended informations, powerful filtering and structured data access. libhomeradar is written in C and is available for Linux and Windows (2003, XP, NT, Vista). Currently libhomeradar works with the Kinetic Avionics SBS-1 base station and the Airnav Systems Radarbox.
|
Callbacks and event listener
There are a lot of events for which you can create listeners. Version I - Hostevents (void)callback_function(LHR H, const int *item);
The first paramater is the handle to the library and the second is a pointer to the hostid from which the event was thrown.
Version II - Contactevents (void)callback_function(LHR H, const int *id, const char *item)
The first parameter is the handle to the library, the second is the hostid of the host on which the event was thrown.
void newcontact(void *handle,const int *id, LHR_CONTACT *C) {
LHR_AIRPORTS *P;
printf("------------------------------\n%s
Contact: %s [%s]\nAirline: %s\nFlightnumber: %s Callsign: %s\n
Squawk: %d\n",(C->newcontact)?"AIR":"",
C->icao24,(C->reg)?C->reg:"UNKNOWN",
(C->airline)?C->airline:"NULL",C->flightnum,C->callsign,C->squawk);
printf("Aircraft: %s %s [%s] cn:%s\n",C->manufacturer,C->model,C->details,C->cn);
printf("Routing: %s Position LAT: %0.5f LON: %0.5f\n",C->route,C->lat,C->lon);
P = C->airports;
while (P) {
if (P->airport) {
printf("Airport [%s / %s] Name: %s, %s\n",
P->airport->iata,P->airport->icao,
P->airport->name,P->airport->country);
} else printf("Unresolveable: %s\n",P->apcode);
P = P->next;
}
/* Free used memory */
homeradar_freecontact(C);
}
EXAMPLE OUTPUT: ------------------------------ Contact: 3C7207 [D-ALPG] Airline: LTU International Airways Flightnumber: LT1732 Callsign: LTU1732 Squawk: 0 Aircraft: Airbus A332 [A330-223] cn:0493 Routing: MUC-CMB-MLE LAT: 0.00000 LON: 0.00000 Airport [MUC / EDDM] Name: Munich, Franz Josef Strauss, Germany Airport [CMB / VCBI] Name: Colombo, Katunayake, Sri Lanka Airport [MLE / VRMM] Name: Male/Hulule Island, International, Maldives As you see you can get all airport informations within a simple while() construct. The airport informations are encapsulated within the LHR_AIRPORTS and the LHR_AP datatype. You should always check if the next pointer is NULL. In this case you have reached the end of the available airport informations. Informations like squawk code or the current position are not always available on the socket output and can be added later. libhomeradar will buffer some informations about the contact to add later missing informations like the squawk or the current position.
|
|||||