/*
 *
 * Copyright (C) 2022 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 */
syntax = "proto3";

package hello_uwb;

option java_multiple_files = true;
option java_package = "com.google.uwb.uwbranging.impl.proto";

// Represents a Controlee's capability parameters.
message UwbCapabilities {
  repeated int32 supported_config_ids = 1;
  bool supports_azimuth = 2;
  bool supports_elevation = 3;
}

// Represents the UWB configuration created by the controller.
message UwbConfiguration {
  int32 config_id = 1;
  int32 channel = 2;
  int32 preamble_index = 3;
  int32 session_id = 4;
  bytes security_info = 5;
  int32 sub_session_id = 6;
  bytes sub_session_key = 7;
}

// Connection info can be capabilities or configuration.
message UwbConnectionInfo {
  oneof info {
    UwbCapabilities capabilities = 1;
    UwbConfiguration configuration = 2;
  }
}

// A control message
message Control {
  string id = 1;
  bytes metadata = 2;
  int32 local_address = 3;
  UwbConnectionInfo connection_info = 4;
}

// A data message
message Data {
  bytes message = 1;
}

message Oob {
  oneof content {
    Control control = 1;
    Data data = 2;
  }
}
