Loading...
Searching...
No Matches
BNO08xTestHelper Class Reference

BNO08x unit test helper class. More...

`#include <BNO08xTestHelper.hpp>`

Collaboration diagram for BNO08xTestHelper:
[legend]

## Classes

struct | imu_report_data_t
| IMU configuration settings passed into constructor. More...

## Public Types

typedef struct BNO08xTestHelper::imu_report_data_t | imu_report_data_t
| IMU configuration settings passed into constructor.

## Static Public Member Functions

static void | print_test_start_banner (const char *TEST_TAG)
| Prints test begin banner.
static void | print_test_end_banner (const char *TEST_TAG)
| Prints end begin banner.
static void | print_test_msg (const char *TEST_TAG, const char *msg)
| Prints a message during a test.
static void | set_test_imu_cfg (bno08x_config_t cfg)
| Set test imu configuration used with create_test_imu()
static void | create_test_imu ()
| Calls BNO08x constructor and creates new test IMU on heap.
static void | destroy_test_imu ()
| Deletes test IMU calling deconstructor and releases heap allocated memory.
static BNO08x * | get_test_imu ()
| Deletes test IMU calling deconstructor and releases heap allocated memory.
static esp_err_t | call_init_config_args ()
| Used to call private BNO08x::init_config_args() member for tests.
static esp_err_t | call_init_gpio ()
| Used to call private BNO08x::init_gpio() member for tests.
static esp_err_t | call_init_hint_isr ()
| Used to call private BNO08x::init_hint_isr() member for tests.
static esp_err_t | call_init_spi ()
| Used to call private BNO08x::init_spi() member for tests.
static esp_err_t | call_launch_tasks ()
| Used to call private BNO08x::launch_tasks() member for tests.
static bool | rotation_vector_data_is_new (imu_report_data_t *report_data, imu_report_data_t *default_report_data)
| Checks if report_data matches the default states stored within prev_report_data data for respective report.
static bool | gyro_integrated_rotation_vector_data_is_new (imu_report_data_t *report_data, imu_report_data_t *default_report_data)
| Checks if report_data matches the default states stored within prev_report_data data for respective report.
static bool | uncalibrated_gyro_data_is_new (imu_report_data_t *report_data, imu_report_data_t *default_report_data)
| Checks if report_data matches the default states stored within prev_report_data data for respective report.
static bool | calibrated_gyro_data_is_new (imu_report_data_t *report_data, imu_report_data_t *default_report_data)
| Checks if report_data matches the default states stored within prev_report_data data for respective report.
static bool | accelerometer_data_is_new (imu_report_data_t *report_data, imu_report_data_t *default_report_data)
| Checks if report_data matches the default states stored within prev_report_data data for respective report.
static bool | linear_accelerometer_data_is_new (imu_report_data_t *report_data, imu_report_data_t *default_report_data)
| Checks if report_data matches the default states stored within prev_report_data data for respective report.
static bool | gravity_data_is_new (imu_report_data_t *report_data, imu_report_data_t *default_report_data)
| Checks if report_data matches the default states stored within prev_report_data data for respective report.
static bool | magnetometer_data_is_new (imu_report_data_t *report_data, imu_report_data_t *default_report_data)
| Checks if report_data matches the default states stored within prev_report_data data for respective report.
static bool | step_counter_data_is_new (imu_report_data_t *report_data, imu_report_data_t *default_report_data)
| Checks if report_data matches the default states stored within prev_report_data data for respective report.
static bool | stability_classifier_data_is_new (imu_report_data_t *report_data, imu_report_data_t *default_report_data)
| Checks if report_data matches the default states stored within prev_report_data data for respective report.
static bool | activity_classifier_data_is_new (imu_report_data_t *report_data, imu_report_data_t *default_report_data)
| Checks if report_data matches the default states stored within prev_report_data data for respective report.
static void | update_report_data (imu_report_data_t *report_data)
| Updates report data with calls relevant test_imu methods.
static void | reset_all_imu_data_to_test_defaults ()
| Resets internal test imu data with test defaults.
static const char * | BNO08xAccuracy_to_str (BNO08xAccuracy accuracy)
| Converts BNO08xAccuracy enum class object to string.
static const char * | BNO08xStability_to_str (BNO08xStability stability)
| Converts BNO08xStability enum class object to string.
static const char * | BNO08xActivity_to_str (BNO08xActivity activity)
| Converts BNO08xActivity enum class object to string.

