libgpsfile  0.2.2
some useful C-functions
gps_table.h File Reference
#include <time.h>
#include <cfe/gpstypes.h>
#include <cfe-tables/tables.h>
Include dependency graph for gps_table.h:

Go to the source code of this file.

Macros

#define TIME_NA   (struct timeval){0, 0}
 
#define ALTITUDE_NA   (alt_t)(ALT_REAL_MIN)
 
#define ACCURACY_NA   (acc_t)(-1)
 
#define gps_table_get_num_records(x)   table_get_num_records(x)
 
#define gps_table_free(x)   table_free(x)
 
#define GPS_EXTENSION_NO_VALUE   '-'
 

Enumerations

enum  {
  FIELD_TIME, FIELD_LAT, FIELD_LNG, FIELD_ALT,
  FIELD_ACC, LIELD_DST, N_FIELDS
}
 
enum  gps_ext_type_t {
  ACCURACY, ALTITUDE, CADENCE, DISTANCE,
  ENERGY, HR, POWER, SEALEVELPRESSURE,
  SPEED, TEMPERATURE, VERTICALSPEED, NO_VALUE
}
 

Functions

rec_t gps_table_store (table_t *t, struct timeval *time, lat_t lat, lng_t lng, alt_t alt, acc_t acc)
 
rec_t gps_table_store_pos (table_t *t, rec_t pos, struct timeval *time, lat_t lat, lng_t lng, alt_t alt, acc_t acc)
 
rec_t gps_table_set_altitude_by_record (const table_t *t, rec_t i, alt_t alt)
 
rec_t gps_table_set_latitude_by_record (const table_t *t, rec_t i, lat_t lat)
 
rec_t gps_table_set_longitude_by_record (const table_t *t, rec_t i, lng_t lng)
 
rec_t gps_table_set_time_by_record (const table_t *t, rec_t i, struct timeval *time)
 
struct timeval gps_table_get_time_by_record (const table_t *t, rec_t i)
 
lat_t gps_table_get_latitude_by_record (const table_t *t, rec_t i)
 
lng_t gps_table_get_longitude_by_record (const table_t *t, rec_t i)
 
alt_t gps_table_get_altitude_by_record (const table_t *t, rec_t i)
 
rec_t gps_table_get_record_by_latlng (const table_t *t, lat_t lat, lng_t lng)
 
long double gps_table_get_distance_by_record (const table_t *t, rec_t i)
 
acc_t gps_table_get_accuracy_by_record (const table_t *t, rec_t i)
 
rec_t gps_table_get_record_by_time_with_start_point (const table_t *t, struct timeval *time, rec_t i)
 
rec_t gps_table_get_record_by_time (const table_t *t, struct timeval *time)
 
lat_t gps_table_get_latitude_by_time (const table_t *t, struct timeval *time)
 
lng_t gps_table_get_longitude_by_time (const table_t *t, struct timeval *time)
 
alt_t gps_table_get_altitude_by_time (const table_t *t, struct timeval *time)
 
void gps_table_update_distance (const table_t *t, rec_t i)
 
int8_t gps_table_set_extension_value (const table_t *t, rec_t i, gps_ext_type_t type, float value)
 
float gps_table_get_extension_value (const table_t *t, rec_t i, gps_ext_type_t type)
 
int8_t gps_table_remove_extension (const table_t *t, rec_t i, gps_ext_type_t type)
 

Macro Definition Documentation

◆ ACCURACY_NA

#define ACCURACY_NA   (acc_t)(-1)

Definition at line 11 of file gps_table.h.

◆ ALTITUDE_NA

#define ALTITUDE_NA   (alt_t)(ALT_REAL_MIN)

Definition at line 10 of file gps_table.h.

◆ GPS_EXTENSION_NO_VALUE

#define GPS_EXTENSION_NO_VALUE   '-'

Definition at line 27 of file gps_table.h.

◆ gps_table_free

#define gps_table_free (   x)    table_free(x)

Definition at line 14 of file gps_table.h.

◆ gps_table_get_num_records

#define gps_table_get_num_records (   x)    table_get_num_records(x)

Definition at line 13 of file gps_table.h.

◆ TIME_NA

