syntax = "proto2";

import "dccl/option_extensions.proto";
import "goby/middleware/protobuf/coroner.proto";
import "jaiabot/messages/option_extensions.proto";

package jaiabot.protobuf;

enum Error
{
    // from jaiabot_fusion
    ERROR__TOO_MANY_ERRORS_TO_REPORT_ALL = 0
        [(jaia.ev).rest_api.presence = GUARANTEED];

    // Directly from systemd
    ERROR__FAILED__UNKNOWN = 1 [(jaia.ev).rest_api.presence = GUARANTEED];
    ERROR__FAILED__GOBYD = 2 [(jaia.ev).rest_api.presence = GUARANTEED];
    ERROR__FAILED__GOBY_LIAISON = 3 [(jaia.ev).rest_api.presence = GUARANTEED];
    ERROR__FAILED__GOBY_GPS = 4 [(jaia.ev).rest_api.presence = GUARANTEED];
    ERROR__FAILED__GOBY_LOGGER = 5 [(jaia.ev).rest_api.presence = GUARANTEED];
    ERROR__FAILED__GOBY_CORONER = 6 [(jaia.ev).rest_api.presence = GUARANTEED];
    ERROR__FAILED__GOBY_MOOS_GATEWAY = 7
        [(jaia.ev).rest_api.presence = GUARANTEED];
    ERROR__FAILED__JAIABOT_HEALTH = 8
        [(jaia.ev).rest_api.presence = GUARANTEED];
    ERROR__FAILED__JAIABOT_METADATA = 9
        [(jaia.ev).rest_api.presence = GUARANTEED];
    ERROR__FAILED__JAIABOT_HUB_MANAGER = 10
        [(jaia.ev).rest_api.presence = GUARANTEED];
    ERROR__FAILED__JAIABOT_WEB_PORTAL = 11
        [(jaia.ev).rest_api.presence = GUARANTEED];
    ERROR__FAILED__JAIABOT_FUSION = 12
        [(jaia.ev).rest_api.presence = GUARANTEED];
    ERROR__FAILED__JAIABOT_MISSION_MANAGER = 13
        [(jaia.ev).rest_api.presence = GUARANTEED];
    ERROR__FAILED__JAIABOT_PID_CONTROL = 14
        [(jaia.ev).rest_api.presence = GUARANTEED];
    ERROR__FAILED__JAIABOT_BLUEROBOTICS_PRESSURE_SENSOR_DRIVER = 15
        [(jaia.ev).rest_api.presence = GUARANTEED];
    ERROR__FAILED__JAIABOT_ATLAS_SCIENTIFIC_EZO_EC_DRIVER = 16
        [(jaia.ev).rest_api.presence = GUARANTEED];
    ERROR__FAILED__JAIABOT_DRIVER_ARDUINO = 18
        [(jaia.ev).rest_api.presence = GUARANTEED];
    ERROR__FAILED__JAIABOT_ENGINEERING = 19
        [(jaia.ev).rest_api.presence = GUARANTEED];
    ERROR__FAILED__MOOS_MOOSDB = 20 [(jaia.ev).rest_api.presence = GUARANTEED];
    ERROR__FAILED__MOOS_PHELMIVP = 21
        [(jaia.ev).rest_api.presence = GUARANTEED];
    ERROR__FAILED__MOOS_UPROCESSWATCH = 22
        [(jaia.ev).rest_api.presence = GUARANTEED];
    ERROR__FAILED__MOOS_PNODEREPORTER = 23
        [(jaia.ev).rest_api.presence = GUARANTEED];
    ERROR__FAILED__PYTHON_JAIABOT_WEB_APP = 24
        [(jaia.ev).rest_api.presence = GUARANTEED];
    ERROR__FAILED__PYTHON_JAIABOT_IMU = 25
        [(jaia.ev).rest_api.presence = GUARANTEED];
    ERROR__FAILED__PYTHON_JAIABOT_PRESSURE_SENSOR = 26
        [(jaia.ev).rest_api.presence = GUARANTEED];
    ERROR__FAILED__PYTHON_JAIABOT_AS_EZO_EC = 27
        [(jaia.ev).rest_api.presence = GUARANTEED];
    ERROR__FAILED__JAIABOT_LOG_CONVERTER = 28
        [(jaia.ev).rest_api.presence = GUARANTEED];
    ERROR__FAILED__JAIABOT_DATA_VISION = 29
        [(jaia.ev).rest_api.presence = GUARANTEED];
    ERROR__FAILED__JAIABOT_SIMULATOR = 30
        [(jaia.ev).rest_api.presence = GUARANTEED];
    ERROR__FAILED__MOOS_SIM_MOOSDB = 31
        [(jaia.ev).rest_api.presence = GUARANTEED];
    ERROR__FAILED__MOOS_SIM_USIMMARINE = 32
        [(jaia.ev).rest_api.presence = GUARANTEED];
    ERROR__FAILED__GOBY_INTERVEHICLE_PORTAL = 33
        [(jaia.ev).rest_api.presence = GUARANTEED];
    ERROR__FAILED__JAIABOT_ECHO_DRIVER = 35
        [(jaia.ev).rest_api.presence = GUARANTEED];
    ERROR__FAILED__PYTHON_JAIABOT_ECHO = 36
        [(jaia.ev).rest_api.presence = GUARANTEED];
    ERROR__FAILED__JAIABOT_TSYS01_TEMPERATURE_SENSOR_DRIVER = 37
        [(jaia.ev).rest_api.presence = GUARANTEED];
    ERROR__FAILED__PYTHON_JAIABOT_TSYS01_TEMPERATURE_SENSOR_DRIVER = 38
        [(jaia.ev).rest_api.presence = GUARANTEED];
    ERROR__FAILED__PYTHON_JAIABOT_MOTOR_LISTENER = 39
        [(jaia.ev).rest_api.presence = GUARANTEED];
    ERROR__FAILED__JAIABOT_SENSORS = 40
        [(jaia.ev).rest_api.presence = GUARANTEED];
    ERROR__FAILED__JAIABOT_COMMS_MANAGER = 41
        [(jaia.ev).rest_api.presence = GUARANTEED];
    ERROR__FAILED__JAIABOT_CTD_MANAGER = 42
        [(jaia.ev).rest_api.presence = GUARANTEED];
    ERROR__FAILED__JAIABOT_UDP_GATEWAY = 43
        [(jaia.ev).rest_api.presence = GUARANTEED];
    ERROR__FAILED__JAIABOT_PPK = 44 [(jaia.ev).rest_api.presence = GUARANTEED];

