libhomeradareasy collect aircraft information |
20,505,134 registered contacts 173395 unique aircraft records, 7.18% unresolved records |
| ACARS DECODER Planespotting Network Kinetic Avionics AirNav Systems Airframes.org RadarVirtuel.com | |||
| 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.
|
This example will only connect to the Airnav Systems Radarbox and will send all contacts to our collector (collector.libhomeradar.org port 8080) Data sharing is not legal in every country. Please check this before you enable this option. You have to assume total responsibility on the consequences of sharing your aircraft contacts
/* System includes */
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
#include <signal.h>
/* libhomeradar header include */
#include "libhomeradar.h"
/* Global variable to libhomeradar */
LHR H = NULL;
/* Shutdown library and finish program */
void shutdownlib(int sig) {
printf("Shutdown system. Closing library handle...\n");
/* Close lib handle */
if (H) homeradar_destroy(H);
exit(0);
}
/* Main program */
int main(int argc, char **argv) {
int e;
/* Init global variable */
H = homeradar_init(16,LHR_AUTOCONNECT|LHR_LOOKUP_ALL,&e,NULL);
/* No error */
if (H == NULL) {
printf("Error initializing libhomeradar. Errorcode #%d\n",e);
return 255;
}
/* Catch SIGINT signals (CTRL-C) */
(void)signal(SIGINT, shutdownlib);
/* Load databases from disc
Files should be located within the current directory */
homeradar_load_databases(H, "./");
/* Add host without event listener */
e = homeradar_addhost(H, "radarbox.libhomeradar.org", 33333, LHR_RADARBOX, 0, NULL);
/* Our contacts are public */
if (!homeradar_public(H, 1))
printf("Unable to send contacts to the collector\n");
/* Do nothing - in this example - loop will be finished after 1 hour
In your real program you can do now what you want */
sleep(3600);
/* Destroy lib handler */
homeradar_destroy(H);
/* Return success */
return 0;
}
|
||