2020-03-30 01:44:20 +02:00
|
|
|
/*
|
|
|
|
* NimBLEEddystoneTLM.h
|
|
|
|
*
|
|
|
|
* Created: on March 15 2020
|
|
|
|
* Author H2zero
|
2020-05-14 06:03:56 +02:00
|
|
|
*
|
2020-03-30 01:44:20 +02:00
|
|
|
* Originally:
|
|
|
|
*
|
|
|
|
* BLEEddystoneTLM.h
|
|
|
|
*
|
|
|
|
* Created on: Mar 12, 2018
|
|
|
|
* Author: pcbreflux
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _NimBLEEddystoneTLM_H_
|
|
|
|
#define _NimBLEEddystoneTLM_H_
|
2021-09-07 05:14:43 +02:00
|
|
|
|
2020-03-30 01:44:20 +02:00
|
|
|
#include "NimBLEUUID.h"
|
|
|
|
|
|
|
|
#include <string>
|
|
|
|
|
|
|
|
#define EDDYSTONE_TLM_FRAME_TYPE 0x20
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Representation of a beacon.
|
|
|
|
* See:
|
|
|
|
* * https://github.com/google/eddystone
|
|
|
|
*/
|
|
|
|
class NimBLEEddystoneTLM {
|
|
|
|
public:
|
2020-05-14 06:03:56 +02:00
|
|
|
NimBLEEddystoneTLM();
|
|
|
|
std::string getData();
|
|
|
|
NimBLEUUID getUUID();
|
|
|
|
uint8_t getVersion();
|
|
|
|
uint16_t getVolt();
|
|
|
|
float getTemp();
|
|
|
|
uint32_t getCount();
|
|
|
|
uint32_t getTime();
|
|
|
|
std::string toString();
|
|
|
|
void setData(const std::string &data);
|
|
|
|
void setUUID(const NimBLEUUID &l_uuid);
|
|
|
|
void setVersion(uint8_t version);
|
|
|
|
void setVolt(uint16_t volt);
|
|
|
|
void setTemp(float temp);
|
|
|
|
void setCount(uint32_t advCount);
|
|
|
|
void setTime(uint32_t tmil);
|
2020-03-30 01:44:20 +02:00
|
|
|
|
|
|
|
private:
|
2020-05-14 06:03:56 +02:00
|
|
|
uint16_t beaconUUID;
|
|
|
|
struct {
|
|
|
|
uint8_t frameType;
|
|
|
|
uint8_t version;
|
|
|
|
uint16_t volt;
|
|
|
|
uint16_t temp;
|
|
|
|
uint32_t advCount;
|
|
|
|
uint32_t tmil;
|
|
|
|
} __attribute__((packed)) m_eddystoneData;
|
2020-03-30 01:44:20 +02:00
|
|
|
|
|
|
|
}; // NimBLEEddystoneTLM
|
|
|
|
|
|
|
|
#endif /* _NimBLEEddystoneTLM_H_ */
|