Skip to contentSkip to conversation

HDP proposed API(0.5)

DISCUSSION José Antonio Santos Cadenas 6 participants 11 messages May 17, 2010 – May 23, 2010 1 message not in the archive Bluetooth drivers

lore
Share & tools
lore
#0 lore raw

Hope the last one :)

----------------------------

BlueZ D-Bus Health API description
**********************************

Santiago Carot-Nemesio <[email protected]> José Antonio Santos-Cadenas <[email protected]> Elvis Pfützenreuter <[email protected]>

Health Device Profile hierarchy
===============================

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

Methods object CreateInstance(object path, dict config)

Returns the path for the new HealthInstance object. The path parameter is the path of the remote object with the callbacks to notify events (see org.bluez.HealthAgent at the end of this document) This petition starts an mcap instance and also register in the SDP if is needed
Dict is defined as bellow:
{ "data_spec" : The data_spec is the data exchange
specification (see section 5.2.10 of the specification document) possible values:
0x00 = reserved, 0x01 [IEEE 11073-20601], 0x02..0xff reserved,
(optional)
"end_points" : [{ (optional)
"mdepid" : uint8, (optional) "role" : ("source" or "sink"), (mandatory) "specs" :[{ (mandatory)
"data_type" : uint16, (mandatory) "description" : string, (optional)
}]
}]
}

if "data_spec" is not set, no SDP record will be registered, so all the other data in the dictionary will be ignored

Instance will be closed by the call or implicitly when the programs leaves the bus.

Possible errors: org.bluez.Error.InvalidArguments

void CloseInstance(object path)

Closes the HDP instance identified by the object path. Also instance will be closed if the process that started leaves the bus. If there is a SDP record associated to this instance it will be removed.

Possible errors: org.bluez.Error.InvalidArguments
org.bluez.Error.NotFound

--------------------------------------------------------------------------------

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

Methods array GetHealthInstances()

			Gets the information of the remote instances present
			in this device and published on its SDP record. The
			returned data follows this format.

			[{"id": "an instance identification as string",
			 "data_spec" : data spec,
			 "end_points":
				["mdepid": uint8,
				 "role"  : "source" or "sink" ,
				 "specs" : [{
					"dtype"       : uint16,
					"description" : string, (optional)
				 }]
				]
			}];

--------------------------------------------------------------------------------

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

object Connect(remote_instance_id)

Connects with the remote instance and returns its object path. To get the session ids on a remote device, you must run the GetHealthInstances in the HealthDevice object.

Possible errors: org.bluez.Error.InvalidArguments
org.bluez.Error.HealthError

void Disconnect(object device, boolean cache)

Disconnect from the remote device. If chahe is false, state will also be deleted. Otherwise, the state will be kept for allowing future reconnections until the adapter is removed.

Possible errors: org.bluez.Error.InvalidArguments
org.bluez.Error.NotFound org.bluez.Error.HealthError

--------------------------------------------------------------------------------

Service org.bluez
Interface org.bluez.HealthLink
Object path [variable prefix]/{hci0,hci1,...}/{hdp0,hdp1,...}/rem_inst_id

boolean Echo(array{byte})

Sends an echo petition to the remote intance. Returns True if response matches with the buffer sent. If some error is detected False value is returned and the associated MCL is closed.

uint16 OpenDataChannel(byte mdepid, byte config)

Creates a new data channel with the indicated config to the remote MCAP Data End Point (MDEP). The configuration should indicate the channel quality of service. In the current version of HDP, valid values are 0x01 for reliable channels and 0x02 for streaming data channel.

Returns the data channel id.

Possible errors: org.bluez.Error.InvalidArguments
org.bluez.Error.HealthError

array GetDataChannelFileDescriptor(uint16 mdlid)

Gets a file descriptor where data can be read or written for receive or sent by the data channel. Returns an array of file descriptors one for write and other for read.

Possible errors: org.bluez.Error.InvalidArguments
org.bluez.Error.NotFound org.bluez.Error.HealthError

void DeleteDataChannel(uint16 mdlid)

Deletes a data channel so it will not be available for use.

Possible errors: org.bluez.Error.InvalidArguments
org.bluez.Error.NotFound org.bluez.Error.HealthError

void DeleteAllDataChannels()

Deletes all data channels so it will not be available for use. Typically this function is called when the connection with the remote device will be closed permanently

Possible errors: org.bluez.Error.HealthError

dict GetDataChannelStatus()

Return a dictionary with all the data channels that can be used to send data right now. The dictionary is formed like follows:
{
"reliable": [mdlid_r1, mdlid_r2, ...], "streaming" : [mdlid_s1, mdlid_s2, ...]
}

