Heart Rate Monitor example for Delta BLE platform
This is a very basic BLE example for DELTA DFBM-NQ620 and DELTA DFCM-NNN50 platforms. This example is doing HRM (Heart Rate Monitor) application, the service spec can be found in here Once compiled and download to DELTA platforms, the module start advertising while LED1 is blinking. User can download the APP 'nRF Connect' available in both App Store and Google Play to scan the adverting and connect to the module.
Note that printf use the baudrate 9600 8n1 as default. In Windows, user could find the ready to use com port number in Device Manager and shown as 'mbed Serial Port(COM#)'
Diff: main.cpp
- Revision:
- 2:d4b007ee15dc
- Parent:
- 1:82331af3e4c9
- Child:
- 3:f2861d705e88
--- a/main.cpp Tue Mar 14 08:33:26 2017 +0000 +++ b/main.cpp Wed Mar 29 07:00:29 2017 +0000 @@ -35,6 +35,7 @@ void disconnectionCallback(const Gap::DisconnectionCallbackParams_t *params) { BLE::Instance(BLE::DEFAULT_INSTANCE).gap().startAdvertising(); // restart advertising + printf("BLE Disconnected, restart advertising!!\r\n"); } void periodicCallback(void) @@ -71,10 +72,12 @@ ble.gap().setAdvertisingType(GapAdvertisingParams::ADV_CONNECTABLE_UNDIRECTED); ble.gap().setAdvertisingInterval(1000); /* 1000ms */ ble.gap().startAdvertising(); + printf("BLE start Advertising!!\r\n"); } int main(void) { + printf("APPLICATION START!!\r\n"); led1 = 1; Ticker ticker; ticker.attach(periodicCallback, 1); // blink LED every second @@ -102,6 +105,7 @@ } hrService->updateHeartRate(hrmCounter); + printf("notify hrmCounter: %i\r\n", hrmCounter); } else { ble.waitForEvent(); // low power wait for event }