From 2640c44b45942c57907fc841d084c99b33ce31f8 Mon Sep 17 00:00:00 2001 From: Larry Davis Date: Mon, 2 Jun 2025 14:38:23 -0700 Subject: [PATCH] Support passing data directly from NimBLEBeacon.getData() to NimBLEAdvertisementData.setManufacturerData() --- src/NimBLEBeacon.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/NimBLEBeacon.h b/src/NimBLEBeacon.h index e624ef8..061e1f6 100644 --- a/src/NimBLEBeacon.h +++ b/src/NimBLEBeacon.h @@ -24,6 +24,7 @@ class NimBLEUUID; # include +# include /** * @brief Representation of a beacon. @@ -40,6 +41,10 @@ class NimBLEBeacon { uint16_t major{}; uint16_t minor{}; int8_t signalPower{}; + operator std::vector () const { + return std::vector(reinterpret_cast(this), + reinterpret_cast(this) + sizeof(BeaconData)); + } } __attribute__((packed)); const BeaconData& getData();