Skip to content

Continua Integration

Alvaro Fides edited this page Jun 25, 2015 · 8 revisions

Table of Contents

Description

The main purpose of this task is to be able to integrate Continua certified devices inside universAAL platforms. For that reason and according to the previous comments, we need to develop three kinds of components (some of them can be shared between all environments without exception):

  1. A component in charge of manage Bluetooth HDP connections and disconnections. Interface with the lower layers and Bluetooth drivers.
  2. A component in charge of understand received HDP frames from Continua agents and accordingly move through the appropriate x73 state machine diagram.
  3. A component in charge of integrate HDP messages/Health data inside universAAL middleware.
The first component should be ad-hoc developed for Windows and GNU/Linux OS because the Bluetooth stack is not the same in both architectures. However, the second and the third are common for all platforms and can be re-used without adding external libraries neither dependencies.

Features

  • Native library (.dll) in Microsoft Visual C++ language for Windows 7 OS (x86_32).
  • JNI wrapper for Windows 7 OS (native library - universAAL middleware).
  • Native library (.so) in C language for GNU/Linux OS (x86_32 and x86_64).
  • JNI wrapper for GNU/Linux OS (native library - universAAL middleware).
  • IEEE 11073 Pure java library with: MDER encoder/decoder, Status machine, Nomenclature and Device specialization components. APDUs manager and Domain Information Model (DIM) component.
  • Continua HDP manager universAAL service, with start and stop: ProvidedContinuaHdpManagerService.SERVICE_SWITCH_ON + ProvidedContinuaHdpManagerService.SERVICE_SWITCH_OFF.

Artifacts

The following Maven artifacts, bundles and libraries from the LDDI repository are all related to the Bluetooth-Continua Integration module.

  • Windows OS HDP manager:Native library to exchange data between Bluetooth lower layer drivers (Toshiba stack) and Continua devices as well as upper layers and manager aplications.
  • GNU/Linux OS HDP manager: Native library to exchange data between Bluetooth lower layer drivers (BlueZ stack) and Continua devices as well as upper layers and manager aplications.
  • ISO/IEEE 11073 standard implementation: a Java implementation of the ISO/IEEE 11073 state machine and flow of information exchange which is able to understand x73 frames received from Continua Health Alliance certified agents.. This is located in folder lddi.common.
  • Continua Health Manager universAAL service: it is the application in charge of provide Continua Health manager services to any other universAAL service. Profiles, restrictions and expected features about Continua Health managers has been done here. It's what we call the "Exporter".
  • Continua Health Manager universAAL caller: Example caller to request Continua Health Alliance manager services execution.
  • Continua Health Manager universAAL subscriber: Example subscriber test to receive Continua Health Alliance manager events.

Installation

Developed source code is independent of any bluetooth dongle, so it doesn't matter which model or manufacturer you choose to test the libraries. In any case, the important first step is obvious: The Bluetooth device should have been paired first. Then you can continue the next installation steps depending on your OS, and finalize by installing the right bundles in OSGi.

Windows

Install the stack

"Bluecove" is the most common Java library for Bluetooth development in Windows environments but it doesn't work with HDP devices. An alternative is using the Toshiba SDK stack.

  1. Install Toshiba SDK Stack version Version v7.00.16. It has to be precisely that version. Available for download free of charge but requires to sign a License Agreement before using the libraries.
  2. Your C:\Windows\System32 path must contain mfc100ud.dll and msvcr100d.dll files. Both dlls are provided by the Microsoft .NET framework. Please, ensure both files are in the right folder.

Compile the Exporter

The binaries of the Exporter (the Continua Health Manager universAAL service) available in our Maven repository are compiled for Windows. In any case, if you need to compile for Windows yourself:

  1. Import in your IDE the project in https://github.com/universAAL/lddi/tree/master/lddi.bluetooth/lddi.bluetooth.continuahdpmanagerservice .
  2. In its lib folder, make sure you only have the right DLL for windows: hdpNativeLib_win_x86_32.dll. (We found the 64 bit one does not work, if you have a PC with an x86_64 architecture you can use the x86_32 version of the DLL - if Eclipse and Java are 32bit versions).
  3. Edit the hdpManager class constant dll_library_name_win_32 and give it the name of the file in the lib folder (e.g. "hdpNativeLib_win_x86_32.dll").
  4. Edit the pom.xml <Bundle-NativeCode> and put the appropriate OS values. For instance: hdpNativeLib_win_x86_32.dll; osname=Windows7; processor=x86.
  5. Compile the project with a Maven install (right click > run as > Maven Install from Eclipse, mvn install from command line).
  6. Make sure you use this compiled jar file in the final step when installing bundles.

