示例#1
0
 /// <summary>
 /// Constructor.
 /// </summary>
 /// <param name="a_kwpDevice">IKWPDevice to be used by KWPHandler.</param>
 public static void setKWPDevice(IKWPDevice a_kwpDevice)
 {
     Console.WriteLine("******* KWPHandler: KWP device set");
     m_kwpDevice = a_kwpDevice;
 }
示例#2
0
        public override void setCANDevice(CANBusAdapter adapterType)
        {
            if (adapterType == CANBusAdapter.LAWICEL)
            {
                canUsbDevice = new CANUSBDevice();
            }
            else if (adapterType == CANBusAdapter.ELM327 && !m_ELM327Kline)
            {
                Sleeptime = SleepTime.ELM327;
                canUsbDevice = new CANELM327Device() { ForcedBaudrate = m_forcedBaudrate };
            }
            else if (adapterType == CANBusAdapter.JUST4TRIONIC)
            {
                canUsbDevice = new Just4TrionicDevice() { ForcedBaudrate = m_forcedBaudrate };
            }
            else if (adapterType == CANBusAdapter.COMBI)
            {
                canUsbDevice = new LPCCANDevice();
            }
            else if (adapterType == CANBusAdapter.KVASER)
            {
                canUsbDevice = new KvaserCANDevice();
            }
            else if (adapterType == CANBusAdapter.MXWIFI)
            {
                canUsbDevice = new CANMXWiFiDevice() { ForcedBaudrate = m_forcedBaudrate };
            }

            if (canUsbDevice != null)
            {
                canUsbDevice.UseOnlyPBus = m_OnlyPBus;
                canUsbDevice.DisableCanConnectionCheck = m_DisableCanConnectionCheck;
                canUsbDevice.TrionicECU = ECU.TRIONIC7;
                canUsbDevice.onReceivedAdditionalInformation += new ICANDevice.ReceivedAdditionalInformation(canUsbDevice_onReceivedAdditionalInformation);
                canUsbDevice.onReceivedAdditionalInformationFrame += new ICANDevice.ReceivedAdditionalInformationFrame(canUsbDevice_onReceivedAdditionalInformationFrame);
                canUsbDevice.AcceptOnlyMessageIds = new List<uint> { 0x258,0x238 }; //t7suite
            }

            if (adapterType == CANBusAdapter.ELM327 && m_ELM327Kline)
            {
                kwpDevice = new ELM327Device() { ForcedBaudrate = m_forcedBaudrate };
                setFlasher();
            }
            else if (adapterType != CANBusAdapter.COMBI || !m_UseFlasherOnDevice)
            {
                kwpDevice = new KWPCANDevice() { Latency = m_Latency };
                kwpDevice.setCANDevice(canUsbDevice);
                setFlasher();
            }
        }