//----------------------------------------------------------------------- // // Copyright © 2012 Nils Hammar. All rights reserved. // //----------------------------------------------------------------------- /* * Software to access vehicle information via the OBD-II connector. * * Copyright © 2012 Nils Hammar * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * You should have received a copy of the GNU General Public License * along with this program. If not, see . * * Alternative licensing is possible, see the licensing document. * * The above text may not be removed or modified. */ namespace SharedObjects.Api { /// /// Handle one J2534 device. /// It is possible to handle more than one device if needed. /// public interface IPassThruDevice { /// /// Gets current Device ID. /// int DeviceID { get; } /// /// Gets Last known error encountered. /// string lastError { get; } /// /// Gets the name of the interface. /// string name { get; } /// /// Gets Current interface implementation used. /// IPassThru passThruInterface { get; } /// /// Check if the interface is declared to have a disconnect bug. /// /// 'true' if a known disconnect bug exists. bool disconnectBug(); /// /// Close the device. /// /// Result status, 0=success. PassThruConstants.resultCode Gl_PassThruClose(); /// /// Execute PassThruOpen on the device. /// /// Result status, 0=success. PassThruConstants.resultCode Gl_PassThruOpen(); /// /// Establish a connection on the device. /// /// Protocol to use. /// Connection flags. /// Baudrate to connect with. /// Channel ID assigned (out value) /// Result status, 0=success. unsafe PassThruConstants.resultCode Gl_PassThruConnect(int ProtocolID, uint Flags, uint Baudrate, out int channelID); /// /// Read version of API. /// /// API Version (out value) /// DLL Version (out value) /// Firmware Version (out value) /// Result status, 0=success. PassThruConstants.resultCode Gl_PassThruReadVersion(out string ApiVersion, out string DllVersion, out string FirmwareVersion); /// /// Set programming voltage on the interface. /// /// Pin to configure. /// Voltage to set. /// Result status, 0=success. PassThruConstants.resultCode Gl_PassThruSetProgrammingVoltage(int Pin, int Voltage); } }