/// <summary> /// Creates an initialized instance of the device configured with fusion and the default settings. /// </summary> public static NavioUcenterDevice Initialize() { // Create device var device = new NavioUcenterDevice(); // Return initialized device return(device); }
/// <summary> /// /// </summary> /// <param name="taskInstance"></param> public void Run(IBackgroundTaskInstance taskInstance) { // Get the deferral and save it to local variable so that the app stays alive backgroundTaskDeferral = taskInstance.GetDeferral(); taskInstance.Canceled += OnCanceled; try { // Initialize ublox device and reset to default config. ubloxService = NavioUcenterDevice.Initialize(); IAsyncAction asyncAction = ThreadPool.RunAsync((workItem) => { ubloxService.StartService(1031); }); Debug.WriteLine("Ublox background task is running..."); } catch (Exception ex) { Debug.WriteLine("Exception starting task: {0}", ex.Message); } }