#define TIME_NA   (struct timeval){0, 0}

Definition at line 9 of file gps_table.h.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
FIELD_TIME 
FIELD_LAT 
FIELD_LNG 
FIELD_ALT 
FIELD_ACC 
LIELD_DST 
N_FIELDS 

Definition at line 29 of file gps_table.h.

◆ gps_ext_type_t

Enumerator
ACCURACY 
ALTITUDE 
CADENCE 
DISTANCE 
ENERGY 
HR 
POWER 
SEALEVELPRESSURE 
SPEED 
TEMPERATURE 
VERTICALSPEED 
NO_VALUE 

Definition at line 55 of file gps_table.h.

Function Documentation

◆ gps_table_get_accuracy_by_record()

acc_t gps_table_get_accuracy_by_record ( const table_t *  t,
rec_t  i 
)

◆ gps_table_get_altitude_by_record()

alt_t gps_table_get_altitude_by_record ( const table_t *  t,
rec_t  i 
)

◆ gps_table_get_altitude_by_time()

alt_t gps_table_get_altitude_by_time ( const table_t *  t,
struct timeval *  time 
)

◆ gps_table_get_distance_by_record()

long double gps_table_get_distance_by_record ( const table_t *  t,
rec_t  i 
)

◆ gps_table_get_extension_value()

float gps_table_get_extension_value ( const table_t *  t,
rec_t  i,
gps_ext_type_t  type 
)

◆ gps_table_get_latitude_by_record()

lat_t gps_table_get_latitude_by_record ( const table_t *  t,
rec_t  i 
)

◆ gps_table_get_latitude_by_time()

lat_t gps_table_get_latitude_by_time ( const table_t *  t,
struct timeval *  time 
)

◆ gps_table_get_longitude_by_record()

lng_t gps_table_get_longitude_by_record ( const table_t *  t,
rec_t  i 
)

◆ gps_table_get_longitude_by_time()

lng_t gps_table_get_longitude_by_time ( const table_t *  t,
struct timeval *  time 
)

◆ gps_table_get_record_by_latlng()

rec_t gps_table_get_record_by_latlng ( const table_t *  t,
lat_t  lat,
lng_t  lng 
)

◆ gps_table_get_record_by_time()

rec_t gps_table_get_record_by_time ( const table_t *  t,
struct timeval *  time 
)
inline

◆ gps_table_get_record_by_time_with_start_point()

rec_t gps_table_get_record_by_time_with_start_point ( const table_t *  t,
struct timeval *  time,
rec_t  i 
)

◆ gps_table_get_time_by_record()

struct timeval gps_table_get_time_by_record ( const table_t *  t,
rec_t  i 
)

◆ gps_table_remove_extension()

int8_t gps_table_remove_extension ( const table_t *  t,
rec_t  i,
gps_ext_type_t  type 
)

◆ gps_table_set_altitude_by_record()

rec_t gps_table_set_altitude_by_record ( const table_t *  t,
rec_t  i,
alt_t  alt 
)

◆ gps_table_set_extension_value()

int8_t gps_table_set_extension_value ( const table_t *  t,
rec_t  i,
gps_ext_type_t  type,
float  value 
)

◆ gps_table_set_latitude_by_record()

rec_t gps_table_set_latitude_by_record ( const table_t *  t,
rec_t  i,
lat_t  lat 
)

◆ gps_table_set_longitude_by_record()

rec_t gps_table_set_longitude_by_record ( const table_t *  t,
rec_t  i,
lng_t  lng 
)

◆ gps_table_set_time_by_record()

rec_t gps_table_set_time_by_record ( const table_t *  t,
rec_t  i,
struct timeval *  time 
)

◆ gps_table_store()

rec_t gps_table_store ( table_t *  t,
struct timeval *  time,
lat_t  lat,
lng_t  lng,
alt_t  alt,
acc_t  acc 
)

◆ gps_table_store_pos()

rec_t gps_table_store_pos ( table_t *  t,
rec_t  pos,
struct timeval *  time,
lat_t  lat,
lng_t  lng,
alt_t  alt,
acc_t  acc 
)

◆ gps_table_update_distance()

void gps_table_update_distance ( const table_t *  t,
rec_t  i 
)