diff --git a/libraries/Bluefruit52Lib/examples/Peripheral/custom_hrm/custom_hrm.ino b/libraries/Bluefruit52Lib/examples/Peripheral/custom_hrm/custom_hrm.ino index d68123ba..3abd60b8 100644 --- a/libraries/Bluefruit52Lib/examples/Peripheral/custom_hrm/custom_hrm.ino +++ b/libraries/Bluefruit52Lib/examples/Peripheral/custom_hrm/custom_hrm.ino @@ -201,27 +201,14 @@ void loop() if (Bluefruit.connected()) { uint8_t hrmdata[2] = { 0b00000110, bps++ }; // Sensor connected, increment BPS value - err_t resp = hrmc.notify(hrmdata, sizeof(hrmdata)); // Note: We use .notify instead of .write! - - // This isn't strictly necessary, but you can check the result - // of the .notify() attempt to see if it was successful or not - switch (resp) { - case ERROR_NONE: - // Value was written correctly! - Serial.print("Heart Rate Measurement updated to: "); Serial.println(bps); - break; - case NRF_ERROR_INVALID_PARAM: - // Characteristic property not set to 'Notify' - Serial.println("ERROR: Characteristic 'Property' not set to Notify!"); - break; - case NRF_ERROR_INVALID_STATE: - // Notify bit not set in the CCCD or not connected - Serial.println("ERROR: Notify not set in the CCCD or not connected!"); - break; - default: - // Unhandled error code - Serial.print("ERROR: Ox"); Serial.println(resp, HEX); - break; + + // Note: We use .notify instead of .write! + // If it is connected but CCCD is not enabled + // The characteristic's value is still updated although notification is not sent + if ( hrmc.notify(hrmdata, sizeof(hrmdata)) ){ + Serial.print("Heart Rate Measurement updated to: "); Serial.println(bps); + }else{ + Serial.println("ERROR: Notify not set in the CCCD or not connected!"); } } } diff --git a/libraries/Bluefruit52Lib/examples/Peripheral/hid_mouse/hid_mouse.ino b/libraries/Bluefruit52Lib/examples/Peripheral/hid_mouse/hid_mouse.ino index 157118f5..815dfdb7 100644 --- a/libraries/Bluefruit52Lib/examples/Peripheral/hid_mouse/hid_mouse.ino +++ b/libraries/Bluefruit52Lib/examples/Peripheral/hid_mouse/hid_mouse.ino @@ -121,7 +121,8 @@ void loop() break; case 'X': - blehid.mouseButtonPress(0); + // X to release all buttons + blehid.mouseButtonRelease(); break; default: break;