    // from goby_coroner
    // must be "ERROR__NOT_RESPONDING__" + uppercase(application name)
    ERROR__NOT_RESPONDING__UNKNOWN_APP = 100
        [(jaia.ev).rest_api.presence = GUARANTEED];
    ERROR__NOT_RESPONDING__GOBYD = 101
        [(jaia.ev).rest_api.presence = GUARANTEED];
    ERROR__NOT_RESPONDING__GOBY_LIAISON = 102
        [(jaia.ev).rest_api.presence = GUARANTEED];
    ERROR__NOT_RESPONDING__GOBY_GPS = 103
        [(jaia.ev).rest_api.presence = GUARANTEED];
    ERROR__NOT_RESPONDING__GOBY_LOGGER = 104
        [(jaia.ev).rest_api.presence = GUARANTEED];
    ERROR__NOT_RESPONDING__GOBY_CORONER = 105
        [(jaia.ev).rest_api.presence = GUARANTEED];
    ERROR__NOT_RESPONDING__JAIABOT_HEALTH = 106
        [(jaia.ev).rest_api.presence = GUARANTEED];
    ERROR__NOT_RESPONDING__JAIABOT_METADATA = 107
        [(jaia.ev).rest_api.presence = GUARANTEED];
    ERROR__NOT_RESPONDING__JAIABOT_HUB_MANAGER = 108
        [(jaia.ev).rest_api.presence = GUARANTEED];
    ERROR__NOT_RESPONDING__JAIABOT_WEB_PORTAL = 109
        [(jaia.ev).rest_api.presence = GUARANTEED];
    ERROR__NOT_RESPONDING__JAIABOT_FUSION = 110
        [(jaia.ev).rest_api.presence = GUARANTEED];
    ERROR__NOT_RESPONDING__GOBY_MOOS_GATEWAY = 111
        [(jaia.ev).rest_api.presence = GUARANTEED];
    ERROR__NOT_RESPONDING__JAIABOT_MISSION_MANAGER = 112
        [(jaia.ev).rest_api.presence = GUARANTEED];
    ERROR__NOT_RESPONDING__JAIABOT_PID_CONTROL = 113
        [(jaia.ev).rest_api.presence = GUARANTEED];
    ERROR__NOT_RESPONDING__JAIABOT_BLUEROBOTICS_PRESSURE_SENSOR_DRIVER = 114
        [(jaia.ev).rest_api.presence = GUARANTEED];
    ERROR__NOT_RESPONDING__JAIABOT_ATLAS_SCIENTIFIC_EZO_EC_DRIVER = 115
        [(jaia.ev).rest_api.presence = GUARANTEED];
    ERROR__NOT_RESPONDING__JAIABOT_DRIVER_ARDUINO = 117
        [(jaia.ev).rest_api.presence = GUARANTEED];
    ERROR__NOT_RESPONDING__JAIABOT_ENGINEERING = 118
        [(jaia.ev).rest_api.presence = GUARANTEED];
    ERROR__NOT_RESPONDING__JAIABOT_SINGLE_THREAD_PATTERN = 119
        [(jaia.ev).rest_api.presence = GUARANTEED];
    ERROR__NOT_RESPONDING__JAIABOT_MULTI_THREAD_PATTERN = 120
        [(jaia.ev).rest_api.presence = GUARANTEED];
    ERROR__NOT_RESPONDING__JAIABOT_SIMULATOR = 121
        [(jaia.ev).rest_api.presence = GUARANTEED];
    ERROR__NOT_RESPONDING__GOBY_INTERVEHICLE_PORTAL = 122
        [(jaia.ev).rest_api.presence = GUARANTEED];
    ERROR__NOT_RESPONDING__JAIABOT_ECHO_DRIVER = 124
        [(jaia.ev).rest_api.presence = GUARANTEED];
    ERROR__NOT_RESPONDING__JAIABOT_TSYS01_TEMPERATURE_SENSOR_DRIVER = 125
        [(jaia.ev).rest_api.presence = GUARANTEED];
    ERROR__NOT_RESPONDING__JAIABOT_DRIVER_CAMERA = 126
        [(jaia.ev).rest_api.presence = GUARANTEED];
    ERROR__NOT_RESPONDING__JAIABOT_COMMS_MANAGER = 127
        [(jaia.ev).rest_api.presence = GUARANTEED];
    ERROR__NOT_RESPONDING__JAIABOT_IMU = 128
        [(jaia.ev).rest_api.presence = GUARANTEED];
    ERROR__NOT_RESPONDING__JAIABOT_TURNER_C_FLUOR_SENSOR_DRIVER = 129
        [(jaia.ev).rest_api.presence = GUARANTEED];
    ERROR__NOT_RESPONDING__JAIABOT_AML_SENSOR_DRIVER = 130
        [(jaia.ev).rest_api.presence = GUARANTEED];
    ERROR__NOT_RESPONDING__JAIABOT_CTD_MANAGER = 131
        [(jaia.ev).rest_api.presence = GUARANTEED];

