InertiaSDK

Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | List of all members
inertia::InertiaConfig Struct Reference

Sensor Configuration. More...

`#include <InertiaConfig.h>`

## Public Member Functions
| InertiaConfig ()
| InertiaConfig (std::vector< uint8_t > const &in, const unsigned dbfStart=5)
| InertiaConfig (std::wstring const &argString)
bool | GetIsRequest () const
void | SetIsRequest (const bool isRequest)
bool | GetIsDefault () const
void | SetIsDefault (const bool isDefault)
void | AddConfig (const ConfigType config, const int sensorID=-1, const AxisConfigDescriptorType descrType=AXIS_DESCRIPTOR_CONFIGURATION)
void | AddConfig (SensorConfigPtr const &config)
bool | HasConfigs () const
bool | HasConfig (const ConfigType config, const int sensorID=-1, const AxisConfigDescriptorType descrType=AXIS_DESCRIPTOR_CONFIGURATION) const
std::vector< unsigned > | GetInstances (const ConfigType config, const unsigned sensorID, const AxisConfigDescriptorType descrType) const
SensorConfigPtr const | GetConfig (const ConfigType config) const
GlobalSamplingConfig const & | GetGlobalSamplingConfig () const
RadioConfig const & | GetRadioConfig () const
AccelConfig const & | GetAccelConfig () const
CompassConfig const & | GetCompassConfig () const
GyroConfig const & | GetGyroConfig () const
StatusConfig const & | GetStatusConfig () const
HeartBeatConfig const & | GetHeartBeatConfig () const
TemperatureConfig const & | GetTemperatureConfig () const
CorrelationConfig const & | GetCorrelationConfig () const
LoggingConfig const & | GetLoggingConfig () const
IMAConfig const & | GetIMAConfig () const
RTCConfig const & | GetRTCConfig () const
ADCConfig const & | GetADCConfig () const
DetectionConfig const & | GetDetectionConfig () const
ADC2Config const & | GetADC2Config () const
AccelConfigExt const & | GetAccelConfigExt () const
VmonBoardConfig const & | GetVmonBoardConfig () const
GenericSensorConfig const & | GetGenericSensorConfig (const ConfigType config) const
SingleAxisConfig const & | GetSingleAxisConfig (const unsigned sensorID, const int instance=-1) const
DualAxisConfig const & | GetDualAxisConfig (const unsigned sensorID) const
TripleAxisConfig const & | GetTripleAxisConfig (const unsigned sensorID) const
QuadAxisConfig const & | GetQuadAxisConfig (const unsigned sensorID) const
OtherAxisConfig const & | GetOtherAxisConfig (const unsigned sensorID) const
SingleAxisCapability const & | GetSingleAxisCapability (const unsigned sensorID, const int instance=-1) const
OtherAxisCapability const & | GetOtherAxisCapability (const unsigned sensorID) const
unsigned | GetSensorID (inertia::ValueType const &valueType) const
std::vector< unsigned > | GetSensorIDs (inertia::ValueType const &valueType) const
void | Merge (InertiaConfig const &config)
bool | IsLastReceived (const ConfigType config, const unsigned sensorID) const
std::vector< uint8_t > | GetBytes () const
const ChannelMap | GetChannelMap () const
unsigned | GetLowestModulo () const
InertiaConfig | GetDeepCopy () const
const std::wstring | ToString () const
const std::wstring | ToReadableString (bool const advanced) const

## Static Public Member Functions
static const po::options_description | GetOptionDescription ()
static const po::options_description | GetOptionDescription (ConfigType const config)
static ConfigType | GetConfigType (std::wstring const &configName)
static const std::wstring | GetName (ConfigType const type)

## Detailed Description

Sensor Configuration.

Class used to store received configurations and to create new configurations.

## Constructor & Destructor Documentation

## ◆ InertiaConfig() [1/3]

inertia::InertiaConfig::InertiaConfig | ( |  | ) |

Default Constructor. Creates an empty configuration.

## ◆ InertiaConfig() [2/3]

inertia::InertiaConfig::InertiaConfig | ( | std::vector< uint8_t > const & | in,
|  | const unsigned | dbfStart = 5 )

Raw data Constructor. Creates a configuration from raw binary data.

