alternatively the manager can initiate a connection to
a device, if it is needed, without having any previous
information about the device.
DI specifies a method by which Bluetooth devices
share information that may be used by another device
to find icons or associated software, such as for ex-
ample specific drivers. All this information is also
published in the SDP record.
4.1 MCAP Impementation
Our MCAP implementation is compliant with the
Bluetooth Special Interest Group specification, sup-
porting all the obligatory features and some of the op-
tional, such as channel reconnection. The only op-
tional feature not supported by current implementa-
tion is the clock synchronization protocol.
MCAP specification requires the enhanced re-
transmission and streamming modes from L2CAP.
None of them was supported by BlueZ when we be-
gan our MCAP implementation, but they have re-
cently been developed in parallel with our work by
BlueZ developers (Padovan, 2009), what has allowed
us to test test our MCAP+HDP implementation.
The system architecture is designed to announce
to the upper layer all the events occurred during the
protocol execution using callbacks. This behaviour
allows the HDP layer to receive all the events in
real time, not needing to do polling or other CPU-
intensive operations, what renders the implementation
more efficient.
MCAP implementation is multithreaded. Once
the MCAP session is opened, a new thread is
launched, waiting for new connections. This thread
also controls all the actions which are part of the
protocol, such as the connection of new data chan-
nels, disconnections, reconnections, etc. The main
thread listens the sockets where new connections are
received and also serves control commands. This ar-
chitecture allows the system to continue working nor-
mally while MCAP is running.
4.2 HDP Impementation
The current HDP implementation simplifies the use of
MCAP by the user. It also registers all the necessary
information on the SDP record. It uses both, callbacks
and accept functions to notify the events to the user,
depending on the role of the current HDP execution
(source or sink).
The implementation completely hides the MCAP
control channels mechanism, providing an abstraction
model based on a notification service which notifies
new MCAP Communication Links (MCL) like new
available remote devices. Of course, the creation of
new MCL’s is made possible by providing the blue-
tooth address of the remote devices. This action will
create a new MCL that will allow applications to re-
quest new data channels.
The API provides mechanisms to start data chan-
nel connections to a previously connected device.
Connections can also be received from remote de-
vices. Depending on the HDP role of the device, it
waits for a new connection calling to an accept func-
tion (source role) or the new connections are automat-
icaly notified when they are received (sink role).
Our HDP implementation also manages the cre-
ation of new data channels and controls the correct
configuration of them before the connections are no-
tified to the user. A check is made to know if the data
channel uses reliable or streamming mode depending
on the configuration parameters that were previously
negotiated.
HDP also takes care of the correct registering in
the SDP record of all the necessary information, such
as the PSM where the MCAP profile is waiting for
connections, the supported devices and protocols, etc.
5 EXPERIMENTAL RESULTS
The implementation described in the previous sec-
tions has been tested in order to check its correct be-
havior and compliance with the standards.
A first test tried to determine if the manager imple-
mentation was Continua compilant. This test was run
by Andago Ingenier
´
ıa personnel. The test consisted
on a communication between our ISO/IEEE 11073-
20601 manager and a simulated thermomether agent
provided by the Continua Enabling Software Library
(CESL), through a TCP connection. This test was
very satisfactory because the response of the man-
ager was completely correct including: the MDER
encondig library, the manager state machine transi-
tions and the APDUs exchanged between manager
and agent.
Once the integration of the manager in Android
was done, the work effort shifted to the wireless com-
munication. In this area we developed an emulation
of a thermomether agent running on Android, using
Bluetooth RFCOMM communications to exchange
data with our manager. We also developed an adap-
tation of our manager to Bluetooth RFCOMM. This
way we were able to run both, the manager and the
agent, in a couple of Android devices. The communi-
cation carried out correctly. Figure 7 shows the man-
ager and an agent running on Android devices.
In the latest devolopment stage the MCAP and
OPENHEALTH - The OpenHealth FLOSS Implementation of the ISO/IEEE 11073-20601 Standard
509