NimBLE-Arduino 1.4.2
Loading...
Searching...
No Matches
NimBLEEddystoneTLM.h
1/*
2 * NimBLEEddystoneTLM.h
3 *
4 * Created: on March 15 2020
5 * Author H2zero
6 *
7 * Originally:
8 *
9 * BLEEddystoneTLM.h
10 *
11 * Created on: Mar 12, 2018
12 * Author: pcbreflux
13 */
14
15#ifndef _NimBLEEddystoneTLM_H_
16#define _NimBLEEddystoneTLM_H_
17
18#include "NimBLEUUID.h"
19
20#include <string>
21
22#define EDDYSTONE_TLM_FRAME_TYPE 0x20
23
30public:
32 std::string getData();
34 uint8_t getVersion();
35 uint16_t getVolt();
36 float getTemp();
37 uint32_t getCount();
38 uint32_t getTime();
39 std::string toString();
40 void setData(const std::string &data);
41 void setUUID(const NimBLEUUID &l_uuid);
42 void setVersion(uint8_t version);
43 void setVolt(uint16_t volt);
44 void setTemp(float temp);
45 void setCount(uint32_t advCount);
46 void setTime(uint32_t tmil);
47
48private:
49 uint16_t beaconUUID;
50 struct {
51 uint8_t frameType;
52 uint8_t version;
53 uint16_t volt;
54 uint16_t temp;
55 uint32_t advCount;
56 uint32_t tmil;
57 } __attribute__((packed)) m_eddystoneData;
58
59}; // NimBLEEddystoneTLM
60
61#endif /* _NimBLEEddystoneTLM_H_ */
Representation of a beacon. See:
Definition: NimBLEEddystoneTLM.h:29
void setData(const std::string &data)
Set the raw data for the beacon advertisement.
Definition: NimBLEEddystoneTLM.cpp:164
void setVersion(uint8_t version)
Set the version to advertise.
Definition: NimBLEEddystoneTLM.cpp:187
void setUUID(const NimBLEUUID &l_uuid)
Set the UUID to advertise.
Definition: NimBLEEddystoneTLM.cpp:178
NimBLEEddystoneTLM()
Construct a default EddystoneTLM beacon object.
Definition: NimBLEEddystoneTLM.cpp:32
uint32_t getCount()
Get the count of advertisements sent.
Definition: NimBLEEddystoneTLM.cpp:91
void setCount(uint32_t advCount)
Set the advertisement count.
Definition: NimBLEEddystoneTLM.cpp:214
void setTemp(float temp)
Set the temperature to advertise.
Definition: NimBLEEddystoneTLM.cpp:205
std::string toString()
Get a string representation of the beacon.
Definition: NimBLEEddystoneTLM.cpp:109
void setTime(uint32_t tmil)
Set the advertisement time.
Definition: NimBLEEddystoneTLM.cpp:223
NimBLEUUID getUUID()
Get the UUID being advertised.
Definition: NimBLEEddystoneTLM.cpp:56
uint32_t getTime()
Get the advertisement time.
Definition: NimBLEEddystoneTLM.cpp:100
float getTemp()
Get the temperature being advertised.
Definition: NimBLEEddystoneTLM.cpp:83
void setVolt(uint16_t volt)
Set the battery voltage to advertise.
Definition: NimBLEEddystoneTLM.cpp:196
std::string getData()
Retrieve the data that is being advertised.
Definition: NimBLEEddystoneTLM.cpp:47
uint8_t getVersion()
Get the version being advertised.
Definition: NimBLEEddystoneTLM.cpp:65
uint16_t getVolt()
Get the battery voltage.
Definition: NimBLEEddystoneTLM.cpp:74
A model of a BLE UUID.
Definition: NimBLEUUID.h:37