Parameters

  in | input bytes
  dbfStart | start-bit in the first byte

## ◆ InertiaConfig() [3/3]

inertia::InertiaConfig::InertiaConfig | ( | std::wstring const & | argString | ) |

Constructor with string argument. Creates a configuration from a string.

Parameters

  argString | string with arguments

## Member Function Documentation

## ◆ AddConfig() [1/2]

void inertia::InertiaConfig::AddConfig | ( | const ConfigType | config,
|  | const int | sensorID = -1,
|  | const AxisConfigDescriptorType | descrType = AXIS_DESCRIPTOR_CONFIGURATION )

Add a configuration type that should be requested or set to its default settings.

Parameters

  config | the configuration type to add
  sensorID | enable the configuration type only for the specified sensorID (relevant for AxisConfig), -1 if sensorID does not matter
  descrType | the descriptor type, e.g. configuration or capability

## ◆ AddConfig() [2/2]

void inertia::InertiaConfig::AddConfig | ( | SensorConfigPtr const & | config | ) |

Add a sensor configuration to this configuration that should be applied to a device.

Parameters

  config | the sensor configuration to add

## ◆ GetAccelConfig()

AccelConfig const & inertia::InertiaConfig::GetAccelConfig | ( |  | ) | const

Get the AccelConfig configuration (::CONFIG_ACCEL).

Returns
  the AccelConfig

Exceptions

  std::runtime_error | when configuration is not available

Deprecated
  not used anymore, replaced by TripleAxisConfig with ::ACCEL_MPU9250

## ◆ GetAccelConfigExt()

AccelConfigExt const & inertia::InertiaConfig::GetAccelConfigExt | ( |  | ) | const

Get the AccelConfigExt configuration (::CONFIG_ACCEL_EXT).

Returns
  the AccelConfigExt

Deprecated
  not used anymore, replaced by TripleAxisConfig with ::ACCEL_MPU9250

## ◆ GetADC2Config()

ADC2Config const & inertia::InertiaConfig::GetADC2Config | ( |  | ) | const

Get the ADC2Config configuration (::CONFIG_ADC2).

Returns
  the ADC2Config

Exceptions

  std::runtime_error | when configuration is not available

## ◆ GetADCConfig()

ADCConfig const & inertia::InertiaConfig::GetADCConfig | ( |  | ) | const

Get the ADCConfig configuration (::CONFIG_ADC).

Returns
  the ADCConfig

Exceptions

  std::runtime_error | when configuration is not available

Deprecated
  not used, replaced by ADC2Config

## ◆ GetBytes()

std::vector< uint8_t > inertia::InertiaConfig::GetBytes | ( |  | ) | const

Get the bytes of the configuration.

Returns
  a vector with the bytes

## ◆ GetChannelMap()

const ChannelMap inertia::InertiaConfig::GetChannelMap | ( |  | ) | const

Get a map with used sampling channels and Channel information.

Returns
  the channelMap

## ◆ GetCompassConfig()

CompassConfig const & inertia::InertiaConfig::GetCompassConfig | ( |  | ) | const

Get the CompassConfig configuration (::CONFIG_COMPASS).

Returns
  the CompassConfig

Exceptions

  std::runtime_error | when configuration is not available

Deprecated
  not used anymore, replaced by TripleAxisConfig with ::COMPASS_AK8963

## ◆ GetConfig()

SensorConfigPtr const inertia::InertiaConfig::GetConfig | ( | const ConfigType | config | ) | const

Get a configuration.

Parameters

  config | the type of configuration

Returns
  the requested configuration, empty pointer when the configuration is not available

## ◆ GetConfigType()

ConfigType inertia::InertiaConfig::GetConfigType | ( | std::wstring const & | configName | ) |
| static

Convert a configuration name to a configuration type.

Parameters

  configName | the configuration name

Returns
  the configuration type

## ◆ GetCorrelationConfig()

CorrelationConfig const & inertia::InertiaConfig::GetCorrelationConfig | ( |  | ) | const

Get the CorrelationConfig configuration (::CONFIG_CORR).

Returns
  the CorrelationConfig

Exceptions

  std::runtime_error | when configuration is not available

