syntax = "proto3";

import "pymammotion/proto/dev_net.proto";

enum Operation {
  WRITE = 0;
  READ = 1;
  ERASE = 2;
}

enum OffPartId {
  OFF_PART_DL_IMG = 0;
  OFF_PART_UPDINFO_BACK = 1;
  OFF_PART_UPDINFO = 2;
  OFF_PART_NAKEDB = 3;
  OFF_PART_FLASHDB = 4;
  OFF_PART_UPD_APP_IMG = 5;
  OFF_PART_UPD_BMS_IMG = 6;
  OFF_PART_UPD_TMP_IMG = 7;
  OFF_PART_DEV_INFO = 8;
  OFF_PART_NAKEDB_BACK = 9;
  OFF_PART_MAX = 10;
}

enum QCAppTestId {
  QC_APP_ITEM_ON_CHARGESATSTION = 0;
  QC_APP_TEST_X3_SPEAKER = 1;
  QC_APP_TEST_STATIC_OBSTACLE_DETECTION = 2;
  QC_APP_TEST_CHARGESTATION_TEMP = 3;
  QC_APP_ITEM_KEY = 4;
  QC_APP_TEST_BUMPER_FRONTLEFT = 5;
  QC_APP_TEST_BUMPER_FRONTRIGHT = 6;
  QC_APP_TEST_STOP = 7;
  QC_APP_TEST_UNLOCK = 8;
  QC_APP_TEST_BUZZ = 9;
  QC_APP_TEST_LIFT = 10;
  QC_APP_ITEM_SENEOR = 11;
  QC_APP_TEST_ROLL_LEFT = 12;
  QC_APP_TEST_ROLL_RIGHT = 13;
  QC_APP_TEST_ULTRA_UNCOVER = 14;
  QC_APP_TEST_ULTRA0_COVER = 15;
  QC_APP_TEST_ULTRA1_COVER = 16;
  QC_APP_TEST_ULTRA2_COVER = 17;
  QC_APP_TEST_RAIN = 18;
  QC_APP_ITEM_SQ = 19;
  QC_APP_TEST_BLE_RSSI = 20;
  QC_APP_TEST_SATELLITES_ROVER = 21;
  QC_APP_TEST_SATELLITES_REF_STATION_L1 = 22;
  QC_APP_TEST_SATELLITES_REF_STATION_L2 = 23;
  QC_APP_TEST_SATELLITES_COMMON_VIEW = 24;
  QC_APP_TEST_CNO_ROVER = 25;
  QC_APP_TEST_CNO_REF_STATION = 26;
  QC_APP_TEST_REF_STATION_LINK_STATUS = 27;
  QC_APP_TEST_LOCATION_STATE = 28;
  QC_APP_TEST_CHARGE_STATUS = 29;
  QC_APP_TEST_PPS_EXTI_COUNT = 30;
  QC_APP_TEST_SAFE_KEY = 50;
  QC_APP_TEST_LORA_RSSI = 60;
  QC_APP_TEST_WIPER_TEST = 80;
  QC_APP_TEST_HEADLAMP_TEST = 81;
  QC_APP_TEST_COMPLETE_SIGNAL = 99;
  QC_APP_TEST_MAX = 100;
}

enum rtk_used_type {
  RTK_USED_LORA = 0;
  RTK_USED_INTERNET = 1;
  RTK_USED_NRTK = 2;
}

enum net_used_type {
  NET_USED_TYPE_NONE = 0;
  NET_USED_TYPE_WIFI = 1;
  NET_USED_TYPE_MNET = 2;
}

enum rpt_info_type {
  RIT_CONNECT = 0;
  RIT_DEV_STA = 1;
  RIT_RTK = 2;
  RIT_DEV_LOCAL = 3;
  RIT_WORK = 4;
  RIT_FW_INFO = 5;
  RIT_MAINTAIN = 6;
  RIT_VISION_POINT = 7;
  RIT_VIO = 8;
  RIT_VISION_STATISTIC = 9;
  RIT_BASESTATION_INFO = 10;
  RIT_CUTTER_INFO = 11;
}

enum rpt_act {
  RPT_START = 0;
  RPT_STOP = 1;
  RPT_KEEP = 2;
}

enum Command_Result {
  RS_OK = 0;
  RS_FAIL_MAGIC = 1;
  RS_FAIL_OTA = 2;
  RS_FAIL_SLOPE = 3;
}

message SysBatUp {
  int32 batVal = 1;
}

