/**
 * @file cmmstruct.proto
 * @brief TDSCmd define
 * @author Fan Chuanlin, fanchuanlin@aliyun.com
 * @version 1.0
 * @date 2022-09-06
 */
syntax = "proto3";
import "google/protobuf/any.proto";
import "google/protobuf/timestamp.proto";
option go_package = "../protogo";
//成功失败 枚举
enum CodeValue
{
    base_start = 0;
    Succeed = 1;
    Failed = 2;
}

enum IID
{
    IID_Base = 0;
    //====================== server =============================
    IID_Server_Base = 10000;
    // common
    IID_Server_SyncEnd = 10001;
    // satellite action
    IID_Server_SatelliteList = 10101;
    IID_Server_SatelliteList_respond = 10102;//list
    IID_Server_SatelliteBaseUpdate = 10103;
    IID_Server_SatelliteBaseUpdate_respond = 10104;
    IID_Server_SatellitePriorityUpdate = 10105;
    IID_Server_SatellitePriorityUpdate_respond = 10106;
    IID_Server_SatellitePriorityList = 10107;
    IID_Server_SatellitePriorityList_respond = 10108;
    IID_Server_SatelliteAvailableUpdate = 10109;
    IID_Server_SatelliteAvailableUpdate_respond = 10110;
    IID_Server_SatelliteElementUpdate = 10111;
    IID_Server_SatelliteElementUpdate_respond = 10112;
    IID_Server_SatelliteElementLoad = 10113;
    IID_Server_SatelliteElementLoad_respond = 10114;
    IID_Server_SatelliteDel = 10115;
    IID_Server_SatelliteDel_respond = 10116;
    IID_Server_SatelliteInstantaneousRootUpdate = 10117;
    IID_Server_SatelliteInstantaneousRootUpdate_respond = 10118;
    IID_Server_SatelliteListSend = 10119;
    IID_Server_SatelliteListSend_respond = 10120;
    IID_Server_SatelliteListReceive = 10121;
    IID_Server_SatelliteListReceive_respond = 10122;
    // 卫星射频/解调参数
    IID_Server_SatelliteWorkParamList = 10201;
    IID_Server_SatelliteWorkParamList_respond = 10202;//list
    IID_Server_SatelliteWorkParamUpdate = 10203;
    IID_Server_SatelliteWorkParamUpdate_respond = 10204;
    IID_Server_SatelliteWorkParamDel = 10205;
    IID_Server_SatelliteWorkParamDel_respond = 10206;
    IID_Server_SatelliteWorkParamListSend = 10207;
    IID_Server_SatelliteWorkParamListSend_respond = 10208;
    IID_Server_SatelliteWorkParamListReceive = 10209;
    IID_Server_SatelliteWorkParamListReceive_respond = 10210;
    // site action
    IID_Server_SiteList = 10301;
    IID_Server_SiteList_respond = 10302;//list
    IID_Server_SiteUpdate = 10303;
    IID_Server_SiteUpdate_respond = 10304;
    IID_Server_SiteParamUpdate = 10305;
    IID_Server_SiteParamUpdate_respond = 10306;
    IID_Server_SiteDel = 10307;
    IID_Server_SiteDel_respond = 10308;
    IID_Server_SiteListSend = 10309;
    IID_Server_SiteListSend_respond = 10310;
    IID_Server_SiteListReceive = 10311;
    IID_Server_SiteListReceive_respond = 10312;
    // task action
    IID_Server_TaskList = 10401;
    IID_Server_TaskList_respond = 10402;//list
    IID_Server_TaskForecast = 10403;
    IID_Server_TaskForecast_respond = 10404;//list
    IID_Server_TaskUpdate = 10405;
    IID_Server_TaskUpdate_respond = 10406;
    IID_Server_TaskDel = 10407;
    IID_Server_TaskDel_respond = 10408;
    IID_Server_TaskDetailDat = 10409;
    IID_Server_TaskDetailDat_respond = 10410;//data
    IID_Server_TaskDetailPoint = 10411;
    IID_Server_TaskDetailPoint_respond = 10412;//data
    IID_Server_TaskPause = 10413;
    IID_Server_TaskPause_respond = 10414;
    IID_Server_TaskRestart = 10415;
    IID_Server_TaskRestart_respond = 10416;
    IID_Server_TaskHandleConflict = 10417;
    IID_Server_TaskHandleConflict_respond = 10418;//list
    IID_Server_TaskHandModeSwitch = 10419;
    IID_Server_TaskHandModeSwitch_respond = 10420;
    IID_Server_TaskIndex = 10421;
    IID_Server_TaskIndex_respond = 10422;//data
    IID_Server_TaskListSend = 10423;
    IID_Server_TaskListSend_respond = 10424;
    IID_Server_TaskListReceive = 10425;
    IID_Server_TaskListReceive_respond = 10426;
    IID_Server_FileReceive = 10427;
    IID_Server_FileReceive_respond = 10428;
    IID_Server_TaskExecAnalysisResult = 105;
    IID_Server_TaskExecAnalysisResult_respond = 10502;
    IID_Server_TaskExecList = 10503;
    IID_Server_TaskExecList_respond = 10504;//list

