Symbian platform (C++)
SDK native APIs, runtime and tooling
Loading...
Searching...
No Matches
control.h
Go to the documentation of this file.
1// Copyright 2026 The Symbian SDK Authors.
2// Licensed under the Apache License, Version 2.0.
3
4#ifndef SYMBIAN_AGENT_CONTROL_H_
5#define SYMBIAN_AGENT_CONTROL_H_
6
7#include <cstddef>
8#include <cstdint>
9#include <string>
10#include <string_view>
11
12#include "absl/status/statusor.h"
13#include "nlohmann/json.hpp"
14
15namespace symbian::agent {
16
18inline constexpr std::size_t kMaximumControlBytes = 4096;
19
21enum class ControlKind : std::uint8_t {
22 kHello = 1,
23 kStatus = 2,
24 kCancel = 3,
25 kResult = 4,
26 kError = 5,
27 kLogs = 6,
30 kPointerEvent = 9,
31 kResourceRead = 10,
32 kResourceWrite = 11,
33 kPackageOpen = 12,
34 kAppRegistered = 13,
35};
36
46 std::uint32_t version = 1;
47 std::uint64_t request_id = 0;
49 std::uint64_t deadline_millis = 0;
50 nlohmann::json body = nlohmann::json::object();
51 nlohmann::json extensions = nlohmann::json::object();
52};
53
59absl::StatusOr<ControlMessage> ParseControl(std::string_view encoded);
60
62absl::StatusOr<std::string> PackControl(const ControlMessage& message);
63
64} // namespace symbian::agent
65
66#endif // SYMBIAN_AGENT_CONTROL_H_
Definition control.cc:14
ControlKind
Version-one control operations; none grants write or device access.
Definition control.h:21
absl::StatusOr< ControlMessage > ParseControl(std::string_view encoded)
Parse one bounded MessagePack control payload.
Definition control.cc:40
absl::StatusOr< std::string > PackControl(const ControlMessage &message)
Validate and serialize a control envelope as MessagePack.
Definition control.cc:79
constexpr std::size_t kMaximumControlBytes
Control messages have a smaller budget than data frames.
Definition control.h:18
Typed control envelope carried as MessagePack inside a wire frame.
Definition control.h:45
nlohmann::json body
Definition control.h:50
nlohmann::json extensions
Definition control.h:51
ControlKind kind
Definition control.h:48
std::uint64_t deadline_millis
Definition control.h:49
std::uint64_t request_id
Definition control.h:47
std::uint32_t version
Definition control.h:46