    // from jaiabot_fusion
    ERROR__MISSING_DATA__GPS_FIX = 200
        [(jaia.ev).rest_api.presence = GUARANTEED];
    ERROR__MISSING_DATA__GPS_POSITION = 201
        [(jaia.ev).rest_api.presence = GUARANTEED];
    ERROR__MISSING_DATA__PRESSURE = 210
        [(jaia.ev).rest_api.presence = GUARANTEED];
    ERROR__MISSING_DATA__HEADING = 212
        [(jaia.ev).rest_api.presence = GUARANTEED];
    ERROR__MISSING_DATA__SPEED = 215 [(jaia.ev).rest_api.presence = GUARANTEED];
    ERROR__MISSING_DATA__COURSE = 216
        [(jaia.ev).rest_api.presence = GUARANTEED];
    ERROR__MISSING_DATA__CALIBRATION_SYS = 217
        [(jaia.ev).rest_api.presence = GUARANTEED];
    ERROR__MISSING_DATA__CALIBRATION_GYRO = 218
        [(jaia.ev).rest_api.presence = GUARANTEED];
    ERROR__MISSING_DATA__CALIBRATION_ACCEL = 219
        [(jaia.ev).rest_api.presence = GUARANTEED];
    ERROR__MISSING_DATA__CALIBRATION_MAG = 220
        [(jaia.ev).rest_api.presence = GUARANTEED];
    ERROR__NOT_CALIBRATED_SYS = 221 [(jaia.ev).rest_api.presence = GUARANTEED];
    ERROR__NOT_CALIBRATED_GYRO = 222 [(jaia.ev).rest_api.presence = GUARANTEED];
    ERROR__NOT_CALIBRATED_ACCEL = 223
        [(jaia.ev).rest_api.presence = GUARANTEED];
    ERROR__NOT_CALIBRATED_MAG = 224 [(jaia.ev).rest_api.presence = GUARANTEED];
    ERROR__NOT_CALIBRATED_IMU = 225 [(jaia.ev).rest_api.presence = GUARANTEED];

