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 + \
bool ubloxcfg_valueFromString(const char *str, const UBLOXCFG_TYPE_t type, const UBLOXCFG_ITEM_t *item, UBLOXCFG_VALUE_t *value)
Convert string to value.
const char * ubloxcfg_typeStr(UBLOXCFG_TYPE_t type)
Stringify item type.
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.
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.
struct UBLOXCFG_KEYVAL_s UBLOXCFG_KEYVAL_t
Key-value pair.
bool ubloxcfg_splitValueStr(char *str, char **valueStr, char **prettyStr)
Split stringified value string.
union UBLOXCFG_VALUE_u UBLOXCFG_VALUE_t
Configuration value storage (s.a. UBLOXCFG_TYPE_t)
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.
bool ubloxcfg_stringifyKeyVal(char *str, const int size, const UBLOXCFG_KEYVAL_t *keyVal)
Stringify key-value pair (for debugging)
enum UBLOXCFG_SIZE_e UBLOXCFG_SIZE_t
Configuration item size.
const UBLOXCFG_ITEM_t * ubloxcfg_getItemByName(const char *name)
Get configuration item info by name.
struct UBLOXCFG_ITEM_s UBLOXCFG_ITEM_t
Configuration item.
const UBLOXCFG_MSGRATE_t * ubloxcfg_getMsgRateCfg(const char *msgName)
Get configuration items for output message rate configuration.
struct UBLOXCFG_MSGRATE_s UBLOXCFG_MSGRATE_t
Configuration items for output message rate configuration.
struct UBLOXCFG_CONST_s UBLOXCFG_CONST_t
Constants for type E1/E2/E4 configuration items.
const UBLOXCFG_ITEM_t ** ubloxcfg_getAllItems(int *num)
Get list of all items.
enum UBLOXCFG_LAYER_e UBLOXCFG_LAYER_t
Configuration layers.
bool ubloxcfg_layerFromName(const char *name, UBLOXCFG_LAYER_t *layer)
Get layer from name.
const char * ubloxcfg_layerName(const UBLOXCFG_LAYER_t layer)
Get name for layer.
const UBLOXCFG_ITEM_t * ubloxcfg_getItemById(const uint32_t id)
Get configuration item info by key ID.
UBLOXCFG_SIZE_e
Configuration item size.
UBLOXCFG_LAYER_e
Configuration layers.
enum UBLOXCFG_TYPE_e UBLOXCFG_TYPE_t
Configuration item storage type (s.a. UBLOXCFG_VALUE_t)
const UBLOXCFG_MSGRATE_t ** ubloxcfg_getAllMsgRateCfgs(int *num)
Get list of all output message rate configurations.
UBLOXCFG_TYPE_e
Configuration item storage type (s.a. UBLOXCFG_VALUE_t)
@ UBLOXCFG_SIZE_EIGHT
Eight bytes.
@ UBLOXCFG_SIZE_ONE
One byte.
@ UBLOXCFG_SIZE_FOUR
Four bytes.
@ UBLOXCFG_SIZE_BIT
One bit.
@ UBLOXCFG_SIZE_TWO
Two bytes.
@ UBLOXCFG_LAYER_DEFAULT
Default layer.
@ UBLOXCFG_LAYER_FLASH
Flash layer.
@ UBLOXCFG_LAYER_RAM
RAM layer (a.k.a. current configuration)
@ UBLOXCFG_LAYER_BBR
BBR layer.
@ UBLOXCFG_TYPE_I1
One byte signed, little-endian (int8_t)
@ UBLOXCFG_TYPE_U8
Eight bytes unsigned, little-endian (uint64_t)
@ UBLOXCFG_TYPE_X8
Eight bytes unsigned, little-endian (uint64_t)
@ UBLOXCFG_TYPE_U2
Two bytes unsigned, little-endian (uint16_t)
@ UBLOXCFG_TYPE_X4
Four bytes unsigned, little-endian (uint32_t)
@ UBLOXCFG_TYPE_I8
Eight byte signed, little-endian (int64_t)
@ UBLOXCFG_TYPE_L
One bit logical (0 = false, 1 = true)
@ UBLOXCFG_TYPE_E2
Two bytes unsigned, little-endian (int16_t)
@ UBLOXCFG_TYPE_E4
Four bytes unsigned, little-endian (int32_t)
@ UBLOXCFG_TYPE_I4
Four bytes signed, little-endian (int32_t)
@ UBLOXCFG_TYPE_I2
Two bytes signed, little-endian (int16_t)
@ UBLOXCFG_TYPE_X2
Two bytes unsigned, little-endian (uint16_t)
@ UBLOXCFG_TYPE_R8
Eight bytes IEEE754 double precision (double)
@ UBLOXCFG_TYPE_R4
Four bytes IEEE754 single precision (float)
@ UBLOXCFG_TYPE_U1
One byte unsigned, little-endian (uint8_t)
@ UBLOXCFG_TYPE_X1
One byte unsigned, little-endian (uint8_t)
@ UBLOXCFG_TYPE_E1
One byte unsigned, little-endian (int8_t)
@ UBLOXCFG_TYPE_U4
Four bytes unsigned, little-endian (uint32_t)
uint16_t ubloxcfg_getVersion(void)
Get library version.
const char ** ubloxcfg_getSources(int *numSources)
Get strings describing the data sources.
Constants for type E1/E2/E4 configuration items.
union UBLOXCFG_CONST_s::@0 val
Value.
int32_t E
E type value as number.
const char * name
Name of the constant.
uint64_t X
X type value as number.
const char * value
Value as string.
const char * unit
Unit (or NULL)
const char * scale
Scale factor as string (or NULL)
UBLOXCFG_TYPE_t type
Storage type.
UBLOXCFG_SIZE_t size
Item size.
double scalefact
Scale factor as number.
int nConsts
Number of constants (or 0 if none)
const char * name
Item name.
const UBLOXCFG_CONST_t * consts
Constants (or NULL if none)
UBLOXCFG_VALUE_t val
Configuration item value.
uint32_t id
Configuration item ID.
Configuration items for output message rate configuration.
const UBLOXCFG_ITEM_t * itemSpi
Item for output rate on SPI port (or NULL)
const UBLOXCFG_ITEM_t * itemUart2
Item for output rate on UART2 port (or NULL)
const char * msgName
Message name.
const UBLOXCFG_ITEM_t * itemUsb
Item for output rate on USB port (or NULL)
const UBLOXCFG_ITEM_t * itemUart1
Item for output rate on UART1 port (or NULL)
const UBLOXCFG_ITEM_t * itemI2c
Item for output rate on I2C port (or NULL)
Configuration value storage (s.a. UBLOXCFG_TYPE_t)
uint16_t U2
UBLOXCFG_TYPE_U2 type value
int16_t I2
UBLOXCFG_TYPE_I2 type value
uint32_t X4
UBLOXCFG_TYPE_X4 type value
double R8
UBLOXCFG_TYPE_R8 type value
int32_t E4
UBLOXCFG_TYPE_E4 type value
int8_t E1
UBLOXCFG_TYPE_E1 type value
uint64_t U8
UBLOXCFG_TYPE_U8 type value
int8_t I1
UBLOXCFG_TYPE_I1 type value
uint32_t U4
UBLOXCFG_TYPE_U4 type value
uint8_t X1
UBLOXCFG_TYPE_X1 type value
uint64_t _raw
raw value, unused bytes shall be 0x00
float R4
UBLOXCFG_TYPE_R4 type value
bool L
UBLOXCFG_TYPE_L type value
int64_t I8
UBLOXCFG_TYPE_I8 type value
uint64_t X8
UBLOXCFG_TYPE_X8 type value
uint8_t U1
UBLOXCFG_TYPE_U1 type value
uint8_t _bytes[8]
raw bytes, unused bytes shall be 0x00
uint16_t X2
UBLOXCFG_TYPE_X2 type value
int32_t I4
UBLOXCFG_TYPE_I4 type value
int16_t E2
UBLOXCFG_TYPE_E2 type value