My Project
 All Classes Functions Variables Pages
BLEValue.h
1 /*
2  * BLEValue.h
3  *
4  * Created on: Jul 17, 2017
5  * Author: kolban
6  */
7 
8 #ifndef COMPONENTS_CPP_UTILS_BLEVALUE_H_
9 #define COMPONENTS_CPP_UTILS_BLEVALUE_H_
10 #include "sdkconfig.h"
11 #if defined(CONFIG_BT_ENABLED)
12 #include <string>
13 
17 class BLEValue {
18 public:
19  BLEValue();
20  void addPart(std::string part);
21  void addPart(uint8_t* pData, size_t length);
22  void cancel();
23  void commit();
24  uint8_t* getData();
25  size_t getLength();
26  uint16_t getReadOffset();
27  std::string getValue();
28  void setReadOffset(uint16_t readOffset);
29  void setValue(std::string value);
30  void setValue(uint8_t* pData, size_t length);
31 
32 private:
33  std::string m_accumulation;
34  uint16_t m_readOffset;
35  std::string m_value;
36 
37 };
38 #endif // CONFIG_BT_ENABLED
39 #endif /* COMPONENTS_CPP_UTILS_BLEVALUE_H_ */