    // more setting action
    IID_Server_MoreSettingSet = 10601;
    IID_Server_MoreSettingSet_respond = 10602;
    IID_Server_MoreSettingGet = 10603;
    IID_Server_MoreSettingGet_respond = 10604;// 正常-data ,获取存储规则-list
    IID_Server_MoreSettingGetDefault = 10605;
    IID_Server_MoreSettingGetDefault_respond = 10606;//data
    IID_Server_MoreSettingDataSet = 10607;
    IID_Server_MoreSettingDataSet_respond = 10608;
    IID_Server_MoreSettingDataDel = 10609;
    IID_Server_MoreSettingDataDel_respond = 10610;
    //  IID_Server_MoreSettingSend = 10611;
    //  IID_Server_MoreSettingSend_respond = 10612;
    //  IID_Server_MoreSettingReceive = 10613;
    //  IID_Server_MoreSettingReceive_respond = 10614;
    // user action
    IID_Server_Login = 10701;
    IID_Server_Login_respond = 10702;//data
    IID_Server_UserCreate = 10703;
    IID_Server_UserCreate_respond = 10704;
    IID_Server_UserUpdate = 10705;
    IID_Server_UserUpdate_respond = 10706;
    IID_Server_UserDel = 10707;
    IID_Server_UserDel_respond = 10708;
    IID_Server_UserList = 10709;
    IID_Server_UserList_respond = 10710;//list
    //====================== UI =============================
    IID_UI_Base = 20000;
    IID_UI_xxx = 20001;
    IID_UI_xxx_respond = 20002;

    //====================== Device =============================
    IID_Device_Base = 30000;
    IID_Device_DBC_CURD = 30001;
    IID_Device_DBC_CURD_respond = 30002;
    IID_Device_Xpro_TX_cmd = 30003;
    IID_Device_Xpro_TX_cmd_respond = 30004;
    IID_Device_Xpro_RX_cmd = 30005;
    IID_Device_Xpro_RX_cmd_respond = 30006; //用不上

    //====================== AGI =============================
    IID_AGI_Base=4000;
    IID_AGI_TLE=4001;
    IID_AGI_TLE_respond=4002;
    IID_AGI_Report=4003;
    IID_AGI_Report_respond=4004;

    //====================== OAM =============================
    IID_OAM_Base = 50000;
    // public use
    IID_OAM_HeartBeat_RX = 50001;
    IID_OAM_LOG_RX = 50003;

