opcode406.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435
  1. #pragma once
  2. #include <cstdint>
  3. #include "../web_service_envelope.h"
  4. namespace sunrise::middleware::web_service::messages::opcode406 {
  5. /** Web Service opcode used by item-state actions such as lock and finisher Favorite. */
  6. inline constexpr std::uint16_t kOpcode = 406;
  7. /** Exact logical fields carried by the native 120-bit item-state descriptor. */
  8. struct Request {
  9. std::uint64_t instanceSoid{};
  10. std::uint16_t definitionIndex{};
  11. /** Accumulated item-state bits, already lifted off the descriptor's bias. */
  12. std::uint32_t flags{};
  13. };
  14. /**
  15. * Parses the exact reflected opcode-406 item-state descriptor.
  16. *
  17. * Both identities are optional native fields carrying a presence bit, and the state value is
  18. * biased from INT32_MIN. Only the two supported state bits are accepted.
  19. *
  20. * Fields are filled as far as the parse reaches, so a refused request still carries what it
  21. * decoded for the caller's trace.
  22. *
  23. * @param message Parsed Web Service envelope.
  24. * @param request Receives the instance, definition row, and unbiased state bits.
  25. * @return True only for the complete canonical 15-byte request.
  26. */
  27. [[nodiscard]] bool parse_request(const Message& message, Request& request) noexcept;
  28. } // namespace sunrise::middleware::web_service::messages::opcode406