## Static Private Attributes

static BNO08x * | test_imu = nullptr
static bno08x_config_t | imu_cfg
static const constexpr char * | TAG = "BNO08xTestHelper"

## Detailed Description

BNO08x unit test helper class.

## Member Typedef Documentation

## imu_report_data_t

typedef struct BNO08xTestHelper::imu_report_data_t BNO08xTestHelper::imu_report_data_t

IMU configuration settings passed into constructor.

## Member Function Documentation

## accelerometer_data_is_new()

static bool BNO08xTestHelper::accelerometer_data_is_new | ( | imu_report_data_t * | report_data,
|  | imu_report_data_t * | default_report_data )

inlinestatic

Checks if report_data matches the default states stored within prev_report_data data for respective report.

Parameters

  report_data | Current report data.
  default_report_data | Default report data to compare (should always contain default values)

Returns
  True if new data was received for respective report.

Here is the caller graph for this function:

## activity_classifier_data_is_new()

static bool BNO08xTestHelper::activity_classifier_data_is_new | ( | imu_report_data_t * | report_data,
|  | imu_report_data_t * | default_report_data )

inlinestatic

Checks if report_data matches the default states stored within prev_report_data data for respective report.

Parameters

  report_data | Current report data.
  default_report_data | Default report data to compare (should always contain default values)

Returns
  True if new data was received for respective report.

Here is the caller graph for this function:

## BNO08xAccuracy_to_str()

static const char * BNO08xTestHelper::BNO08xAccuracy_to_str | ( | BNO08xAccuracy | accuracy | ) |

inlinestatic

Converts BNO08xAccuracy enum class object to string.

Parameters

  report_data | BNO08xAccuracy object to convert to string.

Returns
  The resulting string conversion.

Here is the caller graph for this function:

## BNO08xActivity_to_str()

static const char * BNO08xTestHelper::BNO08xActivity_to_str | ( | BNO08xActivity | activity | ) |

inlinestatic

Converts BNO08xActivity enum class object to string.

Parameters

  activity | BNO08xActivity object to convert to string.

Returns
  The resulting string conversion.

Here is the caller graph for this function:

## BNO08xStability_to_str()

static const char * BNO08xTestHelper::BNO08xStability_to_str | ( | BNO08xStability | stability | ) |

inlinestatic

Converts BNO08xStability enum class object to string.

Parameters

  stability | BNO08xStability object to convert to string.

Returns
  The resulting string conversion.

Here is the caller graph for this function:

## calibrated_gyro_data_is_new()

static bool BNO08xTestHelper::calibrated_gyro_data_is_new | ( | imu_report_data_t * | report_data,
|  | imu_report_data_t * | default_report_data )

inlinestatic

Checks if report_data matches the default states stored within prev_report_data data for respective report.

Parameters

  report_data | Current report data.
  default_report_data | Default report data to compare (should always contain default values)

Returns
  True if new data was received for respective report.

Here is the caller graph for this function:

## call_init_config_args()

static esp_err_t BNO08xTestHelper::call_init_config_args | ( |  | ) |

inlinestatic

Used to call private BNO08x::init_config_args() member for tests.

Returns
  ESP_OK if init succeeded.

Here is the call graph for this function:
Here is the caller graph for this function:

## call_init_gpio()

static esp_err_t BNO08xTestHelper::call_init_gpio | ( |  | ) |

inlinestatic

Used to call private BNO08x::init_gpio() member for tests.

