Esempio n. 1
0
 public J2534HeapMessage(J2534PROTOCOL ProtocolID, J2534TXFLAG TxFlags, byte[] Data)
 {
     pMessage        = Marshal.AllocHGlobal(CONST.J2534MESSAGESIZE);
     this.ProtocolID = ProtocolID;
     this.TxFlags    = TxFlags;
     this.Data       = Data;
 }
 public void InsertSingle(J2534PROTOCOL ProtocolID, J2534TXFLAG TxFlags, IEnumerable <byte> Data)
 {
     Length = 1;
     Marshal.WriteInt32(pMessages, (int)ProtocolID);
     Marshal.WriteInt32(pMessages, 8, (int)TxFlags);
     MarshalIEnumerableToHeapData(pMessages, Data);
 }
Esempio n. 3
0
 public void PopulateWith(J2534PROTOCOL ProtocolID, J2534TXFLAG TxFlags, byte[] Data)
 {
     Length = 1;
     Marshal.WriteInt32(pMessages, (int)ProtocolID);
     Marshal.WriteInt32(pMessages, 8, (int)TxFlags);
     Marshal.WriteInt32(pMessages, 16, Data.Length);
     Marshal.Copy(Data, 0, IntPtr.Add(pMessages, 24), Data.Length);
 }
Esempio n. 4
0
 //Channel Constructor
 internal Channel(J2534Device Device, J2534PROTOCOL ProtocolID, J2534BAUD Baud, J2534CONNECTFLAG ConnectFlags)
 {
     HeapMessageArray  = new J2534HeapMessageArray(CONST.HEAPMESSAGEBUFFERSIZE);
     this.Device       = Device;
     this.ProtocolID   = ProtocolID;
     this.Baud         = (int)Baud;
     this.ConnectFlags = ConnectFlags;
     DefaultTxTimeout  = 50;
     DefaultRxTimeout  = 250;
     DefaultTxFlag     = J2534TXFLAG.NONE;
     Connect();
 }
Esempio n. 5
0
 public J2534Message(J2534PROTOCOL ProtocolID, J2534TXFLAG TxFlags, byte[] Data)
 {
     this.ProtocolID = ProtocolID;
     this.TxFlags    = TxFlags;
     if (Data == null)
     {
         this.Data = Array.Empty <byte>();
     }
     else
     {
         this.Data = Data;
     }
 }
        public void DeepCopy(J2534MessageList Messages)
        {
            if (Messages.Count > array_max_length)
            {
                throw new ArgumentException("J2534MessageList Count exceeds J2534HeapMessageArray buffer length!");
            }
            ProtocolID = Messages.ProtocolID;
            int index = 0;

            for (; index < Messages.Count; index++)
            {
                InsertAt(index, Messages[index]);
                index++;
            }
            Length = index;
        }
Esempio n. 7
0
 public J2534HeapMessage(J2534PROTOCOL ProtocolID, J2534TXFLAG TxFlags, IEnumerable <byte> Data) : this()
 {
     this.ProtocolID = ProtocolID;
     this.TxFlags    = TxFlags;
     this.Data       = Data;
 }
Esempio n. 8
0
 public Channel ConstructChannel(J2534PROTOCOL ProtocolID, J2534BAUD Baud, J2534CONNECTFLAG ConnectFlags)
 {
     return(new Channel(this, ProtocolID, Baud, ConnectFlags));
 }