mbgtools-lx  4.2.8
gpsutils.c File Reference
#include <gpsutils.h>
#include <stdio.h>
#include <string.h>

Go to the source code of this file.

Macros

#define _GPSUTILS
 
#define USE_SNPRINTF   0
 
#define _USE_GPSUTILS_FULL   0
 

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...
 

Macro Definition Documentation

◆ _GPSUTILS

#define _GPSUTILS

Definition at line 41 of file gpsutils.c.

◆ _USE_GPSUTILS_FULL

#define _USE_GPSUTILS_FULL   0

Definition at line 57 of file gpsutils.c.

◆ USE_SNPRINTF

#define USE_SNPRINTF   0

Definition at line 50 of file gpsutils.c.

Function Documentation

◆ 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().