xref: /aosp_15_r20/external/openscreen/cast/cast_core/api/web/message_channel.proto (revision 3f982cf4871df8771c9d4abe6e9a6f8d829b2736)
1// Copyright 2021 The Chromium Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4//
5// **** DO NOT EDIT - this file was automatically generated. ****
6syntax = "proto3";
7
8package cast.web;
9
10option optimize_for = LITE_RUNTIME;
11
12message Message {
13  oneof message_type {
14    MessageRequest request = 1;
15    MessageResponse response = 2;
16    MessagePortStatus status = 3;
17  }
18
19  MessageChannelDescriptor channel = 4;
20}
21
22message MessageChannelDescriptor {
23  uint32 channel_id = 1;
24}
25
26message MessageRequest {
27  string data = 1;
28  repeated MessagePortDescriptor ports = 2;
29}
30
31message MessageResponse {
32  bool result = 1;
33}
34
35// MessagePortDescriptor is used to transfer ownership of a port across the
36// MessageChannel. After port transfer, Messages may be sent to and from the
37// port by using same |channel|, which must be unique to each entangled
38// port pair. Pairs from Cast Core start with |channel_id| of 0x80000000 and
39// increment by one for each pair; pairs generated by a runtime should start
40// at 0x0 and increment by one to avoid collisions.
41message MessagePortDescriptor {
42  MessageChannelDescriptor channel = 1;
43  MessagePortStatus peer_status = 2;
44  uint32 sequence_number = 3;
45}
46
47message MessagePortStatus {
48  enum Status {
49    OK = 0;
50    ERROR = 1;
51    STARTED = 2;
52  }
53
54  Status status = 1;
55}
56