The fist reliable data channel will always be the first data channel in reliable array.

HealthAgent hierarchy
==================

(this object is implemented by the HDP client an receives notifications)

Service unique name
Interface org.bluez.HealthAgent
Object path freely definable

void LinkConnected(object path)

This method is called whenever a new connection has been established over the control channel of the current HDP instance. The object path paremeter contains the object path of the created HealthLink.

void LinkDisconnected(object path)

This method is called when a remote device is disconnected definitively. Any future reconnections will fail. Also all data channels associated to this device will be closed.

void CreatedDataChannel(object path, uint16 mdlid, byte conf)

This method is called when a new data channel is created The path contains the object path of the HealthLink where the new connection is created, the mdlid is the data channel identificator and conf is the que quality of service of the data channel (0x01 reliable, 0x02 streaming).

void DeletedDataChannel(object path, uint16 mdlid)

This method is called when a data channel is closed. After this call the data channel will not be valid and can be reused for future created data channels.

#1 lore raw

T24gTW9uLCBNYXkgMTcsIDIwMTAgYXQgMTE6NTQsIEpvc8OpIEFudG9uaW8gU2FudG9zIENhZGVu YXMKPGpjYWRlbkBsaWJyZXNvZnQuZXM+IHdyb3RlOgo+IEhvcGUgdGhlIGxhc3Qgb25lIDopCj4K PiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCj4KPiBCbHVlWiBELUJ1cyBIZWFsdGggQVBJ IGRlc2NyaXB0aW9uCj4gKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgo+Cj4gwqAg wqAgwqAgwqBTYW50aWFnbyBDYXJvdC1OZW1lc2lvIDxzYW5jYW5lQGdtYWlsLmNvbT4KPiDCoCDC oCDCoCDCoEpvc8OpIEFudG9uaW8gU2FudG9zLUNhZGVuYXMgPHNhbnRvc2NhZGVuYXNAZ21haWwu Y29tPgo+IMKgIMKgIMKgIMKgRWx2aXMgUGbDvHR6ZW5yZXV0ZXIgPGVweEBzaWdub3ZlLmNvbT4K Pgo+IEhlYWx0aCBEZXZpY2UgUHJvZmlsZSBoaWVyYXJjaHkKPiA9PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09Cj4KPiBTZXJ2aWNlIMKgIMKgIMKgIMKgIG9yZy5ibHVlego+IEludGVyZm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gwqAgwqAgwqAgwqAgwqAgwqAgwqAgwqAgwqAgwqAgwqAgwqBjYW4g YmUgcmV1c2VkIGZvciBmdXR1cmUgY3JlYXRlZCBkYXRhIGNoYW5uZWxzLgo+IC0tCj4gVG8gdW5z dWJzY3JpYmUgZnJvbSB0aGlzIGxpc3Q6IHNlbmQgdGhlIGxpbmUgInVuc3Vic2NyaWJlIGxpbnV4 LWJsdWV0b290aCIgaW4KPiB0aGUgYm9keSBvZiBhIG1lc3NhZ2UgdG8gbWFqb3Jkb21vQHZnZXIu a2VybmVsLm9yZwo+IE1vcmUgbWFqb3Jkb21vIGluZm8gYXQgwqBodHRwOi8vdmdlci5rZXJuZWwu b3JnL21ham9yZG9tby1pbmZvLmh0bWwKPgoKCgotLSAKSm/Do28gUGF1bG8gUmVjaGkgVml0YQpo dHRwOi8vanBydml0YS53b3JkcHJlc3MuY29tLwo=

#2 lore raw

Hi,

* João Paulo Rechi Vita <[email protected]> [2010-05-17 18:17:58 -0300]:

<snip>

Quoted 8 lines
Quoted 3 lines · José Antonio Santos Cadenas

               array GetDataChannelFileDescriptor(uint16 mdlid)

Wouldn't be better to pass the fd through the LinkConnected call on Agent? Doing it here allows any process to get the fds.

I was thinking about the MCAP in kernel implementation, my conclusion is that we can solve one of the biggest problem of HDP API if we do it in
kernel: the transparency of MCAP reconnection. HDP will open an MCAP socket and pass it to the user(IEEE app). Then if we need a reconnection, MCAP will transparently reconnect changing the L2CAP channel to transmit the data without the need to change the socket opened with the userspace.

Keep the MCAP socket open means that we are keeping the MCL state for further reconnection.

