// Copyright 2024 The Pigweed Authors
//
// 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
//
//     https://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 factory;

import "pw_protobuf_protos/common.proto";

service Factory {
  rpc GetDeviceInfo(pw.protobuf.Empty) returns (DeviceInfo);
  rpc StartTest(StartTestRequest) returns (pw.protobuf.Empty);
  rpc EndTest(EndTestRequest) returns (pw.protobuf.Empty);

  rpc SampleLtr559Prox(pw.protobuf.Empty) returns (Ltr559ProxSample);
  rpc SampleLtr559Light(pw.protobuf.Empty) returns (Ltr559LightSample);
}

message DeviceInfo {
  uint64 flash_id = 1;
}

message Test {
  enum Type {
    BUTTONS = 0;
    LTR559_PROX = 1;
    LTR559_LIGHT = 2;
    BME688 = 3;
  }
}

message StartTestRequest {
  Test.Type test = 1;
}

message EndTestRequest {
  Test.Type test = 1;
}

message Ltr559ProxSample {
  // Raw 16-bit sensor ADC reading.
  uint32 value = 1;
}

message Ltr559LightSample {
  float lux = 1;
}