/*
 * @Author       : ChenJie
 * @Date         : 2021-12-20 14:47:39
 * @Version      : V3.0
 * @LastEditors  : ChenJie
 * @LastEditTime : 2021-12-29 16:33:32
 * @Description  : file content
 * @FilePath     : \VehicleControl\VehicleControl\src\System\Vehicle\Communication\BleCanProtocolFunc.c
 */
/*
 * CanProtocol.c
 * can协议转换
 *  Created on: 2021年12月20日
 *      Author: QiXiang_CHENJIE
 */
#include "BleCanProtocolFunc.h"
#include "HardwareLib.h"
/**
 * @brief : EBC对ble的命令应答,AT指令,EBC(0x1CEE000X)->BLE(0x1CEF0000X)
 * @param {uint8} CmdIdx
 * @return {*}
 */
void Can2ProtocolCode(uint8 CmdIdx,uint8 DataIdx,uint8 Byte0Num,uint32 *InnerCanID,uint8 *Data)
{
    uint8 BlePwrControl;       //蓝牙电源开关控制  FF-关闭，0A-打开
    uint8 BlePwrControl_Flag;  //蓝牙电源开关控制使能  00-不控制，01-控制
    uint8 BleRoleControl;      //蓝牙主从控制  01-主机，02-从机
    uint8 BleRoleControl_Flag; //蓝牙主从控制使能  00-不控制，01-控制
    uint8 BleName[8];
    //上述变量下线检测时调用修改

    // CmdIdx EBC对BLE命令列表
    switch (CmdIdx)
    {
    case 0x00: // ebc->ble数据传输通道
    {
        Can2DataCode(DataIdx, Byte0Num,Data);
        *InnerCanID = 0x1CEE0000;
        break;
    }
    case 0x01: //查询BLE软件版本
    {
        Data[0] = 0x01;
        Data[1] = 0x00;
        Data[2] = 0x00;
        Data[3] = 0x00;
        Data[4] = 0x00;
        Data[5] = 0x00;
        Data[6] = 0x00;
        Data[7] = 0x00;
        *InnerCanID = 0x1CEE0001;
        break;
    }
    case 0x02: //查询BLE连接状态
    {
        Data[0] = 0x01;
        Data[1] = 0x00;
        Data[2] = 0x00;
        Data[3] = 0x00;
        Data[4] = 0x00;
        Data[5] = 0x00;
        Data[6] = 0x00;
        Data[7] = 0x00;
        *InnerCanID = 0x1CEE0002;
        break;
    }
    case 0x03: //让BLE断开连接
    {
        Data[0] = 0x02;
        Data[1] = 0x00;
        Data[2] = 0x00;
        Data[3] = 0x00;
        Data[4] = 0x00;
        Data[5] = 0x00;
        Data[6] = 0x00;
        Data[7] = 0x00;
        *InnerCanID = 0x1CEE0003;
        break;
    }
    case 0x04: //改无线设备名称 名称为ASCII码值
    {
        Data[0] = BleName[0];
        Data[1] = BleName[1];
        Data[2] = BleName[2];
        Data[3] = BleName[3];
        Data[4] = BleName[4];
        Data[5] = BleName[5];
        Data[6] = BleName[6];
        Data[7] = BleName[7];
        *InnerCanID = 0x1CEE0004;
        break;
    }
    case 0x05: // BLE设备蓝牙开关查询及控制，默认为查询
    {
        if (BlePwrControl_Flag)
        {
            Data[0] = 0x02;
            Data[1] = BlePwrControl;
        }
        else
        {
            Data[0] = 0x01;
            Data[1] = 0x00;
        }
        Data[2] = 0x00;
        Data[3] = 0x00;
        Data[4] = 0x00;
        Data[5] = 0x00;
        Data[6] = 0x00;
        Data[7] = 0x00;
        *InnerCanID = 0x1CEE0005;
        break;
    }
    case 0x06: // BLE 主从机切换及查询，默认为查询
    {
        if (BleRoleControl_Flag)
        {
            Data[0] = 0x02;
            Data[1] = BleRoleControl;
        }
        else
        {
            Data[0] = 0x01;
            Data[1] = 0x00;
        }
        Data[2] = 0x00;
        Data[3] = 0x00;
        Data[4] = 0x00;
        Data[5] = 0x00;
        Data[6] = 0x00;
        Data[7] = 0x00;
        *InnerCanID = 0x1CEE0006;
        break;
    }
    default:
        break;
    }
}
/**
 * @brief : ebc对ble的数据应答,Ebc data ->Ble data
 * @param {*}
 * @return {*}
 */