Doing it inside the kernel removes a big amount of complexity of HDP and IEEE profiles, since we won't need any pipe or change of fd. That could be a killer feature to make it in the kernel.

Any comments? Is this reasonable?

<snip>

Signature · 2 lines
Gustavo F. Padovan
http://padovan.org

A message that is not in the archive (sent off-list or not yet received): [email protected]

#4 lore raw

Hi Elvis,

Quoted 29 lines · Elvis Pfützenreuter
Quoted 26 lines · Gustavo F. Padovan

Hi,

* João Paulo Rechi Vita <[email protected]> [2010-05-17 18:17:58 -0300]:

<snip>

Quoted 8 lines
Quoted 3 lines · José Antonio Santos Cadenas

array GetDataChannelFileDescriptor(uint16 mdlid)

Wouldn't be better to pass the fd through the LinkConnected call on Agent? Doing it here allows any process to get the fds.

I was thinking about the MCAP in kernel implementation, my conclusion is that we can solve one of the biggest problem of HDP API if we do it in
kernel: the transparency of MCAP reconnection. HDP will open an MCAP socket and pass it to the user(IEEE app). Then if we need a reconnection, MCAP will transparently reconnect changing the L2CAP channel to transmit the data without the need to change the socket opened with the userspace.

Keep the MCAP socket open means that we are keeping the MCL state for further reconnection.

Quoted 8 lines
Quoted 5 lines

Doing it inside the kernel removes a big amount of complexity of HDP and IEEE profiles, since we won't need any pipe or change of fd. That could be a killer feature to make it in the kernel.

Any comments? Is this reasonable?

The fd passed to the application could actually be an UNIX socket, so these semantics could be implemented with MCAP in user space. I guess the pipes only appeared in discussion because of the possibility of zero-copy communication.

MCAP in kernel gives zero-copy communication and just one socket to the HDP API. The better of both UNIX socket and pipes options.

Quoted 3 lines

That semantics would be implemented in MCAP part. The HDP profile code itself is (or should be) free from these worries.

Moving MCAP to kernel hides the complexity from userspace HDP profile, but it continues to exist. Then I worry about more complex debugging, dependency on kernel version (or need to put efforts on backporting). MCAP sits above L2CAP, not besides it.

The complexity will exist anyway, I'm proposing a less complex option. Is not that complex change the L2CAP channels used by the MCL inside the kernel. Between all the proposed options to handle reconnection it looks the less complex one.

We should not care about backporting now. We are working directly with upstream and upstream is what really matters here. :)

You will depend on kernel version anyway since ERTM is inside the kernel. About backport if you backport ERTM, then backport MCAP will be easy.

Also MCAP will keep sitting on top of L2CAP, that won't change.

Quoted 2 lines

I acknowledge that it would work, but honestly I prefer to see things being moved to the outside of the kernel than to the inside :)

The real question here is where MCAP will fit better. And where it adds less complexity to its users.

Signature · 2 lines
Gustavo F. Padovan
http://padovan.org
#5 lore raw
Quoted 52 lines · Gustavo F. Padovan

Hi Elvis,

Quoted 29 lines · Elvis Pfützenreuter
Quoted 26 lines · Gustavo F. Padovan

Hi,

* João Paulo Rechi Vita <[email protected]> [2010-05-17 18:17:58 -0300]:

<snip>

Quoted 8 lines
Quoted 3 lines · José Antonio Santos Cadenas

array GetDataChannelFileDescriptor(uint16 mdlid)

Wouldn't be better to pass the fd through the LinkConnected call on Agent? Doing it here allows any process to get the fds.

I was thinking about the MCAP in kernel implementation, my conclusion is that we can solve one of the biggest problem of HDP API if we do it in
kernel: the transparency of MCAP reconnection. HDP will open an MCAP socket and pass it to the user(IEEE app). Then if we need a reconnection, MCAP will transparently reconnect changing the L2CAP channel to transmit the data without the need to change the socket opened with the userspace.

Keep the MCAP socket open means that we are keeping the MCL state for further reconnection.

Quoted 8 lines
Quoted 5 lines

Doing it inside the kernel removes a big amount of complexity of HDP and IEEE profiles, since we won't need any pipe or change of fd. That could be a killer feature to make it in the kernel.

Any comments? Is this reasonable?

The fd passed to the application could actually be an UNIX socket,

so these semantics could be implemented with MCAP in user space. I guess the pipes only appeared in discussion because of the possibility of zero-copy communication.

MCAP in kernel gives zero-copy communication and just one socket to the HDP API. The better of both UNIX socket and pipes options.

Quoted 1 line

