#include <BLE.h>
int heartRateMeasurement = 0;
BLE_Char heartRateChar =
{
{0x37, 0x2A}, // UUID for heart rate measurement
BLE_READABLE, // The BLE client is able to only read this characterisitic value
"Heart rate measurement" // Description shown to the client
};
/* This syntax lets services have any number of characteristics. */
BLE_Char *heartRateChars[] = {&heartRateChar};
BLE_Service heartRateService =
{
{0x0D, 0x18}, // UUID for heart rate service
1, heartRateChars
};
void setup() {
/* Start the BLE layer and connect to the network processor. */
ble.begin();
/* Add the heart rate service. */
ble.addService(&heartRateService);
/* Sets the characteristic value's type. Note that this can be changed by
calling writeValue with a differently typed variable. */
ble.writeValue(&heartRateChar, heartRateMeasurement);
}
void loop() {
ble.handleEvents();
}