    // TODO: IMPLEMENT
    // from xbee driver
    ERROR__COMMS__NO_XBEE = 300;

    // from goby_moos_gateway
    ERROR__MOOS__HELMIVP_STATE_NOT_DRIVE = 400
        [(jaia.ev).rest_api.presence = GUARANTEED];
    ERROR__MOOS__HELMIVP_NO_DESIRED_DATA = 401
        [(jaia.ev).rest_api.presence = GUARANTEED];
    ERROR__MOOS__NO_DATA = 402 [(jaia.ev).rest_api.presence = GUARANTEED];

    // from jaiabot_health
    ERROR__SYSTEM__CANNOT_READ_MEMINFO = 500
        [(jaia.ev).rest_api.presence = GUARANTEED];
    ERROR__SYSTEM__RAM_SPACE_CRITICAL = 501
        [(jaia.ev).rest_api.presence = GUARANTEED];

    ERROR__SYSTEM__CANNOT_READ_SYSINFO = 502
        [(jaia.ev).rest_api.presence = GUARANTEED];
    ERROR__SYSTEM__CPU_LOAD_FACTOR_CRITICAL = 503
        [(jaia.ev).rest_api.presence = GUARANTEED];

    ERROR__SYSTEM__CANNOT_READ_DISK_USAGE = 504
        [(jaia.ev).rest_api.presence = GUARANTEED];
    ERROR__SYSTEM__ROOTFS_DISK_SPACE_CRITICAL = 505
        [(jaia.ev).rest_api.presence = GUARANTEED];
    ERROR__SYSTEM__DATA_DISK_SPACE_CRITICAL = 506
        [(jaia.ev).rest_api.presence = GUARANTEED];

    ERROR__SYSTEM__NTP_PEERS_QUERY_FAILED = 510
        [(jaia.ev).rest_api.presence = GUARANTEED];
    ERROR__SYSTEM__NTP_STATUS_QUERY_FAILED = 511
        [(jaia.ev).rest_api.presence = GUARANTEED];

    ERROR__VEHICLE__VERY_LOW_BATTERY = 600
        [(jaia.ev).rest_api.presence = GUARANTEED];
    ERROR__VEHICLE__CRITICALLY_LOW_BATTERY = 601
        [(jaia.ev).rest_api.presence = GUARANTEED];
    ERROR__VEHICLE__MISSING_DATA_BATTERY = 602
        [(jaia.ev).rest_api.presence = GUARANTEED];

    // arduino driver
    ERROR__VERSION__MISMATCH_ARDUINO = 700
        [(jaia.ev).rest_api.presence = GUARANTEED];
    ERROR__MISSING_DATA__ARDUINO_REPORT = 701
        [(jaia.ev).rest_api.presence = GUARANTEED];
    ERROR__VERSION__MISMATCH_INTERVEHICLE__UPGRADE_HUB = 702 [
        (jaia.ev).rest_api.presence = GUARANTEED
    ];  // INTERVEHICLE_API_VERSION_mismatch - hub version < bot_version OR this
        // hub version < other hub version
    ERROR__VERSION__MISMATCH_INTERVEHICLE__UPGRADE_BOT = 703 [
        (jaia.ev).rest_api.presence = GUARANTEED
    ];  // INTERVEHICLE_API_VERSION_mismatch - hub_version > bot_version
    ERROR__ARDUINO_CONNECTION_FAILED = 704
        [(jaia.ev).rest_api.presence = GUARANTEED];
    ERROR__VERSION__MISMATCH_INTERVEHICLE__UPGRADE_OTHER_HUB = 705
        [(jaia.ev).rest_api.presence =
             GUARANTEED];  // INTERVEHICLE_API_VERSION_mismatch - other hub
                           // version < this hub version

