35 #ifndef __SENSOR_ALG_INTERFACE_H__ 36 #define __SENSOR_ALG_INTERFACE_H__ 71 #elif defined(__ICCARM__) 72 #pragma language=extended 73 #elif defined(__GNUC__) 78 #define SENSOR_TYPE_ACCELEROMETER (0) 80 #define SENSOR_TYPE_MAGNETIC_FIELD (1) 82 #define SENSOR_TYPE_PRESSURE (2) 84 #define SENSOR_TYPE_GYROSCOPE (3) 86 #define SENSOR_TYPE_PROXIMITY (4) 88 #define SENSOR_TYPE_BIOSENSOR_EKG (5) 90 #define SENSOR_TYPE_BIOSENSOR_EEG (6) 92 #define SENSOR_TYPE_BIOSENSOR_EMG (7) 94 #define SENSOR_TYPE_BIOSENSOR_GSR (8) 96 #define SENSOR_TYPE_BIOSENSOR_PPG1 (9) 98 #define SENSOR_TYPE_BIOSENSOR_PPG2 (10) 100 #define SENSOR_TYPE_BIOSENSOR_BISI (11) 102 #define SENSOR_TYPE_BIOSENSOR_PPG1_512HZ (12) 104 #define SENSOR_PHYSICAL_TYPE_ALL (13) 106 #define SENSOR_VIRTUAL_TYPE_START (13) 108 #define SENSOR_TYPE_PEDOMETER (SENSOR_VIRTUAL_TYPE_START) 110 #define SENSOR_TYPE_ACTIVITY (SENSOR_VIRTUAL_TYPE_START+1) 112 #define SENSOR_TYPE_GESTURE_CHECK_TIME (SENSOR_VIRTUAL_TYPE_START+2) 114 #define SENSOR_TYPE_GESTURE_TAP (SENSOR_VIRTUAL_TYPE_START+3) 116 #define SENSOR_TYPE_GESTURE_SHAKE (SENSOR_VIRTUAL_TYPE_START+4) 118 #define SENSOR_TYPE_GESTURE_TWIST (SENSOR_VIRTUAL_TYPE_START+5) 120 #define SENSOR_TYPE_FALL (SENSOR_VIRTUAL_TYPE_START+6) 122 #define SENSOR_TYPE_SLEEP (SENSOR_VIRTUAL_TYPE_START+7) 124 #define SENSOR_TYPE_PDR (SENSOR_VIRTUAL_TYPE_START+8) 126 #define SENSOR_TYPE_HEART_RATE_MONITOR (SENSOR_VIRTUAL_TYPE_START+9) 128 #define SENSOR_TYPE_HEART_RATE_VARIABILITY_MONITOR (SENSOR_VIRTUAL_TYPE_START+10) 130 #define SENSOR_TYPE_BLOOD_PRESSURE_MONITOR (SENSOR_VIRTUAL_TYPE_START+11) 132 #define SENSOR_TYPE_SLEEP_STAGING (SENSOR_VIRTUAL_TYPE_START+12) 134 #define SENSOR_TYPE_MOTION_DETECT (SENSOR_VIRTUAL_TYPE_START+13) 136 #define SENSOR_TYPE_ELECTRIC_HEART_RATE_MONITOR (SENSOR_VIRTUAL_TYPE_START+14) 138 #define SENSOR_TYPE_ALL (SENSOR_VIRTUAL_TYPE_START+15) 603 #define SENSOR_DEFAULT_DELAY (200) 606 #define SENSOR_DELAY 0x01 608 #define SENSOR_ENABLE 0x02 610 #define SENSOR_GET_DATA 0x04 612 #define SENSOR_CUST 0x08 614 #define SENSOR_BATCH 0x10 638 void *buff_in, int32_t size_in);
742 #define SENSOR_MAX_SUBSCRIBER_NAME_LEN ( 8 ) int32_t LF_HF
The balance of autonomic nervous system, represented by low frequency band to high frequency band rat...
Definition: sensor_alg_interface.h:335
int32_t z_uncali
Value of the Z-axis.
Definition: sensor_alg_interface.h:311
int32_t HF
ECG autonomic nervous system high frequency band.
Definition: sensor_alg_interface.h:334
This sensor is reporting data with low accuracy.
Definition: sensor_alg_interface.h:272
int32_t sensor_get_latest_sensor_data(uint32_t type, sensor_data_t *const output)
This function gets the latest data of the specified sensor type.
int32_t(* sensor_descriptor_process_data_callback_t)(const sensor_data_t *input_list, void *reserved)
Feeds input sensor data and trigger the fusion algorithm to execute.
Definition: sensor_alg_interface.h:487
struct sensor_input_list sensor_input_list_t
The required input physical sensor list to register the fusion algorithms.
Sensor events are generated at a constant rate.
Definition: sensor_alg_interface.h:265
uint64_t step_counter
The number of steps taken.
Definition: sensor_alg_interface.h:441
int32_t relative_humidity
Relative humidity measurement.
Definition: sensor_alg_interface.h:388
sensor_uncalibrated_event_t uncalibrated_acc_t
Uncalibrated accelerometer sensor event data.
Definition: sensor_alg_interface.h:423
sensor_status_t
Measurement status of the sensor.
Definition: sensor_alg_interface.h:269
sensor_vec_t orientation_t
Orientation sensor event data.
Definition: sensor_alg_interface.h:415
struct sensor_descriptor sensor_descriptor_t
The description for a virtual sensor (fusion algorithm) registration.
int32_t z_bias
Bias of the Z-axis.
Definition: sensor_alg_interface.h:319
int32_t status
Quality of the measurement, subject to fusion algorithm design.
Definition: sensor_alg_interface.h:337
uint32_t data
Biosensor data.
Definition: sensor_alg_interface.h:357
int32_t(* sensor_subscriber_send_digest_callback_t)(sensor_data_t *const output)
Sends sensor data to the subscriber.
Definition: sensor_alg_interface.h:735
Pedometer sensor event data.
Definition: sensor_alg_interface.h:371
int32_t * beatPos
The count of each heartbeat occurrence depending on the EKG sampling rate.
Definition: sensor_alg_interface.h:338
Fall detection sensor event data.
Definition: sensor_alg_interface.h:402
Falling.
Definition: sensor_alg_interface.h:256
int32_t * feature
Intermediate features for sleep monitor.
Definition: sensor_alg_interface.h:396
Stationary.
Definition: sensor_alg_interface.h:226
int32_t numPwtt
The total number of PWTT contained in the sequence.
Definition: sensor_alg_interface.h:350
No fall is detected.
Definition: sensor_alg_interface.h:255
int32_t y
Value of the Y-axis.
Definition: sensor_alg_interface.h:291
sensor_uncalibrated_event_t uncalibrated_gyro_t
Uncalibrated gyroscope sensor event data.
Definition: sensor_alg_interface.h:425
sensor_fall_type_t
The types of fall detection.
Definition: sensor_alg_interface.h:254
uint32_t type
The sensor type for the subscription.
Definition: sensor_alg_interface.h:752
int32_t bpm
Beats per minute.
Definition: sensor_alg_interface.h:326
Biosensor event data.
Definition: sensor_alg_interface.h:355
int32_t sensor_subscribe_sensor(sensor_subscriber_t *subscriber)
This function subscribes the sensor event for a specified sensor type.
The maximum number of fall types.
Definition: sensor_alg_interface.h:258
struct sensor_driver_object sensor_driver_object_t
The sensor driver object of a physical sensor.
In vehicle.
Definition: sensor_alg_interface.h:235
Relative humidity sensor event data.
Definition: sensor_alg_interface.h:387
int32_t status
Quality of the measurement, subject to fusion algorithm design.
Definition: sensor_alg_interface.h:327
Gesture of checking the time or a glance at the screen.
Definition: sensor_alg_interface.h:250
int32_t sensor_manager_init(void)
This function initializes the data structures in sensor manager.
int32_t sensor_fusion_algorithm_notify(uint32_t sensor_type)
For fusion algorithm to notify sensor manager of sensor event.
Running.
Definition: sensor_alg_interface.h:232
int32_t y_bias
Bias of the Y-axis.
Definition: sensor_alg_interface.h:318
sensor_activity_t activity_data_t
Activity recognition sensor event data.
Definition: sensor_alg_interface.h:433
The description for a virtual sensor (fusion algorithm) registration.
Definition: sensor_alg_interface.h:498
The subscriber information for the sensor event of the specified sensor.
Definition: sensor_alg_interface.h:749
sensor_descriptor_get_result_callback_t get_result
Call this function to get the fused results.
Definition: sensor_alg_interface.h:504
int32_t x
Value of the X-axis.
Definition: sensor_alg_interface.h:290
The sensor driver object of a physical sensor.
Definition: sensor_alg_interface.h:648
int32_t dbp
Diastolic blood pressure in mmHg.
Definition: sensor_alg_interface.h:346
int32_t x_uncali
Value of the X-axis.
Definition: sensor_alg_interface.h:309
Standing.
Definition: sensor_alg_interface.h:227
int32_t feature_type
An indicator to heart rate variability monitor output parameters.
Definition: sensor_alg_interface.h:340
This sensor cannot be trusted because the sensor had no contact with what it was measuring.
Definition: sensor_alg_interface.h:270
int32_t light
Light sensor event data.
Definition: sensor_alg_interface.h:418
Gesture of flipping the device.
Definition: sensor_alg_interface.h:247
uint32_t status
Quality of the measurement.
Definition: sensor_alg_interface.h:300
Gesture of picking up the device.
Definition: sensor_alg_interface.h:249
int32_t numBeatPos
The total number of the counts.
Definition: sensor_alg_interface.h:339
uint32_t accumulated_step_count
Accumulated step count.
Definition: sensor_alg_interface.h:372
sensor_fall_t fall_data_t
Fall detection sensor event data.
Definition: sensor_alg_interface.h:435
int32_t y_uncali
Value of the Y-axis.
Definition: sensor_alg_interface.h:310
No gesture is detected.
Definition: sensor_alg_interface.h:243
uint32_t timeout
The batch timeout in ms.
Definition: sensor_alg_interface.h:755
uint32_t step_length
Step length.
Definition: sensor_alg_interface.h:375
int32_t bpm
Heart rate measurement.
Definition: sensor_alg_interface.h:347
int32_t probability
Probability of gesture detection, the range is from 0 to 100.
Definition: sensor_alg_interface.h:367
uint32_t accumulated_step_length
Accumulated step length.
Definition: sensor_alg_interface.h:373
uint32_t time_stamp
Timestamp.
Definition: sensor_alg_interface.h:409
In motion.
Definition: sensor_alg_interface.h:230
Timstamped sensor event data.
Definition: sensor_alg_interface.h:407
sensor_activity_type_t
The types of activity recognition.
Definition: sensor_alg_interface.h:225
int32_t(* sensor_descriptor_operate_callback_t)(int32_t command, void *buffer_out, int32_t size_out, void *buffer_in, int32_t size_in)
Sets customized parameters in the sensor_descriptor structure.
Definition: sensor_alg_interface.h:476
struct sensor_subscriber sensor_subscriber_t
The subscriber information for the sensor event of the specified sensor.
This sensor is reporting data with maximum accuracy.
Definition: sensor_alg_interface.h:274
sensor_relative_humidity_vec_t relative_humidity_t
Relative humidity sensor event data.
Definition: sensor_alg_interface.h:421
On bicycle.
Definition: sensor_alg_interface.h:234
Heart rate sensor event data.
Definition: sensor_alg_interface.h:325
This sensor is reporting data with an average level of accuracy.
Definition: sensor_alg_interface.h:273
int32_t polling
Data acquisition via polling mode or interrupt driven.
Definition: sensor_alg_interface.h:650
Activity recognition sensor event data.
Definition: sensor_alg_interface.h:361
sensor_pressure_vec_t pressure_t
Pressure sensor event data.
Definition: sensor_alg_interface.h:420
Sensor event data over 3-axis.
Definition: sensor_alg_interface.h:286
The values returned by this sensor cannot be trusted.
Definition: sensor_alg_interface.h:271
int32_t sensor_unsubscribe_sensor(int32_t handle)
This function unsubscribes the sensor event for a specified sensor type.
Sensor events are generated only if the measured values are changed.
Definition: sensor_alg_interface.h:263
uint32_t status
Status of the measurement.
Definition: sensor_alg_interface.h:383
Gesture of positioning the device to take a snapshot.
Definition: sensor_alg_interface.h:248
sensor_uncalibrated_event_t uncalibrated_mag_t
Uncalibrated magnetic field sensor event data.
Definition: sensor_alg_interface.h:424
int32_t(* sensor_driver_object_operate_callback_t)(void *self, uint32_t command, void *buff_out, int32_t size_out, int32_t *actual_out, void *buff_in, int32_t size_in)
Operates on the physical sensor.
Definition: sensor_alg_interface.h:637
sensor_data_unit_t * data
The link-listed timestamped sensor event data.
Definition: sensor_alg_interface.h:448
Climbing.
Definition: sensor_alg_interface.h:233
int32_t report_mode
Report mode.
Definition: sensor_alg_interface.h:501
int32_t type
Biosensor type.
Definition: sensor_alg_interface.h:356
struct sensor_data sensor_data_t
Link-listed timestamped sensor event data.
sensor_subscriber_send_digest_callback_t send_digest
To notify a sensor event to this subscriber.
Definition: sensor_alg_interface.h:754
Heart rate variability sensor event data.
Definition: sensor_alg_interface.h:331
int32_t distance
Proximity sensor event data.
Definition: sensor_alg_interface.h:419
Tilting, the vertical direction of the device changes by at least 35 degrees in the predefined period...
Definition: sensor_alg_interface.h:236
int32_t accumulate
Not used.
Definition: sensor_alg_interface.h:506
uint32_t status
Status of the measurement.
Definition: sensor_alg_interface.h:390
int32_t feature_type
An indicator to blood pressure monitor sensor output parameters.
Definition: sensor_alg_interface.h:351
int32_t handle
Handle of this subscription, filled in sensor_subscribe_sensor.
Definition: sensor_alg_interface.h:751
Sensor events are generated upon the detection.
Definition: sensor_alg_interface.h:264
sensor_vec_t gyroscope_t
Gyroscope sensor event data.
Definition: sensor_alg_interface.h:413
Sitting.
Definition: sensor_alg_interface.h:228
int32_t state
The detected state of a person's sleep, subject to fusion algorithm design.
Definition: sensor_alg_interface.h:395
int32_t temperature
Temperature measurement.
Definition: sensor_alg_interface.h:382
sensor_sleepmonitor_event_t sleep_data_t
Sleep monitor sensor event data.
Definition: sensor_alg_interface.h:432
uint32_t fifo_max_size
Not used.
Definition: sensor_alg_interface.h:449
int sensor_manager_set_cust_from_app(uint32_t sensor_type, void *in_data_buf, int32_t in_size)
This function sends the sensor event for a specified sensor type from application layer...
uint8_t step_type
Step type: 1 for walk, 2 for run, and 3 for jogging.
Definition: sensor_alg_interface.h:376
Laying.
Definition: sensor_alg_interface.h:229
int32_t x_bias
Bias of the X-axis.
Definition: sensor_alg_interface.h:317
int32_t pressure
Pressure measurement.
Definition: sensor_alg_interface.h:381
Blood pressure sensor event data.
Definition: sensor_alg_interface.h:344
sensor_vec_t pdr_event
PDR sensor event data.
Definition: sensor_alg_interface.h:416
The maximum number of activity types.
Definition: sensor_alg_interface.h:238
sensor_bio_t bio_data
Biosensor event data.
Definition: sensor_alg_interface.h:436
sensor_descriptor_process_data_callback_t process_data
Call this function if one of the input sensors of the fusion algorithm has updated data to be used fo...
Definition: sensor_alg_interface.h:505
sensor_heart_rate_event_t heart_rate_t
Heart rate sensor event data.
Definition: sensor_alg_interface.h:428
int32_t version
Fusion algorithm API version.
Definition: sensor_alg_interface.h:500
Gesture detection sensor event data.
Definition: sensor_alg_interface.h:366
sensor_input_list_t * input_list
Required input sensor list.
Definition: sensor_alg_interface.h:502
int32_t feature_num
The number of intermediate features.
Definition: sensor_alg_interface.h:397
int32_t(* sensor_descriptor_get_result_callback_t)(sensor_data_t *const output)
Gets the fusion algorithm results of the sensor event.
Definition: sensor_alg_interface.h:481
sensor_gesture_t gesture_data_t
Gesture detection sensor event data.
Definition: sensor_alg_interface.h:434
int32_t sbp
Systolic blood pressure in mmHg.
Definition: sensor_alg_interface.h:345
sensor_gesture_type_t
The types of gesture detection defined in the fusion algorithm design.
Definition: sensor_alg_interface.h:242
sensor_vec_t accelerometer_t
Accelerometer sensor event data.
Definition: sensor_alg_interface.h:412
int32_t sensor_fusion_algorithm_register_type(const sensor_descriptor_t *desp)
Registers fusion algorithm of the specified sensor_descriptor.
Gesture of tapping the screen.
Definition: sensor_alg_interface.h:245
uint32_t step_frequency
Step frequency.
Definition: sensor_alg_interface.h:374
uint32_t delay
The sampling interval for the sensor event.
Definition: sensor_alg_interface.h:753
A fall type that can be customized for a special fusion algorithm.
Definition: sensor_alg_interface.h:257
sensor_report_mode_t
Methods to generate events with sensors.
Definition: sensor_alg_interface.h:262
Uncalibrated sensor event data over 3-axis.
Definition: sensor_alg_interface.h:305
int32_t status
Quality of the measurement, subject to fusion algorithm design.
Definition: sensor_alg_interface.h:348
sensor_heart_rate_variability_event_t heart_rate_variability_t
Heart rate sensor event data.
Definition: sensor_alg_interface.h:429
sensor_descriptor_operate_callback_t operate
To set customized parameter to fusion algorithms, such as step length for pedometer.
Definition: sensor_alg_interface.h:503
Walking.
Definition: sensor_alg_interface.h:231
Pressure sensor event data.
Definition: sensor_alg_interface.h:380
int32_t * pwtt
The sequence of each Pulse Wave Transit Time (PWTT) interval between ECG and PPG in sampling rate uni...
Definition: sensor_alg_interface.h:349
int32_t temperature
Temperature measurement.
Definition: sensor_alg_interface.h:389
int32_t feature_type
The intermediate feature type.
Definition: sensor_alg_interface.h:398
uint32_t data_exist_count
The count of sensor_data_unit_t in data.
Definition: sensor_alg_interface.h:450
#define SENSOR_MAX_SUBSCRIBER_NAME_LEN
The maximum sensor subscriber name length.
Definition: sensor_alg_interface.h:742
int32_t sensor_fusion_algorithm_register_data_buffer(uint32_t sensor_type, uint32_t exist_data_count)
Registers the required data buffer of fusion algorithm of the specified sensor type.
int32_t sensor_driver_attach(uint32_t sensor_type, sensor_driver_object_t *obj)
Registers the physical sensor driver.
sensor_vec_t magnetic_t
Magnetic field sensor event data.
Definition: sensor_alg_interface.h:414
uint32_t sensor_type
Sensor type.
Definition: sensor_alg_interface.h:499
int32_t LF
ECG autonomic nervous system low frequency band.
Definition: sensor_alg_interface.h:333
Gesture of shaking the device up and down or left and right.
Definition: sensor_alg_interface.h:244
int32_t z
Value of the Z-axis.
Definition: sensor_alg_interface.h:292
int32_t azimuth
Rotation around the Z-axis.
Definition: sensor_alg_interface.h:295
sensor_pedometer_event_t pedometer_t
Pedometer sensor event data.
Definition: sensor_alg_interface.h:427
int32_t bpm
Heart rate measurement.
Definition: sensor_alg_interface.h:336
sensor_driver_object_operate_callback_t sensor_operate
Operates on this physical sensor.
Definition: sensor_alg_interface.h:651
Link-listed timestamped sensor event data.
Definition: sensor_alg_interface.h:447
sensor_blood_pressure_event_t blood_pressure_t
Blood pressure sensor event data.
Definition: sensor_alg_interface.h:430
uint32_t sensor_type
Sensor type.
Definition: sensor_alg_interface.h:408
int32_t pitch
Rotation around the X-axis.
Definition: sensor_alg_interface.h:296
int32_t SDNN
Standard deviation of ECG normal to normal beat interval.
Definition: sensor_alg_interface.h:332
Sleep monitor sensor event data.
Definition: sensor_alg_interface.h:394
Unknown activity type.
Definition: sensor_alg_interface.h:237
int32_t roll
Rotation around the Y-axis.
Definition: sensor_alg_interface.h:297
Gesture of twisting the device attached to the wrist.
Definition: sensor_alg_interface.h:246