message SysWorkState {
  int32 deviceState = 1;
  int32 chargeState = 2;
  int64 cmHash = 3;
  int64 pathHash = 4;
}

message SysSetTimeZone {
  int32 timeStamp = 1;
  int32 timeArea = 2;
}

message SysSetDateTime {
  int32 Year = 1;
  int32 Month = 2;
  int32 Date = 3;
  int32 Week = 4;
  int32 Hours = 5;
  int32 Minutes = 6;
  int32 Seconds = 7;
  int32 timeZone = 8;
  int32 daylight = 9;
}

message SysJobPlan {
  int64 jobId = 1;
  int32 jobMode = 2;
  int32 rainTactics = 3;
  int32 knifeHeight = 4;
}

message SysDevErrCode {
  int32 errorCode = 1;
}

message SysBoardType {
  int32 boardType = 1;
}

message SysSwVersion {
  int32 boardType = 1;
  int32 versionLen = 2;
}

message SysDelJobPlan {
  string deviceId = 1;
  string planId = 2;
}

message SysJobPlanTime {
  int64 planId = 1;
  int32 start_job_time = 2;
  int32 end_job_time = 3;
  int32 time_in_day = 4;
  int32 job_plan_mode = 5;
  int32 job_plan_enable = 6;
  repeated int32 weekDay = 7;
  repeated int32 timeInWeekDay = 8;
  int32 everyDay = 9;
  SysJobPlan job_plan = 10;
}

message SysMowInfo {
  int32 deviceState = 1;
  int32 batVal = 2;
  int32 knifeHeight = 3;
  int32 RTKstatus = 4;
  int32 RTKstars = 5;
}

message SysOptiLineAck {
  int32 responesCmd = 1;
  int32 currentFrame = 2;
}

message SysCommCmd {
  int32 rw = 1;
  int32 id = 2;
  int32 context = 3;
}

message SysUploadFileProgress {
  string bizId = 1;
  int32 result = 2;
  int32 progress = 3;
}

message SysErrorCode {
  int32 code_no = 1;
}

message SysBorder {
  int32 borderval = 1;
}

message SysPlanJobStatus {
  int32 planjob_status = 1;
}

message SysKnifeControl {
  int32 knife_status = 1;
  int32 knife_height = 2;
}

message SysResetSystemStatus {
  int32 reset_staus = 1;
}

message SysResetBladeUsedTimeStatus {
  int32 reset_blade_used_time_status = 1;
}

message TimeCtrlLight {
  int32 operate = 1;
  int32 enable = 2;
  int32 start_hour = 3;
  int32 start_min = 4;
  int32 end_hour = 5;
  int32 end_min = 6;
  int32 action = 7;
}

message vision_point_msg {
  float x = 1;
  float y = 2;
  float z = 3;
}

message vision_point_info_msg {
  int32 label = 1;
  int32 num = 2;
  repeated vision_point_msg vision_point = 3;
}

message vio_to_app_info_msg {
  double x = 1;
  double y = 2;
  double heading = 3;
  int32 vio_state = 4;
  int32 brightness = 5;
  int32 detect_feature_num = 6;
  int32 track_feature_num = 7;
}

message vision_statistic_msg {
  float mean = 1;
  float var = 2;
}

message vision_statistic_info_msg {
  double timestamp = 1;
  int32 num = 2;
  repeated vision_statistic_msg vision_statistics = 3;
}

message systemRapidStateTunnel_msg {
  repeated int64 rapid_state_data = 1;
  repeated vision_point_info_msg vision_point_info = 2;
  vio_to_app_info_msg vio_to_app_info = 3;
  vision_statistic_info_msg vision_statistic_info = 4;
}

message systemTardStateTunnel_msg {
  repeated int64 tard_state_data = 1;
}

message systemUpdateBuf_msg {
  repeated int64 update_buf_data = 1;
}

message SysOffChipFlash {
  Operation op = 1;
  OffPartId id = 2;
  uint32 start_addr = 3;
  uint32 offset = 4;
  int32 length = 5;
  bytes data = 6;
  int32 code = 7;
  string msg = 8;
}

message systemTmpCycleTx_msg {
  repeated int64 cycle_tx_data = 1;
}

message LoraCfgReq {
  int32 op = 1;
  string cfg = 2;
}

message LoraCfgRsp {
  int32 result = 1;
  int32 op = 2;
  string cfg = 3;
  bytes fac_cfg = 4;
}

message mod_fw_info {
  int32 type = 1;
  string identify = 2;
  string version = 3;
}

