Exemplo n.º 1
0
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            var board = RaspberryPi2Board.GetDefault();

            if (board != null)
            {
                board.PowerLed.TurnOff();
                board.StatusLed.TurnOn();
            }

            base.OnNavigatedTo(e);
        }
Exemplo n.º 2
0
        protected async override void OnNavigatedTo(NavigationEventArgs e)
        {
            await connection.ConnectAsync();

            var board = RaspberryPi2Board.GetDefault();

            if (board != null)
            {
                board.PowerLed.TurnOff();
                board.StatusLed.TurnOn();
            }

            if (!string.IsNullOrWhiteSpace(deviceName) && !string.IsNullOrWhiteSpace(deviceKey))
            {
                geolocator = new Geolocator();
                geolocator.PositionChanged += OnPositionChanged;

                deviceClient = DeviceClient.Create(iotHubUri, new DeviceAuthenticationWithRegistrySymmetricKey(deviceName, deviceKey),
                                                   TransportType.Http1);
            }

            timer.Start();
            base.OnNavigatedTo(e);
        }