esp-nimble-cpp  1.4.1
NimBLEEddystoneURL.h
1 /*
2  * NimBLEEddystoneURL.h
3  *
4  * Created: on March 15 2020
5  * Author H2zero
6  *
7  * Originally:
8  *
9  * BLEEddystoneURL.h
10  *
11  * Created on: Mar 12, 2018
12  * Author: pcbreflux
13  */
14 
15 #ifndef _NIMBLEEddystoneURL_H_
16 #define _NIMBLEEddystoneURL_H_
17 #include "NimBLEUUID.h"
18 
19 #include <string>
20 
21 #define EDDYSTONE_URL_FRAME_TYPE 0x10
22 
29 public:
31  std::string getData();
33  int8_t getPower();
34  std::string getURL();
35  std::string getDecodedURL();
36  void setData(const std::string &data);
37  void setUUID(const NimBLEUUID &l_uuid);
38  void setPower(int8_t advertisedTxPower);
39  void setURL(const std::string &url);
40 
41 private:
42  uint16_t beaconUUID;
43  uint8_t lengthURL;
44  struct {
45  uint8_t frameType;
46  int8_t advertisedTxPower;
47  uint8_t url[16];
48  } __attribute__((packed)) m_eddystoneData;
49 
50 }; // NIMBLEEddystoneURL
51 
52 #endif /* _NIMBLEEddystoneURL_H_ */
Representation of a beacon. See:
Definition: NimBLEEddystoneURL.h:28
std::string getURL()
Get the raw URL being advertised.
Definition: NimBLEEddystoneURL.cpp:68
NimBLEUUID getUUID()
Get the UUID being advertised.
Definition: NimBLEEddystoneURL.cpp:50
int8_t getPower()
Get the transmit power being advertised.
Definition: NimBLEEddystoneURL.cpp:59
void setPower(int8_t advertisedTxPower)
Set the transmit power to advertise.
Definition: NimBLEEddystoneURL.cpp:183
void setURL(const std::string &url)
Set the URL to advertise.
Definition: NimBLEEddystoneURL.cpp:192
std::string getDecodedURL()
Get the full URL being advertised.
Definition: NimBLEEddystoneURL.cpp:77
std::string getData()
Retrieve the data that is being advertised.
Definition: NimBLEEddystoneURL.cpp:41
void setData(const std::string &data)
Set the raw data for the beacon advertisement.
Definition: NimBLEEddystoneURL.cpp:158
NimBLEEddystoneURL()
Construct a default EddystoneURL beacon object.
Definition: NimBLEEddystoneURL.cpp:28
void setUUID(const NimBLEUUID &l_uuid)
Set the UUID to advertise.
Definition: NimBLEEddystoneURL.cpp:174
A model of a BLE UUID.
Definition: NimBLEUUID.h:37