Skip to content

Commit cf115e0

Browse files
authored
Revert 42201d4, app should specify response when (un)subscribing. (#470)
In some applications it is benefitial to not write to the 0x2902 descriptor with response, particulary in cases where the device sends notifications regardless of subscribing. This reverts the previous change to the behavior of the (un)subscribe call which forced writing with response, the application should decide if it's required.
1 parent 345ef03 commit cf115e0

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

src/NimBLERemoteCharacteristic.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -616,7 +616,6 @@ bool NimBLERemoteCharacteristic::setNotify(uint16_t val, notify_callback notifyC
616616

617617
NIMBLE_LOGD(LOG_TAG, "<< setNotify()");
618618

619-
response = true; // Always write with response as per Bluetooth core specification.
620619
return desc->writeValue((uint8_t *)&val, 2, response);
621620
} // setNotify
622621

src/NimBLERemoteCharacteristic.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,8 @@ class NimBLERemoteCharacteristic {
7373

7474
bool subscribe(bool notifications = true,
7575
notify_callback notifyCallback = nullptr,
76-
bool response = true);
77-
bool unsubscribe(bool response = true);
76+
bool response = false);
77+
bool unsubscribe(bool response = false);
7878
bool registerForNotify(notify_callback notifyCallback,
7979
bool notifications = true,
8080
bool response = true)

0 commit comments

Comments
 (0)