mirror of
https://github.com/h2zero/esp-nimble-cpp.git
synced 2025-07-29 18:07:14 +02:00
Support passing data directly from NimBLEBeacon.getData() to NimBLEAdvertisementData.setManufacturerData()
This commit is contained in:
@ -24,6 +24,7 @@
|
||||
class NimBLEUUID;
|
||||
|
||||
# include <cstdint>
|
||||
# include <vector>
|
||||
|
||||
/**
|
||||
* @brief Representation of a beacon.
|
||||
@ -40,6 +41,10 @@ class NimBLEBeacon {
|
||||
uint16_t major{};
|
||||
uint16_t minor{};
|
||||
int8_t signalPower{};
|
||||
operator std::vector<uint8_t> () const {
|
||||
return std::vector<uint8_t>(reinterpret_cast<const uint8_t*>(this),
|
||||
reinterpret_cast<const uint8_t*>(this) + sizeof(BeaconData));
|
||||
}
|
||||
} __attribute__((packed));
|
||||
|
||||
const BeaconData& getData();
|
||||
|
Reference in New Issue
Block a user