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 
 

Adding source hosts to the library

Without hosts your library is nearly unusable and can only provide some basic informations about flights, aircrafts, airports or airlines (of cause, the lookup must be enabled) or some distance calculation functions.

For the host management libhomeradar provides some special functions:

  homeradar_addhost()		will add a new SBS-1 source
  homeradar_drophost()		delete host from your hostlist

Now we add the first host to our LHR handle which was returned by the libhomeradar_init() function. The SBS-1 box is connected to the server 192.168.1.1 and the SBS-1 software is started.
Within the addhost function you can listen immediatly to one event.

  int hostid = homeradar_addhost(H, "192.168.1.1", 0, LHR_SBS1, LHR_ONFAILED, connectionfailed);

The first parameter is the handle which comes from libhomeradar_init()
The second parameter is the ip address or the hostname of your SBS-1 server.
The third parameter is the port on which the SBS-1 box will send his socket output. 0 = default (30003)
The fourth parameter is the type of the connect. 2 macros are available here:

LHR_SBS1	Connect to Kinetic Avionics SBS-1 box
LHR_RADARBOX	Connect to Airnav Systems Radarbox

The fifth parameter is the flag for the event which should be checked (0 and sixt to NULL will not install any event handler)
The fifth parameter is the address of the callback function or NULL if no callback function should be registered.
 
This function returns an integer which will be used for all function calls for this host. If you ignore the return of the function you can use the homeradar_gethostbyname() function to get the numeric hostid.
 
If you have set the LHR_AUTOCONNECT flag during the libhomeradar_init() call, libhomeradar will immediatly try to connect to new added hosts.
In such cases it is a good idea to add an eventhandler for LHR_ONFAILED to be informed if libhomeradar cannot connect to the host.
 
To drop a host from the list you should use the libhomeradar_drophost() function. The first parameter is the handle to the library and the second the numerical hostid of the host which should be dropped from the list. If the host is in connect state, the connection will be closed. If the LHR_ONCLOSE event is registered, the callback will be started.
 
It is also a good idea to catch timeout events. libhomeradar has a timeout of 45 seconds (you can change this with the libhomeradar_config() function) and if the host cannot be connected within this time the lib will call the event handler for the timeout event (if registered)

  /* Set callback function when connection cannot be established */
  (void)homeradar_onhandler(H, LHR_ONTIMEOUT, LHR_HOSTS_ALL, connectiontimeout);

The homeradar_onhandler() function must be called with the library handle, the flag for the event which should be catched, the numeric hostid (or LHR_HOSTS_ALL) of the host on which the event should be installed and the address of the callback function.

Using userspace log function Docu
Table of contents
Manually connect to hosts