Deprecated
  not used

## ◆ GetDeepCopy()

InertiaConfig inertia::InertiaConfig::GetDeepCopy | ( |  | ) | const

Get a deep copy of this InertiaConfig, making sure that shared pointers are not shared.

Returns
  a copy of this configuration

## ◆ GetDetectionConfig()

DetectionConfig const & inertia::InertiaConfig::GetDetectionConfig | ( |  | ) | const

Get the DetectionConfig configuration (::CONFIG_DETECTION).

Returns
  the DetectionConfig

Exceptions

  std::runtime_error | when configuration is not available

Deprecated
  not used

## ◆ GetDualAxisConfig()

DualAxisConfig const & inertia::InertiaConfig::GetDualAxisConfig | ( | const unsigned | sensorID | ) | const

Get the DualAxisConfig configuration (::CONFIG_DUAL_AXIS).

Parameters

  sensorID | a DualAxisSensors ID

Returns
  the DualAxisConfig

Exceptions

  std::runtime_error | when configuration is not available

## ◆ GetGenericSensorConfig()

GenericSensorConfig const & inertia::InertiaConfig::GetGenericSensorConfig | ( | const ConfigType | config | ) | const

Get the GenericSensorConfig of the specified type.

Parameters

  config | the type of configuration (an AxisConfig)

Returns
  the GenericSensorConfig

Exceptions

  std::runtime_error | when configuration is not available

## ◆ GetGlobalSamplingConfig()

GlobalSamplingConfig const & inertia::InertiaConfig::GetGlobalSamplingConfig | ( |  | ) | const

Get the GlobalSamplingConfig configuration (::CONFIG_GLOBAL_SAMPLING).

Returns
  the GlobalSamplingConfig

Exceptions

  std::runtime_error | when configuration is not available

## ◆ GetGyroConfig()

GyroConfig const & inertia::InertiaConfig::GetGyroConfig | ( |  | ) | const

Get the GyroConfig configuration (::CONFIG_GYRO).

Returns
  the GyroConfig

Exceptions

  std::runtime_error | when configuration is not available

Deprecated
  not used anymore, replaced by TripleAxisConfig with ::GYRO_MPU9250

## ◆ GetHeartBeatConfig()

HeartBeatConfig const & inertia::InertiaConfig::GetHeartBeatConfig | ( |  | ) | const

Get the HeartBeatConfig configuration (::CONFIG_HEARTBEAT).

Returns
  the HeartBeatConfig

Exceptions

  std::runtime_error | when configuration is not available

Deprecated
  not used

## ◆ GetIMAConfig()

IMAConfig const & inertia::InertiaConfig::GetIMAConfig | ( |  | ) | const

Get the IMAConfig configuration (::CONFIG_IMA).

Returns
  the IMAConfig

Exceptions

  std::runtime_error | when configuration is not available

## ◆ GetInstances()

std::vector< unsigned > inertia::InertiaConfig::GetInstances | ( | const ConfigType | config,
|  | const unsigned | sensorID,
|  | const AxisConfigDescriptorType | descrType ) const

Get the available instances of a specific configuration type and sensorID.

Parameters

  config | the type of the configuration
  sensorID | the sensorID of the configuration
  descrType | the descriptor type of the configuration

Returns
  a vector with all available instances

## ◆ GetIsDefault()

bool inertia::InertiaConfig::GetIsDefault | ( |  | ) | const

Get if the InertiaConfig is used to reset configurations of a device to its default settings.

Returns
  true when used for setting to default settings

## ◆ GetIsRequest()

bool inertia::InertiaConfig::GetIsRequest | ( |  | ) | const

Get if the InertiaConfig is used to request configurations from a device.

Returns
  true when used for requesting

## ◆ GetLoggingConfig()

LoggingConfig const & inertia::InertiaConfig::GetLoggingConfig | ( |  | ) | const

Get the LoggingConfig configuration (::CONFIG_LOGGING).

Returns
  the LoggingConfig

Exceptions

  std::runtime_error | when configuration is not available

## ◆ GetLowestModulo()

unsigned inertia::InertiaConfig::GetLowestModulo | ( |  | ) | const

Get the lowest (closest to 1) modulo according to this configuration.

