mbgtools-lx  4.2.8
gpsutils.h File Reference
#include <mbggeo.h>
#include <stddef.h>

Go to the source code of this file.

Macros

#define _ext   extern
 

Functions

void swap_double (double *p)
 Swap the bytes of a single variable of type "double". More...
 
void swap_eph_doubles (EPH *p)
 Swap the "double" fields in an EPH structure. More...
 
void swap_alm_doubles (ALM *p)
 Swap the "double" fields in an ALM structure. More...
 
void swap_utc_doubles (UTC *p)
 Swap the "double" fields in a UTC structure. More...
 
void swap_iono_doubles (IONO *p)
 Swap the "double" fields in a IONO structure. More...
 
void swap_pos_doubles (POS *p)
 Swap the "double" fields in a POS structure. More...
 
size_t snprint_dms (char *s, size_t max_len, const DMS *p, int prec)
 Print the DMS part of a geo position into a string buffer. More...
 
size_t snprint_alt (char *s, size_t max_len, double alt)
 Print the altitude part of a geo position into a string buffer. More...
 
size_t snprint_pos_geo (char *s, size_t max_len, const POS *p, char sep, int prec)
 Print a geo position in POS format into a string buffer. More...
 
size_t snprint_fixed_freq (char *s, size_t max_len, FIXED_FREQ_INFO *p_ff)
 Print a formatted FIXED_FREQ_INFO into a string buffer. More...
 

Macro Definition Documentation

◆ _ext

#define _ext   extern

Definition at line 47 of file gpsutils.h.

Function Documentation

◆ snprint_alt()

size_t snprint_alt ( char *  s,
size_t  max_len,
double  alt 
)

Print the altitude part of a geo position into a string buffer.

Parameters
[out]sThe string buffer to be filled
[in]max_lenSize of the output buffer for 0-terminated string
[in]altThe altitude value to be printed, in [m]
Returns
Length of the string in the buffer
See also
snprint_dms
snprint_pos_geo
snprint_fixed_freq

Referenced by swap_pos_doubles().

◆ snprint_dms()

size_t snprint_dms ( char *  s,
size_t  max_len,
const DMS p,
int  prec 
)

Print the DMS part of a geo position into a string buffer.

Parameters
[out]sThe string buffer to be filled
[in]max_lenSize of the output buffer for 0-terminated string
[in]pPointer to a DMS structure to be printed
[in]precPrecision, i.e. number of fractions of the seconds
Returns
Length of the string in the buffer
See also
snprint_dms
snprint_alt
snprint_pos_geo
snprint_fixed_freq

Referenced by swap_pos_doubles().

◆ snprint_fixed_freq()

size_t snprint_fixed_freq ( char *  s,
size_t  max_len,
FIXED_FREQ_INFO p_ff 
)

Print a formatted FIXED_FREQ_INFO into a string buffer.

Parameters
[out]sThe string buffer to be filled
[in]max_lenSize of the output buffer for 0-terminated string
[in]p_ffPointer to a FIXED_FREQ_INFO structure to be printed
Returns
Length of the string in the buffer
See also
snprint_dms
snprint_alt
snprint_pos_geo

Referenced by swap_pos_doubles().

◆ snprint_pos_geo()

size_t snprint_pos_geo ( char *  s,
size_t  max_len,
const POS p,
char  sep,
int  prec 
)

Print a geo position in POS format into a string buffer.

Parameters
[out]sThe string buffer to be filled
[in]max_lenSize of the output buffer for 0-terminated string
[in]pPointer to a POS structure to be printed
[in]sepSeparator character for the DMS part
[in]precPrecision, i.e. number of fractions of the seconds of the DMS part
Returns
Length of the string in the buffer
See also
snprint_dms
snprint_alt
snprint_fixed_freq

Referenced by swap_pos_doubles().

◆ swap_alm_doubles()

void swap_alm_doubles ( ALM p)

Swap the "double" fields in an ALM structure.

See comments for swap_double

Parameters
[in,out]pPointer to an ALM structure to be converted
See also
swap_double
swap_eph_doubles
swap_utc_doubles
swap_iono_doubles
swap_pos_doubles

Definition at line 182 of file gpsutils.c.

References ALM::af0, ALM::af1, ALM::deltai, ALM::e, ALM::M0, ALM::omega, ALM::OMEGA0, ALM::OMEGADOT, ALM::sqrt_A, and swap_double().

◆ swap_double()

void swap_double ( double *  p)

Swap the bytes of a single variable of type "double".

The memory layout of a "double" on Meinberg bus level devices and computers usually differs. This function can be used to fix this and is usually called from inside API functions, if required.

Parameters
[in,out]pPointer to a "double" to be swapped
See also
swap_eph_doubles
swap_alm_doubles
swap_utc_doubles
swap_iono_doubles
swap_pos_doubles

Definition at line 101 of file gpsutils.c.

Referenced by mbg_get_utc_parm(), mbg_set_gps_pos_lla(), mbg_set_gps_pos_xyz(), mbg_set_utc_parm(), mbgextio_get_pos_lla(), mbgextio_get_pos_xyz(), mbgextio_set_pos_lla(), swap_alm_doubles(), swap_eph_doubles(), swap_iono_doubles(), swap_pos_doubles(), and swap_utc_doubles().

◆ swap_eph_doubles()

void swap_eph_doubles ( EPH p)

Swap the "double" fields in an EPH structure.

See comments for swap_double

Parameters
[in,out]pPointer to an EPH structure to be converted
See also
swap_double
swap_alm_doubles
swap_utc_doubles
swap_iono_doubles
swap_pos_doubles

Definition at line 138 of file gpsutils.c.

References EPH::af0, EPH::af1, EPH::af2, EPH::cic, EPH::cis, EPH::crc, EPH::crs, EPH::cuc, EPH::cus, EPH::deltan, EPH::e, EPH::i0, EPH::idot, EPH::M0, EPH::omega, EPH::OMEGA0, EPH::OMEGADOT, EPH::sqrt_A, swap_double(), and EPH::tgd.

◆ swap_iono_doubles()

void swap_iono_doubles ( IONO p)

Swap the "double" fields in a IONO structure.

See comments for swap_double

Parameters
[in,out]pPointer to a IONO structure to be converted
See also
swap_double
swap_eph_doubles
swap_alm_doubles
swap_utc_doubles
swap_pos_doubles

Definition at line 235 of file gpsutils.c.

References IONO::alpha_0, IONO::alpha_1, IONO::alpha_2, IONO::alpha_3, IONO::beta_0, IONO::beta_1, IONO::beta_2, IONO::beta_3, and swap_double().

◆ swap_pos_doubles()

void swap_pos_doubles ( POS p)

◆ swap_utc_doubles()

void swap_utc_doubles ( UTC p)

Swap the "double" fields in a UTC structure.

See comments for swap_double

Parameters
[in,out]pPointer to a UTC structure to be converted
See also
swap_double
swap_eph_doubles
swap_alm_doubles
swap_iono_doubles
swap_pos_doubles

Definition at line 212 of file gpsutils.c.

References UTC::A0, UTC::A1, and swap_double().