public void Connect() { DeviceId = 0; J2534Status = J2534Interface.PassThruOpen(IntPtr.Zero, ref DeviceId); if (J2534Status != J2534Err.STATUS_NOERROR) { throw new J2534Exception(J2534Status); } }
public bool DetectProtocol() { // possible return values: // ProtocolID.ISO15765; // CAN // ProtocolID.ISO9141; // ISO-K // ProtocolID.J1850PWM; // J1850PWM // ProtocolID.J1850VPW; // J1850VPW m_deviceId = 0; m_status = m_j2534Interface.PassThruOpen(IntPtr.Zero, ref m_deviceId); if (m_status != J2534Err.STATUS_NOERROR) { return(false); } if (ConnectIso15765()) { m_protocol = ProtocolID.ISO15765; m_isConnected = true; } return(true); }