summaryrefslogtreecommitdiff
path: root/src/BLEEddystoneURL.h
diff options
context:
space:
mode:
authorchegewara <imperiaonline4@gmail.com>2018-11-30 10:59:14 +0100
committerchegewara <imperiaonline4@gmail.com>2018-11-30 10:59:14 +0100
commit934702b6169b92c71cbc850876fd17fb9ee3236d (patch)
tree048df4f7106cd4a574b609a13e62a36567f5a322 /src/BLEEddystoneURL.h
parentUpload of 0.4.16 (diff)
downloadthermostat-934702b6169b92c71cbc850876fd17fb9ee3236d.tar.gz
thermostat-934702b6169b92c71cbc850876fd17fb9ee3236d.tar.bz2
thermostat-934702b6169b92c71cbc850876fd17fb9ee3236d.zip
Changes, bugfixes and updgrades. Library is ready to work with arduino-esp32 v1.0.1.
Diffstat (limited to 'src/BLEEddystoneURL.h')
-rw-r--r--src/BLEEddystoneURL.h43
1 files changed, 43 insertions, 0 deletions
diff --git a/src/BLEEddystoneURL.h b/src/BLEEddystoneURL.h
new file mode 100644
index 0000000..0b538c0
--- /dev/null
+++ b/src/BLEEddystoneURL.h
@@ -0,0 +1,43 @@
+/*
+ * BLEEddystoneURL.cpp
+ *
+ * Created on: Mar 12, 2018
+ * Author: pcbreflux
+ */
+
+#ifndef _BLEEddystoneURL_H_
+#define _BLEEddystoneURL_H_
+#include "BLEUUID.h"
+
+#define EDDYSTONE_URL_FRAME_TYPE 0x10
+
+/**
+ * @brief Representation of a beacon.
+ * See:
+ * * https://github.com/google/eddystone
+ */
+class BLEEddystoneURL {
+public:
+ BLEEddystoneURL();
+ std::string getData();
+ BLEUUID getUUID();
+ int8_t getPower();
+ std::string getURL();
+ std::string getDecodedURL();
+ void setData(std::string data);
+ void setUUID(BLEUUID l_uuid);
+ void setPower(int8_t advertisedTxPower);
+ void setURL(std::string url);
+
+private:
+ uint16_t beaconUUID;
+ uint8_t lengthURL;
+ struct {
+ uint8_t frameType;
+ int8_t advertisedTxPower;
+ uint8_t url[16];
+ } __attribute__((packed)) m_eddystoneData;
+
+}; // BLEEddystoneURL
+
+#endif /* _BLEEddystoneURL_H_ */