    // OAM relay
    IID_OAM_SysStatus_Relay = 50005;
    IID_OAM_SysStatus_Relay_Respond = 50006;
    IID_OAM_Performance_Relay = 50007;
    IID_OAM_Performance_Relay_Respond = 50008;
    IID_OAM_Alert_Start_Relay = 50009;
    IID_OAM_Alert_Start_Relay_Respond = 50010;
    IID_OAM_Alert_End_Relay = 50011;
    IID_OAM_Alert_End_Relay_Respond = 50012;

    IID_OAM_LOG_Relay = 50013;
    IID_OAM_LOG_Relay_Respond = 50014;

    // communicate with UI
    IID_OAM_UI_SysStatus_Require = 50015;
    IID_OAM_UI_SysStatus_Respond = 50016;
    IID_OAM_UI_SysStatus_Update = 50017;
    IID_OAM_UI_SysStatus_Update_Respond = 50018;

    IID_OAM_UI_CurrentAlarms_Require = 50019;
    IID_OAM_UI_CurrentAlarms_Respond = 50020;
    IID_OAM_UI_CurrentAlarms_Start_Update = 50021;
    IID_OAM_UI_CurrentAlarms_Start_Update_Respond = 50022;
    IID_OAM_UI_CurrentAlarms_End_Update = 50023;
    IID_OAM_UI_CurrentAlarms_End_Update_Respond = 50024;

    IID_OAM_UI_HistoryAlarms_Require = 50025;
    IID_OAM_UI_HistoryAlarms_Respond = 50026;

    IID_OAM_UI_AlarmAttribution_Require = 50027;
    IID_OAM_UI_AlarmAttribution_Respond = 50028;
    IID_OAM_UI_AlarmAttribution_Update_Require = 50029;
    IID_OAM_UI_AlarmAttribution_Update_Respond = 50030;

    IID_OAM_UI_PerInfos_Require = 50031;
    IID_OAM_UI_PerInfos_Respond = 50032;
    IID_OAM_UI_PerAttribution_Require = 50033;
    IID_OAM_UI_PerAttribution_Respond = 50034;
    IID_OAM_UI_PerAttribution_Update_Require = 50035;
    IID_OAM_UI_PerAttribution_Update_Respond = 50036;

    IID_OAM_UI_LOG_Require = 50037;
    IID_OAM_UI_LOG_Respond = 50038;

    // communicate with Device
    IID_OAM_Device_Alert_Start = 50039;
    IID_OAM_Device_Alert_Start_Respond = 50040;
    IID_OAM_Device_Alert_End = 50041;
    IID_OAM_Device_Alert_End_Respond = 50042;
    IID_OAM_Device_Performance_RX = 50043;

    /*
    ......
    xxxx  id%2 == 1
    xxxx_respond = id+1
    */
}

/// sub system define
enum BROKERAREA
{
    BROKERAREA_LOCAL = 0;
    BROKERAREA_CLOUD_LEVEL2 = 1;
    BROKERAREA_CLOUD_LEVEL1 = 2;
}

enum SUBSYSTEM
{
    SUBSYSTEM_base = 0;
    SUBSYSTEM_Server = 1;
    SUBSYSTEM_UI = 2;
    SUBSYSTEM_Device = 3;
    SUBSYSTEM_AGI = 4;
    SUBSYSTEM_OAM = 5;
    SUBSYSTEM_default = 6;
}

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

//设备状态枚举
enum Devistatus
{
    Init_status = 0;
    Online = 1;
    Offline = 2;
    Alarm = 3;
}
//心跳
message Heartbeat
{
    uint32 suid = 1;
    repeated IID iid_list = 2;
    map<uint32, Devistatus> Dev_status = 3; //存放设备状态 <DEV_SUID,STATUS>
}

message TDSCmd
{
    IID interface_id = 1;
    uint32 dst_suid = 2;
    uint32 src_suid = 3;
    uint32 forward_flag = 4;
    uint32 priority = 5; //报文优先级 可以优先发送
    uint32 request_index = 6; 
    google.protobuf.Timestamp ts = 7;
    repeated google.protobuf.Any parameters = 8;
}
