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.

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:

The heart rate detected

For how long the heart rate has been stable

Number of beats with the current heart rate

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

The durration of the beat in ms ( a so called interbeat interval)

Time of the beat in ms (for relative comparison)

Usage hints:

    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:

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>

    }