public static SessionChannel Create(J2534.Device Device, J2534.Protocol ProtocolID, J2534.Baud Baud, J2534.ConnectFlag Flags)
            {
                string Key = $"{Device}:{ProtocolID}:{Baud}";

                lock (channelcache)
                {
                    SessionChannel result;

                    if (!channelcache.ContainsKey(Key))
                    {
                        var NewChannel = new SessionChannel(Device.GetChannel(ProtocolID, Baud, Flags));
                        NewChannel.OnDisposing += () =>
                        {
                            lock (channelcache)
                            {
                                NewChannel.refCount--;
                                if (NewChannel.refCount < 1)
                                {
                                    channelcache.Remove(Key);
                                }
                            }
                        };
                        channelcache[Key] = NewChannel;
                    }
                    result = channelcache[Key];
                    result.refCount++;
                    return(result);
                }
            }
 public ISO15765Session(J2534.Device Device) : base(new ISO15765Header(), SessionChannel.Factory.Create(Device, J2534.Protocol.ISO15765, J2534.Baud.ISO15765, J2534.ConnectFlag.NONE))
 {
     if (!sessionChannel.IsInitialized)
     {
         initializeChannel();
         sessionChannel.IsInitialized = true;
     }
 }
示例#3
0
 public PWMSession(J2534.Device Device) : base(SessionChannel.Factory.Create(Device, J2534.Protocol.J1850PWM, J2534.Baud.J1850PWM, J2534.ConnectFlag.NONE))
 {
     if (!sessionChannel.IsInitialized)
     {
         initializeChannel();
         sessionChannel.IsInitialized = true;
     }
 }
示例#4
0
 public FordCANSession(J2534.Device Device) : base(Device)
 {
 }
 public FordPWMSession(J2534.Device Device) : base(Device)
 {
 }
示例#6
0
 public VPWSession(J2534.Device Device) : base(SessionChannel.Factory.Create(Device, J2534.Protocol.J1850VPW, J2534.Baud.J1850VPW, J2534.ConnectFlag.NONE))
 {
 }
 public ISO14229Session(J2534.Device Device) : base(Device)
 {
 }
 public ISO9141Session(J2534.Device Device) : base(SessionChannel.Factory.Create(Device, J2534.Protocol.ISO9141, J2534.Baud.ISO9141, J2534.ConnectFlag.NONE))
 {
 }