Implements Telit's GPS geolocation functions.
More...
#include <device.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include "modem.h"
#include "strlib.h"
#include "extern.h"
#include "gps.h"
|
uint8 | modem_gps_power_toggle (uint8 gps_power_on) |
| Toggle power to the GPS module. More...
|
|
uint8 | modem_get_gps_position (float *lat, float *lon, float *hdop, float *altitude, uint8 *gps_fix, float *cog, float *spkm, float *spkn, uint8 *nsat, uint8 min_satellites, uint8 max_tries) |
| Retrieves the current GPS position by attempting to connect to the GPS network. More...
|
|
uint8 | run_gps_routine (int *gps_trigger, float *lat, float *lon, float *hdop, float *altitude, uint8 *gps_fix, float *cog, float *spkm, float *spkn, uint8 *nsat, uint8 min_satellites, uint8 max_tries) |
| Runs GPS routine to retrieve GPS position. More...
|
|
uint8 | zip_gps (char *labels[], float readings[], uint8 *array_ix, int *gps_trigger, uint8 min_satellites, uint8 max_tries, uint8 max_size) |
| Takes a string array of labels and float array of values and pairs the corresponding values. More...
|
|
Implements Telit's GPS geolocation functions.
- Author
- Matt Bartos and Ivan Mondragon
- Version
- TODO
- Date
- 2017-06-01
uint8 modem_get_gps_position |
( |
float * |
lat, |
|
|
float * |
lon, |
|
|
float * |
hdop, |
|
|
float * |
altitude, |
|
|
uint8 * |
gps_fix, |
|
|
float * |
cog, |
|
|
float * |
spkm, |
|
|
float * |
spkn, |
|
|
uint8 * |
nsat, |
|
|
uint8 |
min_satellites, |
|
|
uint8 |
max_tries |
|
) |
| |
Retrieves the current GPS position by attempting to connect to the GPS network.
- Parameters
-
lat | Buffer to store the Latitude. |
lon | Buffer to store the Longitude. |
hdop | Buffer to store the Horizontal Diluition of Precision. |
altitude | Buffer to store the Altitude: mean-sea-level (geoid). |
gps_fix | Buffer to store the flag:
- 0 = Invalid Fix
- 2 = 2D fix
- 3 = 3D fix
|
cog | Buffer to store the Course over ground. |
spkm | Buffer to store the Speed over ground (km/hr). |
spkn | Buffer to store the Speed over ground (knots). |
nsat | Buffer to store the number of satellites in use [0..12] |
min_satellites | Minimum number of satellits the module should connect to. |
max_tries | Maximum number of attempts. |
- Returns
- 1u if the gps module was able to connect to the minimum number of satellites, 0u otherwise.
uint8 modem_gps_power_toggle |
( |
uint8 |
gps_power_on | ) |
|
Toggle power to the GPS module.
- Parameters
-
gps_power_on | Enable flag:
- 0 = Power off
- 1 = Power on
|
- Returns
- 1u on success, 0u otherwise.
uint8 run_gps_routine |
( |
int * |
gps_trigger, |
|
|
float * |
lat, |
|
|
float * |
lon, |
|
|
float * |
hdop, |
|
|
float * |
altitude, |
|
|
uint8 * |
gps_fix, |
|
|
float * |
cog, |
|
|
float * |
spkm, |
|
|
float * |
spkn, |
|
|
uint8 * |
nsat, |
|
|
uint8 |
min_satellites, |
|
|
uint8 |
max_tries |
|
) |
| |
Runs GPS routine to retrieve GPS position.
- Parameters
-
gps_trigger | gps_trigger flag. |
lat | Buffer to store the Latitude. |
lon | Buffer to store the Longitude. |
hdop | Buffer to store the Horizontal Diluition of Precision. |
altitude | Buffer to store the Altitude: mean-sea-level (geoid). |
gps_fix | Buffer to store the flag:
- 0 = Invalid Fix
- 2 = 2D fix
- 3 = 3D fix
|
cog | Buffer to store the Course over ground. |
spkm | Buffer to store the Speed over ground (km/hr). |
spkn | Buffer to store the Speed over ground (knots). |
nsat | Buffer to store the number of satellites in use [0..12] |
min_satellites | Minimum number of satellits the module should connect to. |
max_tries | Maximum number of attempts. |
- Returns
- 1u if the gps module was able to connect to the minimum number of satellites, 0u otherwise.
uint8 zip_gps |
( |
char * |
labels[], |
|
|
float |
readings[], |
|
|
uint8 * |
array_ix, |
|
|
int * |
gps_trigger, |
|
|
uint8 |
min_satellites, |
|
|
uint8 |
max_tries, |
|
|
uint8 |
max_size |
|
) |
| |
Takes a string array of labels and float array of values and pairs the corresponding values.
- Parameters
-
labels[] | Array to store the labels. |
readings[] | Array to store the corresponding values. |
array_ix | Current array index. |
gps_trigger | GPS trigger. |
min_satellites | Minimum number of satellits the module should connect to. |
max_tries | Maximum number of attempts. |
max_size | Max size of the labels and readings arrays. |
- Returns
- (*array_ix) + 10