예제 #1
0
        public async void Run(IBackgroundTaskInstance taskInstance)
        {
            //Deferral task to allow for async
            BackgroundTaskDeferral deferral = taskInstance.GetDeferral();

            var app = new AppIoTBackgroundDeviceTask <SoundSensorState, SoundSensorStateReported>("SoundSensor", new Guid("8e2fb18a-e7ae-45f9-bf05-d42455ba6ce0"));

            app.InitApplication     += InitApplication;
            app.StartApplication    += StartApplication;
            app.ChangeConfiguration += ReceiveDesiredConfiguration;

            await app.Run();

            deferral.Complete();
        }
예제 #2
0
        public async void Run(IBackgroundTaskInstance taskInstance)
        {
            //Deferral task to allow for async
            BackgroundTaskDeferral deferral = taskInstance.GetDeferral();

            var app = new AppIoTBackgroundDeviceTask <SmartBulbState, SmartBulbStateReported>("SmartBulb", new Guid("26fcf049-de51-4fe4-9015-8a0245fa8aa8"));

            app.InitApplication         += InitApplication;
            app.StartApplication        += StartApplication;
            app.RunApplication          += RunApplication;
            app.EndApplication          += EndApplication;
            app.GeneralError            += GeneralError;
            app.ChangeConfiguration     += ReceiveDesiredConfiguration;
            app.DisconnectedApplication += DisconnectedApplication;
            app.TestMethod += TestMethod;

            await app.Run();

            deferral.Complete();
        }