@@ -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 (" \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.
180186 if (chr.uuid == hrmc.uuid ) {
181187 if (chr.notifyEnabled ()) {
182- Serial.println (" Heart Rate Measurement CCCD: Notify enabled" );
188+ Serial.println (" \t Heart Rate Measurement ' Notify' enabled" );
183189 } else {
184- Serial.println (" Heart Rate Measurement CCCD: Notify disabled" );
190+ Serial.println (" \t Heart Rate Measurement ' Notify' disabled" );
185191 }
186192 }
187193}
0 commit comments