50
L. Chaari Fourati and S. Said
4.2 Steps for Reading Sensed Data on Mobile App
The development of a Mobile App able to read BLE sensed data can be resumed
by the following steps:
Step 1: Declaring permission on a manifest file is required to use BLE features
and to perform BLE communication toward requesting or accepting connection
or reading the different measurements.
Step 2: Assigning UUID for service and characteristic as declared in the previous
subsection.
Step 3: Chekinging that BLE is supported on the PDA and enable it.
Step 4: Turning On the Bluetooth and displaying dialogue box on the PDA
that asking for permission from the user to turn on Bluetooth.
Step 5: Scanning and visualizing nearby BLE health devices and their addresses
on the PDA.
Step 6: Connecting to a GATT server on health device to manage the connection
and to send data using the connectGatt() method that requires as parameters(a
Context object, autoConnect and a reference to a BluetoothGattCallback). The
BluetoothGattCallback is used to deliver GATT client operations to the client
(Mobile App on the PDA).
Step 7: Discovering, reading and displaying GATT services and characteristics
by controlling the device activity (DeviceControlActivity).
Step 8: Reading Sensed Data(for example: temperature). Thus, we set notification or indication value on Temperature Measurement Characteristic then write
to the descriptor to set the right value for characteristics. The updates from the
health device on characteristics value will be posted on the next callback using
onCharacteristicChanged.
Developers can get detailed description and example of codes from the main
android(section Bluetoot connectivity) webpage [25].
We recapitulate the different steps required for enabling a mobile App to get
sensed data from health devices in Fig. 3.
L. Chaari Fourati and S. Said
4.2 Steps for Reading Sensed Data on Mobile App
The development of a Mobile App able to read BLE sensed data can be resumed
by the following steps:
Step 1: Declaring permission on a manifest file is required to use BLE features
and to perform BLE communication toward requesting or accepting connection
or reading the different measurements.
Step 2: Assigning UUID for service and characteristic as declared in the previous
subsection.
Step 3: Chekinging that BLE is supported on the PDA and enable it.
Step 4: Turning On the Bluetooth and displaying dialogue box on the PDA
that asking for permission from the user to turn on Bluetooth.
Step 5: Scanning and visualizing nearby BLE health devices and their addresses
on the PDA.
Step 6: Connecting to a GATT server on health device to manage the connection
and to send data using the connectGatt() method that requires as parameters(a
Context object, autoConnect and a reference to a BluetoothGattCallback). The
BluetoothGattCallback is used to deliver GATT client operations to the client
(Mobile App on the PDA).
Step 7: Discovering, reading and displaying GATT services and characteristics
by controlling the device activity (DeviceControlActivity).
Step 8: Reading Sensed Data(for example: temperature). Thus, we set notification or indication value on Temperature Measurement Characteristic then write
to the descriptor to set the right value for characteristics. The updates from the
health device on characteristics value will be posted on the next callback using
onCharacteristicChanged.
Developers can get detailed description and example of codes from the main
android(section Bluetoot connectivity) webpage [25].
We recapitulate the different steps required for enabling a mobile App to get
sensed data from health devices in Fig. 3.
