#pragma once #include #include #include namespace sunrise::middleware::bap::activity_message::state_refresh { /** State-refresh requests use activity message type 18. */ inline constexpr std::uint32_t kMessageType = 18; /** Two big-endian 32-bit fields form the complete request body. */ inline constexpr std::size_t kEncodedSize = 8; /** Membership revision and logical bubble index requested by the client. */ struct StateRefresh final { std::uint32_t membershipRevision{}; std::int32_t bubbleIndex{}; }; /** * Parses the complete fixed state-refresh request body. * @param input Activity message body holding exactly 8 bytes. * @param refresh Cleared first. Filled in only on success. * @return True only when both big-endian fields are present with no tail. */ [[nodiscard]] bool parse_state_refresh(std::span input, StateRefresh& refresh) noexcept; } // namespace sunrise::middleware::bap::activity_message::state_refresh