esp-nimble-cpp/src/NimBLEValue.h

47 lines
918 B
C
Raw Normal View History

2020-03-30 01:44:20 +02:00
/*
* NimBLEValue.h
*
* Created: on March 6, 2020
* Author H2zero
*
* Originally:
*
* BLEValue.h
*
* Created on: Jul 17, 2017
* Author: kolban
*/
#ifndef MAIN_BLEVALUE_H_
#define MAIN_BLEVALUE_H_
#include "sdkconfig.h"
#if defined(CONFIG_BT_ENABLED)
#include <string>
/**
* @brief The model of a %BLE value.
*/
class NimBLEValue {
public:
NimBLEValue();
void addPart(const std::string &part);
void addPart(const uint8_t* pData, size_t length);
2020-03-30 01:44:20 +02:00
void cancel();
void commit();
uint8_t* getData();
size_t getLength();
uint16_t getReadOffset();
std::string getValue();
void setReadOffset(uint16_t readOffset);
void setValue(const std::string &value);
void setValue(const uint8_t* pData, size_t length);
2020-03-30 01:44:20 +02:00
private:
std::string m_accumulation;
uint16_t m_readOffset;
std::string m_value;
};
#endif // CONFIG_BT_ENABLED
#endif /* MAIN_BLEVALUE_H_ */