Skip to content

Commit 6821c59

Browse files
committed
Fix arduino#380 characteristic written returns incorrect value after first connect
1. Not set the flage when local device try to set the value. 2. Changed file libraries/CurieBLE/src/internal/BLECharacteristicImp.cpp
1 parent 001cab4 commit 6821c59

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

libraries/CurieBLE/src/internal/BLECharacteristicImp.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,7 @@ bool
259259
BLECharacteristicImp::setValue(const unsigned char value[], uint16_t length)
260260
{
261261
_setValue(value, length, 0);
262+
_value_updated = true;
262263
if (BLEUtils::isLocalBLE(_ble_device) == true)
263264
{
264265
// GATT server
@@ -554,7 +555,6 @@ BLECharacteristicImp::_setValue(const uint8_t value[], uint16_t length, uint16_t
554555
}
555556
}
556557

557-
_value_updated = true;
558558
memcpy(_value + offset, value, length);
559559
_value_length = length;
560560
}

0 commit comments

Comments
 (0)