message device_fw_info {
  int32 result = 1;
  string version = 2;
  repeated mod_fw_info mod = 3;
}

message mow_to_app_info_t {
  int32 type = 1;
  int32 cmd = 2;
  repeated int32 mow_data = 3;
}

message device_product_type_info_t {
  int32 result = 1;
  string main_product_type = 2;
  string sub_product_type = 3;
}

message QCAppTestExcept {
  string except_type = 1;
  repeated QCAppTestConditions conditions = 2;
}

message QCAppTestConditions {
  string cond_type = 1;
  int32 int_val = 2;
  float float_val = 3;
  double double_val = 4;
  string string_val = 5;
}

message mow_to_app_qctools_info_t {
  QCAppTestId type = 1;
  int32 timeOfDuration = 2;
  int32 result = 3;
  string result_details = 4;
  repeated QCAppTestExcept except = 5;
}

message mCtrlSimulationCmdData {
  int32 subCmd = 1;
  int32 param_id = 2;
  repeated int32 param_value = 3;
}

message app_to_dev_get_mqtt_config_t {
  int32 get_mqtt_config = 1;
}

message dev_to_app_get_mqtt_config_t {
  int32 rtk_status = 1;
  string rtk_base_num = 2;
}

message app_to_dev_set_mqtt_rtk_t {
  rtk_used_type set_rtk_mode = 1;
  int32 stop_nrtk_flag = 2;
  int32 set_nrtk_net_mode = 3;
}

message dev_to_app_set_mqtt_rtk_t {
  int32 set_rtk_mode_error = 1;
}

message rpt_lora {
  int32 pair_code_scan = 1;
  int32 pair_code_channel = 2;
  int32 pair_code_locid = 3;
  int32 pair_code_netid = 4;
  int32 lora_connection_status = 5;
}

message mqtt_rtk_connect {
  rtk_used_type rtk_switch = 1;
  int32 rtk_channel = 2;
  string rtk_base_num = 3;
  double latitude = 4;
  double longitude = 5;
  int32 nrtk_map_convert_status = 6;
  int32 nrtk_net_mode = 7;
  int32 new_rtk_mode = 8;
}

message pos_score {
  uint32 rover_score = 1;
  uint32 rover_level = 2;
  uint32 base_score = 3;
  uint32 base_level = 4;
  uint32 base_moved = 5;
  uint32 base_moving = 6;
}

message rpt_rtk {
  int32 status = 1;
  int32 pos_level = 2;
  int32 gps_stars = 3;
  int32 age = 4;
  int32 lat_std = 5;
  int32 lon_std = 6;
  int32 l2_stars = 7;
  int64 dis_status = 8;
  int64 top4_total_mean = 9;
  int32 co_view_stars = 10;
  int32 reset = 11;
  rpt_lora lora_info = 12;
  mqtt_rtk_connect mqtt_rtk_info = 13;
  pos_score score_info = 14;
}

message rpt_dev_location {
  int32 real_pos_x = 1;
  int32 real_pos_y = 2;
  int32 real_toward = 3;
  int32 pos_type = 4;
  int64 zone_hash = 5;
  int64 bol_hash = 6;
}

message vio_survival_info_t {
  float vio_survival_distance = 1;
}

message collector_status_t {
  int32 collector_installation_status = 1;
}

message lock_state_t {
  uint32 lock_state = 1;
}

message rpt_dev_status {
  int32 sys_status = 1;
  int32 charge_state = 2;
  int32 battery_val = 3;
  int32 sensor_status = 4;
  int32 last_status = 5;
  int64 sys_time_stamp = 6;
  int32 vslam_status = 7;
  MnetInfo mnet_info = 8;
  vio_survival_info_t vio_survival_info = 9;
  collector_status_t collector_status = 10;
  lock_state_t lock_state = 11;
  uint32 self_check_status = 12;
  fpv_to_app_info_t fpv_info = 13;
}

message net_speed {
  uint32 download = 1;
  uint32 upload = 2;
}

message rpt_connect_status {
  int32 connect_type = 1;
  int32 ble_rssi = 2;
  int32 wifi_rssi = 3;
  int32 link_type = 4;
  int32 mnet_rssi = 5;
  int32 mnet_inet = 6;
  net_used_type used_net = 7;
  MnetCfg mnet_cfg = 8;
  net_speed dev_net_speed = 9;
  bool iot_wifi_report = 10;
  int32 iot_con_status = 11;
  int32 wifi_con_status = 12;
  int32 wifi_is_available = 13;
}

