esp32_BNO08x 1.4
C++ BNO08x IMU driver component for esp-idf.
BNO08xRptActivityClassifier Class Reference

Class to represent activity classifier reports. (See Ref. Manual 6.5.36) More...

#include <report/BNO08xRptActivityClassifier.hpp>

Inheritance diagram for BNO08xRptActivityClassifier:
Collaboration diagram for BNO08xRptActivityClassifier:

Public Member Functions

 BNO08xRptActivityClassifier (uint8_t ID, EventBits_t rpt_bit, BNO08xPrivateTypes::bno08x_sync_ctx_t *sync_ctx)
 
bool enable (uint32_t time_between_reports, sh2_SensorConfig_t sensor_cfg=BNO08xPrivateTypes::default_sensor_cfg) override
 Enables activity classifier reports such that the BNO08x begins sending them. More...
 
bno08x_activity_classifier_t get ()
 Grabs most recent activity classifier data. More...
 
BNO08xActivity get_most_likely_activity ()
 Grabs most the most likely activity from most recent activity classifier data. More...
 
void set_activities_to_enable (BNO08xActivityEnable activities_to_enable)
 Sets the activities to be monitored for with ActivityClassifier reports, all enable after setting. More...
 
- Public Member Functions inherited from BNO08xRpt
bool disable (sh2_SensorConfig_t sensor_cfg=BNO08xPrivateTypes::default_sensor_cfg)
 Disables a sensor report by setting its period to 0us such that the BNO08x stops sending it. More...
 
bool register_cb (std::function< void(void)> cb_fxn)
 Registers a callback to execute when new data from a specific report is received. More...
 
bool has_new_data ()
 Checks if a new report has been received since the last time this function was called. More...
 
bool flush ()
 Flush all buffered reports for this sensor/report module. More...
 
bool get_sample_counts (bno08x_sample_counts_t &sample_counts)
 Gets sample counts for this sensor (see SH-2 ref manual 6.4.3.1) More...
 
bool clear_sample_counts ()
 Clears BNO08x internal sample counts for this sensor. (see SH-2 ref manual 6.4.3.1) More...
 
bool get_meta_data (bno08x_meta_data_t &meta_data)
 Retrieves meta data for this sensor/report by reading respective record in FRS (flash record system). More...
 
virtual bool enable (uint32_t time_between_reports, sh2_SensorConfig_t sensor_cfg=BNO08xPrivateTypes::default_sensor_cfg)=0
 

Additional Inherited Members

- Protected Member Functions inherited from BNO08xRpt
bool rpt_enable (uint32_t time_between_reports, sh2_SensorConfig_t sensor_cfg=BNO08xPrivateTypes::default_sensor_cfg)
 Enables a sensor report such that the BNO08x begins sending it. More...
 
virtual void update_data (sh2_SensorValue_t *sensor_val)=0
 
 BNO08xRpt (uint8_t ID, EventBits_t rpt_bit, BNO08xPrivateTypes::bno08x_sync_ctx_t *sync_ctx)
 BNO08xRpt report constructor. More...
 
void unlock_sh2_HAL ()
 Unlocks sh2 HAL lib to allow other tasks to call its APIs. More...
 
void lock_sh2_HAL ()
 Locks sh2 HAL lib to only allow the calling task to call its APIs. More...
 
void unlock_user_data ()
 Unlocks user data to allow other tasks to read/modify it. More...
 
void lock_user_data ()
 Locks locks user data to only allow the calling task to read/modify it. More...
 
void signal_data_available ()
 Signals to BNO08x::data_available() that a new report has arrived. More...
 
- Protected Attributes inherited from BNO08xRpt
uint8_t ID
 Report ID, ex. SH2_ACCELERATION. More...
 
EventBits_t rpt_bit
 Respective enable and data bit for report in evt_grp_rpt_en and evt_grp_rpt_data. More...
 
uint32_t period_us
 The period/interval of the report in microseconds. More...
 
BNO08xPrivateTypes::bno08x_sync_ctx_tsync_ctx
 
- Static Protected Attributes inherited from BNO08xRpt
static const constexpr float RAD_2_DEG
 Constant for radian to degree conversions, sed in quaternion to euler function conversions. More...
 
static const constexpr char * TAG = "BNO08xRpt"
 

Detailed Description

Class to represent activity classifier reports. (See Ref. Manual 6.5.36)

Constructor & Destructor Documentation

◆ BNO08xRptActivityClassifier()

BNO08xRptActivityClassifier::BNO08xRptActivityClassifier ( uint8_t  ID,
EventBits_t  rpt_bit,
BNO08xPrivateTypes::bno08x_sync_ctx_t sync_ctx 
)
inline

Member Function Documentation

◆ enable()

bool BNO08xRptActivityClassifier::enable ( uint32_t  time_between_reports,
sh2_SensorConfig_t  sensor_cfg = BNO08xPrivateTypes::default_sensor_cfg 
)
overridevirtual

Enables activity classifier reports such that the BNO08x begins sending them.

Parameters
report_period_usThe period/interval of the report in microseconds.
sensor_cfgSensor special configuration (optional, see BNO08xPrivateTypes::default_sensor_cfg for defaults).
Returns
True if report was successfully enabled.

Implements BNO08xRpt.

Here is the call graph for this function:

◆ get()

bno08x_activity_classifier_t BNO08xRptActivityClassifier::get ( )

Grabs most recent activity classifier data.

Returns
Struct containing requested data.
Here is the call graph for this function:

◆ get_most_likely_activity()

BNO08xActivity BNO08xRptActivityClassifier::get_most_likely_activity ( )

Grabs most the most likely activity from most recent activity classifier data.

Returns
BNO08xActivity object with detected state.
Here is the call graph for this function:

◆ set_activities_to_enable()

void BNO08xRptActivityClassifier::set_activities_to_enable ( BNO08xActivityEnable  activities_to_enable)

Sets the activities to be monitored for with ActivityClassifier reports, all enable after setting.

Parameters
activities_to_enableThe activities to be monitored with sent reports.
Returns
void, nothing to return

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