Functions
data_sets.c File Reference
#include "data_sets.h"
#include <stddef.h>
#include <math.h>
Include dependency graph for data_sets.c:

Go to the source code of this file.

Functions

static void appendGPSCoord (const gps_pos_t *gps, char **buffer, int *bufferLength, double v, const char *degreesFormat, char posC, char negC)
 
static void appendGPSTimeOfLastFix (const gps_pos_t *gps, char **buffer, int *bufferLength)
 
uint32_t checksum32 (const void *data, int count)
 
uint64_t didToRmcBit (uint32_t dataId, uint64_t defaultRmcBits)
 
uint32_t flashChecksum32 (const void *data, int size)
 
void flipDouble (void *ptr)
 
double flipDoubleCopy (double val)
 
void flipDoubles (uint8_t *data, int dataLength, int offset, uint16_t *offsets, uint16_t offsetsLength)
 
void flipEndianess32 (uint8_t *data, int dataLength)
 
void flipFloat (uint8_t *ptr)
 
float flipFloatCopy (float val)
 
void flipStrings (uint8_t *data, int dataLength, int offset, uint16_t *offsets, uint16_t offsetsLength)
 
uint16_t * getDoubleOffsets (eDataIDs dataId, uint16_t *offsetsLength)
 
uint16_t * getStringOffsetsLengths (eDataIDs dataId, uint16_t *offsetsLength)
 
double gpsToJulian (int32_t gpsWeek, int32_t gpsMilliseconds, int32_t leapSeconds)
 
int gpsToNmeaGGA (const gps_pos_t *gps, char *buffer, int bufferLength)
 
double gpsToUnix (uint32_t gpsWeek, uint32_t gpsTimeofWeekMS, uint8_t leapSeconds)
 
void julianToDate (double julian, int32_t *year, int32_t *month, int32_t *day, int32_t *hour, int32_t *minute, int32_t *second, int32_t *millisecond)
 
int satNo (int sys, int prn)
 
int satNumCalc (int gnssID, int svID)
 
uint32_t serialNumChecksum32 (const void *data, int size)
 
int ubxSys (int gnssID)
 

Function Documentation

◆ appendGPSCoord()

static void appendGPSCoord ( const gps_pos_t gps,
char **  buffer,
int *  bufferLength,
double  v,
const char *  degreesFormat,
char  posC,
char  negC 
)
static

Definition at line 726 of file data_sets.c.

◆ appendGPSTimeOfLastFix()

static void appendGPSTimeOfLastFix ( const gps_pos_t gps,
char **  buffer,
int *  bufferLength 
)
static

Definition at line 715 of file data_sets.c.

◆ checksum32()

uint32_t checksum32 ( const void *  data,
int  count 
)

Creates a 32 bit checksum from data

Parameters
datathe data to create a checksum for
countthe number of bytes in data
Returns
the 32 bit checksum for data

Definition at line 531 of file data_sets.c.

◆ didToRmcBit()

uint64_t didToRmcBit ( uint32_t  dataId,
uint64_t  defaultRmcBits 
)

Convert DID to realtime message bits

Definition at line 563 of file data_sets.c.

◆ flashChecksum32()

uint32_t flashChecksum32 ( const void *  data,
int  size 
)

Definition at line 557 of file data_sets.c.

◆ flipDouble()

void flipDouble ( void *  ptr)

Flip the bytes of a double in place (8 bytes) - ptr is assumed to be at least 8 bytes Only flips each 4 byte pair, does not flip the individual bytes within the pair

Parameters
ptrthe double to flip

Definition at line 47 of file data_sets.c.

◆ flipDoubleCopy()

double flipDoubleCopy ( double  val)

Flip the bytes of a double in place (8 bytes) Unlike flipDouble, this also flips the individual bytes in each 4 byte pair

Parameters
valthe double to flip
Returns
the flipped double

Definition at line 60 of file data_sets.c.

◆ flipDoubles()

void flipDoubles ( uint8_t *  data,
int  dataLength,
int  offset,
uint16_t *  offsets,
uint16_t  offsetsLength 
)

Flip double (64 bit) floating point values in data

