NimBLECharacteristic: add setValue(uint8_t single_byte)

This commit is contained in:
h2zero 2020-06-21 20:38:38 -06:00
parent 0712f606f1
commit c25e48872f
2 changed files with 5 additions and 0 deletions

View file

@ -478,6 +478,10 @@ void NimBLECharacteristic::setValue(const std::string &value) {
setValue((uint8_t*)(value.data()), value.length()); setValue((uint8_t*)(value.data()), value.length());
} // setValue } // setValue
void NimBLECharacteristic::setValue(uint8_t data8) {
setValue(&data8, 1);
} // setValue
void NimBLECharacteristic::setValue(uint16_t& data16) { void NimBLECharacteristic::setValue(uint16_t& data16) {
uint8_t temp[2]; uint8_t temp[2];
temp[0] = data16; temp[0] = data16;

View file

@ -80,6 +80,7 @@ public:
void setCallbacks(NimBLECharacteristicCallbacks* pCallbacks); void setCallbacks(NimBLECharacteristicCallbacks* pCallbacks);
void setValue(const uint8_t* data, size_t size); void setValue(const uint8_t* data, size_t size);
void setValue(const std::string &value); void setValue(const std::string &value);
void setValue(uint8_t data8);
void setValue(uint16_t& data16); void setValue(uint16_t& data16);
void setValue(uint32_t& data32); void setValue(uint32_t& data32);
void setValue(int& data32); void setValue(int& data32);