2011-08-18 23:10:49 +02:00
|
|
|
/*
|
|
|
|
* This is a simple program to demonstrate the use of
|
|
|
|
* libowlps-resultreader-udp.
|
|
|
|
* It must be linked against libowlps and its dependencies
|
|
|
|
* (see the Makefile).
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "owlps-resultreader-udp.h"
|
|
|
|
|
|
|
|
#include <unistd.h>
|
|
|
|
|
|
|
|
int main(void)
|
|
|
|
{
|
|
|
|
owl_result *result ;
|
|
|
|
int sockfd ;
|
|
|
|
|
|
|
|
sockfd = owl_create_udp_listening_socket(MOBILE_DEFAULT_PORT) ;
|
|
|
|
if (sockfd < 0)
|
|
|
|
return 1 ;
|
|
|
|
|
|
|
|
while (1)
|
|
|
|
{
|
2011-08-20 08:57:29 +02:00
|
|
|
if (! (result = owl_receive_position(sockfd)))
|
2011-08-18 23:10:49 +02:00
|
|
|
return 1 ;
|
|
|
|
owl_print_result(result) ;
|
|
|
|
owl_free_result(result) ;
|
|
|
|
printf("--------------\n") ;
|
|
|
|
}
|
|
|
|
|
|
|
|
close(sockfd) ;
|
|
|
|
|
|
|
|
return 0 ;
|
|
|
|
}
|