Returns
  the lowest modulo

## ◆ GetName()

const std::wstring inertia::InertiaConfig::GetName | ( | ConfigType const | type | ) |
| static

Convert a configuration type to a configuration name.

Parameters

  type | the configuration type

Returns
  the configuration name

## ◆ GetOptionDescription() [1/2]

const po::options_description inertia::InertiaConfig::GetOptionDescription | ( |  | ) |
| static

Get the possible command-line arguments for InertiaConfig. Only available when WITH_BOOST_PROGRAM_OPTIONS is defined.

Returns
  the option description

## ◆ GetOptionDescription() [2/2]

const po::options_description inertia::InertiaConfig::GetOptionDescription | ( | ConfigType const | config | ) |
| static

Get the possible command-line arguments for the given configuration type. Only available when WITH_BOOST_PROGRAM_OPTIONS is defined.

Parameters

  config | the type of configuration

Returns
  option description

## ◆ GetOtherAxisCapability()

OtherAxisCapability const & inertia::InertiaConfig::GetOtherAxisCapability | ( | const unsigned | sensorID | ) | const

Get the OtherAxisCapability capability (::CONFIG_SINGLE_AXIS).

Parameters

  sensorID | a OtherAxisSensors ID

Returns
  the OtherAxisCapability

Exceptions

  std::runtime_error | when capability is not available

## ◆ GetOtherAxisConfig()

OtherAxisConfig const & inertia::InertiaConfig::GetOtherAxisConfig | ( | const unsigned | sensorID | ) | const

Get the OtherAxisConfig configuration (::CONFIG_OTHER_AXIS).

Parameters

  sensorID | a OtherAxisSensors ID

Returns
  the OtherAxisConfig

Exceptions

  std::runtime_error | when configuration is not available

## ◆ GetQuadAxisConfig()

QuadAxisConfig const & inertia::InertiaConfig::GetQuadAxisConfig | ( | const unsigned | sensorID | ) | const

Get the QuadAxisConfig configuration (::CONFIG_QUAD_AXIS).

Parameters

  sensorID | a QuadAxisSensors ID

Returns
  the QuadAxisConfig

Exceptions

  std::runtime_error | when configuration is not available

## ◆ GetRadioConfig()

RadioConfig const & inertia::InertiaConfig::GetRadioConfig | ( |  | ) | const

Get the RadioConfig configuration (::CONFIG_RADIO).

Returns
  the RadioConfig

Exceptions

  std::runtime_error | when configuration is not available

## ◆ GetRTCConfig()

RTCConfig const & inertia::InertiaConfig::GetRTCConfig | ( |  | ) | const

Get the RTCConfig configuration (::CONFIG_RTC).

Returns
  the RTCConfig

Exceptions

  std::runtime_error | when configuration is not available

## ◆ GetSensorID()

unsigned inertia::InertiaConfig::GetSensorID | ( | inertia::ValueType const & | valueType | ) | const

Get the first available sensorID for a specific type.

Parameters

  valueType | the ValueType

Returns
  the sensorID, (unsigned)-1 if not found

## ◆ GetSensorIDs()

std::vector< unsigned > inertia::InertiaConfig::GetSensorIDs | ( | inertia::ValueType const & | valueType | ) | const

Get all sensorIDs for a specific type.

Parameters

  valueType | the ValueType

Returns
  the list of sensorIDs

## ◆ GetSingleAxisCapability()

SingleAxisCapability const & inertia::InertiaConfig::GetSingleAxisCapability | ( | const unsigned | sensorID,
|  | const int | instance = -1 ) const

Get the SingleAxisCapability capability (::CONFIG_SINGLE_AXIS).

Parameters

  sensorID | a SingleAxisSensors ID
  instance | a specific instance of the sensorID, see GetInstances(), -1 to ignore and get the first available

Returns
  the SingleAxisCapability

Exceptions

  std::runtime_error | when capability is not available

## ◆ GetSingleAxisConfig()

SingleAxisConfig const & inertia::InertiaConfig::GetSingleAxisConfig | ( | const unsigned | sensorID,
|  | const int | instance = -1 ) const

Get the SingleAxisConfig configuration (::CONFIG_SINGLE_AXIS).

