Skip to content

Commit 33d5c05

Browse files
authored
Dont echo Writes to Characteristic with BLEWriteWithoutResponse
sandeepmistry#174
1 parent c074f30 commit 33d5c05

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/BLECharacteristic.cpp

+7-1
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,13 @@ bool BLECharacteristic::written() {
107107
}
108108

109109
void BLECharacteristic::setValue(BLECentral& central, const unsigned char value[], unsigned char length) {
110-
this->setValue(value, length);
110+
//https://github.com/sandeepmistry/arduino-BLEPeripheral/pull/174
111+
if(_properties & BLEWriteWithoutResponse){
112+
this->_valueLength = min(length, this->_valueSize);
113+
memcpy(this->_value, value, this->_valueLength);
114+
} else {
115+
this->setValue(value, length);
116+
}
111117

112118
this->_written = true;
113119

0 commit comments

Comments
 (0)