GNU/Linux

Install the stack

BlueZ is the official Linux Bluetooth protocol stack and supports all core Bluetooth protocols and layers required to establish HDP connections between agents and managers (Bluetooth Health Device Profile version 1.0 specification). The source code is developed in C language, not Java, so we use D-Bus library through the open inter-process communication system and C-Java gateway through Java Native Interface (JNI) technology.

  1. Make sure you have Java JDK and not Open JDK (64 bit Oracle JDK version don't work on 32 bit OS, ensure you are working with the appropriate binaries package).
  2. Install BlueZ version 4.80 or higher (we recommend at least 4.96): http://www.bluez.org/.
  3. Install D-Bus version 1.4.14: http://www.freedesktop.org/wiki/Software/dbus.

Compile the Exporter

The binaries of the Exporter (the Continua Health Manager universAAL service) available in our Maven repository are compiled for Windows. For Linux, you need to compile with the right library yourself:

  1. Import in your IDE the project in https://github.com/universAAL/lddi/tree/master/lddi.bluetooth/lddi.bluetooth.continuahdpmanagerservice .
  2. In its lib folder, make sure you only have the right .so library for Linux 32 or 64 bits: libHDPnative_unix_32.so.zip or libHDPnative_unix_64.so.zip.
  3. Edit the hdpManager class constant dll_library_name_win_32 and give it the name of the file in the lib folder (e.g. "libHDPnative_unix_32.so"). You can also change the name of the constant if you want.
  4. Edit the pom.xml <Bundle-NativeCode> and put the appropriate Linux OS values.
  5. Compile the project with a Maven install (right click > run as > Maven Install from Eclipse, mvn install from command line).
  6. Make sure you use this compiled jar file in the final step when installing bundles.

Install the bundles

Whether you use Linux or Windows, when you run universAAL, you will need to install the following bundles in OSGI to get the Bluetooth-Continua Integration:

  • ...Middleware bundles...
  • org.unviersAAL.ontology/ont.phWorld/x.y.z
  • org.unviersAAL.ontology/ont.measurement/x.y.z
  • org.unviersAAL.ontology/ont.health.measurement/x.y.z
  • org.unviersAAL.ontology/ont.device/x.y.z
  • org.unviersAAL.ontology/ont.personalhealthdevice/x.y.z
  • org.unviersAAL.ontology/ont.ont.continuahealthmanager/x.y.z
  • org.universAAL.lddi/lddi.lib.ieeex73std/x.y.z (Not a bundle, use wrap:)
  • org.universAAL.lddi/lddi.bluetooth.continuahdpmanagerservice/x.y.z
Alternatively you can simply install the Karaf feature (uAAL-LDDI-BluetoothContinua) from the LDDI Karaf features. There is also a set of test applications in the Karaf feature (uAAL-LDDI-BluetoothContinua.test) - see below.

Example applications

There are a set of example applications that can be used to test the Bluetooth Continua Integration or as a sample of how to interact with it.

  • Continua Health Manager universAAL caller: Example caller to request Continua Manager services execution. It can switch between simulated or actual calls and events.
  • Continua Health Manager universAAL subscriber: Example subscriber test to receive Continua Manager events. Subscribes to BloodPressureMonitor and WeighingScale devices. This is a simple uAAL subscriber so it makes no assumptions on where the device events come from (Bluetooth or any other).
There are also a couple of examples of how to develop directly with the native libraries to create your own Exporters for Bluetooth-Continua. Take into account that these examples are not placed in the LDDI repository but the Samples repository. These are very much like the official Exporter shown in previous sections.
  • Continua Health Manager universAAL server for Windows 7 OS: universAAL Continua Manager server (windows OS version). Full sample ready to work with Continua Health Alliance weighing scales as well as arm blood pressure monitors. When a new measurement is received from the Continua agents, data can be published through universAAL context bus. Supports Blood Pressure Monitor and Weighing Scale devices.
  • Continua Health Manager universAAL server for Ubuntu OS: universAAL Continua Manager server (GNU/Linux OS version). Full sample ready to work with Continua Health Alliance weighing scales as well as arm blood pressure monitors. When a new measurement is received from the Continua agents, data can be published throught universAAL context bus. Supports Blood Pressure Monitor and Weighing Scale devices.