Пример #1
0
        static async Task Main(string[] args)
        {
            System.Console.WriteLine("Hello World!");

            var logger = new ConsoleLoggerProvider((s, level) => true, true).CreateLogger("test");

            var driver = new BaosDriver("/dev/ttyAMA0", logger, new DataReceiver(logger));

            await driver.Start();

            //var desc = await driver.GetDatapointDescriptions();

            logger.LogDebug($"GetDpValues...");
            var data = await driver.GetDatapointValue(1, 1);

            logger.LogDebug($"GetDpValues...done");


            logger.LogDebug($"setDpValue...");
            var data1 = await driver.GetDatapointValue(2, 1);

            //var sendData = await driver.SetDatapointValue(1, new byte[] { 0x00 });
            logger.LogDebug($"setDpValue...done");

            System.Console.ReadLine();

            await driver.Stop();
        }
Пример #2
0
 public override async Task <bool> Start()
 {
     if (await _driver.Start())
     {
         return(await base.Start());
     }
     return(false);
 }