Returns
  ESP_OK if init succeeded.

Here is the call graph for this function:
Here is the caller graph for this function:

## call_init_hint_isr()

static esp_err_t BNO08xTestHelper::call_init_hint_isr | ( |  | ) |

inlinestatic

Used to call private BNO08x::init_hint_isr() member for tests.

Returns
  ESP_OK if init succeeded.

Here is the call graph for this function:
Here is the caller graph for this function:

## call_init_spi()

static esp_err_t BNO08xTestHelper::call_init_spi | ( |  | ) |

inlinestatic

Used to call private BNO08x::init_spi() member for tests.

Returns
  ESP_OK if init succeeded.

Here is the call graph for this function:
Here is the caller graph for this function:

## call_launch_tasks()

static esp_err_t BNO08xTestHelper::call_launch_tasks | ( |  | ) |

inlinestatic

Used to call private BNO08x::launch_tasks() member for tests.

Returns
  ESP_OK if init succeeded.

Here is the call graph for this function:
Here is the caller graph for this function:

## create_test_imu()

static void BNO08xTestHelper::create_test_imu | ( |  | ) |

inlinestatic

Calls BNO08x constructor and creates new test IMU on heap.

Returns
  void, nothing to return

Here is the call graph for this function:
Here is the caller graph for this function:

## destroy_test_imu()

static void BNO08xTestHelper::destroy_test_imu | ( |  | ) |

inlinestatic

Deletes test IMU calling deconstructor and releases heap allocated memory.

Returns
  void, nothing to return

Here is the caller graph for this function:

## get_test_imu()

static BNO08x * BNO08xTestHelper::get_test_imu | ( |  | ) |

inlinestatic

Deletes test IMU calling deconstructor and releases heap allocated memory.

Returns
  Pointer to BNO08x IMU object to test.

Here is the caller graph for this function:

## gravity_data_is_new()

static bool BNO08xTestHelper::gravity_data_is_new | ( | imu_report_data_t * | report_data,
|  | imu_report_data_t * | default_report_data )

inlinestatic

Checks if report_data matches the default states stored within prev_report_data data for respective report.

Parameters

  report_data | Current report data.
  default_report_data | Default report data to compare (should always contain default values)

Returns
  True if new data was received for respective report.

Here is the caller graph for this function:

## gyro_integrated_rotation_vector_data_is_new()

static bool BNO08xTestHelper::gyro_integrated_rotation_vector_data_is_new | ( | imu_report_data_t * | report_data,
|  | imu_report_data_t * | default_report_data )

inlinestatic

Checks if report_data matches the default states stored within prev_report_data data for respective report.

Parameters

  report_data | Current report data.
  default_report_data | Default report data to compare (should always contain default values)

Returns
  True if new data was received for respective report.

Here is the caller graph for this function:

## linear_accelerometer_data_is_new()

static bool BNO08xTestHelper::linear_accelerometer_data_is_new | ( | imu_report_data_t * | report_data,
|  | imu_report_data_t * | default_report_data )

inlinestatic

Checks if report_data matches the default states stored within prev_report_data data for respective report.

Parameters

  report_data | Current report data.
  default_report_data | Default report data to compare (should always contain default values)

Returns
  True if new data was received for respective report.

Here is the caller graph for this function:

## magnetometer_data_is_new()

static bool BNO08xTestHelper::magnetometer_data_is_new | ( | imu_report_data_t * | report_data,
|  | imu_report_data_t * | default_report_data )

inlinestatic

Checks if report_data matches the default states stored within prev_report_data data for respective report.

Parameters

  report_data | Current report data.
  default_report_data | Default report data to compare (should always contain default values)

Returns
  True if new data was received for respective report.

Here is the caller graph for this function:

## print_test_end_banner()

static void BNO08xTestHelper::print_test_end_banner | ( | const char * | TEST_TAG | ) |

inlinestatic

Prints end begin banner.

Parameters

  TEST_TAG | String containing test name.

