syntax = "proto3";

package mrc.proto;

option java_package = "com.mrc.proto";

message ProtobufFingerData {
    uint32 X = 1;
    uint32 Y = 2;
    bool Down = 3;
}

message ProtobufTouchpadData {
    repeated ProtobufFingerData Fingers = 1;
}

message ProtobufJoystickData {
    uint64 AvailableButtons = 1;
    uint64 Buttons = 2;
    uint32 AvailableAxes = 3;
    repeated sint32 Axes = 4;
    // Each POV takes up 4 bits
    // We can fit 8 in here.
    uint32 POVCount = 5;
    uint32 POVs = 6;
    repeated ProtobufTouchpadData Touchpads = 7;
}

message ProtobufControlData {
    uint32 ControlWord = 5;
    int32 MatchTime = 2;
    repeated ProtobufJoystickData Joysticks = 3;
    fixed64 CurrentOpMode = 4;
    string GameData = 6;
}

message ProtobufJoystickDescriptor {
    string JoystickName = 1;
    bool IsGamepad = 2;
    uint32 GamepadType = 3;
    uint32 SupportedOutputs = 4;
}

message ProtobufJoystickDescriptors {
    repeated ProtobufJoystickDescriptor Descriptors = 1;
}

message ProtobufJoystickOutput {
    uint32 LEDs = 1;
    uint32 Rumble = 2; // 16 bits, left msb, right lsb
    uint32 TriggerRumble = 3; // 16 bits, left msb, right lsb
}

message ProtobufJoystickOutputs {
    repeated ProtobufJoystickOutput Outputs = 1;
}

message ProtobufMatchInfo {
    string EventName = 1;
    int32 MatchNumber = 2;
    int32 ReplayNumber = 3;
    int32 MatchType = 4;
}

message ProtobufErrorInfo {
    bool IsError = 1;
    sint32 ErrorCode = 2;
    string Details = 3;
    string Location = 4;
    string CallStack = 5;
}

message ProtobufOpMode {
    fixed64 Hash = 1;
    string Name = 2;
    string Group = 3;
    string Description = 4;
    int32 TextColor = 5;
    int32 BackgroundColor = 6;
}

message ProtobufAvailableOpModes {
    repeated ProtobufOpMode Modes = 1;
}

message ProtobufErrorInfoTimestamp {
    ProtobufErrorInfo ErrorInfo = 1;
    uint64 Timestamp = 2;
    int32 SequenceNumber = 3;
    int32 NumOccurrences = 4;
}

message ProtobufConsoleLineTimestamp {
    string ConsoleLine = 1;
    uint64 Timestamp = 2;
    int32 SequenceNumber = 3;
}
