• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/* eslint-disable */
2import type {Controller} from '../rootcanal/configuration';
3
4import type {ChipKind} from './common';
5
6export const protobufPackage = 'netsim.model';
7
8/** Radio Type used by netsim-grpc in testing module */
9export enum PhyKind {
10  /** NONE - Unknown Chip Kind */
11  NONE = 'NONE',
12  BLUETOOTH_CLASSIC = 'BLUETOOTH_CLASSIC',
13  BLUETOOTH_LOW_ENERGY = 'BLUETOOTH_LOW_ENERGY',
14  WIFI = 'WIFI',
15  UWB = 'UWB',
16  WIFI_RTT = 'WIFI_RTT',
17  UNRECOGNIZED = 'UNRECOGNIZED',
18}
19
20/**
21 * A 3D position. A valid Position must have both x and y coordinates.
22 * The position coordinates are in meters.
23 */
24export interface Position {
25  /** positional value of x axis */
26  x: number;
27  /** positional value of y axis */
28  y: number;
29  /** positional value of z axis */
30  z: number;
31}
32
33/**
34 * A 3D orientation. A valid Orientation must have yaw, pitch, and roll.
35 * The orientation values are in degrees.
36 */
37export interface Orientation {
38  /** Rotational value around vertical axis. */
39  yaw: number;
40  /** Rotational value around side-to-side axis */
41  pitch: number;
42  /** Rotational value around front-to-back axis */
43  roll: number;
44}
45
46/** Model of a Chip in netsim */
47export interface Chip {
48  /** Type of Radio (BT, WIFI, UWB) */
49  kind: ChipKind;
50  /** Chip Identifier */
51  id: number;
52  /** optional like "rear-right" */
53  name: string;
54  /** optional like Quorvo */
55  manufacturer: string;
56  /** optional like DW300 */
57  productName: string;
58  /** Dual mode of Bluetooth */
59  bt?:|Chip_Bluetooth|undefined;
60  /** Bluetooth Beacon Low Energy */
61  bleBeacon?:|Chip_BleBeacon|undefined;
62  /** UWB */
63  uwb?:|Chip_Radio|undefined;
64  /** WIFI */
65  wifi?: Chip_Radio|undefined;
66}
67
68/** Radio state associated with the Chip */
69export interface Chip_Radio {
70  /** Boolean state of Radio */
71  state?:|boolean|undefined;
72  /** Maximum range of Radio */
73  range: number;
74  /** Transmitted packet counts */
75  txCount: number;
76  /** Received packet counts */
77  rxCount: number;
78}
79
80/** Bluetooth has 2 radios */
81export interface Chip_Bluetooth {
82  /** BLE */
83  lowEnergy:|Chip_Radio|undefined;
84  /** Bluetooth Classic */
85  classic:|Chip_Radio|undefined;
86  /** BD_ADDR address */
87  address: string;
88  /** rootcanal Controller Properties */
89  btProperties: Controller|undefined;
90}
91
92/**
93 * BleBeacon has numerous configurable fields.
94 * Address, AdvertiseSetting, AdvertiseData.
95 */
96export interface Chip_BleBeacon {
97  /** Bluetooth Radio */
98  bt:|Chip_Bluetooth|undefined;
99  /** BD_ADDR address */
100  address: string;
101  /** Settings on how beacon functions */
102  settings:|Chip_BleBeacon_AdvertiseSettings|undefined;
103  /** Advertising Data */
104  advData:|Chip_BleBeacon_AdvertiseData|undefined;
105  /** Scan Response Data */
106  scanResponse: Chip_BleBeacon_AdvertiseData|undefined;
107}
108
109/** Advertise Settigns dictate how the beacon functions on the netwwork. */
110export interface Chip_BleBeacon_AdvertiseSettings {
111  /** How often the beacon sends an advertising packet */
112  advertiseMode?:|Chip_BleBeacon_AdvertiseSettings_AdvertiseMode|undefined;
113  /** Numeric time interval between advertisements in ms. */
114  milliseconds?:|number|undefined;
115  /** Amount of power to send transmission */
116  txPowerLevel?:|Chip_BleBeacon_AdvertiseSettings_AdvertiseTxPower|undefined;
117  /** Numeric transmission power in dBm. Must be within [-127, 127]. */
118  dbm?:|number|undefined;
119  /** Whether the beacon will respond to scan requests. */
120  scannable: boolean;
121  /** Limit adveritising to a given amoutn of time. */
122  timeout: number;
123}
124
125/**
126 * How often the beacon sends an advertising packet
127 *
128 * Referenced From
129 * packages/modules/Bluetooth/framework/java/android/bluetooth/le/BluetoothLeAdvertiser.java#151
130 */
131export enum Chip_BleBeacon_AdvertiseSettings_AdvertiseMode {
132  /**
133   * LOW_POWER - Perform Bluetooth LE advertising in low power mode. This is the
134   * default and preferred advertising mode as it consumes the least power
135   */
136  LOW_POWER = 'LOW_POWER',
137  /**
138   * BALANCED - Perform Bluetooth LE advertising in balanced power mode. This is
139   * balanced between advertising frequency and power consumption
140   */
141  BALANCED = 'BALANCED',
142  /**
143   * LOW_LATENCY - Perform Bluetooth LE advertising in low latency, high power
144   * mode. This has the highest power consumption and should not be used for
145   * continuous background advertising
146   */
147  LOW_LATENCY = 'LOW_LATENCY',
148  UNRECOGNIZED = 'UNRECOGNIZED',
149}
150
151/**
152 * Amount of power to send transmissions. Correlates with signal strength
153 * and range. Inversely correlates with energy consumption.
154 *
155 * Referenced From
156 * packages/modules/Bluetooth/framework/java/android/bluetooth/le/BluetoothLeAdvertiser.java#159
157 */
158export enum Chip_BleBeacon_AdvertiseSettings_AdvertiseTxPower {
159  /**
160   * ULTRA_LOW - Advertise using the lowest transmission (TX) power level. Low
161   * transmission power can be used to restrict the visibility range of
162   * advertising packets
163   */
164  ULTRA_LOW = 'ULTRA_LOW',
165  /** LOW - Advertise using low TX power level. This is the default */
166  LOW = 'LOW',
167  /** MEDIUM - Advertise using medium TX power level */
168  MEDIUM = 'MEDIUM',
169  /**
170   * HIGH - Advertise using high TX power level. This corresponds to largest
171   * visibility range of the advertising packet
172   */
173  HIGH = 'HIGH',
174  UNRECOGNIZED = 'UNRECOGNIZED',
175}
176
177/**
178 * These parameters dictate which fields are included in advertisements or
179 * scan responses sent by the beacon. Beacons in Betosim will support a
180 * subset of the complete list of fields found in "Supplement to the
181 * Bluetooth Core Specification"
182 */
183export interface Chip_BleBeacon_AdvertiseData {
184  /** Whether the device name should be included in advertise packet. */
185  includeDeviceName: boolean;
186  /**
187   * Whether the transmission power level should be included in the
188   * advertise packet.
189   */
190  includeTxPowerLevel: boolean;
191  /** Manufacturer specific data. */
192  manufacturerData: Uint8Array;
193  /** GATT services supported by the devices */
194  services: Chip_BleBeacon_AdvertiseData_Service[];
195}
196
197/** GATT service proto */
198export interface Chip_BleBeacon_AdvertiseData_Service {
199  /** UUID of a Bluetooth GATT service for the beacon */
200  uuid: string;
201  /** Bytes of data associated with a GATT service provided by the device */
202  data: Uint8Array;
203}
204
205/**
206 * Protobuf for ChipCreate
207 *
208 * This is used specifically for CreateDevice
209 */
210export interface ChipCreate {
211  /** Type of Radio (BT, WIFI, UWB) */
212  kind: ChipKind;
213  /** BD_ADDR address */
214  address: string;
215  /** optional like "rear-right" */
216  name: string;
217  /** optional like Quorvo */
218  manufacturer: string;
219  /** optional like DW300 */
220  productName: string;
221  /** BleBeaconCreate protobuf */
222  bleBeacon?:|ChipCreate_BleBeaconCreate|undefined;
223  /** optional rootcanal configuration for bluetooth chipsets. */
224  btProperties: Controller|undefined;
225}
226
227/**
228 * Protobuf for BleBeaconCreate
229 * Beacon specific information during creation
230 */
231export interface ChipCreate_BleBeaconCreate {
232  /** BD_ADDR address */
233  address: string;
234  /** Settings on how beacon functions */
235  settings:|Chip_BleBeacon_AdvertiseSettings|undefined;
236  /** Advertising Data */
237  advData:|Chip_BleBeacon_AdvertiseData|undefined;
238  /** Scan Response Data */
239  scanResponse: Chip_BleBeacon_AdvertiseData|undefined;
240}
241
242/** Device model for netsim */
243export interface Device {
244  /** Device Identifier */
245  id: number;
246  /** Device name. Settable at creation */
247  name: string;
248  /** Visibility of device in the scene */
249  visible?:|boolean|undefined;
250  /** Position of Device */
251  position:|Position|undefined;
252  /** Orientation of Device */
253  orientation:|Orientation|undefined;
254  /** Chips in Device. Device can have multiple chips of the same kind. */
255  chips: Chip[];
256}
257
258/**
259 * Protobuf for DeviceCreate
260 *
261 * This is used specifically for CreateDevice
262 */
263export interface DeviceCreate {
264  /** Device name. */
265  name: string;
266  /** Position of Device */
267  position:|Position|undefined;
268  /** Orientation of Device */
269  orientation:|Orientation|undefined;
270  /** Chips in Device */
271  chips: ChipCreate[];
272}
273
274/** Scene model for netsim */
275export interface Scene {
276  /** List of devices in the scene. */
277  devices: Device[];
278}
279
280/** Capture model for netsim */
281export interface Capture {
282  /** Capture Identifier (Same as Chip Identifier) */
283  id: number;
284  /** Type of Radio (BT, WIFI, UWB) */
285  chipKind: ChipKind;
286  /** device AVD name */
287  deviceName: string;
288  /** capture state */
289  state?:|boolean|undefined;
290  /** size of current capture */
291  size: number;
292  /** number of records in current capture */
293  records: number;
294  /**
295   * Timestamp of the most recent start_capture
296   * When "state" is set "ON", timestamp is updated.
297   */
298  timestamp:|Date|undefined;
299  /**
300   * True if capture for the chip is attached to netsim.
301   * False if chip has been detached from netsim.
302   */
303  valid: boolean;
304}
305