# esp32_BNO08x: include/report/BNO08xRptActivityClassifier.hpp Source File

Loading...
Searching...
No Matches
BNO08xRptActivityClassifier.hpp
Go to the documentation of this file.
#pragma once
#include "BNO08xRpt.hpp"
class BNO08xRptActivityClassifier : public BNO08xRpt
{
public:
BNO08xRptActivityClassifier(uint8_t ID, EventBits_t rpt_bit, BNO08xPrivateTypes::bno08x_sync_ctx_t* sync_ctx)
: BNO08xRpt(ID, rpt_bit, sync_ctx)
{
}
bool enable(
uint32_t time_between_reports, sh2_SensorConfig_t sensor_cfg = BNO08xPrivateTypes::default_sensor_cfg) override;
bno08x_activity_classifier_t get();
BNO08xActivity get_most_likely_activity();
void set_activities_to_enable(BNO08xActivityEnable activities_to_enable);
private:
void update_data(sh2_SensorValue_t* sensor_val) override;
bno08x_activity_classifier_t data;
BNO08xActivityEnable activities_to_enable =
BNO08xActivityEnable::ALL;
static const constexpr char* TAG = "BNO08xRptActivityClassifier";
};
BNO08xActivity
BNO08xActivity
BNO08xActivity states returned from BNO08x::activity_classifier.get()
Definition BNO08xGlobalTypes.hpp:132
BNO08xActivityEnable
BNO08xActivityEnable
BNO08xActivity Classifier enable bits passed to enable_activity_classifier()
Definition BNO08xGlobalTypes.hpp:117
BNO08xActivityEnable::ALL
@ ALL
BNO08xRpt.hpp
BNO08xRptActivityClassifier
Class to represent activity classifier reports. (See Ref. Manual 6.5.36)
Definition BNO08xRptActivityClassifier.hpp:16
BNO08xRptActivityClassifier::activities_to_enable
BNO08xActivityEnable activities_to_enable
Activities to be monitored, call enable after setting.
Definition BNO08xRptActivityClassifier.hpp:32
BNO08xRptActivityClassifier::data
bno08x_activity_classifier_t data
Most recent report data, doesn't account for step rollover.
Definition BNO08xRptActivityClassifier.hpp:31
BNO08xRptActivityClassifier::enable
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.
Definition BNO08xRptActivityClassifier.cpp:35
BNO08xRptActivityClassifier::get_most_likely_activity
BNO08xActivity get_most_likely_activity()
Grabs most the most likely activity from most recent activity classifier data.
Definition BNO08xRptActivityClassifier.cpp:60
BNO08xRptActivityClassifier::get
bno08x_activity_classifier_t get()
Grabs most recent activity classifier data.
Definition BNO08xRptActivityClassifier.cpp:47
BNO08xRptActivityClassifier::BNO08xRptActivityClassifier
BNO08xRptActivityClassifier(uint8_t ID, EventBits_t rpt_bit, BNO08xPrivateTypes::bno08x_sync_ctx_t *sync_ctx)
Definition BNO08xRptActivityClassifier.hpp:18
BNO08xRptActivityClassifier::update_data
void update_data(sh2_SensorValue_t *sensor_val) override
Updates activity classifier data from decoded sensor event.
Definition BNO08xRptActivityClassifier.cpp:15
BNO08xRptActivityClassifier::set_activities_to_enable
void set_activities_to_enable(BNO08xActivityEnable activities_to_enable)
Sets the activities to be monitored for with ActivityClassifier reports, all enable after setting.
Definition BNO08xRptActivityClassifier.cpp:75
BNO08xRptActivityClassifier::TAG
static const constexpr char * TAG
Definition BNO08xRptActivityClassifier.hpp:34
BNO08xRpt
Class to represent and manage reports returned from BNO08x.
Definition BNO08xRpt.hpp:26
BNO08xRpt::sync_ctx
BNO08xPrivateTypes::bno08x_sync_ctx_t * sync_ctx
Definition BNO08xRpt.hpp:42
BNO08xRpt::ID
uint8_t ID
Report ID, ex. SH2_ACCELERATION.
Definition BNO08xRpt.hpp:39
BNO08xRpt::rpt_bit
EventBits_t rpt_bit
Respective enable and data bit for report in evt_grp_rpt_en and evt_grp_rpt_data.
Definition BNO08xRpt.hpp:40
BNO08xPrivateTypes::default_sensor_cfg
static sh2_SensorConfig default_sensor_cfg
Definition BNO08xPrivateTypes.hpp:127
BNO08xPrivateTypes::bno08x_sync_ctx_t
Holds context used to synchronize tasks and callback execution.
Definition BNO08xPrivateTypes.hpp:57
bno08x_activity_classifier_t
Struct to represent activity classifier data.
Definition BNO08xGlobalTypes.hpp:414