Hello!
I was wondering if it would be possible to use the bmi160_get_sensor_time function, from the documentation(https://support.dialog-semiconductor.com/system/files/restricted/UM-B-06...), to add some sort of timestamp, in milliseconds, to the accelerometer, gyroscope and magnetometer data.
I don't need a real time value, just a relative value from which I can get a time difference in milliseconds to corroborate the sampling frequency of the sensors.
I would like to add the timestamp to the sensor report, every time new data is generated. Would this be possible?
Thanks :)
Device:
Hi gomezago,
You could use the bmi160_get_sensor_time(&v_sensor_time_u32) from the bmi160 driver or the lld_evt_time_get() which gets the current time value from HW and pass them to the sensor report. Take care that the bmi160_get_sensor_time() returns an uint32, which is not the real time clock. It returns a relative value which is related with the previous calculated value.
Thanks, PM_Dialog
Hi PM_Dialog!
Thanks for your reply! It was very helpful. The relative value is good enough for my application.
可以肯定的是,我必须添加一个广告ditional field (size 4B) to the accelerometer and gyroscope reports? Or is there any other way to implement this?
Thanks for your help,
Hi gomezago,
This is up to your implementation. For example you might use the user_add_sensor_report_acc_gyro_mag(). This function sends the sensor data in the form of a notification (report) to the central device. A sensor data notification is called a report. This function forms a report for the accelerometer, gyroscope or magnetometer. A DWS_VAL_NTF_REQ message is formed and sent to the DWS profile task.
Thanks,