message nav_heading_state_t {
  uint32 heading_state = 1;
}

message rpt_work {
  int32 plan = 1;
  int64 path_hash = 2;
  int32 progress = 3;
  int32 area = 4;
  int32 bp_info = 5;
  int64 bp_hash = 6;
  int32 bp_pos_x = 7;
  int32 bp_pos_y = 8;
  int64 real_path_num = 9;
  int32 path_pos_x = 10;
  int32 path_pos_y = 11;
  int64 ub_zone_hash = 12;
  int64 ub_path_hash = 13;
  int64 init_cfg_hash = 14;
  int64 ub_ecode_hash = 15;
  int32 nav_run_mode = 16;
  int64 test_mode_status = 17;
  int32 man_run_speed = 18;
  int32 nav_edit_status = 19;
  int32 knife_height = 20;
  nav_heading_state_t nav_heading_state = 21;
  float cutter_offset = 22;
  float cutter_width = 23;
}

message blade_used {
  int32 blade_used_time = 1;
  int32 blade_used_warn_time = 2;
}

message user_set_blade_used_warn_time {
  int32 blade_used_warn_time = 1;
}

message rpt_maintain {
  int64 mileage = 1;
  int32 work_time = 2;
  int32 bat_cycles = 3;
  blade_used blade_used_time = 4;
}

message fpv_to_app_info_t {
  int32 fpv_flag = 1;
  int32 wifi_available = 2;
  int32 mobile_net_available = 3;
}

message rpt_basestation_info {
  uint32 ver_major = 1;
  uint32 ver_minor = 2;
  uint32 ver_patch = 3;
  uint32 ver_build = 4;
  uint32 basestation_status = 5;
  uint32 connect_status_since_poweron = 6;
}

message report_info_cfg {
  rpt_act act = 1;
  int32 timeout = 2;
  int32 period = 3;
  int32 no_change_period = 4;
  int32 count = 5;
  repeated rpt_info_type sub = 6;
}

message report_info_data {
  rpt_connect_status connect = 1;
  rpt_dev_status dev = 2;
  rpt_rtk rtk = 3;
  repeated rpt_dev_location locations = 4;
  rpt_work work = 5;
  device_fw_info fw_info = 6;
  rpt_maintain maintain = 7;
  repeated vision_point_info_msg vision_point_info = 8;
  vio_to_app_info_msg vio_to_app_info = 9;
  vision_statistic_info_msg vision_statistic_info = 10;
  rpt_basestation_info basestation_info = 11;
  rpt_cutter_rpm cutter_work_mode_info = 12;
}

message debug_common_report_t {
  string m_name = 1;
  string key = 2;
  string value = 3;
  int64 gen_time = 4;
}

message debug_errocode_report_t {
  int32 code = 1;
  string mname = 2;
  string value = 3;
  int64 gen_time = 4;
}

message debug_enable_t {
  int32 enbale = 1;
}

message debug_res_cfg_ability_t {
  int32 total_keys = 1;
  int32 cur_key_id = 2;
  string keys = 3;
  string value = 4;
}

message debug_cfg_read_t {
  string key = 1;
  string value = 2;
}

message debug_cfg_write_t {
  string key = 1;
  string value = 2;
}

message msgbus_pkt {
  int32 type = 1;
  int32 typeCommand = 2;
  int32 recvDeviceId = 3;
  int32 sendDeviceId = 4;
  int32 dataLength = 5;
  string data = 6;
  int32 ctrl = 7;
  int32 flag = 8;
  int32 seqs = 9;
}

message response_set_mode_t {
  int32 statue = 1;
  int32 set_work_mode = 2;
  int32 cur_work_mode = 3;
  int64 start_work_time = 4;
  int64 end_work_time = 5;
  int32 interruptflag = 6;
  int32 cur_work_time = 7;
}

message rpt_cutter_rpm {
  int32 current_cutter_mode = 1;
  int32 current_cutter_rpm = 2;
}

message dev_statue_t {
  int32 sys_status = 1;
  int32 charge_status = 2;
  int32 bat_val = 3;
  int32 wheel_status = 4;
  int32 pump_status = 5;
  int32 work_mode = 6;
  int32 model = 7;
  int32 ble_rssi = 8;
  int32 wifi_rssi = 9;
  int32 wifi_connect_status = 10;
  int32 iot_connect_status = 11;
  int32 wifi_available = 12;
}

