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();