@@ -110,9 +110,10 @@ void setupHRM(void)
110
110
// Heart Rate Control Point 0x2A39 Conditional Write <-- Not used here
111
111
hrms.start ();
112
112
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!
116
117
117
118
// Configure the Heart Rate Measurement characteristic
118
119
// 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)
175
176
{
176
177
(void ) request;
177
178
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 (" \t Payload :" );
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.
180
186
if (chr.uuid == hrmc.uuid ) {
181
187
if (chr.notifyEnabled ()) {
182
- Serial.println (" Heart Rate Measurement CCCD: Notify enabled" );
188
+ Serial.println (" \t Heart Rate Measurement ' Notify' enabled" );
183
189
} else {
184
- Serial.println (" Heart Rate Measurement CCCD: Notify disabled" );
190
+ Serial.println (" \t Heart Rate Measurement ' Notify' disabled" );
185
191
}
186
192
}
187
193
}
0 commit comments