message report_info_t {
  dev_statue_t dev_status = 1;
}

message work_mode_t {
  int32 work_mode = 1;
}

message special_mode_t {
  int32 stair_mode = 1;
  int32 violent_mode = 2;
  int32 berthing_mode = 3;
}

message set_peripherals_t {
  int32 buzz_enable = 1;
}

message debug_sun_time_t {
  int32 subCmd = 1;
  int32 sunRiseTime = 2;
  int32 sunSetTime = 3;
}

message remote_reset_req_t {
  int32 magic = 1;
  int64 bizid = 2;
  int32 reset_mode = 3;
  int32 force_reset = 4;
  int64 account = 5;
}

message remote_reset_rsp_t {
  int32 magic = 1;
  int64 bizid = 2;
  Command_Result result = 3;
}

message MctlSys {
  oneof SubSysMsg {
    SysBatUp toapp_batinfo = 1;
    SysWorkState toapp_work_state = 2;
    SysSetTimeZone todev_time_zone = 3;
    SysSetDateTime todev_data_time = 4;
    SysJobPlan job_plan = 6;
    SysDevErrCode toapp_err_code = 7;
    SysJobPlanTime todev_job_plan_time = 10;
    SysMowInfo toapp_mow_info = 11;
    SysCommCmd bidire_comm_cmd = 12;
    int64 plan_job_del = 14;
    SysBorder border = 15;
    SysPlanJobStatus toapp_plan_status = 18;
    SysUploadFileProgress toapp_ul_fprogress = 19;
    SysDelJobPlan todev_deljobplan = 20;
    int32 todev_mow_info_up = 21;
    SysKnifeControl todev_knife_ctrl = 22;
    int32 todev_reset_system = 23;
    SysResetSystemStatus todev_reset_system_status = 24;
    systemRapidStateTunnel_msg systemRapidStateTunnel = 25;
    systemTardStateTunnel_msg systemTardStateTunnel = 26;
    systemUpdateBuf_msg systemUpdateBuf = 27;
    TimeCtrlLight todev_time_ctrl_light = 28;
    systemTmpCycleTx_msg systemTmpCycleTx = 29;
    SysOffChipFlash todev_off_chip_flash = 30;
    int32 todev_get_dev_fw_info = 31;
    device_fw_info toapp_dev_fw_info = 32;
    LoraCfgReq todev_lora_cfg_req = 33;
    LoraCfgRsp toapp_lora_cfg_rsp = 34;
    mow_to_app_info_t mow_to_app_info = 35;
    device_product_type_info_t device_product_type_info = 36;
    mow_to_app_qctools_info_t mow_to_app_qctools_info = 37;
    report_info_cfg todev_report_cfg = 38;
    report_info_data toapp_report_data = 39;
    mCtrlSimulationCmdData simulation_cmd = 42;
    app_to_dev_get_mqtt_config_t app_to_dev_get_mqtt_config_msg = 43;
    dev_to_app_get_mqtt_config_t dev_to_app_get_mqtt_config_msg = 44;
    app_to_dev_set_mqtt_rtk_t app_to_dev_set_mqtt_rtk_msg = 45;
    dev_to_app_set_mqtt_rtk_t dev_to_app_set_mqtt_rtk_msg = 46;
    int32 todev_reset_blade_used_time = 47;
    SysResetBladeUsedTimeStatus todev_reset_blade_used_time_status = 48;
    int32 todev_factor_reset_system = 49;
    user_set_blade_used_warn_time blade_used_warn_time = 50;
    debug_common_report_t debug_common_report = 51;
    debug_errocode_report_t debug_errocode_report = 52;
    debug_enable_t debug_enable = 53;
    debug_cfg_read_t debug_cfg_read = 54;
    debug_cfg_write_t debug_cfg_write = 55;
    debug_res_cfg_ability_t debug_res_cfg_ability = 56;
    msgbus_pkt to_dev_msgbus = 57;
    msgbus_pkt to_app_msgbus = 58;
    response_set_mode_t response_set_mode = 59;
    report_info_t report_info = 60;
    work_mode_t set_work_mode = 61;
    special_mode_t set_special_mode = 62;
    set_peripherals_t set_peripherals = 63;
    debug_sun_time_t to_dev_set_sun_time = 64;
    remote_reset_req_t to_dev_remote_reset = 65;
    remote_reset_rsp_t to_app_remote_reset = 66;
    rpt_cutter_rpm current_cutter_mode = 67;
  }
}