That semantics would be implemented in MCAP part. The HDP profile

code itself is (or should be) free from these worries.

Quoted 2 lines

Moving MCAP to kernel hides the complexity from userspace HDP

Quoted 8 lines

profile, but it continues to exist. Then I worry about more complex debugging, dependency on kernel version (or need to put efforts on backporting). MCAP sits above L2CAP, not besides it.

The complexity will exist anyway, I'm proposing a less complex option. Is not that complex change the L2CAP channels used by the MCL inside the kernel. Between all the proposed options to handle reconnection it looks the less complex one.

One advantage of MCAP within the kernel is the ability to reject an invalid incoming L2CAP before a call to accept(). (An example of this is a duplicated control channel or a data channel with incorrect ERTM/Streaming configuration.)

Quoted 7 lines

We should not care about backporting now. We are working directly with upstream and upstream is what really matters here. :)

You will depend on kernel version anyway since ERTM is inside the kernel. About backport if you backport ERTM, then backport MCAP will be easy.

Quoted 8 lines

Also MCAP will keep sitting on top of L2CAP, that won't change.

Quoted 2 lines

I acknowledge that it would work, but honestly I prefer to see

things being moved to the outside of the kernel than to the inside :)

The real question here is where MCAP will fit better. And where it adds less complexity to its users.

The solution I've used for MCAP utilizes the epoll family of calls to provide a single fd which multiplexes all listening, control, and data sockets. The primary advantage of this approach is simple integration into the application's main loop. In my experience, such a model is much easier to integrate into i.e. a JNI interface. However, it appears much of this complexity is hidden by the proposed HDP API

As for the proposed API itself, it looks to provide the necessary functionality to implement a 20601 device. One little quibble I'll add is the choice of name "HealthAgent". As someone who comes from the 20601 side of things, this could cause some confusion with the 20601 term "agent". Since I believe this is a standard Bluez term, I'd just request that this gotcha is well documented.

Has any thought been given regarding support for MCAP clock synchronization? IEEE-20601 is mostly agnostic to the transport, but this is one point where transport-specific information is exposed within the 20601 protocol (via the MDS object's Mds-Time-Info attribute). I'm not aware of any devices which currently support clock synch (my code included), so I'd argue this isn't a blocking feature for the first release.

--nathan

#6 lore raw
Quoted 61 lines · El Tuesday 18 May 2010 04:42:42 Nathan Holstein escribió:
Quoted 51 lines · Gustavo F. Padovan

Hi Elvis,

Quoted 27 lines · Elvis Pfützenreuter
Quoted 26 lines · Gustavo F. Padovan

Hi,

* João Paulo Rechi Vita <[email protected]> [2010-05-17 18:17:58 -0300]:

<snip>

Quoted 7 lines

On Mon, May 17, 2010 at 11:54, José Antonio Santos Cadenas

Quoted 1 line · <[email protected]> wrote:

array GetDataChannelFileDescriptor(uint16 mdlid)

Wouldn't be better to pass the fd through the LinkConnected call on Agent? Doing it here allows any process to get the fds.

I was thinking about the MCAP in kernel implementation, my conclusion is that we can solve one of the biggest problem of HDP API if we do it in kernel: the transparency of MCAP reconnection. HDP will open an MCAP socket and pass it to the user(IEEE app). Then if we need a reconnection, MCAP will transparently reconnect changing the L2CAP channel to transmit the data without the need to change the socket opened with the userspace.

Keep the MCAP socket open means that we are keeping the MCL state for further reconnection.

Quoted 7 lines
Quoted 5 lines

Doing it inside the kernel removes a big amount of complexity of HDP and IEEE profiles, since we won't need any pipe or change of fd. That could be a killer feature to make it in the kernel.

Any comments? Is this reasonable?

The fd passed to the application could actually be an UNIX socket,

so these semantics could be implemented with MCAP in user space. I guess the pipes only appeared in discussion because of the possibility of zero-copy communication.

MCAP in kernel gives zero-copy communication and just one socket to the HDP API. The better of both UNIX socket and pipes options.

Quoted 1 line

That semantics would be implemented in MCAP part. The HDP profile

code itself is (or should be) free from these worries.

Quoted 1 line

Moving MCAP to kernel hides the complexity from userspace HDP

Quoted 8 lines

profile, but it continues to exist. Then I worry about more complex debugging, dependency on kernel version (or need to put efforts on backporting). MCAP sits above L2CAP, not besides it.

The complexity will exist anyway, I'm proposing a less complex option. Is not that complex change the L2CAP channels used by the MCL inside the kernel. Between all the proposed options to handle reconnection it looks the less complex one.

Quoted 4 lines

One advantage of MCAP within the kernel is the ability to reject an invalid incoming L2CAP before a call to accept(). (An example of this is a duplicated control channel or a data channel with incorrect ERTM/Streaming configuration.)

That's not completely true, you can do this from user space too. In fact, the MCAP implementation that we send to this mailing list do this. You can have a look to the code and test that if you try to establish two mcap connections with the same instance, MCAP will refuse the second one before the accept, just as you mentioned.

He tested the current implementation even with real devices (Oximeter and blood pressure) and this behaviour is being done correctly.

Quoted 17 lines
Quoted 8 lines

We should not care about backporting now. We are working directly with upstream and upstream is what really matters here. :)

