Searching, please wait...

libhomeradar

easy collect aircraft information
~50,000,000 registered contacts
303894 unique aircraft records, 28.78% unresolved records
 ACARS DECODER Planespotting Network Kinetic Avionics AirNav Systems Airframes.org Atlas Tracking
libhomeradar - easy collect aircraft informations

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.


Yahoo! My Web  Google Bookmarks  Windows Live  Facebook  Ask  del.icio.us  Furl 
 

This program will only initialize the libhomeradar handle but we will not add any hosts. Here you see the database lookups which can be made by libhomeradar. To enable database lookups you should load the databases during the homeradar_init() call or with the homeradar_load_databases() function.


 
libhomeradar - easy collect aircraft informations - Download example  Download this source
/* System includes */
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <string.h>

/* libhomeradar header include */
#include "libhomeradar.h"

/* Main program */
int main(int argc, char **argv) {
  int e;
  LHR_AIRPORTS *P;
  LHR_CONTACT *C;
  LHR_AP *A;
  LHR H = homeradar_init(16,LHR_AUTOCONNECT|LHR_LOOKUP_ALL,&e,"./");
  char *c, *r;

  /* No error */
  if (H == NULL) {
    printf("Error initializing libhomeradar. Errorcode #%d\n",e);
    return 255;
  }

  /* Show some database lookups and additional function of the library
     This time we are not connected to any hosts */

  /* Get airline informations for the given flight */
  if ((c = homeradar_getairline(H, "MA0521"))) 
    printf("Airline for flight MA0521 is: %s\n",c);

  /* Lookup flightrouting */
  if ((c = homeradar_getroute(H, "MA0521"))) {
    printf("Routing for flight MA0521 is %s\n",c);

    /* Get full human readable routing for the given flight */
    P = homeradar_fullrouting(H, c);
    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 airport structure with the complete tree */
    homeradar_freeairport(P);
  }

  /* Get ICAO24 code from an aircraft reg */
  if ((c = homeradar_geticao24byreg(H, "HA-LOA"))) {
    printf("ICAO24 code of aircraft reg HA-LOA: %s\n",c);

    /* And reverse lookup. Reg by ICAO24 code */
    if ((r = homeradar_getregbyicao24(H, c)))
      printf("ICAO24 code %s is aircraft reg: %s\n",c,r);
  }

  /* Get extented informations about this aircraft */
  if ((C = homeradar_gettype(H, "HA-LOA"))) {
    printf("Aircraft details for aircraft: %s\n",C->reg);
    printf("Manufacturer: %s  Model: %s  Model Details: %s\n",
            C->manufacturer,C->model,C->details);
    printf("Aircraft construction number: %s\n",C->cn);

    /* Free allocated memory */
    homeradar_freecontact(C);
  }

  /* Get all informations for the given airport */
  if ((A = homeradar_getairport(H, "BUD"))) {
    printf("IATA code: %s  /  ICAO code: %s\n",A->iata,A->icao);
    printf("Airport name: %s\nCountry: %s\nLocation: LAT %0.5f LON %0.5f\n",
            A->name,A->country,A->LAT,A->LON);

    /* Free allocated memory */
    free((char*)A);
  }

  /* Shutdown libhomeradar and free all allocated memory */
  printf("Shutdown libhomeradar...\n");
  homeradar_destroy(H);

  /* Return success */
  return 0;
}