Let’s say for example that you want to create a heart rate monitor app. You’ll need information about the heart rate GATT profile to connect to and collect data from the bluetooth enabled HR monitor device.
GATT profiles are high level definitions that define how to use standard services in your applications. The heart rate GATT profile is used for fitness or health applications. The server device with a heart rate sensor exposes the standard heart rate service so that the Bluetooth LE client discovers the service and starts collecting data, for example the bpm (beats per minute). The GATT profile is the combination of service + characteristics.
You could research all of these specifications on your own, or you could skip ahead by using our prebuilt IoT heart rate sensor component.
With RAD Studio 10.2, we not only provide Bluetooth components out of the box, but also offer over 50 prebuilt IoT device components for many popular devices, ranging from home automation, to fitness gadgets, medical devices, environmental sensors and more.
For example, you can quickly build your own fitness application using either the generic ThingConnect heart rate service component or a device specific IoT component. We provide ready-to-use sample apps for each of the IoT components in GetIt.
The IoT framework for Bluetooth LE based devices uses TBluetoothDeviceDiscoveryManager to manage the connection with an IoT device as a general Bluetooth LE based connection mechanism and wraps each device as a component. For instance, the TWahooTICKRHeartRateMonitor component wraps the Wahoo TICKR Heart Rate Monitor.
The TBluetoothDeviceDiscoveryManager component provides the basic mechanism for connecting to Bluetooth LE based devices. In the TBluetoothDeviceDiscoveryManager component, you can define timeout and a number of re-tries to connect for these devices.
To build a ThingConnect application, you need the following components:
The TBluetoothDeviceDiscoveryManager component is used to set up the connection with the device.
The corresponding ThingConnect device component is used to retrieve the services and the characteristics data from the device.
Using the TPolarHeartRateMonitor component, it’s easy to connect to the Polar H7 heart rate sensor, and start monitoring the Heart Rate service, including subscribing to HR measurement data updates, and retrieving the building sensor location.
You can find a step-by-step tutorial on how to build your own heart rate tracking application using RAD Studio here.
With RAD Studio, we provide fully customizable user interface templates. Using one of the FireMonkey UI templates provides a great starting point for building a visually stunning fitness application.
Shown: FireMonkey UI template – Home Screen 3, available in GetIt.
We customized the UI by expanding the heart rate layout height on tap to show the resting heart rate, last recorded heart rate and current heart rate. This allows the user to see all relevant fitness data on a single screen. For more details on how to calculate your resting heart rate, see this great article from Polar.