Unix HAL sample code: init and basic config structure. More...
#include "glgps_hal.h"
#include "glgps_hal_unix.h"
#include "glgps_event_helper.h"
#include <time.h>
#include <sys/times.h>
#include <sys/types.h>
#include <poll.h>
#include <stdlib.h>
#include <unistd.h>
Functions | |
GpsHal * | GpsHalCreateHal () |
Creates HAL layer In this function the application can perform any needed initialization of the HAL. | |
void | GpsHalDestroy (GpsHal *pHal) |
Destroys HAL; in this function the application can clean up the HAL as needed. | |
void | GpsHalInit (GpsHal *pHal) |
Initialises HAL before it would be used very first time. | |
short | GpsHalOpen (GpsHal *pHal) |
Opens GPS HAL. | |
void | GpsHalClose (GpsHal *pHal) |
Closes GPS HAL This is where serial port is closed, TCXO power turned off, ASIC turned off. | |
void | GpsHalCloseLog (GpsHal *pHal) |
The session has ended the log file can be closed. | |
void | GpsHalSetCfgValue (GpsHal *pHal, const char *pcAttrName, const char *pcValue) |
Sets the value of the parameter not recognized by the GLCT config parser. | |
int | GpsHalWaitForEvent (GpsHal *pHal, GPSCTRL_EVENT *pEvent, int iTimeouMs) |
Sleep in this function until event is received. |
Unix HAL sample code: init and basic config structure.
void GpsHalClose | ( | GpsHal * | pHal | ) |
Closes GPS HAL This is where serial port is closed, TCXO power turned off, ASIC turned off.
pHal | Handle to HAL instance retrieved through prior call to GpsHalCreateHal(). |
GpsHal* GpsHalCreateHal | ( | void | ) |
Creates HAL layer In this function the application can perform any needed initialization of the HAL.
void GpsHalDestroy | ( | GpsHal * | pHal | ) |
Destroys HAL; in this function the application can clean up the HAL as needed.
pHal | Handle to HAL instance retrieved through prior call to GpsHalCreateHal(). |
void GpsHalInit | ( | GpsHal * | pHal | ) |
Initialises HAL before it would be used very first time.
Prepares HAL to be opened.
short GpsHalOpen | ( | GpsHal * | pHal | ) |
Opens GPS HAL.
This is where serial port is opened, TCXO power turned on, ASIC turned on.
pHal | Handle to HAL instance retrieved through prior call to GpsHalCreateHal(). |
0 | if success, non-zero otherwise |
void GpsHalSetCfgValue | ( | GpsHal * | pHal, |
const char * | pcAttrName, | ||
const char * | pcValue | ||
) |
Sets the value of the parameter not recognized by the GLCT config parser.
Or if you are defining a config parameter spans out of the ARP module, define it here instead of ARP's config parser callback function.
int GpsHalWaitForEvent | ( | GpsHal * | pHal, |
GPSCTRL_EVENT * | pEvent, | ||
int | iTimeoutMs | ||
) |
Sleep in this function until event is received.
Efficiently wait for an event from either the serial port, the network connection, command strings for the GPS control software, whatever else you might need to wait on.
pHal | Handle to HAL instance retrieved through prior call to GpsHalCreateHal(). |
pEvent | TODO: comment pEvent |
iTimeoutMs | TODO: comment iTimeoutMs |