Ejemplo n.º 1
0
        /// <summary>
        /// Synchronously issues a block read request and waits for the response
        /// </summary>
        public byte[] SyncReadBlock(int address, int length)
        {
            SsmPacket request  = SsmPacket.CreateBlockReadRequest(address, length);
            SsmPacket response = this.SyncSendReceive(request);

            return(((List <byte>)response.Values).ToArray());
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Read a block of RAM from the ECU
        /// </summary>
        public IAsyncResult BeginBlockRead(int address, int length, AsyncCallback callback, object state)
        {
            this.BeginOperation();

            BlockReadAsyncResult internalState = new BlockReadAsyncResult(callback, state);
            SsmPacket            request       = SsmPacket.CreateBlockReadRequest(address, length);

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