Parameters
datathe data to flip doubles in
dataLengththe number of bytes in data
offsetoffset into data to start flipping at
offsetsa list of offsets of all doubles in data, starting at position 0
offsetsLengththe number of items in offsets

Definition at line 91 of file data_sets.c.

◆ flipEndianess32()

void flipEndianess32 ( uint8_t *  data,
int  dataLength 
)

Flip the endianess of 32 bit values in data

Parameters
datathe data to flip 32 bit values in
dataLengththe number of bytes in data

Definition at line 73 of file data_sets.c.

◆ flipFloat()

void flipFloat ( uint8_t *  ptr)

Flip the bytes of a float in place (4 bytes) - ptr is assumed to be at least 4 bytes

Parameters
ptrthe float to flip

Definition at line 19 of file data_sets.c.

◆ flipFloatCopy()

float flipFloatCopy ( float  val)

Flip the bytes of a float (4 bytes) - ptr is assumed to be at least 4 bytes

Parameters
valthe float to flip
Returns
the flipped float

Definition at line 31 of file data_sets.c.

◆ flipStrings()

void flipStrings ( uint8_t *  data,
int  dataLength,
int  offset,
uint16_t *  offsets,
uint16_t  offsetsLength 
)

Flip string values in data - this compensates for the fact that flipEndianess32 is called on all the data

Parameters
datathe data to flip string values in
dataLengththe number of bytes in data
offsetthe offset into data to start flipping strings at
offsetsa list of offsets and byte lengths into data where strings start at
offsetsLengththe number of items in offsets, should be 2 times the string count

Definition at line 117 of file data_sets.c.

◆ getDoubleOffsets()

uint16_t* getDoubleOffsets ( eDataIDs  dataId,
uint16_t *  offsetsLength 
)

Get the offsets of double / int64 (64 bit) values given a data id

Parameters
dataIdthe data id to get double offsets for
offsetsLengthreceives the number of double offsets
Returns
a list of offets of doubles or 0 if none, offset will have high bit set if it is an int64 instead of a double

Definition at line 141 of file data_sets.c.

◆ getStringOffsetsLengths()

uint16_t* getStringOffsetsLengths ( eDataIDs  dataId,
uint16_t *  offsetsLength 
)

Gets the offsets and lengths of strings given a data id

Parameters
dataIdthe data id to get string offsets and lengths for
offsetsLengthreceives the number of items in the return value
Returns
a list of offsets and lengths of strings for the data id or 0 if none

Definition at line 382 of file data_sets.c.

◆ gpsToJulian()

double gpsToJulian ( int32_t  gpsWeek,
int32_t  gpsMilliseconds,
int32_t  leapSeconds 
)

Convert GPS Week and Seconds to Julian Date. Leap seconds are the GPS-UTC offset (18 seconds as of December 31, 2016).

Definition at line 708 of file data_sets.c.

◆ gpsToNmeaGGA()

int gpsToNmeaGGA ( const gps_pos_t gps,
char *  buffer,
int  bufferLength 
)

Definition at line 745 of file data_sets.c.

◆ gpsToUnix()

double gpsToUnix ( uint32_t  gpsWeek,
uint32_t  gpsTimeofWeekMS,
uint8_t  leapSeconds 
)

Convert GPS Week and Ms and leapSeconds to Unix seconds

Definition at line 699 of file data_sets.c.

◆ julianToDate()

void julianToDate ( double  julian,
int32_t *  year,
int32_t *  month,
int32_t *  day,
int32_t *  hour,
int32_t *  minute,
int32_t *  second,
int32_t *  millisecond 
)

Convert Julian Date to calendar date.

Definition at line 607 of file data_sets.c.

◆ satNo()

int satNo ( int  sys,
int  prn 
)

Definition at line 868 of file data_sets.c.

◆ satNumCalc()

int satNumCalc ( int  gnssID,
int  svID 
)

Definition at line 908 of file data_sets.c.

◆ serialNumChecksum32()

uint32_t serialNumChecksum32 ( const void *  data,
int  size 
)

Definition at line 551 of file data_sets.c.

◆ ubxSys()

int ubxSys ( int  gnssID)

Definition at line 849 of file data_sets.c.



inertial_sense_ros
Author(s):
autogenerated on Sun Feb 28 2021 03:17:59