syntax = "proto3";
import "types.proto";
package Hwproxy;
import "mdb/bmc/kepler/Hwproxy/types/message.proto";
import "google/protobuf/empty.proto";

// BlockIO方法声明
service BlockIOMethod {
    option (service_interface) = "bmc.kepler.Chip.BlockIO";

    rpc Read(HwproxyMsg.BlockReadReq) returns (HwproxyMsg.BlockReadRsp);
    rpc Write(HwproxyMsg.BlockWriteReq) returns (google.protobuf.Empty);
    rpc WriteRead(HwproxyMsg.BlockWriteReq) returns (HwproxyMsg.BlockReadRsp);
}

message IBlockIO {
    option (interface) = "bmc.kepler.Chip.BlockIO";
}

service JtagMethod {
    option (service_interface) = "bmc.kepler.Chip.JtagTarget";

    rpc GetChipIdcode(google.protobuf.Empty) returns (HwproxyMsg.GetChipIdcodeRsp);
    rpc SetTargetNumber(HwproxyMsg.SetTargetNumberReq) returns (google.protobuf.Empty);
    rpc SetBypassMode(HwproxyMsg.SetBypassModeReq) returns (google.protobuf.Empty);
}

message IJtag {
    option (interface) = "bmc.kepler.Chip.JtagTarget";
}

// Accessor/Scanner
message IAccessor {
    option (interface) = "bmc.kepler.Accessor";

    uint64 Value = 1;
}

message Accessor {
    option (path) = "/bmc/kepler/Accessor/:Id";

    IAccessor Accessor = 1;
}

message IScanner {
    option (interface) = "bmc.kepler.Scanner";

    uint64 Value = 1 [(readonly) = true];
}

message Scanner {
    option (path) = "/bmc/kepler/Scanner/:Id";

    IScanner Scanner = 1;
}

// Bus

message IBus {
    option (interface) = "bmc.kepler.Bus";

}

message I2c {
    option (path) = "/bmc/kepler/Bus/I2c/:Id";

    IBus I2c = 1;
}

message Hisport {
    option (path) = "/bmc/kepler/Bus/Hisport/:Id";

    IBus Hisport = 1;
}

// Chip

message IRtc {
    option (interface) = "bmc.kepler.Chip.Rtc";

    repeated uint8 RtcTimestamp = 1 [(readonly) = true];
}

message IChip {
    option (interface) = "bmc.kepler.Chip";

    uint8 HealthStatus = 1 [(default) = "1"];
    uint8 PowerStatus = 2 [(default) = "1"];
    uint8 SelfTestResult = 3 [(default) = "1"];
}

message SMC {
    option (path) = "/bmc/kepler/Chip/SMC";

    IRtc Rtc = 1;
}

message Smc {
    option (path) = "/bmc/kepler/Chip/Smc/:Id";

    IChip Smc = 1;
}

message Eeprom {
    option (path) = "/bmc/kepler/Chip/Eeprom/:Id";

    IBlockIO BlockIO = 1;
    IChip Eeprom = 2;
}

message Pca9544 {
    option (path) = "/bmc/kepler/Chip/Pca9544/:Id";
 
    IChip Pca9544 = 1;
}

message Pca9545 {
    option (path) = "/bmc/kepler/Chip/Pca9545/:Id";

    IChip Pca9545 = 1;
}

message Pca9555 {
    option (path) = "/bmc/kepler/Chip/Pca9555/:Id";

    IChip Pca9555 = 1;
}

message Vrd {
    option (path) = "/bmc/kepler/Chip/Vrd/:Id";

    IChip Vrd = 1;
}

message Lm75 {
    option (path) = "/bmc/kepler/Chip/Lm75/:Id";

    IChip Lm75 = 1;
}

message Ads78 {
    option (path) = "/bmc/kepler/Chip/Ads78/:Id";

    IChip Ads78 = 1;
}

message CpldRegister {
    option (path) = "/bmc/kepler/Chip/CpldRegister/:Id";

    IChip CpldRegister = 1;
}

message Chip {
    option (path) = "/bmc/kepler/Chip/:Id";

    IChip Chip = 1;
}

message Cpld {
    option (path) = "/bmc/kepler/Chip/Cpld/:Id";

    IBlockIO BlockIO = 1;
    IChip Chip = 2;
    IJtag JtagTarget = 3;
}

// Mux

message II2CMux {
    option (interface) = "bmc.kepler.Mux.I2cMux";
}

message I2CMux {
    option (path) = "/bmc/kepler/Mux/I2cMux/:Id";

    II2CMux I2CMux = 1;
}