linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Garbat Rafal <rafal.garbat@tieto.com>
To: Anderson Lizardo <anderson.lizardo@openbossa.org>
Cc: "linux-bluetooth@vger.kernel.org"
	<linux-bluetooth@vger.kernel.org>,
	Santiago Carot-Nemesio <sancane@gmail.com>,
	Johan Hedberg <johan.hedberg@gmail.com>
Subject: Re: [PATCH v2 01/13] Heart Rate Profile API
Date: Wed, 29 Aug 2012 11:42:39 +0200	[thread overview]
Message-ID: <503DE40F.1050008@tieto.com> (raw)
In-Reply-To: <CAJdJm_NTTyaKhmgnYJc40xpPLTRwAJ9EkLKCH67nmMJU8KvE+w@mail.gmail.com>

Hi,

On 08/28/2012 09:21 PM, Anderson Lizardo wrote:
> Hi,
>
> After some discussion with Johan on IRC, I think I understand what he
> is proposing, and it makes sense IMHO. The idea is to simply replace
> the object path for RegisterWatcher/UnregisterWatcher to [variable
> prefix]/{hci0,hci1,...} (adapter path) and have the watcher object
> methods accept a "object device" as first argument.
>
> This way, the application that wants to register wacthers will monitor
> only for new adapters (and not new devices) and register watchers on
> them. The D-Bus interface for RegisterWatcher() will still be profile
> specific (e.g. org.bluez.HeartRate in this case).
>
> One issue with this idea (and which still needs to be sorted out if we
> proceed with this), is that other methods specific to the profile
> (like Reset() for Heart Rate and EnableIntermediateMeasurement() for
> Thermometer) need to be in different interfaces.
>
> Johan, do you have any ideas for this?
>
> Regards,
I guess, that with such approach, the HeartRate API could look something 
like this :

BlueZ D-Bus Heart Rate API description
****************************************

Copyright (C) 2012    Santiago Carot-Nemesio <sancane@gmail.com>

Heart Rate Manager hierarchy
============================

Service        org.bluez
Interface    org.bluez.HeartRateManager
Object path    [variable prefix]/{hci0,hci1,...}

Methods        RegisterWatcher(object agent)

                           Registers a watcher to monitor heart rate 
measurements.

                           Possible Errors: org.bluez.Error.InvalidArguments

                       UnregisterWatcher(object agent)

                           Unregisters a watcher.

Heart Rate Profile hierarchy
============================

Service        org.bluez
Interface    org.bluez.HeartRate
Object path    [variable prefix]/{hci0,hci1,...}/dev_XX_XX_XX_XX_XX_XX

Methods        dict GetProperties()

                         Returns all properties for the interface. See the
                         Properties section for the available properties.

                       Reset()

                         Restart the accumulation of energy expended 
from zero.

                         Possible Errors: org.bluez.Error.NotSupported

Properties    boolean ResetSupported [readonly]

                         True if energy expended is supported.

Heart Rate Watcher hierarchy

============================
Service        unique name
Interface    org.bluez.HeartRateWatcher
Object path    freely definable

Methods        void MeasurementReceived(object device, dict measure)

             This callback is called whenever a heart rate
             measurement is received from the heart rate device.
             The unit for the Value is expressed in beats per
             minute (bpm). The energy field is optional and
             represents the accumulated energy expended in
             kilo Joules since last time it was reset. Furthermore,
             the device will be automatically reset when it
             is needed.
             The Contact field, if present, indicates
             that the device supports contact sensor, besides it
             will be true if skin contact is detected. The optional
             interval field is an array containing RR-Interval
             values which represent the time between two R-Wave
             detections, where the RR-Interval value 0 is older
             than the value 1 and so on.

             Dict is defined as below:
             {
                 "Value" : uint16,
                 "Energy" : uint16,
                 "Contact" : boolean,
                 "Location" : ("Other", "Chest", "Wrist","Finger",
                     "Hand", "Earlobe", "Foot"),
                 "Interval" : array{uint16}
             }


Just a proposal, please comment.

Rafal

  reply	other threads:[~2012-08-29  9:42 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-13 15:08 [PATCH v2 00/13] Add Heart Rate Service Rafal Garbat
2012-08-13 15:08 ` [PATCH v2 01/13] Heart Rate Profile API Rafal Garbat
2012-08-14  9:56   ` Johan Hedberg
2012-08-28 15:20     ` Johan Hedberg
2012-08-28 15:43       ` Garbat Rafal
2012-08-28 16:56         ` Johan Hedberg
2012-08-28 17:55           ` Anderson Lizardo
2012-08-28 18:10             ` Johan Hedberg
2012-08-28 18:23               ` Anderson Lizardo
2012-08-28 19:21                 ` Anderson Lizardo
2012-08-29  9:42                   ` Garbat Rafal [this message]
2012-08-29 17:54                     ` Anderson Lizardo
2012-08-29 17:57                       ` Johan Hedberg
2012-08-13 15:08 ` [PATCH v2 02/13] heartrate: Add Heart Rate Service GATT client skeleton Rafal Garbat
2012-08-13 15:08 ` [PATCH v2 03/13] heartrate: Add conn logic and attio callbacks Rafal Garbat
2012-08-13 15:08 ` [PATCH v2 04/13] heartrate: Discover Characteristic Descriptors Rafal Garbat
2012-08-13 15:08 ` [PATCH v2 05/13] heartrate: Process Heart Rate Descriptors Rafal Garbat
2012-08-13 15:08 ` [PATCH v2 06/13] heartrate: Add DBus connection logic Rafal Garbat
2012-08-13 15:08 ` [PATCH v2 07/13] heartrate: Process Heart Rate Characteristics Rafal Garbat
2012-08-13 15:08 ` [PATCH v2 08/13] heartrate: Add notification support Rafal Garbat
2012-08-13 15:08 ` [PATCH v2 09/13] heartrate: Process measurements Rafal Garbat
2012-08-13 15:08 ` [PATCH v2 10/13] heartrate: Add support for Control Point Reset Rafal Garbat
2012-08-13 15:08 ` [PATCH v2 11/13] heartrate: Add GetProperties method handle Rafal Garbat
2012-08-13 15:08 ` [PATCH v2 12/13] heartrate: Add org.bluez.HeartRateWatcher iface to default policy Rafal Garbat
2012-08-13 15:08 ` [PATCH v2 13/13] heartrate: Add Heart Rate test script Rafal Garbat

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=503DE40F.1050008@tieto.com \
    --to=rafal.garbat@tieto.com \
    --cc=anderson.lizardo@openbossa.org \
    --cc=johan.hedberg@gmail.com \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=sancane@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).