public static void EngineConnect() { var veh = config.GetVehicle(config.Vehicle); if (veh == null) { veh = new ConfigVehicleData(); } if (HOBD.engine == null) { HOBD.engine = Engine.CreateInstance(veh.ECUEngine); } IStream stream = null; if (config.Port.StartsWith("btspp")) { stream = new BluetoothStream(); } else if (config.Port.StartsWith("tcp")) { stream = new TCPStream(); } else { stream = new SerialStream(); } engine.Deactivate(); engine.Registry = Registry; engine.Init(stream, config.Port, ""); }
public static void EngineConnect() { if (HOBD.engine == null) HOBD.engine = Engine.CreateInstance(config.GetVehicle(config.Vehicle).ECUEngine); IStream stream = null; if (config.Port.StartsWith("btspp")) stream = new BluetoothStream(); else stream = new SerialStream(); engine.Deactivate(); engine.Registry = Registry; engine.Init(stream, config.Port, ""); }