public static async void Test() { BrainDeviceManager.Init(); var sender = await BrainDeviceManager.Connnect("127.0.0.1", 9211); var cmdResult = await sender.Start(); if (cmdResult != CommandError.Success) { AppLogger.Error("Failed to start sampler"); return; } cmdResult = await sender.SetFilter(true); cmdResult = await sender.SetTrap(DevCommandSender.TrapSettingEnum.Trap_50); cmdResult = await sender.SetSampleRate(DevCommandSender.SampleRateEnum.SPS_250); cmdResult = await sender.QueryParam(); AppLogger.Debug("QueryParam result:" + cmdResult); await sender.Stop(); BrainDeviceManager.DisConnect(); }
static void Main(string[] args) { //OldTest(args); try { BrainDeviceManager.Test(); Console.ReadLine(); } catch (Exception e) { Console.WriteLine(e.Message); } }