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:
15:7ba28817e31e
Parent:
13:3ca2045597e7
Child:
16:f3361e20642d
--- a/main.cpp	Tue Jun 10 14:37:18 2014 +0100
+++ b/main.cpp	Tue Jun 10 14:40:29 2014 +0100
@@ -138,6 +138,9 @@
     Ticker ticker;
     ticker.attach(periodicCallback, 1);
 
+    DEBUG("Initialising the nRF51822\n\r");
+    ble.init();
+
     /* Setup the local GAP/GATT event handlers */
     ble.onTimeout(timeoutCallback);
     ble.onConnection(connectionCallback);
@@ -145,13 +148,10 @@
     ble.onUpdatesEnabled(updatesEnabledCallback);
     ble.onUpdatesDisabled(updatesDisabledCallback);
 
-    DEBUG("Initialising the nRF51822\n\r");
-    ble.init();
-
+    /* setup advertising */
     ble.accumulateAdvertisingPayload(GapAdvertisingData::BREDR_NOT_SUPPORTED);
     ble.accumulateAdvertisingPayload(GapAdvertisingData::COMPLETE_LIST_16BIT_SERVICE_IDS, (uint8_t *)uuid16_list, sizeof(uuid16_list));
     ble.accumulateAdvertisingPayload(GapAdvertisingData::HEART_RATE_SENSOR_HEART_RATE_BELT);
-
     ble.setAdvertisingType(GapAdvertisingParams::ADV_CONNECTABLE_UNDIRECTED);
     ble.setAdvertisingInterval(160); /* 100ms; in multiples of 0.625ms. */
     ble.startAdvertising();