/// <summary> /// Open the CAN device. /// </summary> /// <returns>True if the device was opened, otherwise false.</returns> public bool open() { Console.WriteLine("******* KWPCANDevice: Opening KWPCANDevice"); bool retVal = false; Console.WriteLine("Opening m_canDevice"); lock (m_lockObject) { Console.WriteLine("Lock passed: Opening m_canDevice"); if (m_canDevice.open() == OpenResult.OK) { Console.WriteLine("Adding listener"); m_canDevice.addListener(m_kwpCanListener); retVal = true; } else { retVal = false; } } Console.WriteLine("return value = " + retVal.ToString()); return(retVal); }
/// <summary> /// Open the CAN device. /// </summary> /// <returns>True if the device was opened, otherwise false.</returns> public override bool open() { logger.Debug("******* KWPCANDevice: Opening KWPCANDevice"); bool retVal = false; logger.Debug("Opening m_canDevice"); lock (m_lockObject) { logger.Debug("Lock passed: Opening m_canDevice"); if (m_canDevice.open() == OpenResult.OK) { logger.Debug("Adding listener"); m_canDevice.addListener(m_kwpCanListener); retVal = true; } else { retVal = false; } } logger.Debug("return value = " + retVal.ToString()); return(retVal); }