    // jaiabot_sensor
    ERROR__INIT_FAILED__BLUE_ROBOTICS__BAR30 = 800
        [(jaia.ev).rest_api.presence = GUARANTEED];
    ERROR__MISSING_DATA__BLUEROBOTICS_BAR30_DATA = 801
        [(jaia.ev).rest_api.presence = GUARANTEED];
}

enum Warning
{
    // from jaiabot_fusion
    WARNING__TOO_MANY_WARNINGS_TO_REPORT_ALL = 0
        [(jaia.ev).rest_api.presence = GUARANTEED];

    // from jaiabot_coroner
    WARNING__NOT_RESPONDING__UNKNOWN_APP = 100
        [(jaia.ev).rest_api.presence = GUARANTEED];
    WARNING__NOT_RESPONDING__JAIABOT_ATLAS_SCIENTIFIC_EZO_EC_DRIVER = 101
        [(jaia.ev).rest_api.presence = GUARANTEED];
    WARNING__NOT_RESPONDING__JAIABOT_BLUEROBOTICS_PRESSURE_SENSOR_DRIVER = 102
        [(jaia.ev).rest_api.presence = GUARANTEED];
    WARNING__NOT_RESPONDING__JAIABOT_ADAFRUIT_BNO055_DRIVER = 103
        [(jaia.ev).rest_api.presence = GUARANTEED];
    WARNING__NOT_RESPONDING__JAIABOT_ADAFRUIT_BNO085_DRIVER = 104
        [(jaia.ev).rest_api.presence = GUARANTEED];
    WARNING__NOT_RESPONDING__JAIABOT_ECHO_DRIVER = 105
        [(jaia.ev).rest_api.presence = GUARANTEED];
    WARNING__NOT_RESPONDING__JAIABOT_TSYS01_TEMPERATURE_SENSOR_DRIVER = 106
        [(jaia.ev).rest_api.presence = GUARANTEED];
    WARNING__NOT_RESPONDING__JAIABOT_AML_SENSOR_DRIVER = 107
        [(jaia.ev).rest_api.presence = GUARANTEED];

    // from jaiabot_fusion
    WARNING__MISSING_DATA__PITCH = 200
        [(jaia.ev).rest_api.presence = GUARANTEED];
    WARNING__MISSING_DATA__ROLL = 201
        [(jaia.ev).rest_api.presence = GUARANTEED];
    WARNING__MISSING_DATA__TEMPERATURE = 202
        [(jaia.ev).rest_api.presence = GUARANTEED];
    WARNING__MISSING_DATA__COURSE = 216
        [(jaia.ev).rest_api.presence = GUARANTEED];
    WARNING__NOT_CALIBRATED_SYS = 221
        [(jaia.ev).rest_api.presence = GUARANTEED];
    WARNING__IMU_ISSUE = 222 [(jaia.ev).rest_api.presence = GUARANTEED];

    // TODO: IMPLEMENT
    WARNING__TEMPERATURE__ARDUINO_TOO_HIGH = 210
        [(jaia.ev).rest_api.presence = GUARANTEED];
    WARNING__TEMPERATURE__LINUX_TOO_HIGH = 211
        [(jaia.ev).rest_api.presence = GUARANTEED];

    // TODO: IMPLEMENT
    // from xbee driver
    WARNING__COMMS_LOW_SIGNAL_STRENGTH = 300
        [(jaia.ev).rest_api.presence = GUARANTEED];

    // from jaiabot_health
    WARNING__VEHICLE__LOW_BATTERY = 400
        [(jaia.ev).rest_api.presence = GUARANTEED];

