public async Task InitSessionAsync()
        {
            await this.ConnectSlaveAsync().ConfigureAwait(false);

            foreach (var operation in this.config.Operations.Values)
            {
                operation.RequestLength = this.RequestSize;
                operation.Request       = new byte[this.RequestSize];
                operation.Decoder       = DataDecoderFactory.CreateDecoder(operation.FunctionCode, operation.DataType);

                this.EncodeRead(operation);
            }
        }
Exemplo n.º 2
0
 public DeviceQuery(DriverFactory driverFactory, DataDecoderFactory decoderFactory)
 {
     _driverFactory  = driverFactory;
     _decoderFactory = decoderFactory;
 }