Ejemplo n.º 1
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();
            }
        }
Ejemplo n.º 2
0
 public override void setCANDevice(CANBusAdapter adapterType)
 {
     if (adapterType == CANBusAdapter.LAWICEL)
     {
         canUsbDevice = new CANUSBDevice();
     }
     else if (adapterType == CANBusAdapter.ELM327)
     {
         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 }; ;
     }
     canUsbDevice.UseOnlyPBus = m_OnlyPBus;
     canUsbDevice.DisableCanConnectionCheck = m_DisableCanConnectionCheck;
     canUsbDevice.TrionicECU = ECU.TRIONIC8;
     canUsbDevice.onReceivedAdditionalInformation += new ICANDevice.ReceivedAdditionalInformation(canUsbDevice_onReceivedAdditionalInformation);
     canUsbDevice.onReceivedAdditionalInformationFrame += new ICANDevice.ReceivedAdditionalInformationFrame(canUsbDevice_onReceivedAdditionalInformationFrame);
     if (m_canListener == null)
     {
         m_canListener = new CANListener();
     }
     canUsbDevice.addListener(m_canListener);
     canUsbDevice.AcceptOnlyMessageIds = new List<uint> { 0x645, 0x7E0, 0x7E8, 0x311, 0x5E8 };
 }