Searching, please wait...


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 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  Furl 

This example will connect to our SBS-1 box and will immediatly new contacted aircrafts. All other contacts will be inserted into the libraries internal queue. After the queue has reached the limit (see the homeradar_init() function) the ONFULLQUEUE event will be triggered. Every 6 seconds this program will show you how many items are currently in the contactqueue. This program runs appr. 2 minutes.

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

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

/* Show new contacted aircrafts */
void onair(LHR handle,const int *id, LHR_CONTACT *C) {
  char tstr[64];

  printf("*** NEW CONTACT ***\n===================\n");
  if (id != NULL) printf("[%s]\n",homeradar_gethostbyid(handle,*(id)));
  printf("Contact: %s [%s]\n",
          C->icao24,(C->reg)?C->reg:"UNKNOWN - Lookup not enabled?!");
  strftime(tstr,sizeof(tstr),"%d %m %Y %H:%M:%S",localtime(&C->contacted));
  printf("Date: %s\n===================\n",tstr);

  /* Free used memory */

/* Callback function to show aircraft informations */
void newcontact(LHR handle,const int *id, LHR_CONTACT *C) {

  printf("%sContact: %s [%s]\nAirline: %s\nFlightnumber: %s  Callsign: %s\nSquawk: %d\n",
  printf("Aircraft: %s %s [%s] cn:%s\n",C->manufacturer,C->model,C->details,C->cn);
  printf("Routing: %s LAT: %0.5f LON: %0.5f\n",C->route,C->lat,C->lon);

  /* Get airport informations */
  P = C->airports;
  while (P) {
    if (P->airport) {
      printf("Airport [%s / %s] Name: %s, %s\n",
    } else printf("Unresolveable: %s\n",P->apcode);
    P = P->next;

  /* Free LHR_CONTACT struct */

/* Internal message queue is full */
void fullqueue(LHR handle, const int *id) {

  /* Show all buffered contacts */
  while (homeradar_pendingcontacts(handle, *(id))) {
    if ((C = homeradar_getnextcontact(handle, *(id))))
      newcontact(handle, id, C);

/* Show statistics for the given host */
void statistics(const LHR H, const char *host) {

  /* Get statistics from libhomeradar */
  if ((S = homeradar_stats(H, homeradar_gethostbyname(H, host)))) {

    /* Show statistics */
    printf("\nStatistics on '%s'\n=====================================\n",host);
    printf("You are currently %sCONNECTED to this host\n",(S->connected==0)?"NOT ":"");
    if (S->connected == 1) printf("We are connected to this host since %ld seconds\n",S->online);
    printf("%ld kilobytes read from this host\n",S->bytes);
    printf("%ld messages read from this host\n",S->messages);
    printf("%ld valid messages read from this host\n",S->validmsgs);

    /* Free allocated memory */

/* Main program */
int main(int argc, char **argv) {
  int e;

  /* Init handle and load databases from current directory */
  LHR H = homeradar_init(16,LHR_AUTOCONNECT|LHR_LOOKUP_ALL,&e,"./");

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

  /* Add host */
  e = homeradar_addhost(H, "", 33033, LHR_SBS1, LHR_ONAIRCONTACT, onair);

  /* Setup the event listener for the LHR_ONCONTACT event */
  if (homeradar_onhandler(H, LHR_ONFULLQUEUE, e, fullqueue)==0) {
    printf("Unable to add event listener\n");

  /* Do nothing - in this example - loop will be finished after 120 seconds 
     In your real program you can do now what you want */
  e = 19;
  while (e--) {
    printf("Pending contacts at the moment: %d\n",homeradar_pendingcontacts(H, LHR_HOSTS_ALL));

  /* Show statistics for this servers */
  statistics(H, "");
  /* Shutdown libhomeradar and free all alocated memory */
  printf("Shutdown libhomeradar...\n");

  /* Return success */
  return 0;