Skip to content

Commit 0167d15

Browse files
author
microbuilder
committed
Minor cleanup
1 parent bd5e974 commit 0167d15

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

libraries/Bluefruit52Lib/examples/custom_hrm/custom_hrm.ino

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -110,9 +110,10 @@ void setupHRM(void)
110110
// Heart Rate Control Point 0x2A39 Conditional Write <-- Not used here
111111
hrms.start();
112112

113-
// Note: You must start the service before calling any characteristics
114-
// Calling .start() on a BLECharacteristic will cause it to be added to
115-
// the last BLEService that was 'start()'ed!
113+
// Note: You must call .start() on the BLEService before calling .start() on
114+
// any characteristic(s) within that service definition.. Calling .start() on
115+
// a BLECharacteristic will cause it to be added to the last BLEService that
116+
// was 'start()'ed!
116117

117118
// Configure the Heart Rate Measurement characteristic
118119
// See: https://www.bluetooth.com/specifications/gatt/viewer?attributeXmlFile=org.bluetooth.characteristic.heart_rate_measurement.xml
@@ -175,13 +176,18 @@ void cccd_callback(BLECharacteristic& chr, ble_gatts_evt_write_t* request)
175176
{
176177
(void) request;
177178

178-
// Check the characteristic this CCCD record is associated with in case
179-
// this callback is used for multiple CCCD callbacks.
179+
// Display the raw request packet
180+
Serial.println("CCCD Updated");
181+
Serial.print("\tPayload :");
182+
Serial.printBuffer(request->data, request->len);
183+
184+
// Check the characteristic this CCCD update is associated with in case
185+
// this handler is used for multiple CCCD records.
180186
if (chr.uuid == hrmc.uuid) {
181187
if (chr.notifyEnabled()) {
182-
Serial.println("Heart Rate Measurement CCCD: Notify enabled");
188+
Serial.println("\tHeart Rate Measurement 'Notify' enabled");
183189
} else {
184-
Serial.println("Heart Rate Measurement CCCD: Notify disabled");
190+
Serial.println("\tHeart Rate Measurement 'Notify' disabled");
185191
}
186192
}
187193
}

0 commit comments

Comments
 (0)