Demonstrates a BGScript implementation of a master/scanning device, rather than the slave/peripheral end which most other example projects implement. See architectural comments in the beginning of htm_collector.bgs file for a detailed explanation of the operational flow. Requires a separate peripheral device which implements the Health Thermometer profile.
Note: This project is for BT121 module only. A version that works with BLE11x modules can be found here.
Scanning for HTM devices will begin automatically. This project parses the advertisement packet for the Health Thermometer service UUID (0x1809), and attempts to connect to the first device it sees which advertises this service. Once connected, it locates the HTM measurement characteristic, enables indications on it, and then outputs the incoming measurements until the device goes out of range or is otherwise disconnected.
This project should work with any Bluetooth Smart device that implements the Health Thermometer profile. One possibility is to use a BT121 development board running the bgdemo example that is included in Smart Ready SDK.
By default, the application will connect to any device that advertises the Health Thermometer service. If you want the application to connect only to one specific device, there is an option in the script to limit the connection to fixed MAC address only.
This option is enabled by setting constant 'use_fixed_addr' to a non-zero value. The fixed MAC address is initialized in system_boot event.