internal void Update(VersionInformationCommand v) { Bootloader = v.BootloaderVersion; Firmware = v.FirmwareVersion; RadioBootloader = v.RadioBootloaderVersion; RadioFirmware = v.RadioFirmwareVersion; }
/// <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); }
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; }
bool SetReader(VersionInformationCommand version, int tries) { if (tries > 2) { return(false); } _commander.Execute(new AbortCommand()); _commander.Execute(new FactoryDefaultsCommand()); _commander.Execute(version); if (!version.Response.IsSuccessful) { return(SetReader(new VersionInformationCommand(), tries + 1)); } _info.Update(version); Messenger.Default.Send(new GenericMessage <TslReaderInfo>(_info)); return(true); }
public void Update(VersionInformationCommand v) { Serials.update(v); Versions.Update(v); Model = ModelFromSerial(v.SerialNumber); }
internal void update(VersionInformationCommand v) { Antenna = v.AntennaSerialNumber; Device = v.SerialNumber; Radio = v.RadioSerialNumber; }