summaryrefslogtreecommitdiff
path: root/src/BLEBeacon.h
diff options
context:
space:
mode:
authorNeil Kolban <kolban1@kolban.com>2018-01-17 18:16:31 -0600
committerNeil Kolban <kolban1@kolban.com>2018-01-17 18:16:31 -0600
commit3f5005c383540d07dd16ac044c78d7be28d4aa8e (patch)
treec5236ddbe5c8dd99ad7083dd498110152ad0e9be /src/BLEBeacon.h
parentRemoval of unneeded file (diff)
downloadthermostat-3f5005c383540d07dd16ac044c78d7be28d4aa8e.tar.gz
thermostat-3f5005c383540d07dd16ac044c78d7be28d4aa8e.tar.bz2
thermostat-3f5005c383540d07dd16ac044c78d7be28d4aa8e.zip
0.4.8
Diffstat (limited to 'src/BLEBeacon.h')
-rw-r--r--src/BLEBeacon.h43
1 files changed, 43 insertions, 0 deletions
diff --git a/src/BLEBeacon.h b/src/BLEBeacon.h
new file mode 100644
index 0000000..0b02e2b
--- /dev/null
+++ b/src/BLEBeacon.h
@@ -0,0 +1,43 @@
+/*
+ * BLEBeacon2.h
+ *
+ * Created on: Jan 4, 2018
+ * Author: kolban
+ */
+
+#ifndef COMPONENTS_CPP_UTILS_BLEBEACON_H_
+#define COMPONENTS_CPP_UTILS_BLEBEACON_H_
+#include "BLEUUID.h"
+/**
+ * @brief Representation of a beacon.
+ * See:
+ * * https://en.wikipedia.org/wiki/IBeacon
+ */
+class BLEBeacon {
+private:
+ struct {
+ uint16_t manufacturerId;
+ uint8_t subType;
+ uint8_t subTypeLength;
+ uint8_t proximityUUID[16];
+ uint16_t major;
+ uint16_t minor;
+ int8_t signalPower;
+ } __attribute__((packed))m_beaconData;
+public:
+ BLEBeacon();
+ std::string getData();
+ uint16_t getMajor();
+ uint16_t getMinor();
+ uint16_t getManufacturerId();
+ BLEUUID getProximityUUID();
+ int8_t getSignalPower();
+ void setData(std::string data);
+ void setMajor(uint16_t major);
+ void setMinor(uint16_t minor);
+ void setManufacturerId(uint16_t manufacturerId);
+ void setProximityUUID(BLEUUID uuid);
+ void setSignalPower(int8_t signalPower);
+}; // BLEBeacon
+
+#endif /* COMPONENTS_CPP_UTILS_BLEBEACON_H_ */