    WARNING__SYSTEM__NTP_NOT_SYNCHRONIZED = 500
        [(jaia.ev).rest_api.presence = GUARANTEED];
    WARNING__SYSTEM__NTP_OFFSET_HIGH = 501
        [(jaia.ev).rest_api.presence = GUARANTEED];
    WARNING__SYSTEM__NTP_JITTER_HIGH = 502
        [(jaia.ev).rest_api.presence = GUARANTEED];
    WARNING__SYSTEM__RAM_SPACE_LOW = 503
        [(jaia.ev).rest_api.presence = GUARANTEED];
    WARNING__SYSTEM__CPU_LOAD_FACTOR_HIGH = 504
        [(jaia.ev).rest_api.presence = GUARANTEED];
    WARNING__SYSTEM__ROOTFS_DISK_SPACE_LOW = 505
        [(jaia.ev).rest_api.presence = GUARANTEED];
    WARNING__SYSTEM__DATA_DISK_SPACE_LOW = 506
        [(jaia.ev).rest_api.presence = GUARANTEED];

    // from Motor Status Thread
    WARNING__NOT_RESPONDING__JAIABOT_RPM_LISTENER = 600
        [(jaia.ev).rest_api.presence = GUARANTEED];
    WARNING__NOT_RESPONDING__JAIABOT_ARDUINO_MOTOR_TEMP = 601
        [(jaia.ev).rest_api.presence = GUARANTEED];

    // from jaiabot_mission_manager
    WARNING__MISSION__INFEASIBLE_MISSION__TRANSIT_MUST_HAVE_A_GOAL = 700
        [(jaia.ev).rest_api.presence = GUARANTEED];
    WARNING__MISSION__INFEASIBLE_MISSION__TRANSIT_CANNOT_RECOVER_AT_FINAL_GOAL_WITHOUT_A_GOAL =
        701 [(jaia.ev).rest_api.presence = GUARANTEED];
    WARNING__MISSION__INFEASIBLE_MISSION__MUST_HAVE_RECOVERY_LOCATION_IF_NOT_RECOVERING_AT_FINAL_GOAL =
        702 [(jaia.ev).rest_api.presence = GUARANTEED];
    WARNING__MISSION__INFEASIBLE_MISSION__MINIMUM_BOTTOM_DEPTH_REACHED = 703
        [(jaia.ev).rest_api.presence = GUARANTEED];
    WARNING__MISSION__INFEASIBLE_MISSION__GOAL_DESIRED_DEPTH_EXCEEDED_MAX = 704
        [(jaia.ev).rest_api.presence = GUARANTEED];
    WARNING__VEHICLE__NO_FORWARD_PROGRESS = 705
        [(jaia.ev).rest_api.presence = GUARANTEED];

    WARNING__MISSION__DATA_OFFLOAD_FAILED = 720
        [(jaia.ev).rest_api.presence = GUARANTEED];
    WARNING__MISSION__DATA__GPS_FIX_DEGRADED = 721
        [(jaia.ev).rest_api.presence = GUARANTEED];
    WARNING__MISSION__DATA_PRE_OFFLOAD_FAILED = 722
        [(jaia.ev).rest_api.presence = GUARANTEED];
    WARNING__MISSION__DATA_POST_OFFLOAD_FAILED = 723
        [(jaia.ev).rest_api.presence = GUARANTEED];

    // from jaiabot_sensor

    // from jaiabot_sensors
    WARNING__INIT_FAILED__ATLAS_SCIENTIFIC__OEM_DO = 800
        [(jaia.ev).rest_api.presence = GUARANTEED];
    WARNING__INIT_FAILED__ATLAS_SCIENTIFIC__OEM_EC = 801
        [(jaia.ev).rest_api.presence = GUARANTEED];
    WARNING__INIT_FAILED__ATLAS_SCIENTIFIC__OEM_PH = 802
        [(jaia.ev).rest_api.presence = GUARANTEED];
    WARNING__INIT_FAILED__TURNER__C_FLUOR = 803
        [(jaia.ev).rest_api.presence = GUARANTEED];
    WARNING__MISSING_DATA__ATLAS_OEM_EC_DATA = 804
        [(jaia.ev).rest_api.presence = GUARANTEED];
    WARNING__MISSING_DATA__ATLAS_OEM_PH_DATA = 805
        [(jaia.ev).rest_api.presence = GUARANTEED];
    WARNING__MISSING_DATA__ATLAS_OEM_DO_DATA = 806
        [(jaia.ev).rest_api.presence = GUARANTEED];
    WARNING__MISSING_DATA__TURNER_C_FLUOR_DATA = 807
        [(jaia.ev).rest_api.presence = GUARANTEED];
    WARNING__MISSING_DATA__AML_DATA = 808
        [(jaia.ev).rest_api.presence = GUARANTEED];
    WARNING__INIT_FAILED__AML = 809 [(jaia.ev).rest_api.presence = GUARANTEED];
}

