void bluetooth_BluetoothStateChanged(Bluetooth sender, Bluetooth.BluetoothState btState)
 {
     // If the state is now "connected", we can do stuff over the link.
     if (btState == Bluetooth.BluetoothState.Connected)
     {
         Debug.Print("Connected");
     }
     // if the state is now "disconnected", you might need to stop other processes but for this example we'll just confirm that in the debug output window
     if (btState == Bluetooth.BluetoothState.Disconnected)
     {
         Debug.Print("Disconnected");
     }
 }
Пример #2
0
        private void OnBluetoothStateChanged(Bluetooth sender, Bluetooth.BluetoothState btState)
        {
            Debug.Print("SolarPulse - Bluetooth state changed - State: \"" + btState + "\".");

            switch (btState) {
                case Bluetooth.BluetoothState.Connected:
                    this.ShowMaintenanceScreen();
                    break;
                default:
                    if (previousBluetoothState == Bluetooth.BluetoothState.Connected) {
                        this.ShowMainScreen();
                    }
                    break;
            }
            this.previousBluetoothState = btState;
        }