initial commit
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
using RTCSync.Models;
|
||||
using RTCSync.Services;
|
||||
using RTCSync.Utils;
|
||||
|
||||
namespace RTCSync.Options;
|
||||
|
||||
public class ReadTimeOption : IOption
|
||||
{
|
||||
public string Description =>
|
||||
"Чтение времени с часов реального времени.";
|
||||
|
||||
public List<string> OptionNames => ["-r", "--read-time"];
|
||||
|
||||
public string OptionValues => "";
|
||||
|
||||
public void Execute(OptionArgs args)
|
||||
{
|
||||
// bind and init CH431
|
||||
var device = DeviceDispatcher.SetUpDevice();
|
||||
if (device == null)
|
||||
return;
|
||||
while (true)
|
||||
{
|
||||
DeviceReaders.PrintTimeRTC(device);
|
||||
Thread.Sleep(500);
|
||||
}
|
||||
|
||||
device.ReleaseInterface(0);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user