message LinuxHardwareStatus
{
    option (dccl.msg) = {
        unit_system: "si"
    };

    message Processor
    {
        // from sysinfo
        message LoadAverages
        {
            required float one_min = 1;
            required float five_min = 2;
            required float fifteen_min = 3;
        }
        optional LoadAverages loads = 10;

        optional int32 num_processes = 15;

        // from nproc
        optional int32 num_processors = 20;
    }

    message Information
    {
        required uint64 total = 1 [(dccl.field) = {
            units { prefix: "kilo" unit: "information::byte" }
        }];
        required uint64 available = 2 [(dccl.field) = {
            units { prefix: "kilo" unit: "information::byte" }
        }];
        required float use_percent = 3;
    }

    message Memory
    {
        // from sysinfo
        required Information ram = 1;
        required Information swap = 2;
    }

    message Disk
    {
        // from boost filesystem
        optional Information rootfs = 1;
        optional Information data = 2;
    }

    message WiFi
    {
        required bool is_connected = 1;
        optional uint32 link_quality = 2;
        optional uint32 link_quality_percentage = 3;
        optional int32 signal_level = 4;
        optional int32 noise_level = 5;
    }

    optional int32 uptime = 10
        [(dccl.field) = { units { base_dimensions: "T" } }];
    optional Processor processor = 20;
    optional Memory memory = 30;
    optional Disk disk = 40;
    optional WiFi wifi = 50;
}

