定制版本逆变电源通讯程序[增加干节点状态读取和母联开关状态读取以及防雷显示]
V10.645 edit at date 2022-03-03 lijun
1.修复远程升级BTS只能远程升级加密版本BTSbug
2.平台可以通过版本号区分当前BTS是否为加密协议版本BTS
5个文件已修改
77 ■■■■ 已修改文件
BattMonitor_FBS9100S_Inverter/src/com/battmonitor/base/Com.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
BattMonitor_FBS9100S_Inverter/src/com/dev/btse/comm/FBS9100S_DFU.java 29 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
BattMonitor_FBS9100S_Inverter/src/com/dev/btse/comm/FBS9100S_SocketClient2.java 38 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
BattMonitor_FBS9100S_Inverter/src/com/version_inf/version_inf.txt 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
BattMonitor_FBS9100S_Inverter/src/main/main_MonitorServer_FBS9100S.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
BattMonitor_FBS9100S_Inverter/src/com/battmonitor/base/Com.java
@@ -157,4 +157,8 @@
            System.out.println(e.getMessage());
        }
    }
//    public static void main(String[] args) {
//        getIPFromStr("192.168.010.79", new byte[4]);
//    }
}
BattMonitor_FBS9100S_Inverter/src/com/dev/btse/comm/FBS9100S_DFU.java
@@ -49,6 +49,11 @@
    //private ByteBuffer FBS9100TxBuffer = ByteBuffer.allocate(1048);
    private ByteBuffer FBS9100RxBuffer = ByteBuffer.allocate(1500);
    
    /**
     * 2022-03-02 @lijun 用于标识设备是否为加密版本
     */
    private boolean DevFBS9100_Encry_en = true;                            //BTS是否为加密版本
    public FBS9100S_DFU(MysqlConnPool con_pool, int dev_id) {
        logger = LogManager.getLogger(this.getClass());
        
@@ -185,7 +190,11 @@
        byte[] plain_tx_t = new byte[bf_t.limit()];
        byte[] cipher_tx_t = new byte[bf_t.limit()];
        bf_t.get(plain_tx_t);
        my_aes.ecb_encrypt(plain_tx_t, cipher_tx_t, plain_tx_t.length);
        if(DevFBS9100_Encry_en) {
            my_aes.ecb_encrypt(plain_tx_t, cipher_tx_t, plain_tx_t.length);
        }else {
            cipher_tx_t = plain_tx_t;
        }
        //System.out.println(ComFn.bytesToHexString(cipher_tx_t, cipher_tx_t.length));
        socket_t.setSoTimeout(3000);
        try {
@@ -311,7 +320,11 @@
                        byte[] cipher_buf = new byte[FBS9100RxBuffer.limit()];
                        byte[] plain_buf = new byte[FBS9100RxBuffer.limit()];
                        FBS9100RxBuffer.get(cipher_buf);
                        my_aes.ecb_decrypt(cipher_buf, plain_buf, cipher_buf.length);
                        if(DevFBS9100_Encry_en) {
                            my_aes.ecb_decrypt(cipher_buf, plain_buf, cipher_buf.length);
                        }else {
                            plain_buf = cipher_buf;
                        }
                        //System.out.println(ComFn.bytesToHexString(plain_buf, plain_buf.length));
                        FBS9100RxBuffer.position(0);
                        FBS9100RxBuffer.put(plain_buf);
@@ -425,7 +438,11 @@
                            byte[] cipher_buf = new byte[FBS9100RxBuffer.limit()];
                            byte[] plain_buf = new byte[FBS9100RxBuffer.limit()];
                            FBS9100RxBuffer.get(cipher_buf);
                            my_aes.ecb_decrypt(cipher_buf, plain_buf, cipher_buf.length);
                            if(DevFBS9100_Encry_en) {
                                my_aes.ecb_decrypt(cipher_buf, plain_buf, cipher_buf.length);
                            }else {
                                plain_buf = cipher_buf;
                            }
                            //System.out.println(ComFn.bytesToHexString(plain_buf, plain_buf.length));
                            FBS9100RxBuffer.position(0);
                            FBS9100RxBuffer.put(plain_buf);
@@ -495,6 +512,12 @@
        return check_ok;
        //*********************************************************************************//
    }
    public void setDevFBS9100_Encry_en(boolean devFBS9100_Encry_en) {
        DevFBS9100_Encry_en = devFBS9100_Encry_en;
    }
}
/***************************************************************************************
****************************** end of file (FBS_TestParam) *****************************
BattMonitor_FBS9100S_Inverter/src/com/dev/btse/comm/FBS9100S_SocketClient2.java
@@ -20,6 +20,7 @@
import com.battmonitor.dev.FBS9100S_DeviceInf;
import com.battmonitor.sql.MysqlConnPool;
import com.config.AppConfig;
import com.dev.btse.data.ComFn;
import com.dev.btse.data.Ecb_Aes;
import com.dev.btse.data.FBS9100S_BusCoupleState;
import com.dev.btse.data.FBS9100S_LIBMS_AlarmState;
@@ -277,6 +278,7 @@
            FBS9100_Task_Thread_SQL.updateFbs9100SetParamBydev_id(m_ConnPool, m_StatAndParam, tmp_dis_param);
            tmp_dis_param = null;
            m_FBS9100S_DFU = new FBS9100S_DFU(m_ConnPool, m_StatAndParam.dev_id);
            m_FBS9100S_DFU.setDevFBS9100_Encry_en(DevFBS9100_Encry_en);                    //设置当前设备版本
            
            m_NT_DCDC_StateList = new FBS9100S_NT_DCDC_State[FBS9100_ComBase.BTS_DCDC_CountMax];
            for(int n=0; n<m_NT_DCDC_StateList.length; n++) {
@@ -620,24 +622,25 @@
                            //读取机柜表头数据2022-01-06 新增机柜表头数据读取[尚未测试]
                            //SocketComm(FBS9100_ComBase.CMD_GetSimData, ByteBuffer.allocate(0), socket);
                        }                        
                        /**
                         *     常规BTS新增均衡供电信息和均衡电流信息读取[锂电BTS无当前信息]
                         *  2021-08-31 @lijun 假负载设备新增均衡供电模块状态读取
                         *     假负载设备新增均衡供电模块状态读取
                         */
                        if(0 == (DevReadCount%(15*DevReadCount_Rate)) && FBS9100_ComBase.BTSE_DevType_LIBTS != m_BTSDevSoftType) {
                            //读取均衡供电模块信息
                            //System.err.println("读取均衡供电模块信息");
                            SocketComm(FBS9100_ComBase.CMD_GetJunHengState, ByteBuffer.allocate(0), socket);
                        }
                        //--------------------------- 读取均衡电流数据[锂电BTS无当前信息读取] --------------------------------------//
                        if(0 == (DevReadCount%(39*DevReadCount_Rate)) && FBS9100_ComBase.BTSE_DevType_LIBTS != m_BTSDevSoftType) {
                            //System.out.println("读取均衡电流");
                            SocketComm(FBS9100_ComBase.CMD_GetMonomerJHCUR, ByteBuffer.allocate(0), socket);
                        }
                    }
                    
                    /**
                     *     常规BTS新增均衡供电信息和均衡电流信息读取[锂电BTS无当前信息]
                     *  2021-08-31 @lijun 假负载设备新增均衡供电模块状态读取
                     *     假负载设备新增均衡供电模块状态读取
                     */
                    if(0 == (DevReadCount%(15*DevReadCount_Rate)) && FBS9100_ComBase.BTSE_DevType_LIBTS != m_BTSDevSoftType) {
                        //读取均衡供电模块信息
                        //System.err.println("读取均衡供电模块信息");
                        SocketComm(FBS9100_ComBase.CMD_GetJunHengState, ByteBuffer.allocate(0), socket);
                    }
                    //--------------------------- 读取均衡电流数据[锂电BTS无当前信息读取] --------------------------------------//
                    if(0 == (DevReadCount%(39*DevReadCount_Rate)) && FBS9100_ComBase.BTSE_DevType_LIBTS != m_BTSDevSoftType) {
                        //System.out.println("读取均衡电流");
                        SocketComm(FBS9100_ComBase.CMD_GetMonomerJHCUR, ByteBuffer.allocate(0), socket);
                    }
                    
                    
                    if(m_StatAndParam.dev_id/1000000 == 911 || m_StatAndParam.dev_id/1000000 == 912) {
@@ -1228,7 +1231,8 @@
                if(true == deviceinf.putByteBuffer(bf)) {
                    m_BTSDevSoftWareVersion = deviceinf.SoftwareVersion;
                    m_BTSDevHardwareVersion = deviceinf.HardwareVersion;
                    m_StatAndParam.m_DevVersion = String.format("D:%d,V%d.%02d.%02d",
                    //2022-03-03 @lijun 根据版本号区分当前BTS版本是否为加密版本还是不加密版本
                    m_StatAndParam.m_DevVersion = (DevFBS9100_Encry_en?"AES ":"")  + String.format("D:%d,V%d.%02d.%02d",
                                                    deviceinf.DeviceType,
                                                    deviceinf.DeviceVersion,
                                                    deviceinf.HardwareVersion,
BattMonitor_FBS9100S_Inverter/src/com/version_inf/version_inf.txt
@@ -1,3 +1,7 @@
V10.645 edit at date 2022-03-03 lijun
    1.修复远程升级BTS只能远程升级加密版本BTSbug
    2.平台可以通过版本号区分当前BTS是否为加密协议版本BTS
V10.644 edit at date 2022-01-10 lijun
    1.锂电BTS新增重启内部DCDC模块命令
        CMD_ReStartDCDC        =    0x9A;    //远程重启内部DCDC模块
BattMonitor_FBS9100S_Inverter/src/main/main_MonitorServer_FBS9100S.java
@@ -29,7 +29,7 @@
    /**************************************************************************/
    /**************************************************************************/
    public final static boolean app_debug = false;
    public final static double m_VersionNum = 10.644;
    public final static double m_VersionNum = 10.645;
    public final static String m_Version = "Welcome To Use BattMonitorFBS9100S V" 
                                            + m_VersionNum + " RC_20201110";
    /**************************************************************************/