Fix handling of registerForNotify in BLERemoteCharacteristic.cpp (#4063)
This commit is contained in:
parent
11d071b1c8
commit
342b9cf2d8
@ -467,6 +467,7 @@ void BLERemoteCharacteristic::registerForNotify(notify_callback notifyCallback,
|
||||
uint8_t val[] = {0x01, 0x00};
|
||||
if(!notifications) val[0] = 0x02;
|
||||
BLERemoteDescriptor* desc = getDescriptor(BLEUUID((uint16_t)0x2902));
|
||||
if (desc != nullptr)
|
||||
desc->writeValue(val, 2);
|
||||
} // End Register
|
||||
else { // If we weren't passed a callback function, then this is an unregistration.
|
||||
@ -482,6 +483,7 @@ void BLERemoteCharacteristic::registerForNotify(notify_callback notifyCallback,
|
||||
|
||||
uint8_t val[] = {0x00, 0x00};
|
||||
BLERemoteDescriptor* desc = getDescriptor((uint16_t)0x2902);
|
||||
if (desc != nullptr)
|
||||
desc->writeValue(val, 2);
|
||||
} // End Unregister
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user