Demo Glucose Service

Dependencies:   BLE_API mbed nRF51822

Fork of BLE_HeartRate by Bluetooth Low Energy

BLE_Glucose_demo implements the Glucose Service which enables a collector device to connect and interact with.

There is a brief sample code edited with Android Studio for demo this BLE_Glucose_demo example, and it is public on github, everyone can clone it by this URL: https://github.com/Marcomissyou/BluetoothLeGlucose.git. It is convenient for you to development your BLE idea.

There is also provided apk file so you can download and install it directly then demo this code, but make sure your Android phone supports Bluetooth 4.0. /media/uploads/Marcomissyou/bleglucoseservice.apk

Revision:
64:8cd9416028a7
Parent:
63:fc6117c32419
--- a/GlucoseService.h	Fri May 29 07:16:24 2015 +0000
+++ b/GlucoseService.h	Fri Jun 26 06:18:17 2015 +0000
@@ -17,12 +17,14 @@
 #ifndef __BLE_GLUCOSE_SERVICE_H__
 #define __BLE_GLUCOSE_SERVICE_H__
 
-#include "BLEDevice.h"
+#include "BLE.h"
 /**
 * @class GlucoseService
 * @brief BLE Glucose Service. This service displays the Glucose measurement value represented as a 16bit Float format.<br>
 * @This example can be demonstrated with Blood Pressure Android App downloaded from
 * @https://github.com/Marcomissyou/BluetoothLeGlucose.git
+* @Author: Marco.Hsu  
+* @Email: marco.missyou@gmail.com  
 */
 static uint16_t SEQUENCE_NUMBER = 11111;
 static uint16_t BASE_TIME_YEAR = 2015;
@@ -54,8 +56,8 @@
         ble.updateCharacteristicValue(GlucoseValue.getValueAttribute().getHandle(), GlucoseMeasurementValue.getPointer(), 12);
     }
     
-    virtual void onDataWritten(const GattCharacteristicWriteCBParams *params) {
-        if (params->charHandle == GluControlPoint.getValueAttribute().getHandle()) {
+    virtual void onDataWritten(const GattWriteCallbackParams *params) {
+        if (params->handle == GluControlPoint.getValueAttribute().getHandle()) {
             uint16_t bytesRead = params->len;
             if (bytesRead <= 4) {
                 memcpy(GluReceiveBuffer, params->data, bytesRead);