You will depend on kernel version anyway since ERTM is inside the kernel. About backport if you backport ERTM, then backport MCAP will be easy.

Quoted 8 lines

Also MCAP will keep sitting on top of L2CAP, that won't change.

Quoted 1 line

I acknowledge that it would work, but honestly I prefer to see

things being moved to the outside of the kernel than to the inside :)

The real question here is where MCAP will fit better. And where it adds less complexity to its users.

Quoted 6 lines

The solution I've used for MCAP utilizes the epoll family of calls to provide a single fd which multiplexes all listening, control, and data sockets. The primary advantage of this approach is simple integration into the application's main loop. In my experience, such a model is much easier to integrate into i.e. a JNI interface. However, it appears much of this complexity is hidden by the proposed HDP API

Your are right, HDP is doing this work for the upper layer and the integration should be as easy as you mentioned. Also you have to take in count that MCAP can be used by other profiles in the future, so you *should not* do HDP specific work at MCAP layer.

About the epoll implementation, we did a preliminary version or MCAP using "select" that I think that is similar to epoll. The experience says us that this is not the best approach. A repository containing this code is here [1].

Quoted 7 lines

As for the proposed API itself, it looks to provide the necessary functionality to implement a 20601 device. One little quibble I'll add is the choice of name "HealthAgent". As someone who comes from the 20601 side of things, this could cause some confusion with the 20601 term "agent". Since I believe this is a standard Bluez term, I'd just request that this gotcha is well documented.

We know that, in fact we started working in HDP/MCAP because we had previously developed a manger. In our firs approach we refused that nomenclature because we think that is confused, but BlueZ uses it and as this is being included in BlueZ we should use its nomenclature. We will try to document it in order to clarify this issue.

Quoted 8 lines

Has any thought been given regarding support for MCAP clock synchronization? IEEE-20601 is mostly agnostic to the transport, but this is one point where transport-specific information is exposed within the 20601 protocol (via the MDS object's Mds-Time-Info attribute). I'm not aware of any devices which currently support clock synch (my code included), so I'd argue this isn't a blocking feature for the first release.

Yes, we (Santiago and me) and Elvis (and his team) are planning to continue this work over MCAP in the next weeks.

Elvis, can you give more details about this?

Quoted 5 lines

--nathan

[1] http://openhealth.morfeo-project.org/

#7 lore raw

On May 18, 2010, at 5:10 AM, José Antonio Santos Cadenas wrote:

<snip>

Quoted 8 lines
Quoted 7 lines

Has any thought been given regarding support for MCAP clock synchronization? IEEE-20601 is mostly agnostic to the transport, but this is one point where transport-specific information is exposed within the 20601 protocol (via the MDS object's Mds-Time-Info attribute). I'm not aware of any devices which currently support clock synch (my code included), so I'd argue this isn't a blocking feature for the first release.

Quoted 4 lines

Yes, we (Santiago and me) and Elvis (and his team) are planning to continue this work over MCAP in the next weeks.

Elvis, can you give more details about this?

Not yet, we plan to begin working on CSP this week.

#8 lore raw
In reply to Gustavo F. Padovan

Hello Gustavo,

Quoted 4 lines

MCAP in kernel gives zero-copy communication and just one socket to the HDP API. The better of both UNIX socket and pipes options.

That's right I agree with you, but the main question here is not based in hiding MCAP reconnection, because future profiles using MCAP may be concern about above reconnection. Please, remember that nothing about hiding reconnections are mentioned in MCAP specification. However, reconnection are exposed as deseable capability in MCAP that upper profiles can use.

In other hands, in particular case of HDP, we want to hide reconnection process to application layer because ISO/IEEE11073-20601 is transport agnostic, that means for example, a manager or agent sending or receiving APDUs don't be concern about such issues in transpiort layer (neither MCAP nor HDP). As you can see, the problem isn't in MCAP but in HDP<-->App to achieve reconnection transparency. That's is better explained in ISO/IEEE11073-20601 and some references can be found in HDP white paper.

Quoted 16 lines
Quoted 3 lines

That semantics would be implemented in MCAP part. The HDP profile code itself is (or should be) free from these worries.

Moving MCAP to kernel hides the complexity from userspace HDP profile, but it continues to exist. Then I worry about more complex debugging, dependency on kernel version (or need to put efforts on backporting). MCAP sits above L2CAP, not besides it.

The complexity will exist anyway, I'm proposing a less complex option. Is not that complex change the L2CAP channels used by the MCL inside the kernel. Between all the proposed options to handle reconnection it looks the less complex one.

We should not care about backporting now. We are working directly with upstream and upstream is what really matters here. :)

You will depend on kernel version anyway since ERTM is inside the kernel. About backport if you backport ERTM, then backport MCAP will be easy.

Quoted 9 lines

Also MCAP will keep sitting on top of L2CAP, that won't change.

Quoted 2 lines

I acknowledge that it would work, but honestly I prefer to see things being moved to the outside of the kernel than to the inside :)

