/agps-library

A C library for get location from list nearby access point SSID

Primary LanguageCOtherNOASSERTION

HOW TO BUILD

	Please ensure that you have Yocto Krogoth SDK for styl-image-yellowfin*.
	Please contact STYL's system engineers for more detailed information.

	# Initialize development environment
	source <location of extracted SDK>/poky/2.1.1/environment-setup-cortexa9hf-neon-poky-linux-gnueabi

	# Generate autoconf file
		./autogen.sh

	# Configure package
		./configure --host=arm-poky-linux-gnueabi --prefix=${PWD}/image
	
	# Compile package
		make -j4

	# Install package
		make install

EXAMPLES

	stylagps_demo (source examples/main.c):

		An infinite loop runs to queries AGPS location via libstylagps API.
		Output result to stdout.
		Terminate process by hitting Ctrl-C

	stylagps_send (source example/stylAgpsSend.c):

		Query AGPS location data and write to file to share with other processes.
		IPC Concept: Write then wait until file is deleted by receiver.

		An infinite loop runs to queries AGPS location via libstylagps API.
		Output result to stdout with prefix "SEND".
		Write data to AGPS_DATA_FILE (default is /tmp/stylagps.data).
		To avoid race condition, AGPS_DATA_FILE is not updated until it deleted by reader.
		Terminate process by hitting Ctrl-C

	stylagps_receive (source example/stylAgpsReceive.c):

		Receive AGPS location from AGPS_DATA_FILE which is feeded by stylagps_send.
		IPC Concept: Read then delete to allow sender to update.

		An infinite loop runs to queries AGPS location via libstylagps API.
		Output result to stdout with prefix "RECEIVE".
		Read data from AGPS_DATA_FILE (default is /tmp/stylagps.data).
		To avoid race condition, AGPS_DATA_FILE is deleted after reading to allow sender do update.
		Terminate process by hitting Ctrl-C

HEADERS
	
	stylagps.h

	NOTE: you may want to copy header into ${BUILD_SYSROOT}/usr/include

INTERFACE

	- Initialize a NMClient Object
		GObject * StylAgpsInit();
	
	- Clean up for NMClient Object
		void StylAgpsFinalize(GObject * nm_device);

	- Query location from Google
		gint StylAgpsGetLocation(GObject * nm_device,
					 gdouble *latitude, gdouble *longitude, gdouble *accuracy);

	
CONFIGURATION

	Behavior of libstylagps and some examples can be configured via /etc/stylagps/stylagps.conf

	- keyAPI: key API of Google Geolocation to be authorized to query Google API
	- geoLocationURL: link to access Google API
	- googleRequestTimeoutSec: timeout of Google API request.
	  Please adjust this to be complied with your internet connection speed.
	- agpsUpdateFrequencyUSec: used in stylagps_mqSend (resolution usec) to configure update frequency.