void Can2DataCode(uint8 DataIdx, uint8 Byte0Num,uint8 Data[])
{
    switch (DataIdx)
    {
    case 0x01: //主机数据类型1的应答
    {
        Data[0] = 0x11;
        Data[1] = ebcd_st_ebcWork;
        Data[2] = ebcd_st_ebcConnect;
        Data[3] = ebcd_st_ebcLockWork;
        Data[4] = 0x00;
        Data[5] = 0x00;
        Data[6] = 0x00;
        Data[7] = 0x00;
        break;
    }
    case 0x02: //主机数据类型2的应答 共7条
    {
        switch (Byte0Num)
        {
        case 0x21:
        {
            vcud_st_keyOn = 0;        // TBD
            bcud_st_bcuTmsLiquid = 0; // TBD
            Data[0] = Byte0Num;
            Data[1] = ebcd_st_unlockSensor;
            Data[2] = ebcd_st_lockSensor;
            Data[3] = vcud_st_keyOn;
            Data[4] = ebcd_P_airSensor;
            Data[5] = bcud_st_bcuTmsLiquid;
            Data[6] = ebcd_flg_pluginLockSig;
            Data[7] = 0x00;
            break;
        }
        case 0x22:
        {
            Data[0] = Byte0Num;
            Data[1] = 0x00;
            Data[2] = 0x00;
            Data[3] = 0x00;
            Data[4] = 0x00;
            Data[5] = ebcd_st_pedstSensor;
            Data[6] = ebcd_st_pluginLockSig;
            Data[7] = 0x00;
            break;
        }
        case 0x23:
        {
            Data[0] = Byte0Num;
            Data[1] = ebcd_st_unlockSucJug;
            Data[2] = ebcd_st_lockSucJug;
            Data[3] = 0x00;
            Data[4] = 0x00;
            Data[5] = 0x00;
            Data[6] = 0x00;
            Data[7] = 0x00;
            break;
        }
        case 0x24:
        {
            Data[0] = Byte0Num;
            Data[1] = 0x00;
            Data[2] = 0x00;
            Data[3] = 0x00;
            Data[4] = 0x00;
            Data[5] = ebcd_st_pedstSucJug;
            Data[6] = ebcd_flg_swapAdmit;
            Data[7] = 0x00;
            break;
        }
        case 0x25:
        {
            Data[0] = Byte0Num;
            Data[1] = ebcd_st_ebcWork;
            Data[2] = ebcd_st_ebcConnect;
            Data[3] = ebcd_st_ebcLockWork;
            Data[4] = ebcd_Nr_errMax;
            Data[5] = ebcd_Num_err1;
            Data[6] = ebcd_Num_err2;
            Data[7] = 0x00;
            break;
        }
        case 0x26:
        {
            Data[0] = Byte0Num;
            Data[1] = (ebcd_Nr_swapBatt >> 8) & 0xFF;
            Data[2] = ebcd_Nr_swapBatt & 0xFF;
            Data[3] = (ebcd_Nr_swapSucBatt >> 8) & 0xFF;
            Data[4] = ebcd_Nr_swapSucBatt;
            Data[5] = 0x00;
            Data[6] = 0x00;
            Data[7] = 0x00;
            break;
        }
        case 0x27:
        {
            Data[0] = Byte0Num;
            Data[1] = ebcd_st_errTable1;
            Data[2] = ebcd_st_errTable2;
            Data[3] = ebcd_st_errTable3;
            Data[4] = 0x00;
            Data[5] = 0x00;
            Data[6] = 0x00;
            Data[7] = 0x00;
            break;
        }
        default:
            break;
        }
        break;
    }
    case 0x03: //主机数据类型3的应答 共5条
    {
        vcud_st_handbrake = HandbrakeSts;
        vcud_st_footbrake = (BrakePedal > 0);
        vcud_st_gear = GearPos;
        vcud_st_vcuComun = (VCU_Life != 0xFF);
        vcud_st_carStart = VehSts;
        vcud_st_Steer = 0x00; // TBD
        vcud_M_accDrv = VCU_TotalDistance * 10;
        if (EBC_VinMsgFlag == 0x07)
        {
            memcpy(vcuv_Num_vin, VCU_VIN, 17);
        }
        switch (Byte0Num)
        {
        case 0x31:
        {
            Data[0] = Byte0Num;
            Data[1] = vcud_st_handbrake;
            Data[2] = vcud_st_footbrake;
            Data[3] = vcud_st_gear;
            Data[4] = vcud_st_vcuComun;
            Data[5] = vcud_st_carStart;
            Data[6] = vcud_st_Steer;
            Data[7] = 0x00;
            break;
        }
        case 0x32:
        {
            Data[0] = Byte0Num;
            Data[1] = vcuv_Num_vin[0];
            Data[2] = vcuv_Num_vin[1];
            Data[3] = vcuv_Num_vin[2];
            Data[4] = vcuv_Num_vin[3];
            Data[5] = vcuv_Num_vin[4];
            Data[6] = vcuv_Num_vin[5];
            Data[7] = 0x00;
            break;
        }
        case 0x33:
        {
            Data[0] = Byte0Num;
            Data[1] = vcuv_Num_vin[6];
            Data[2] = vcuv_Num_vin[7];
            Data[3] = vcuv_Num_vin[8];
            Data[4] = vcuv_Num_vin[9];
            Data[5] = vcuv_Num_vin[10];
            Data[6] = vcuv_Num_vin[11];
            Data[7] = 0x00;
            break;
        }
        case 0x34:
        {
            Data[0] = Byte0Num;
            Data[1] = vcuv_Num_vin[12];
            Data[2] = vcuv_Num_vin[13];
            Data[3] = vcuv_Num_vin[14];
            Data[4] = vcuv_Num_vin[15];
            Data[5] = vcuv_Num_vin[16];
            Data[6] = 0x00;
            Data[7] = 0x00;
            break;
        }
        case 0x35:
        {
            Data[0] = Byte0Num;
            Data[1] = (vcud_M_accDrv >> 24) & 0xFF;
            Data[2] = (vcud_M_accDrv >> 16) & 0xFF;
            Data[3] = (vcud_M_accDrv >> 8) & 0xFF;
            Data[4] = (vcud_M_accDrv)&0xFF;
            Data[5] = vcud_P_airSensorForward;
            Data[6] = vcud_P_airSensorBack;
            Data[7] = 0x00;
            break;
        }
        default:
            break;
        }
        break;
    }
    case 0x04: //主机数据类型4的应答 共16条
    {
        bcud_st_bcuComun = (BMS1_Life != 0xFF);
        bcud_pct_bcuSoh = BMS2_SOH;
        bcud_V_battU = BMS2_PackInsideVolt;
        if (BMS1_SysSts == 2)
        {
            bcud_st_hvWork = 0;
        }
        else if (BMS1_SysSts == 0 || BMS1_SysSts == 1)
        {
            bcud_st_hvWork = 1;
        }
        else if (BMS1_SysSts == 3)
        {
            bcud_st_hvWork = 2;
        }
        else
        {
            bcud_st_hvWork = 3;
        }
        bcud_st_bcuMainRelay = BMS1_MainPosRelaySt;
        bcud_pct_soc = (UINT16)(BMS2_SOC * 4);
        memcpy(bcuv_Num_battSn, BMS_SN_SysCode, sizeof(BMS_SN_SysCode));
        bcud_Q_snglChrg = BMS19_SingleChargeAh;
        bcud_E_snglChrg = BMS19_SingleChargeKwh;
        bcud_Q_accRecovry = BMS16_TotalEneryECOChargeAh;
        bcud_E_accRecovry = BMS16_TotalEneryECOChargeKwh;
        bcud_Q_accSwapBatt = BMS17_TotalStationChargeAh;
        bcud_E_accSwapBatt = BMS17_TotalStationChargeKwh;
        bcud_Q_accPlugInChrg = BMS18_TotalPoleChargeAh;
        bcud_E_accPlugInChrg = BMS18_TotalPoleChargeKwh;
        bcud_Q_accDischrg = BMS14_TotalDischargeAh;
        bcud_E_accDischrg = BMS14_TotalDischargeAh;
        bcud_Q_accChrg = BMS18_TotalPoleChargeAh;
        bcud_E_accChrg = BMS15_TotalChargeKwh;
        switch (Byte0Num)
        {
        case 0x40:
        {
            Data[0] = Byte0Num;
            Data[1] = (bcud_E_accPlugInChrg >> 24) & 0xFF;
            Data[2] = (bcud_E_accPlugInChrg >> 16) & 0xFF;
            Data[3] = (bcud_E_accPlugInChrg >> 8) & 0xFF;
            Data[4] = (bcud_E_accPlugInChrg)&0xFF;
            Data[5] = 0x00;
            Data[6] = 0x00;
            Data[7] = 0x00;
            break;
        }
        case 0x41:
        {
            Data[0] = Byte0Num;
            Data[1] = (bcud_Q_accChrg >> 24) & 0xFF;
            Data[2] = (bcud_Q_accChrg >> 16) & 0xFF;
            Data[3] = (bcud_Q_accChrg >> 8) & 0xFF;
            Data[4] = (bcud_Q_accChrg)&0xFF;
            Data[5] = bcud_st_bcuComun;
            Data[6] = bcud_st_hvWork;
            Data[7] = 0x00;
            break;
        }
        case 0x42:
        {
            Data[0] = Byte0Num;
            Data[1] = (bcud_Q_accDischrg >> 24) & 0xFF;
            Data[2] = (bcud_Q_accDischrg >> 16) & 0xFF;
            Data[3] = (bcud_Q_accDischrg >> 8) & 0xFF;
            Data[4] = (bcud_Q_accDischrg)&0xFF;
            Data[5] = bcud_st_bcuMainRelay;
            Data[6] = bcud_pct_bcuSoh;
            Data[7] = 0x00;
            break;
        }
        case 0x43:
        {
            Data[0] = Byte0Num;
            Data[1] = (bcud_E_accChrg >> 24) & 0xFF;
            Data[2] = (bcud_E_accChrg >> 16) & 0xFF;
            Data[3] = (bcud_E_accChrg >> 8) & 0xFF;
            Data[4] = (bcud_E_accChrg)&0xFF;
            Data[5] = (bcud_V_battU >> 8) & 0xFF;
            Data[6] = (bcud_V_battU)&0xFF;
            Data[7] = 0x00;
            break;
        }
        case 0x44:
        {
            Data[0] = Byte0Num;
            Data[1] = (bcud_E_accDischrg >> 24) & 0xFF;
            Data[2] = (bcud_E_accDischrg >> 16) & 0xFF;
            Data[3] = (bcud_E_accDischrg >> 8) & 0xFF;
            Data[4] = (bcud_E_accDischrg)&0xFF;
            Data[5] = (bcud_pct_soc >> 8) & 0xFF;
            Data[6] = (bcud_pct_soc)&0xFF;
            Data[7] = 0x00;
            break;
        }
        case 0x45:
        {
            Data[0] = Byte0Num;
            Data[1] = bcuv_Num_battSn[0];
            Data[2] = bcuv_Num_battSn[1];
            Data[3] = bcuv_Num_battSn[2];
            Data[4] = bcuv_Num_battSn[3];
            Data[5] = bcuv_Num_battSn[4];
            Data[6] = bcuv_Num_battSn[5];
            Data[7] = 0x00;
            break;
        }
        case 0x46:
        {
            Data[0] = Byte0Num;
            Data[1] = bcuv_Num_battSn[6];
            Data[2] = bcuv_Num_battSn[7];
            Data[3] = bcuv_Num_battSn[8];
            Data[4] = bcuv_Num_battSn[9];
            Data[5] = bcuv_Num_battSn[10];
            Data[6] = bcuv_Num_battSn[11];
            Data[7] = 0x00;
            break;
        }
        case 0x47:
        {
            Data[0] = Byte0Num;
            Data[1] = bcuv_Num_battSn[12];
            Data[2] = bcuv_Num_battSn[13];
            Data[3] = bcuv_Num_battSn[14];
            Data[4] = bcuv_Num_battSn[15];
            Data[5] = bcuv_Num_battSn[16];
            Data[6] = bcuv_Num_battSn[17];
            Data[7] = 0x00;
            break;
        }
        case 0x48:
        {
            Data[0] = Byte0Num;
            Data[1] = bcuv_Num_battSn[18];
            Data[2] = bcuv_Num_battSn[19];
            Data[3] = bcuv_Num_battSn[20];
            Data[4] = bcuv_Num_battSn[21];
            Data[5] = bcuv_Num_battSn[22];
            Data[6] = bcuv_Num_battSn[23];
            Data[7] = 0x00;
            break;
        }
        case 0x49:
        {
            Data[0] = Byte0Num;
            Data[1] = bcuv_Num_battSn[24];
            Data[2] = bcuv_Num_battSn[25];
            Data[3] = bcuv_Num_battSn[26];
            Data[4] = bcuv_Num_battSn[27];
            Data[5] = bcuv_Num_battSn[28];
            Data[6] = bcuv_Num_battSn[29];
            Data[7] = 0x00;
            break;
        }
        case 0x4A:
        {
            Data[0] = Byte0Num;
            Data[1] = bcuv_Num_battSn[30];
            Data[2] = bcuv_Num_battSn[31];
            Data[3] = 0x00;
            Data[4] = 0x00;
            Data[5] = 0x00;
            Data[6] = 0x00;
            Data[7] = 0x00;
            break;
        }
        case 0x4B:
        {
            Data[0] = Byte0Num;
            Data[1] = (bcud_Q_snglChrg >> 8) & 0xFF;
            Data[2] = (bcud_Q_snglChrg)&0xFF;
            Data[3] = (bcud_Q_accRecovry >> 24) & 0xFF;
            Data[4] = (bcud_Q_accRecovry >> 16) & 0xFF;
            Data[5] = (bcud_Q_accRecovry >> 8) & 0xFF;
            Data[6] = (bcud_Q_accRecovry)&0xFF;
            Data[7] = 0x00;
            break;
        }
        case 0x4C:
        {
            Data[0] = Byte0Num;
            Data[1] = (bcud_Q_accSwapBatt >> 24) & 0xFF;
            Data[2] = (bcud_Q_accSwapBatt >> 16) & 0xFF;
            Data[3] = (bcud_Q_accSwapBatt >> 8) & 0xFF;
            Data[4] = (bcud_Q_accSwapBatt)&0xFF;
            Data[5] = 0x00;
            Data[6] = 0x00;
            Data[7] = 0x00;
            break;
        }
        case 0x4D:
        {
            Data[0] = Byte0Num;
            Data[1] = (bcud_E_snglChrg >> 8) & 0xFF;
            Data[2] = (bcud_E_snglChrg)&0xFF;
            Data[3] = (bcud_E_accRecovry >> 24) & 0xFF;
            Data[4] = (bcud_E_accRecovry >> 16) & 0xFF;
            Data[5] = (bcud_E_accRecovry >> 8) & 0xFF;
            Data[6] = (bcud_E_accRecovry)&0xFF;
            Data[7] = 0x00;
            break;
        }
        case 0x4E:
        {
            Data[0] = Byte0Num;
            Data[1] = (bcud_E_accSwapBatt >> 24) & 0xFF;
            Data[2] = (bcud_E_accSwapBatt >> 16) & 0xFF;
            Data[3] = (bcud_E_accSwapBatt >> 8) & 0xFF;
            Data[4] = (bcud_E_accSwapBatt)&0xFF;
            Data[5] = 0x00;
            Data[6] = 0x00;
            Data[7] = 0x00;
            break;
        }
        case 0x4F:
        {
            Data[0] = Byte0Num;
            Data[1] = (bcud_Q_accPlugInChrg >> 24) & 0xFF;
            Data[2] = (bcud_Q_accPlugInChrg >> 16) & 0xFF;
            Data[3] = (bcud_Q_accPlugInChrg >> 8) & 0xFF;
            Data[4] = (bcud_Q_accPlugInChrg)&0xFF;
            Data[5] = 0x00;
            Data[6] = 0x00;
            Data[7] = 0x00;
            break;
        }
        default:
            break;
        }
    break;
    }
    case 0x05:
    {
        Data[0] = 0x51;
        Data[1] = 0x00;
        Data[2] = 0x00;
        Data[3] = 0x00;
        Data[4] = 0x00;
        Data[5] = 0x00;
        Data[6] = 0x00;
        Data[7] = 0x00;
        break;
    }
    default:
        Data[0] = 0x00;
        Data[1] = 0x00;
        Data[2] = 0x00;
        Data[3] = 0x00;
        Data[4] = 0x00;
        Data[5] = 0x00;
        Data[6] = 0x00;
        Data[7] = 0x00;
        break;
    }
}