The real question here is where MCAP will fit better. And where it adds less complexity to its users.

Quoted 1 line

From my point of view we should avoid implement MCAP in kernel space

for the same reason exposed by Jose Antonio and Elvis in other emails. IMHO hidding reconnections in MCAP is not an good reason to implement it in kernel space because transparency is required in HDP nor in MCAP.

If you hide reconnection to upper profiles in MCAP, you are closing the door to future specifications if they require doing aditional precessing when a reconnection takes place in MCAP.

Thanks for your comments.

Regards,

#9 lore raw

Hi Santiago,

Sorry for the delay on the reply.

Quoted 14 lines · Santiago Carot-Nemesio

Hello Gustavo,

Quoted 4 lines

MCAP in kernel gives zero-copy communication and just one socket to the HDP API. The better of both UNIX socket and pipes options.

That's right I agree with you, but the main question here is not based in hiding MCAP reconnection, because future profiles using MCAP may be concern about above reconnection. Please, remember that nothing about hiding reconnections are mentioned in MCAP specification. However, reconnection are exposed as deseable capability in MCAP that upper profiles can use.

Quoted 8 lines

In other hands, in particular case of HDP, we want to hide reconnection process to application layer because ISO/IEEE11073-20601 is transport agnostic, that means for example, a manager or agent sending or receiving APDUs don't be concern about such issues in transpiort layer (neither MCAP nor HDP). As you can see, the problem isn't in MCAP but in HDP<-->App to achieve reconnection transparency. That's is better explained in ISO/IEEE11073-20601 and some references can be found in HDP white paper.

Exactly. I'm not trying to make reconnection transparent at MCAP level. What I said is that we can achieve reconnection transparency on the HDP <--> App level doing MCAP in kernel.

I'm not saying that MCAP should be in kernel, I'm just trying to address advantages and disadvantages of both implementation.

Quoted 39 lines
Quoted 21 lines
Quoted 5 lines

That semantics would be implemented in MCAP part. The HDP profile code itself is (or should be) free from these worries.

Moving MCAP to kernel hides the complexity from userspace HDP profile, but it continues to exist. Then I worry about more complex debugging, dependency on kernel version (or need to put efforts on backporting). MCAP sits above L2CAP, not besides it.

The complexity will exist anyway, I'm proposing a less complex option. Is not that complex change the L2CAP channels used by the MCL inside the kernel. Between all the proposed options to handle reconnection it looks the less complex one.

We should not care about backporting now. We are working directly with upstream and upstream is what really matters here. :)

You will depend on kernel version anyway since ERTM is inside the kernel. About backport if you backport ERTM, then backport MCAP will be easy.

Also MCAP will keep sitting on top of L2CAP, that won't change.

Quoted 1 line
Quoted 6 lines
Quoted 1 line

I acknowledge that it would work, but honestly I prefer to see things being moved to the outside of the kernel than to the inside :)

The real question here is where MCAP will fit better. And where it adds less complexity to its users.

From my point of view we should avoid implement MCAP in kernel space

for the same reason exposed by Jose Antonio and Elvis in other emails. IMHO hidding reconnections in MCAP is not an good reason to implement it in kernel space because transparency is required in HDP nor in MCAP.

If you hide reconnection to upper profiles in MCAP, you are closing the door to future specifications if they require doing aditional precessing when a reconnection takes place in MCAP.

Thanks for your comments.

Regards,

