コード例 #1
0
        /// <summary>
        /// Executes the task.
        /// </summary>
        public void Run(IBackgroundTaskInstance taskInstance)
        {
            // Create the RC input device
            using (var rcInput = new NavioRCInputDevice())
            {
                // Receive notifcations when frames arrive
                rcInput.ChannelsChanged += OnChannelsChanged;

                // Wait forever (this background task has no GUI)
                rcInput.Stopped.WaitOne();
            }
        }
コード例 #2
0
        /// <summary>
        /// Executes the task.
        /// </summary>
        public void Run(IBackgroundTaskInstance taskInstance)
        {
            // Create the RC input device
            using (var rcInput = new NavioRCInputDevice())
            {
                // Log start
                Debug.WriteLine("Navio RC input test start.");

                // Start receiving frames
                Debug.WriteLine("Waiting for valid PWM frames...");
                rcInput.ChannelsChanged += OnChannelsChanged;

                // Wait forever (this background task has no GUI)
                rcInput.Stopped.WaitOne();
            }
        }
コード例 #3
0
 /// <summary>
 /// Creates an instance.
 /// </summary>
 public RCInputTestUIModel(TaskFactory uiThread) : base(uiThread)
 {
     // Initialize device
     Device = new NavioRCInputDevice();
     Device.ChannelsChanged += OnChannelsChanged;
 }