/**
 * @brief : Ebc通过Can2接受到的协议解码
 * @param {uint8} CmdIdx
 * @return {*}
 */
void Can2ProtocolDecode(uint32 Can2ID,uint8 Data[])
{
    switch (Can2ID)
    {
    case 0x1CEF0000:
    {
        Can2DataDecode(Data);
        bled_flg_bleConn = 1;
        break;
    }
    case 0x1CEF0001:
    {
        bled_Nr_softVer = (Data[0] << 24) | (Data[1] << 16) | (Data[2] << 8) | (Data[3]);
        break;
    }
    case 0x1CEF0002:
    {
        if (Data[0] != 0xFF)
        {
            bled_flg_bleConn = 1;
        }
        else
        {
            bled_flg_bleConn = 0;
        }
        break;
    }
    case 0x1CEF00F1:
    {
    	ebcd_flg_ebcEolDone = Data[0];//下线检测完成（取消定时解锁）暂时放这里
    	EEPROMDrv_bSaveInstantUB = 1;
    	break;
    }
    default:
        break;
    }
}
/**
 * @brief : Ebc通过can2接收到的数据解码,Ble->Ebc
 * @param {*}
 * @return {*}
 */
void Can2DataDecode(uint8 Data[])
{
    uint8 CmdIndex = Data[0];
    ebcd_st_toBleAns = CmdIndex;
    ebcd_flg_Can2SendEnbale = TRUE;//所有的信息均立即回复
    switch (CmdIndex)
    {
    case 0x01: //心跳数据，为了维持通讯
    {
        bled_flg_Heart = 1;
        ebcd_flg_Can2SendEnbale = TRUE;
        break;
    }
    case 0x02: //获取换电控制器信息
    {
        bled_flg_getEbcData = 1;
        ebcd_flg_Can2SendEnbale = TRUE;
        break;
    }
    case 0x03: //获得车辆信息
    {
        bled_flg_getVcuData = 1;
        ebcd_flg_Can2SendEnbale = TRUE;
        break;
    }
    case 0x04: //获取电池信息
    {
        bled_flg_getBmsData = 1;
        ebcd_flg_Can2SendEnbale = TRUE;
        break;
    }
    case 0x05: //握手
    {
        bled_flg_handShake = 1;
        ebcd_flg_Can2SendEnbale = TRUE;
        break;
    }
    case 0x06: //解锁
    {
        bled_flg_unlockCmd = Data[1];
        bled_flg_lockCmd = 0;
        break;
    }
    case 0x07: //锁紧
    {
        bled_flg_lockCmd = Data[1];
        bled_flg_unlockCmd = 0;
        break;
    }
    case 0x08: //完成换电
    {
        bled_flg_swapBattDone = 1;
        break;
    }
    case 0x09: //强制解锁，强制上升
    {
        bled_flg_unlockCmdForce = Data[1];
        bled_flg_topAscendCmdForce = Data[2];
        break;
    }
    case 0x0A: //强制锁紧，强制下降
    {
        bled_flg_lockCmdForce = Data[1];
        bled_flg_topDescendCmdForce = Data[2];
        break;
    }
    case 0x0B: //回到行车状态
    {
        bled_flg_backToDrv = 1;
        break;
    }
    case 0x0C: //顶板举升
    {
        bled_flg_topAscendCmd = Data[1];
        break;
    }
    case 0x0D: //顶板下降
    {
        bled_flg_topDescendCmd = Data[1];
        break;
    }
    case 0x0E: //换电开始自动解锁
    {
        bled_flg_autoUnlock = 1;
        break;
    }
    case 0x0F: //换电完成自动锁紧
    {
        bled_flg_autoLock = 1;
        break;
    }
    case 0x10: //除尘开始
    {
        bled_flg_openDustReCmd = 1;
        break;
    }
    case 0x11: //除尘关闭
    {
        bled_flg_closeDustReCmd = 1;
        break;
    }
    case 0x12: //切换到无线通信状态
    {
        break;
    }
    case 0x13: //进入换电状态
    {
        bled_flg_toSwapMod = 1;
        break;
    }
    case 0x14: //急停指令
    {
        bled_flg_safeStopCmd = 1;
        break;
    }//新增需要改数组
    default:
        break;
    }
}