Signature · 2 lines
Gustavo F. Padovan
http://padovan.org
#10 lore raw
In reply to Gustavo F. Padovan

Hi Gustavo,

Quoted 14 lines · El Monday 17 May 2010 23:38:38 Gustavo F. Padovan escribió:

Hi,

* João Paulo Rechi Vita <[email protected]> [2010-05-17 18:17:58 -0300]:

<snip>

Quoted 7 lines

On Mon, May 17, 2010 at 11:54, José Antonio Santos Cadenas

Quoted 1 line · <[email protected]> wrote:

array GetDataChannelFileDescriptor(uint16 mdlid)

Wouldn't be better to pass the fd through the LinkConnected call on Agent? Doing it here allows any process to get the fds.

Quoted 7 lines

I was thinking about the MCAP in kernel implementation, my conclusion is that we can solve one of the biggest problem of HDP API if we do it in
kernel: the transparency of MCAP reconnection. HDP will open an MCAP socket and pass it to the user(IEEE app). Then if we need a reconnection, MCAP will transparently reconnect changing the L2CAP channel to transmit the data without the need to change the socket opened with the userspace.

This that you proposed is something that we thought when we started with MCAP/HDP. We finally decided to put MCAP outside the kernel because of the following reasons:
- The first and the most important is that everything that can be done in
user space should be done in user space. We talked about this issue in the list some time ago and Marcel suggested us that if MCAP doesn't have interaction with other kernel subsystems, it should be implemented outside the kernel. You can read these mails here [1]. Basing on our experience with MCAP that's true, MCAP does not interact with any kernel subsystem.
- An other reason is that reconnections *should not* be transparent at
MCAP level. Any profile using MCAP should be concerned about the data channel disconnection and reconnection. In the case of HDP reconnections should be hide to the application layer.
- Finally the kernel implementation will require a very complex API
because MCAP require notifying lots of events some of the requiring a response(i.e., incoming mdl connection that need a response from the next level using MCAP with the configuration). Probably MCAP in the kernel space will be so complicated to used an you will require a user space library that make simpler the use of this API.

Quoted 9 lines

Keep the MCAP socket open means that we are keeping the MCL state for further reconnection.

Doing it inside the kernel removes a big amount of complexity of HDP and IEEE profiles, since we won't need any pipe or change of fd. That could be a killer feature to make it in the kernel.

Any comments? Is this reasonable?

In our opinion reconnections are not a reason to implement MCAP in kernel space because reconections should not be transparent at this level.

Quoted 2 lines

<snip>

[1] http://www.spinics.net/lists/linux-bluetooth/msg03001.html

#11 lore raw
In reply to João Paulo Rechi Vita
Quoted 141 lines · El Monday 17 May 2010 23:17:58 João Paulo Rechi Vita escribió:

On Mon, May 17, 2010 at 11:54, José Antonio Santos Cadenas

Quoted 138 lines · <[email protected]> wrote:

Hope the last one :)

----------------------------

BlueZ D-Bus Health API description
**********************************

Santiago Carot-Nemesio <[email protected]> José Antonio Santos-Cadenas <[email protected]> Elvis Pfützenreuter <[email protected]>

Health Device Profile hierarchy
===============================

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

Methods object CreateInstance(object path, dict config)

Returns the path for the new HealthInstance
object. The path parameter is the path of the remote object with the callbacks to notify events (see
org.bluez.HealthAgent at the end of this document) This petition starts an mcap instance and also
register in the SDP if is needed
Dict is defined as bellow:
{ "data_spec" : The data_spec is the data exchange
specification (see section 5.2.10
of the specification document) possible values:

                                               0x00 = reserved,
                                               0x01 [IEEE 11073-20601],
                                               0x02..0xff reserved,
                                       (optional)
                         "end_points" : [{ (optional)
                               "mdepid" : uint8, (optional)
                               "role" : ("source" or "sink"), (mandatory)
                               "specs" :[{ (mandatory)
                                       "data_type" : uint16, (mandatory)
                                       "description" : string, (optional)
                               }]
                         }]
                       }

                       if "data_spec" is not set, no SDP record will be
                       registered, so all the other data in the

dictionary will be ignored

Instance will be closed by the call or implicitly
when the programs leaves the bus.

Possible errors: org.bluez.Error.InvalidArguments

void CloseInstance(object path)

Closes the HDP instance identified by the object
path. Also instance will be closed if the process that started leaves the bus. If there is a SDP record associated to this instance it will be removed.

Possible errors: org.bluez.Error.InvalidArguments
org.bluez.Error.NotFound

