Open Heart
Introduction
OpenHeart is a Instant Heart Rate implementation created to allow developers to create their own Web applications using the framework we provide.
Quick Start
The most basic implementation described below is a simple implementation of our framework that displays user's heart rate.
http://openheaert.azumio.com/js/
For our application to recognize and embed your page you should open the following url in your mobile browser:
com.azumio.openheart:?url=<path to your page>
Functionality Overview
The framework contains two types of calls: Incoming and Outgoing.
A simple implementation is provided at every call.
Launching your application
If you wish to launch your application simply include the following URL in the webpage from which the user can access the application:
com.azumio.openheart:?url=<path to your page>
** we should provide a way to detect, if the application is installed **
Incoming calls:
Those are the calls the Native application calls when a certain action happens.
void on()
void off()
void heartRate(int heartRate, int duration, int beats, int quality)
void pulse(int rr, long timestamp)
void appear()
The calls should be implemented following this template
azumio.OpenHeart.<functonName>(function(<parameters>) {
<functionality>
}
azumio.OpenHeart.on()
Called when the heart rate monitor starts recording.
azumio.OpenHeart.on(function(){
$("#state").html("on"); });
azumio.OpenHeart.off()
Called when the heart rate monitor stops recording.
azumio.OpenHeart.off(function(){
$("#state").html("off");
});
azumio.OpenHeart.heartRate(int heartRate, int duration, int beats, int quality)
Called when a heart rate is detected by the heart rate monitor.
Updates on every heart beat. The result is an average over the {duration}
Usage hint:
- Display precise heart rate
Parameters:
int heartRate
The heart rate detected
int duration
For how long the heart rate has been stable
int beats
Number of beats with the current heart rate
int quality
Quality of the reading. We recommend that all the readings with quality below 5 is rejected as invalid.
azumio.OpenHeart.heartRate(function( heartRate, durration, beats, quality ){
$("#value").html(""+heartRate+","+durration+","+beats+","+quality);
});
azumio.OpenHeart.pulse(int rr, int timestamp)
Event on every heart beat.
Parameters
int rr
The durration of the beat in ms ( a so called interbeat interval)
timestamp
Time of the beat in ms (for relative comparison)
Usage hints:
animate a heart in sync with your heart beat.
display fast heart rate changes
azumio.OpenHeart.pulse(function(rr,timestamp){
$("#rrvalue").html(""+rr+"@"+timestamp);
});
azumio.OpenHeart.appear()
Called when the application is shown to the user (launched from the home screen, restarted from history, returned to from another activity).
azumio.OpenHeart.appear(function() {
$("#appear").html("appear");
});
Outgoing calls:
Outgoing calls give the Web application the option to control the heart rate monitor and retrieve some additional data from the application.
The following functions are available:
void on()
void off()
String getWaveform()
azumio.OpenHeart.on()
Turns the heart rate monitor on.
azumio.OpenHeart.off()
Turns the heart rate monitor on.
azumio.OpenHeart.getWaveForm()
Returns the JSON object containing the curent wave form (you should be able to construct a graph from the data provided).
The JSON structure is as follows:
{
samples: [],
sampleRate:<int>
timestamp:<int>
}