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:
29:76d865c718a6
Parent:
28:bdfc8cc53f0b
Child:
30:3dc9e6f2bc8c
--- a/main.cpp	Fri Jul 04 10:37:49 2014 +0100
+++ b/main.cpp	Fri Jul 04 15:06:51 2014 +0100
@@ -38,8 +38,8 @@
 GattService        battService(GattService::UUID_BATTERY_SERVICE, battLevelChars, sizeof(battLevelChars) / sizeof(GattCharacteristic *));
 
 /* Device Information service */
-const char         deviceName[] = { 'm', 'b', 'e', 'd' };
-GattCharacteristic deviceManufacturer(GattCharacteristic::UUID_MANUFACTURER_NAME_STRING_CHAR, (uint8_t *)deviceName, sizeof(deviceName), sizeof(deviceName),
+const static char  DEVICE_NAME[] = "Nordic_HRM";
+GattCharacteristic deviceManufacturer(GattCharacteristic::UUID_MANUFACTURER_NAME_STRING_CHAR, (uint8_t *)DEVICE_NAME, sizeof(DEVICE_NAME), sizeof(DEVICE_NAME),
                                       GattCharacteristic::BLE_GATT_CHAR_PROPERTIES_READ);
 GattCharacteristic *deviceInformationChars[] = {&deviceManufacturer};
 GattService        deviceInformationService(GattService::UUID_DEVICE_INFORMATION_SERVICE, deviceInformationChars,
@@ -100,9 +100,10 @@
     ble.onDisconnection(disconnectionCallback);
 
     /* setup advertising */
-    ble.accumulateAdvertisingPayload(GapAdvertisingData::BREDR_NOT_SUPPORTED);
+    ble.accumulateAdvertisingPayload(GapAdvertisingData::BREDR_NOT_SUPPORTED | GapAdvertisingData::LE_GENERAL_DISCOVERABLE);
     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.accumulateAdvertisingPayload(GapAdvertisingData::COMPLETE_LOCAL_NAME, (uint8_t *)DEVICE_NAME, sizeof(DEVICE_NAME));
     ble.setAdvertisingType(GapAdvertisingParams::ADV_CONNECTABLE_UNDIRECTED);
     ble.setAdvertisingInterval(160); /* 100ms; in multiples of 0.625ms. */
     ble.startAdvertising();