-------------------------------------------------------------------------
-------

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

Methods array GetHealthInstances()

Gets the information of the remote instances
present in this device and published on its SDP record. The returned data follows this format.

                       [{"id": "an instance identification as string",
                        "data_spec" : data spec,
                        "end_points":
                               ["mdepid": uint8,
                                "role"  : "source" or "sink" ,
                                "specs" : [{
                                       "dtype"       : uint16,
                                       "description" : string, (optional)
                                }]
                               ]
                       }];

-------------------------------------------------------------------------
-------

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

object Connect(remote_instance_id)

Connects with the remote instance and returns its
object path. To get the session ids on a remote device, you must run the GetHealthInstances in the HealthDevice object.

Possible errors: org.bluez.Error.InvalidArguments
org.bluez.Error.HealthError

void Disconnect(object device, boolean cache)

Disconnect from the remote device. If chahe is
false, state will also be deleted. Otherwise, the state will be kept for allowing future reconnections until the adapter is removed.

Possible errors: org.bluez.Error.InvalidArguments
org.bluez.Error.NotFound org.bluez.Error.HealthError

-------------------------------------------------------------------------
-------

Service         org.bluez
Interface       org.bluez.HealthLink
Object path     [variable

prefix]/{hci0,hci1,...}/{hdp0,hdp1,...}/rem_inst_id

boolean Echo(array{byte})

Sends an echo petition to the remote intance.
Returns True if response matches with the buffer sent. If some error is detected False value is returned and the associated MCL is closed.

uint16 OpenDataChannel(byte mdepid, byte config)

Creates a new data channel with the indicated
config to the remote MCAP Data End Point (MDEP). The configuration should indicate the channel quality of service. In the current version of HDP, valid values are 0x01 for reliable channels and 0x02 for streaming data channel.

Returns the data channel id.

Quoted 7 lines
Quoted 4 lines

Possible errors: org.bluez.Error.InvalidArguments
org.bluez.Error.HealthError

array GetDataChannelFileDescriptor(uint16 mdlid)

Wouldn't be better to pass the fd through the LinkConnected call on Agent? Doing it here allows any process to get the fds.

Originally we thought about doing like that. But Elvis suggested to centralize all the ways that you get the file descriptor in just one place and we thought that it was a great idea. In addition, think that you will need this call because the LinkConnected call is only called when the connection is initiated by the remote HDP instance but the connections initiated by your side will not be notified. About the "security" issue you mentioned, we are planing to control who can call this methods only the process that initiated the HDP instance will receive a response to this methods, any other process will receive an error.

Quoted 80 lines
Quoted 80 lines

Gets a file descriptor where data can be read or written for receive or sent by the data channel. Returns an array of file descriptors one for write and other for read.

Possible errors: org.bluez.Error.InvalidArguments
org.bluez.Error.NotFound org.bluez.Error.HealthError

void DeleteDataChannel(uint16 mdlid)

Deletes a data channel so it will not be available
for use.

Possible errors: org.bluez.Error.InvalidArguments
org.bluez.Error.NotFound org.bluez.Error.HealthError

void DeleteAllDataChannels()

Deletes all data channels so it will not be
available for use. Typically this function is called when the connection with the remote device will be closed permanently

Possible errors: org.bluez.Error.HealthError

dict GetDataChannelStatus()

Return a dictionary with all the data channels
that can be used to send data right now. The dictionary is formed like follows:

                       {
                               "reliable": [mdlid_r1, mdlid_r2, ...],
                               "streaming" : [mdlid_s1, mdlid_s2, ...]
                       }

                       The fist reliable data channel will always be the

first data channel in reliable array.

HealthAgent hierarchy
==================

(this object is implemented by the HDP client an receives notifications)

Service         unique name
Interface       org.bluez.HealthAgent
Object path     freely definable

void LinkConnected(object path)

This method is called whenever a new connection has been established over the control channel of
the current HDP instance. The object path paremeter contains the object path of the created HealthLink.

void LinkDisconnected(object path)

This method is called when a remote device is disconnected definitively. Any future
reconnections will fail. Also all data channels associated to this device will be closed.

void CreatedDataChannel(object path, uint16 mdlid, byte
conf)

This method is called when a new data channel is
created The path contains the object path of the HealthLink where the new connection is created, the mdlid is the data channel identificator and conf is the que quality of service of the data channel (0x01 reliable, 0x02 streaming).

void DeletedDataChannel(object path, uint16 mdlid)

This method is called when a data channel is
closed. After this call the data channel will not be valid and can be reused for future created data channels. --
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html