Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions libraries/CurieBLE/src/BLECharacteristic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,11 @@ bool BLECharacteristic::setValue(const unsigned char value[], unsigned short len
return writeValue(value, (int)length);
}

bool BLECharacteristic::setValue(const char* value)
{
return this->setValue((const unsigned char *)value, strlen(value));
}

bool BLECharacteristic::writeValue(const byte value[], int length)
{
return writeValue(value, length, 0);
Expand Down
9 changes: 9 additions & 0 deletions libraries/CurieBLE/src/BLECharacteristic.h
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,15 @@ class BLECharacteristic: public BLEAttributeWithValue
*/
bool setValue(const unsigned char value[], unsigned short length);

/**
* Set the current value of the Characteristic with a String
*
* @param value New string value to set, strings exceeding maxLength will be truncated
*
* @return bool true set value success, false on error
*/
bool setValue(const char* value);

/**
* @brief Write the value of the characteristic
*
Expand Down