#ifndef __GYRO_ATTR_H__ #define __GYRO_ATTR_H__ #include "mbed.h" #include "bmi160.h" #include "cJSON.h" #define GYRO_SENSOR_UPDATE_THREAD_STACK_SIZE 2048 class GyroAttr { public: GyroAttr(BMI160* _imu); ~GyroAttr(); int sensor_init(); int start_sensor_update(int _interval_ms); cJSON* get_gyro(); private: void init_attr(); void sensor_update_main_loop(); private: BMI160* imu; BMI160::AccConfig acc_config; BMI160::GyroConfig gyro_config; cJSON *gyro; cJSON *x, *y, *z; int interval_ms; Thread thread; }; #endif