Returns
  void, nothing to return

Here is the caller graph for this function:

## print_test_msg()

BNO08xTestHelper::print_test_msg | ( | const char * | TEST_TAG,
|  | const char * | msg )

inlinestatic

Prints a message during a test.

Parameters

  TEST_TAG | String containing test name.
  msg | String containing message to print.

Returns
  void, nothing to return

Here is the caller graph for this function:

## print_test_start_banner()

static void BNO08xTestHelper::print_test_start_banner | ( | const char * | TEST_TAG | ) |

inlinestatic

Prints test begin banner.

Parameters

  TEST_TAG | String containing test name.

Returns
  void, nothing to return

Here is the caller graph for this function:

## reset_all_imu_data_to_test_defaults()

BNO08xTestHelper::reset_all_imu_data_to_test_defaults | ( |  | ) |

inlinestatic

Resets internal test imu data with test defaults.

Returns
  void, nothing to return.

Here is the caller graph for this function:

## rotation_vector_data_is_new()

static bool BNO08xTestHelper::rotation_vector_data_is_new | ( | imu_report_data_t * | report_data,
|  | imu_report_data_t * | default_report_data )

inlinestatic

Checks if report_data matches the default states stored within prev_report_data data for respective report.

Parameters

  report_data | Current report data.
  default_report_data | Default report data to compare (should always contain default values)

Returns
  True if new data was received for respective report.

Here is the caller graph for this function:

## set_test_imu_cfg()

static void BNO08xTestHelper::set_test_imu_cfg | ( | bno08x_config_t | cfg | ) |

inlinestatic

Set test imu configuration used with create_test_imu()

Parameters

  cfg | String containing test name.

Returns
  void, nothing to return

## stability_classifier_data_is_new()

static bool BNO08xTestHelper::stability_classifier_data_is_new | ( | imu_report_data_t * | report_data,
|  | imu_report_data_t * | default_report_data )

inlinestatic

Checks if report_data matches the default states stored within prev_report_data data for respective report.

Parameters

  report_data | Current report data.
  default_report_data | Default report data to compare (should always contain default values)

Returns
  True if new data was received for respective report.

Here is the caller graph for this function:

## step_counter_data_is_new()

static bool BNO08xTestHelper::step_counter_data_is_new | ( | imu_report_data_t * | report_data,
|  | imu_report_data_t * | default_report_data )

inlinestatic

Checks if report_data matches the default states stored within prev_report_data data for respective report.

Parameters

  report_data | Current report data.
  default_report_data | Default report data to compare (should always contain default values)

Returns
  True if new data was received for respective report.

Here is the caller graph for this function:

## uncalibrated_gyro_data_is_new()

static bool BNO08xTestHelper::uncalibrated_gyro_data_is_new | ( | imu_report_data_t * | report_data,
|  | imu_report_data_t * | default_report_data )

inlinestatic

Checks if report_data matches the default states stored within prev_report_data data for respective report.

Parameters

  report_data | Current report data.
  default_report_data | Default report data to compare (should always contain default values)

Returns
  True if new data was received for respective report.

Here is the caller graph for this function:

## update_report_data()

static void BNO08xTestHelper::update_report_data | ( | imu_report_data_t * | report_data | ) |

inlinestatic

Updates report data with calls relevant test_imu methods.

Parameters

  report_data | Pointer to imu_report_data_t struct to save report data.

Returns
  void, noting to return.

Here is the call graph for this function:
Here is the caller graph for this function:

## Member Data Documentation

## imu_cfg

bno08x_config_t BNO08xTestHelper::imu_cfg

inlinestaticprivate

## TAG

const constexpr char* BNO08xTestHelper::TAG = "BNO08xTestHelper"

staticconstexprprivate

## test_imu

BNO08x* BNO08xTestHelper::test_imu = nullptr

inlinestaticprivate

The documentation for this class was generated from the following files:

- BNO08xTestHelper.hpp
- CallbackTests.cpp