public J2534MessageList ToJ2534MessageList()
        {
            J2534MessageList return_list = new J2534MessageList();

            return_list.ProtocolID = ProtocolID;
            for (int i = 0; i < Length; i++)
            {
                return_list.Add(ElementAt(i));
            }
            return(return_list);
        }
Пример #2
0
        /// <summary>
        /// Sends all messages contained in 'MsgList'
        /// </summary>
        /// <returns>Returns 'false' if successful</returns>
        public J2534Status SendMessages(J2534MessageList Messages)
        {
            J2534Status Status = new J2534Status();

            lock (Device.Library.API_LOCK)
            {
                HeapMessageArray.DeepCopy(Messages);
                Status.Code = Device.Library.API.WriteMsgs(ChannelID, HeapMessageArray.Ptr, HeapMessageArray.Length.Ptr, DefaultTxTimeout);
                if (Status.IsNotOK)
                {
                    Status.Description = Device.Library.GetLastError();
                }
            }
            return(Status);
        }
        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;
        }