Skip to content

Commit c7aaa85

Browse files
sgbihuSidLeung
authored andcommitted
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 484fcdc commit c7aaa85

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

libraries/CurieBLE/src/internal/BLECharacteristicImp.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,7 @@ bool
260260
BLECharacteristicImp::setValue(const unsigned char value[], uint16_t length)
261261
{
262262
_setValue(value, length, 0);
263+
_value_updated = true;
263264
if (BLEUtils::isLocalBLE(_ble_device) == true)
264265
{
265266
// GATT server
@@ -555,7 +556,6 @@ BLECharacteristicImp::_setValue(const uint8_t value[], uint16_t length, uint16_t
555556
}
556557
}
557558

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

0 commit comments

Comments
 (0)