nRF51 SDK
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
Blood Glucose Application

Modules

 main.c
 Glucose Meter service Sample Application.
 

Detailed Description

The Blood Glucose Application is a firmware example that implements the Blood Glucose profile using the hardware delivered in the nRF51822 Development Kit.

The source code and project file can be found in the <InstallFolder>\Nordic\nrf51822\Board\nrf6310\ble\ble_app_gls folder.

The application includes the two services in the Blood Glucose profile:

In addition, use of the Battery Service is also demonstrated.

When the application starts, a timer for generating battery measurements is started.

The actual measurements are hard coded values and gets added when connected and bonded to a master, at each press of the button 0. The timestamps are simulated and it uses the Record Access Control point and implements the filtering on sequence number. It supports only glucose measurement characteristic, not glucose context.

Note
This application is not power optimised!
The application will stop advertising after 3 minutes and go to system-off mode. Push the button 0 restart advertising.

Setup

Instructions on how to set up the nRFgo Motherboard: nRFgo Motherboard Setup (nRF6310).

LED assignments:

Buttons assignments:

Demonstrating the Blood Glucose Meter Profile

The Blood Glucose Meter Profile uses the Record Access Control Point characteric to access all measurements. This means that the sensor does not automatically send new measurements, the collector has to fetch them writing request to the control point (see http://developer.bluetooth.org/Pages/default.aspx for more detail on the RACP characteristic).

nRF6350 Display - MITM protection

The Blood Glucose Application is able to use the nRF6350 Display to secure the bonding using Man-in-the-Middle protection (MITM). If the nRF6350 Display is available and connected according to the setup found in nRFgo Motherboard Setup (nRF6310) , then the Blood Glucose Application will present a passkey during bonding.

The passkey must be entered at the master to complete the bonding and ensure MITM protection.

mitm_display.jpg
nRF6350 Display presenting a passkey

Testing

The Glucose Meter Application can be tested using the nRFUtility app for iOS and Android. The app will be listed as "nRFready Utility" on Apple Store and as "nRF Utility" on Google Play.

It can also be tested using the Master Control Panel as follows:

  1. Compile and program the application. Observe that the Advertising LED is lit.
  2. Connect to the device from Master Control Panel (the device will be advertising as 'Nordic_Glucose'), then perform service discovery. Observe that the Connected LED is lit, and the Advertising LED is off.
  3. Click the 'Enable services' button on the Master Control Panel. Observe that Battery Level notifications are received every 10 seconds.
  4. Press Button 0 five times.
  5. Do a Read all records operation: Write 0101 (OpCode : REPORT_STORED_RECORDS, Operator : ALL_STORED_RECORDS) to Record Access Control Point Characteristic (UUID 0x2A52). Observe that you receive five notification of the glucose measurements(UUID 0x2A18) and one indication of the RACP indicating success (06000101);
  6. Read the number of stored records: Write 0401 (OpCode: REPORT_NUM_STORED_RECORDS, Operator: ALL_STORED_RECORDS) to Record Access Control Point Characteristic (UUID 0x2A52). Observe that you get an indication of the RACP giving you the number of records, 5 (05000500).