opcode903.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435
  1. #pragma once
  2. #include <cstdint>
  3. #include "../web_service_envelope.h"
  4. namespace sunrise::middleware::web_service::messages::opcode903 {
  5. /** Web Service opcode used by an ordinary item socket-plug insertion. */
  6. inline constexpr std::uint16_t kOpcode = 903;
  7. /** Exact logical fields carried by the native 144-bit socket action descriptor. */
  8. struct Request {
  9. std::uint64_t instanceSoid{};
  10. std::uint32_t socketIndex{};
  11. std::uint16_t targetDefinitionIndex{};
  12. std::uint16_t plugDefinitionIndex{};
  13. bool hasInstance{};
  14. bool hasTargetDefinition{};
  15. bool hasPlugDefinition{};
  16. };
  17. /**
  18. * Parses the exact reflected opcode-903 descriptor, including both alignment layers.
  19. *
  20. * The native item identity can name either an instance or an uninstanced definition. State decides
  21. * which identity shapes it supports after this codec has proved the wire representation.
  22. *
  23. * @param message Parsed Web Service envelope.
  24. * @param request Receives the decoded target, socket lane, and plug definition.
  25. * @return True only for the complete canonical 18-byte request.
  26. */
  27. [[nodiscard]] bool parse_request(const Message& message, Request& request) noexcept;
  28. } // namespace sunrise::middleware::web_service::messages::opcode903