package com.bonait.bnframework.common.helper;

import com.bonait.bnframework.HBL.Communication.Modbus.ModbusMaster;

public class ModbusHelper extends ModbusMaster {
    private static volatile ModbusHelper instance = null;
    public synchronized static ModbusHelper get(){
        if(instance==null)instance=new ModbusHelper();
        return instance;
    }
    private ModbusHelper(){}

    public void RtuInit(String comName,int baudRate){
        new Thread(()->{ RtuConnect(comName,baudRate);}).start();
    }

    public void TcpInit(String ip,int port){
        new Thread(()->{ TcpConnect(ip,port);}).start();
    }
}
