/*
 * File: autd3.proto
 * Project: proto
 * Created Date: 26/06/2023
 * Author: Shun Suzuki
 * -----
 * Last Modified: 22/11/2023
 * Modified By: Shun Suzuki (suzuki@hapis.k.u-tokyo.ac.jp)
 * -----
 * Copyright (c) 2023 Shun Suzuki. All rights reserved.
 *
 */

syntax = "proto3";

package autd3;

import "utils.proto";

message TxRawData {
  bytes data = 1;
  uint32 num_devices = 2;
}
message SendResponse { bool success = 1; }
message RxMessage { bytes data = 1; }
message ReadRequest {}

message CloseRequest {}
message CloseResponse { bool success = 1; }

message Geometry {
  message Transducer {
    uint32 idx = 1;
    Vector3 pos = 2;
    Quaternion rot = 3;
  }
  message Device {
    uint32 idx = 1;
    float sound_speed = 2;
    float attenuation = 3;
    repeated Transducer transducers = 4;
  }
  repeated Device devices = 1;
}

message GeometryResponse {}

service Simulator {
  rpc ConfigGeomety(Geometry) returns (GeometryResponse) {}
  rpc UpdateGeomety(Geometry) returns (GeometryResponse) {}
  rpc SendData(TxRawData) returns (SendResponse) {}
  rpc ReadData(ReadRequest) returns (RxMessage) {}
  rpc Close(CloseRequest) returns (CloseResponse) {}
}

service ECAT {
  rpc SendData(TxRawData) returns (SendResponse) {}
  rpc ReadData(ReadRequest) returns (RxMessage) {}
  rpc Close(CloseRequest) returns (CloseResponse) {}
}
