Beispiel #1
0
        /// <summary>
        /// Synchronously issues a read request and waits for the response
        /// </summary>
        public byte[] SyncReadMultiple(IList <int> addresses)
        {
            SsmPacket request  = SsmPacket.CreateMultipleReadRequest(addresses);
            SsmPacket response = this.SyncSendReceive(request);

            return(((List <byte>)response.Values).ToArray());
        }
Beispiel #2
0
        /// <summary>
        /// Begins reading multiple disjoint addesses from the ECU
        /// </summary>
        public IAsyncResult BeginMultipleRead(IList <int> addresses, AsyncCallback callback, object state)
        {
            this.BeginOperation();

            MultipleReadAsyncResult internalState = new MultipleReadAsyncResult(callback, state);
            SsmPacket request = SsmPacket.CreateMultipleReadRequest(addresses);

            this.stream.BeginWrite(
                request.Data,
                0,
                request.Data.Length,
                this.MultipleReadRequestWritten,
                internalState);
            return(internalState);
        }