message NTPStatus
{
    option (dccl.msg) = {
        unit_system: "si"
    };
    // from ntpq -c rv 0
    enum SyncSource
    {
        SYNC_UNKNOWN = -1;
        SYNC_UNSPECIFIED = 0;
        SYNC_PPS = 1;
        SYNC_LF_RADIO = 2;
        SYNC_HF_RADIO = 3;
        SYNC_UHF_RADIO = 4;
        SYNC_LOCAL = 5;
        SYNC_NTP = 6;
        SYNC_OTHER = 7;
        SYNC_WRISTWATCH = 8;
        SYNC_TELEPHONE = 9;
    }

    optional SyncSource sync_source = 10 [default = SYNC_UNKNOWN];

    enum LeapIndicator
    {
        LEAP_UNKNOWN = -1;
        LEAP_NONE = 0x00;
        LEAP_LAST_MINUTE_HAS_61_SECONDS = 0x01;
        LEAP_LAST_MINUTE_HAS_59_SECONDS = 0x02;
        LEAP_CLOCK_NOT_SYNCHRONIZED = 0x03;
    }
    optional LeapIndicator leap_indicator = 11 [default = LEAP_UNKNOWN];
    optional int32 system_event_counter = 12 [default = 0];
    enum NTPSystemEvent
    {
        NTP_SYSTEM_EVENT_UNKNOWN = -1;
        NTP_SYSTEM_EVENT_UNSPECIFIED = 0x0;
        NTP_SYSTEM_FREQ_NOT_SET = 0x1;
        NTP_SYSTEM_FREQ_SET = 0x2;
        NTP_SYSTEM_SPIKE_DETECT = 0x3;
        NTP_SYSTEM_FREQ_MODE = 0x4;
        NTP_SYSTEM_CLOCK_SYNC = 0x5;
        NTP_SYSTEM_RESTART = 0x6;
        NTP_SYSTEM_PANIC_STOP = 0x7;
        NTP_SYSTEM_NO_SYSTEM_PEER = 0x8;
        NTP_SYSTEM_LEAP_ARMED = 0x9;
        NTP_SYSTEM_LEAP_DISARMED = 0xa;
        NTP_SYSTEM_LEAP_EVENT = 0xb;
        NTP_SYSTEM_CLOCK_STEP = 0xc;
        NTP_SYSTEM_KERNEL_INFO = 0xd;
        NTP_SYSTEM_LEAPSECOND_VALUES_UPDATE_FROM_FILE = 0xe;
        NTP_SYSTEM_STALE_LEAPSECOND_VALUES = 0xf;
    }
    optional NTPSystemEvent last_system_event = 13
        [default = NTP_SYSTEM_EVENT_UNKNOWN];

    // from ntpq -p
    message NTPPeer
    {
        enum TallyCode
        {
            PEER_CODE_UNKNOWN = -1;
            PEER_NOT_VALID = 0x20;                       // ' '
            PEER_DISCARDED_BY_INTERSECTION = 0x78;       // 'x'
            PEER_DISCARDED_BY_TABLE_OVERFLOW = 0x2E;     // '.'
            PEER_DISCARDED_BY_CLUSTER_ALGORITHM = 0x2D;  // '-'
            PEER_INCLUDED_IN_COMBINE = 0x2B;             // '+'
            PEER_ALTERNATIVE_BACKUP = 0x23;              // '#'
            PEER_SYSTEM_SYNC_SOURCE = 0x2A;              // '*'
            PEER_PPS_SYNC = 0x6F;                        // 'o'
        }

        required TallyCode tally_code = 1 [default = PEER_CODE_UNKNOWN];
        required string remote = 2;
        required string refid = 3;
        optional int32 stratum = 4 [default = 16];
        optional int32 when = 5
            [default = -1, (dccl.field) = { units { base_dimensions: "T" } }];
        optional int32 poll = 6
            [default = -1, (dccl.field) = { units { base_dimensions: "T" } }];
        // bitmask
        optional int32 reach = 7 [default = 0];
        optional float delay = 8 [
            default = nan,
            (dccl.field) = { units { prefix: "milli" base_dimensions: "T" } }
        ];
        optional float offset = 9 [
            default = nan,
            (dccl.field) = { units { prefix: "milli" base_dimensions: "T" } }
        ];
        optional float jitter = 10 [
            default = nan,
            (dccl.field) = { units { prefix: "milli" base_dimensions: "T" } }
        ];
    }
    optional NTPPeer system_sync_peer = 20;
    repeated NTPPeer peer = 21;
}

message HelmIVPStatus
{
    option (dccl.msg) = {
        unit_system: "si"
    };
    optional string helm_ivp_state = 1 [default = "PARK"];
    optional bool helm_ivp_desired_speed = 2 [default = false];
    optional bool helm_ivp_desired_heading = 3 [default = false];
    optional bool helm_ivp_desired_depth = 4 [default = false];
    optional bool helm_ivp_data = 5 [default = false];
}

message ThreadHealth
{
    repeated Error error = 1;
    repeated Warning warning = 2;
}

extend goby.middleware.protobuf.ThreadHealth
{
    optional ThreadHealth jaiabot_thread = 1000;
}

message VehicleHealth {}

extend goby.middleware.protobuf.VehicleHealth
{
    optional VehicleHealth jaiabot_vehicle = 1000;
}

message SystemdStartReport
{
    required Error clear_error =
        1;  // the corresponding ERROR__FAILED__* to clear (if exists)
}

message SystemdStopReport
{
    enum ServiceResult
    {
        SERVICE_RESULT_UNKNOWN = 0;
        SERVICE_RESULT_SUCCESS = 1;
        SERVICE_RESULT_PROTOCOL = 2;
        SERVICE_RESULT_TIMEOUT = 3;
        SERVICE_RESULT_EXIT_CODE = 4;
        SERVICE_RESULT_SIGNAL = 5;
        SERVICE_RESULT_CORE_DUMP = 6;
        SERVICE_RESULT_WATCHDOG = 7;
        SERVICE_RESULT_START_LIMIT_HIT = 8;
        SERVICE_RESULT_RESOURCES = 9;
    }
    required ServiceResult result = 1;
    required Error error = 2;  // the corresponding ERROR__FAILED__*
    optional string journal_dump_file =
        3;  // if failed, the journal snippet from last boot was written here
}

message SystemdReportAck
{
    required Error error_ack =
        1;  // which app this relates to, by its corresponding error value
}
