Demo Glucose Service
Dependencies: BLE_API mbed nRF51822
Fork of BLE_HeartRate by
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
Diff: main.cpp
- Revision:
- 47:430545f41113
- Parent:
- 46:ee7c55907f36
- Child:
- 50:477004d54431
--- a/main.cpp Tue Sep 30 00:07:32 2014 +0000 +++ b/main.cpp Tue Sep 30 02:14:27 2014 +0000 @@ -21,6 +21,7 @@ #include "DeviceInformationService.h" BLEDevice ble; +DigitalOut led1(LED1); const static char DEVICE_NAME[] = "Nordic_HRM"; static const uint16_t uuid16_list[] = {GattService::UUID_HEART_RATE_SERVICE, @@ -35,6 +36,8 @@ void periodicCallback(void) { + led1 = !led1; /* Do blinky on LED1 while we're waiting for BLE events */ + /* Note that the periodicCallback() executes in interrupt context, so it is safer to do * heavy-weight sensor polling from the main thread. */ triggerSensorPolling = true; @@ -42,6 +45,7 @@ int main(void) { + led1 = 1; Ticker ticker; ticker.attach(periodicCallback, 1);