Parameters

  sensorID | a SingleAxisSensors ID
  instance | a specific instance of the sensorID, see GetInstances(), -1 to ignore and get the first available

Returns
  the SingleAxisConfig

Exceptions

  std::runtime_error | when configuration is not available

## ◆ GetStatusConfig()

StatusConfig const & inertia::InertiaConfig::GetStatusConfig | ( |  | ) | const

Get the StatusConfig configuration (::CONFIG_STATUS).

Returns
  the StatusConfig

Exceptions

  std::runtime_error | when configuration is not available

## ◆ GetTemperatureConfig()

TemperatureConfig const & inertia::InertiaConfig::GetTemperatureConfig | ( |  | ) | const

Get the TemperatureConfig configuration (::CONFIG_STATUS).

Returns
  the TemperatureConfig

Exceptions

  std::runtime_error | when configuration is not available

Deprecated
  not used, replaced by SingleAxisConfig with ::TEMP_MPU9250

## ◆ GetTripleAxisConfig()

TripleAxisConfig const & inertia::InertiaConfig::GetTripleAxisConfig | ( | const unsigned | sensorID | ) | const

Get the TripleAxisConfig configuration (::CONFIG_TRIPLE_AXIS).

Parameters

  sensorID | a TripleAxisSensors ID

Returns
  the TripleAxisConfig

Exceptions

  std::runtime_error | when configuration is not available

## ◆ GetVmonBoardConfig()

VmonBoardConfig const & inertia::InertiaConfig::GetVmonBoardConfig | ( |  | ) | const

Get the VmonBoardConfig configuration (::CONFIG_VMON_BOARD).

Returns
  the VmonBoardConfig

Exceptions

  std::runtime_error | when configuration is not available

## ◆ HasConfig()

bool inertia::InertiaConfig::HasConfig | ( | const ConfigType | config,
|  | const int | sensorID = -1,
|  | const AxisConfigDescriptorType | descrType = AXIS_DESCRIPTOR_CONFIGURATION ) const

Check if this InertiaConfig contains a specific configuration type.

Parameters

  config | the type of the configuration
  sensorID | the sensorID of the configuration (relevant for AxisConfig), -1 if sensorID does not matter
  descrType | the descriptor type of the configuration (relevant for AxisConfig).

Returns
  true when the requested configuration is available

## ◆ HasConfigs()

bool inertia::InertiaConfig::HasConfigs | ( |  | ) | const

Check if this InertiaConfig contains configuration items.

Returns
  true when configurations are present

## ◆ IsLastReceived()

bool inertia::InertiaConfig::IsLastReceived | ( | const ConfigType | config,
|  | const unsigned | sensorID ) const

Indicate whether the config of the specific sensorID is merged or received (relevant for AxisConfig).

Parameters

  config | the type of configuration
  sensorID | the sensorID of the configuration

Returns
  true when the config for the sensorID is received or the config has no sensorID, false when the sensorID is merged

## ◆ Merge()

void inertia::InertiaConfig::Merge | ( | InertiaConfig const & | config | ) |

Merge the given InertiaConfig into this one.

Parameters

  config | the InertiaConfig to merge with

## ◆ SetIsDefault()

void inertia::InertiaConfig::SetIsDefault | ( | const bool | isDefault | ) |

Set the InertiaConfig to reset configurations of a device to its default settings.

Parameters

  isDefault | true to enable setting to default settings

## ◆ SetIsRequest()

void inertia::InertiaConfig::SetIsRequest | ( | const bool | isRequest | ) |

Set the InertiaConfig to request configurations from a device.

Parameters

  isRequest | true to enable requesting

## ◆ ToReadableString()

const std::wstring inertia::InertiaConfig::ToReadableString | ( | bool const | advanced | ) | const

Get a readable string representation of this InertiaConfig.

Parameters

  advanced | include all or only basic options

Returns
  the string

## ◆ ToString()

const std::wstring inertia::InertiaConfig::ToString | ( |  | ) | const

Get a string representation of this InertiaConfig. The string is compatible with GetOptionDescription() and InertiaConfig(std::wstring const&).

Returns
  the string

The documentation for this struct was generated from the following file:

- InertiaConfig.h