summaryrefslogtreecommitdiff
path: root/src/BLEValue.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/BLEValue.h')
-rw-r--r--src/BLEValue.h36
1 files changed, 36 insertions, 0 deletions
diff --git a/src/BLEValue.h b/src/BLEValue.h
new file mode 100644
index 0000000..a292c6e
--- /dev/null
+++ b/src/BLEValue.h
@@ -0,0 +1,36 @@
+/*
+ * BLEValue.h
+ *
+ * Created on: Jul 17, 2017
+ * Author: kolban
+ */
+
+#ifndef COMPONENTS_CPP_UTILS_BLEVALUE_H_
+#define COMPONENTS_CPP_UTILS_BLEVALUE_H_
+#include "sdkconfig.h"
+#if defined(CONFIG_BT_ENABLED)
+#include <string>
+
+/**
+ * @brief The model of a %BLE value.
+ */
+class BLEValue {
+public:
+ BLEValue();
+ void addPart(std::string part);
+ void addPart(uint8_t* pData, size_t length);
+ void cancel();
+ void commit();
+ uint16_t getReadOffset();
+ std::string getValue();
+ void setReadOffset(uint16_t readOffset);
+ void setValue(std::string value);
+ void setValue(uint8_t* pData, size_t length);
+
+private:
+ std::string m_accumulation;
+ uint16_t m_readOffset;
+ std::string m_value;
+};
+#endif // CONFIG_BT_ENABLED
+#endif /* COMPONENTS_CPP_UTILS_BLEVALUE_H_ */