언어 설정

Menu
Sites
Language
HumanActivityMonitor recording heart rate

Hello, I'm developing an WEB app for Tizen 3.0 using TizenStudio. Target device is Samsung Gear Sport Smart Watch only. Application is supposed to gather heart rate data over long period of time and then send this data. In general what I'm trying to achieve is to gather complete heart rate data from last 10+ hours, measured at least every minute (if possible even more frequently). Battery or optimization is not an issue here, as long as the device lasts through 10+ hours of measurment. 

I have managed to record and read something, but I have a lot of questions, because documentation is really poor in this aspect. 

My code is:

var options = {
    retentionPeriod : 1
};
tizen.humanactivitymonitor.startRecorder("HRM", options);

Documentation mentions two possible options: retentionPeriod and interval, but does not explain how they work. 

  1. Are there any other options (beside retentionPeriod and interval) for starting the recorder?
  2. Is interval in seconds? Milliseconds? Hours?
  3. What happens after retention period ends?
  4. What is MAX and MIN time for both: retention period and interval?
  5. Do I have to start SLEEP_MONITOR in my application before starting the recording?
  6. If my recording is activated and then user checks the heart rate in other app - is it added to my recording?
  7. Can I record the data for more than 10 hours?
  8. Can I read recorded data from multiple recordings?
  9. When do I have to stop the recording?
  10. I often get NotFoundError: Failed to read recorded data error despite the fact that heart rate monitor did read something.

 

Please address my questions, and have a good day :)

 

Edited by: Damian Michalak on 22 3월, 2018

Responses

3 댓글
André Reus

As per this document, only Pressure data can be recorded... https://developer.tizen.org/development/guides/web-application/sensors/human-activity-monitor#record

Unit of retentionPeriod is hour and interval is miliseconds .. 

You can read data by query ...

/* To retrieve data from July 1, 2016 to July 31, 2016 */
var query = {};
query['startTime'] = (new Date(2016, 7, 1)).getTime() / 1000;
query['endTime'] = (new Date(2016, 7, 31)).getTime() / 1000;
/* To retrieve data everyday at midnight */
/* Time is 0:00 internally */
query['anchorTime'] = (new Date(2016, 7, 1, 0, 0)).getTime() / 1000;
query['interval'] = 1440; /* Day */
tizen.humanactivitymonitor.readRecorderData(type, query, onread, onerror);

If the power is not a problem ...you may call start function using your defined interval ( js interval) and store in your own database with time... 

tizen.humanactivitymonitor.start('HRM', onchangedCB);
Damian Michalak

Thank you for your response André. I agree that documentation mentioned recording of Pressure data only. But I'm 100% sure that I managed to record and read heart rate, unfortunately I cannot do it again for some unknown reason...

About the recording and reading the data:

I understand that in order to read the data from... let's say last week -> this data must be recorded with retention at least 168 (which is 7days * 24 hours) so it will be kept in the system for at least 7 days.

And as you suggested maybe I will have to use standard HR monitor, but I was hoping that this recording mechanism would do the trick.

Cheers.

 

André Reus

Yes i agree ,,,,,if the recording mechanism would do the trick it will save time and effort..
But the problem is that the documentation is not clearly saying anything .... either the documentation is not completed or the features is not satisfying