summaryrefslogtreecommitdiff
path: root/sensor/patchedBLE/src/BLEBeacon.h
diff options
context:
space:
mode:
authordakkar <dakkar@thenautilus.net>2018-08-03 12:23:17 +0100
committerdakkar <dakkar@thenautilus.net>2018-08-03 12:23:17 +0100
commitbb00c2da73b6ab8837f50c9f889ee151f8abc036 (patch)
tree3922eb826386260568ccaa1da7056c141f752a97 /sensor/patchedBLE/src/BLEBeacon.h
parentdon't print from callback, there's races (diff)
parentUpload of 0.4.16 (diff)
downloadthermostat-bb00c2da73b6ab8837f50c9f889ee151f8abc036.tar.gz
thermostat-bb00c2da73b6ab8837f50c9f889ee151f8abc036.tar.bz2
thermostat-bb00c2da73b6ab8837f50c9f889ee151f8abc036.zip
Add 'sensor/patchedBLE/' from commit '7951347ed68313d75c367e1f2cce763cb56d1eb2'
git-subtree-dir: sensor/patchedBLE git-subtree-mainline: 27e209cf58abeda1dc110777f99a98804a13fdbf git-subtree-split: 7951347ed68313d75c367e1f2cce763cb56d1eb2
Diffstat (limited to 'sensor/patchedBLE/src/BLEBeacon.h')
-rw-r--r--sensor/patchedBLE/src/BLEBeacon.h43
1 files changed, 43 insertions, 0 deletions
diff --git a/sensor/patchedBLE/src/BLEBeacon.h b/sensor/patchedBLE/src/BLEBeacon.h
new file mode 100644
index 0000000..0b02e2b
--- /dev/null
+++ b/sensor/patchedBLE/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_ */