mirror of
https://github.com/h2zero/esp-nimble-cpp.git
synced 2024-11-21 20:50:55 +01:00
03cb7b21d9
This allows NimBLE options in menuconfig to reduce code size based on the roles selected (scan/advertising/central/peripheral). Significant code space can be saved by removing unnecessary roles for the application.
51 lines
1.2 KiB
C++
51 lines
1.2 KiB
C++
/*
|
|
* NimBLEBeacon2.h
|
|
*
|
|
* Created: on March 15 2020
|
|
* Author H2zero
|
|
*
|
|
* Originally:
|
|
*
|
|
* BLEBeacon2.h
|
|
*
|
|
* Created on: Jan 4, 2018
|
|
* Author: kolban
|
|
*/
|
|
|
|
#ifndef MAIN_NIMBLEBEACON_H_
|
|
#define MAIN_NIMBLEBEACON_H_
|
|
|
|
#include "NimBLEUUID.h"
|
|
/**
|
|
* @brief Representation of a beacon.
|
|
* See:
|
|
* * https://en.wikipedia.org/wiki/IBeacon
|
|
*/
|
|
class NimBLEBeacon {
|
|
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:
|
|
NimBLEBeacon();
|
|
std::string getData();
|
|
uint16_t getMajor();
|
|
uint16_t getMinor();
|
|
uint16_t getManufacturerId();
|
|
NimBLEUUID getProximityUUID();
|
|
int8_t getSignalPower();
|
|
void setData(const std::string &data);
|
|
void setMajor(uint16_t major);
|
|
void setMinor(uint16_t minor);
|
|
void setManufacturerId(uint16_t manufacturerId);
|
|
void setProximityUUID(const NimBLEUUID &uuid);
|
|
void setSignalPower(int8_t signalPower);
|
|
}; // NimBLEBeacon
|
|
|
|
#endif /* MAIN_NIMBLEBEACON_H_ */
|