• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// Copyright 2022 The Android Open Source Project
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//      http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15syntax = "proto3";
16
17package netsim.model;
18
19import "common.proto";
20import "google/protobuf/timestamp.proto";
21
22// A 3D position. A valid Position must have both x and y coordinates.
23// The position coordinates are in meters.
24message Position {
25  float x = 1;
26  float y = 2;
27  float z = 3;
28}
29
30message Orientation {
31  float yaw = 1;
32  float pitch = 2;
33  float roll = 3;
34}
35
36enum PhyKind {
37  NONE = 0;
38  BLUETOOTH_CLASSIC = 1;
39  BLUETOOTH_LOW_ENERGY = 2;
40  WIFI = 3;
41  UWB = 4;
42  WIFI_RTT = 5;
43}
44
45// An explicit valued boolean.
46enum State {
47  UNKNOWN = 0;
48  ON = 1;
49  OFF = 2;
50}
51
52message Chip {
53  netsim.common.ChipKind kind = 1;
54  int32 id = 2;
55  string name = 3;  // optional like "rear-right"
56
57  string manufacturer = 4;  // optional like Quorvo
58  string product_name = 5;  // optional like DW300
59  State capture = 6;        // packet capture
60
61  // Radio state associated with the Chip
62  message Radio {
63    State state = 1;
64    float range = 2;
65    int32 tx_count = 3;
66    int32 rx_count = 4;
67  }
68
69  // Bluetooth has 2 radios
70  message Bluetooth {
71    Radio low_energy = 1;
72    Radio classic = 2;
73  }
74
75  oneof chip {
76    Bluetooth bt = 7;
77    Radio uwb = 8;
78    Radio wifi = 9;
79  }
80}
81
82message Device {
83  int32 id = 1;
84  string name = 2;  // settable at creation
85  bool visible = 3;
86  Position position = 4;
87  Orientation orientation = 5;
88  // Device can have multiple chips of the same kind.
89  repeated Chip chips = 6;
90}
91
92message Scene {
93  repeated Device devices = 1;
94}
95
96message Capture {
97  int32 id = 1;  // same as chip_id
98  netsim.common.ChipKind chip_kind = 2;
99  // device AVD name
100  string device_name = 3;
101  // capture state
102  State state = 4;
103  // size of current capture
104  int32 size = 5;
105  // number of records in current capture
106  int32 records = 6;
107  google.protobuf.Timestamp timestamp = 7;
108  bool valid = 8;
109}
110