Ejemplo n.º 1
0
        /// <summary>
        /// Send ID & IV commands to update the device info property
        /// </summary>
        /// <returns></returns>
        public async Task UpdateDeviceInfoAsync()
        {
            if (!Connected)
                throw new LidaRxStateException("This instance is not yet connected to the Sweep scanner.");

            // gather information about the device
            var idCommand = new DeviceInformationCommand();
            var ivCommand = new VersionInformationCommand();

            await SimpleCommandTxRxAsync(idCommand);
            await SimpleCommandTxRxAsync(ivCommand);

            FillDeviceInfo(idCommand, ivCommand);
        }
Ejemplo n.º 2
0
        private void FillDeviceInfo(DeviceInformationCommand idCommand, VersionInformationCommand ivCommand)
        {
            this.Info.BitRate = idCommand.SerialBitrate.Value;
            this.Info.LaserState = idCommand.LaserState.Value;
            this.Info.Mode = idCommand.Mode.Value;
            this.Info.Diagnostic = idCommand.Diagnostic.Value;
            this.Info.MotorSpeed = idCommand.MotorSpeed ?? SweepMotorSpeed.SpeedUnknown;
            this.Info.SampleRate = SweepConfigHelpers.IntToSweepSampleRate(idCommand.SampleRate.Value);

            this.Info.SerialNumber = ivCommand.SerialNumber.ToString();
            this.Info.Protocol = ivCommand.ProtocolVersion.Value.ToString();
            this.Info.FirmwareVersion = ivCommand.FirmwareVersion.ToString();
            this.Info.HardwareVersion = ivCommand.HardwareVersion.ToString();
            this.Info.Model = ivCommand.Model;
        }