24 #ifndef __UBLOXCFG_H__ 25 #define __UBLOXCFG_H__ 30 #include "ubloxcfg_gen.h" 60 #define UBLOXCFG_ID2SIZE(id) (UBLOXCFG_SIZE_t)(((id) >> 28) & 0x0f) 67 #define UBLOXCFG_ID2GROUP(id) ((id) & 0x0fff0000) 74 #define UBLOXCFG_ID2IDGRP(id) ((id) & 0x0000ffff) 257 #define UBLOXCFG_KEYVAL_ANY(name, value) { .id = UBLOXCFG_ ## name ## _ID, .val = { .UBLOXCFG_ ## name ## _TYPE = (value) } } 275 #define UBLOXCFG_KEYVAL_ENU(name, value) { .id = UBLOXCFG_ ## name ## _ID, .val = { .UBLOXCFG_ ## name ## _TYPE = (UBLOXCFG_ ## name ## _ ## value) } } 298 #define UBLOXCFG_KEYVAL_MSG(msg, port, rate) UBLOXCFG_KEYVAL_ANY(msg ## _ ## port, rate) 489 #define UBLOXCFG_MAX_KEYVAL_STR_SIZE (_UBLOXCFG_MAX_ITEM_LEN + \ 492 _UBLOXCFG_MAX_CONSTS_LEN + \ 567 #endif // __UBLOXCFG_H__ const char * unit
Unit (or NULL)
const UBLOXCFG_ITEM_t * ubloxcfg_getItemByName(const char *name)
Get configuration item info by name.
UBLOXCFG_TYPE_t type
Storage type.
int16_t I2
UBLOXCFG_TYPE_I2 type value
int16_t E2
UBLOXCFG_TYPE_E2 type value
Two bytes signed, little-endian (int16_t)
const UBLOXCFG_CONST_t * consts
Constants (or NULL if none)
Four bytes unsigned, little-endian (int32_t)
One bit logical (0 = false, 1 = true)
Two bytes unsigned, little-endian (uint16_t)
bool ubloxcfg_splitValueStr(char *str, char **valueStr, char **prettyStr)
Split stringified value string.
Configuration value storage (s.a. UBLOXCFG_TYPE_t)
UBLOXCFG_SIZE_t size
Item size.
const UBLOXCFG_MSGRATE_t * ubloxcfg_getMsgRateCfg(const char *msgName)
Get configuration items for output message rate configuration.
RAM layer (a.k.a. current configuration)
Eight bytes unsigned, little-endian (uint64_t)
uint32_t X4
UBLOXCFG_TYPE_X4 type value
const UBLOXCFG_ITEM_t * itemUsb
Item for output rate on USB port (or NULL)
Four bytes unsigned, little-endian (uint32_t)
bool L
UBLOXCFG_TYPE_L type value
union UBLOXCFG_VALUE_u UBLOXCFG_VALUE_t
Configuration value storage (s.a. UBLOXCFG_TYPE_t)
Four bytes signed, little-endian (int32_t)
const char * value
Value as string.
const char * msgName
Message name.
enum UBLOXCFG_SIZE_e UBLOXCFG_SIZE_t
Configuration item size.
struct UBLOXCFG_ITEM_s UBLOXCFG_ITEM_t
Configuration item.
Eight bytes unsigned, little-endian (uint64_t)
uint16_t X2
UBLOXCFG_TYPE_X2 type value
const char ** ubloxcfg_getSources(int *numSources)
Get strings describing the data sources.
const UBLOXCFG_ITEM_t * itemI2c
Item for output rate on I2C port (or NULL)
const UBLOXCFG_ITEM_t * itemUart1
Item for output rate on UART1 port (or NULL)
int64_t I8
UBLOXCFG_TYPE_I8 type value
int8_t E1
UBLOXCFG_TYPE_E1 type value
const char * name
Name of the constant.
Eight byte signed, little-endian (int64_t)
const UBLOXCFG_MSGRATE_t ** ubloxcfg_getAllMsgRateCfgs(int *num)
Get list of all output message rate configurations.
uint8_t X1
UBLOXCFG_TYPE_X1 type value
uint8_t U1
UBLOXCFG_TYPE_U1 type value
One byte unsigned, little-endian (uint8_t)
struct UBLOXCFG_KEYVAL_s UBLOXCFG_KEYVAL_t
Key-value pair.
uint16_t U2
UBLOXCFG_TYPE_U2 type value
const UBLOXCFG_ITEM_t ** ubloxcfg_getAllItems(int *num)
Get list of all items.
Configuration items for output message rate configuration.
const UBLOXCFG_ITEM_t * itemUart2
Item for output rate on UART2 port (or NULL)
const char * ubloxcfg_typeStr(UBLOXCFG_TYPE_t type)
Stringify item type.
Eight bytes IEEE754 double precision (double)
double scalefact
Scale factor as number.
uint32_t U4
UBLOXCFG_TYPE_U4 type value
Constants for type E1/E2/E4 configuration items.
enum UBLOXCFG_TYPE_e UBLOXCFG_TYPE_t
Configuration item storage type (s.a. UBLOXCFG_VALUE_t)
bool ubloxcfg_makeData(uint8_t *data, const int size, const UBLOXCFG_KEYVAL_t *keyVal, const int nKeyVal, int *dataSize)
Configuration data from key-value list.
int8_t I1
UBLOXCFG_TYPE_I1 type value
int nConsts
Number of constants (or 0 if none)
One byte unsigned, little-endian (int8_t)
Four bytes IEEE754 single precision (float)
bool ubloxcfg_stringifyValue(char *str, const int size, const UBLOXCFG_TYPE_t type, const UBLOXCFG_ITEM_t *item, const UBLOXCFG_VALUE_t *val)
Stringify item value.
uint32_t id
Configuration item ID.
float R4
UBLOXCFG_TYPE_R4 type value
bool ubloxcfg_layerFromName(const char *name, UBLOXCFG_LAYER_t *layer)
Get layer from name.
uint16_t ubloxcfg_getVersion(void)
Get library version.
union UBLOXCFG_CONST_s::@0 val
Value.
const UBLOXCFG_ITEM_t * ubloxcfg_getItemById(const uint32_t id)
Get configuration item info by key ID.
bool ubloxcfg_stringifyKeyVal(char *str, const int size, const UBLOXCFG_KEYVAL_t *keyVal)
Stringify key-value pair (for debugging)
UBLOXCFG_VALUE_t val
Configuration item value.
struct UBLOXCFG_MSGRATE_s UBLOXCFG_MSGRATE_t
Configuration items for output message rate configuration.
One byte unsigned, little-endian (uint8_t)
int32_t E4
UBLOXCFG_TYPE_E4 type value
int32_t E
E type value as number.
Four bytes unsigned, little-endian (uint32_t)
int32_t I4
UBLOXCFG_TYPE_I4 type value
const UBLOXCFG_ITEM_t * itemSpi
Item for output rate on SPI port (or NULL)
One byte signed, little-endian (int8_t)
enum UBLOXCFG_LAYER_e UBLOXCFG_LAYER_t
Configuration layers.
UBLOXCFG_LAYER_e
Configuration layers.
const char * scale
Scale factor as string (or NULL)
double R8
UBLOXCFG_TYPE_R8 type value
UBLOXCFG_TYPE_e
Configuration item storage type (s.a. UBLOXCFG_VALUE_t)
uint64_t X
X type value as number.
const char * name
Item name.
Two bytes unsigned, little-endian (int16_t)
bool ubloxcfg_parseData(const uint8_t *data, const int size, UBLOXCFG_KEYVAL_t *keyVal, const int maxKeyVal, int *nKeyVal)
Key-value list from configuration data.
UBLOXCFG_SIZE_e
Configuration item size.
const char * ubloxcfg_layerName(const UBLOXCFG_LAYER_t layer)
Get name for layer.
bool ubloxcfg_valueFromString(const char *str, const UBLOXCFG_TYPE_t type, const UBLOXCFG_ITEM_t *item, UBLOXCFG_VALUE_t *value)
Convert string to value.
uint8_t _bytes[8]
raw bytes
Two bytes unsigned, little-endian (uint16_t)
uint64_t X8
UBLOXCFG_TYPE_X8 type value
uint64_t U8
UBLOXCFG_TYPE_U8 type value
struct UBLOXCFG_CONST_s UBLOXCFG_CONST_t
Constants for type E1/E2/E4 configuration items.