Skip to content
This repository has been archived by the owner on Nov 21, 2020. It is now read-only.

Commit

Permalink
Temporary hack for profiles not being saved on close
Browse files Browse the repository at this point in the history
  • Loading branch information
kprinssu committed Jul 27, 2016
1 parent f27d72a commit 83eba7d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 11 deletions.
14 changes: 5 additions & 9 deletions AnneProKeyboard/MainPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -131,12 +131,6 @@ private void StartScanning()
DeviceWatcher.Start();
}

private void StopScanning()
{
Watcher.Stop();
DeviceWatcher.Stop();
}

private void SetupBluetooth()
{
Watcher = new BluetoothLEAdvertisementWatcher { ScanningMode = BluetoothLEScanningMode.Active };
Expand All @@ -153,7 +147,7 @@ private async void DeviceFound(BluetoothLEAdvertisementWatcher watcher, Bluetoot
{
if (btAdv.Advertisement.LocalName.Contains("ANNE"))
{
await Dispatcher.RunAsync(CoreDispatcherPriority.Low, async () =>
await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, async () =>
{
var device = await BluetoothLEDevice.FromBluetoothAddressAsync(btAdv.BluetoothAddress);
var result = await device.DeviceInformation.Pairing.PairAsync(DevicePairingProtectionLevel.None);
Expand Down Expand Up @@ -206,9 +200,8 @@ await Dispatcher.RunAsync(CoreDispatcherPriority.High, () =>
this.syncButton.IsEnabled = true;
});
}
catch (Exception)
catch
{

}
}

Expand Down Expand Up @@ -345,6 +338,9 @@ private void KeyboardColourButton_Click(object sender, RoutedEventArgs e)
{
this.EditingProfile.KeyboardColours[button_index - 1] = this.SelectedColour;
}

//this may be wasteful, only way to counteract the fact that we cannot save on close
this.SaveProfiles();
}

private void ProfileNameChangedEvent_TextChanged(object sender, TextChangedEventArgs e)
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ A Universal Windows App for controlling the an Anne Pro keyboard over Bluetooth
## Requirements
This app has been tested against Windows 10. Windows 8 should be supported, but futher testing is required.
Windows 7 will not be supported due to lack of support by Microsoft.
The keyboard has to be L0 mode by: pressing Fn+B, Fn+0, ESC, Fn+B, +

## Supported Features
* Automatic keyboard pairing (launch the app, and it should start scanning for the keyboard)
Expand All @@ -16,8 +17,7 @@ Windows 7 will not be supported due to lack of support by Microsoft.
* Improve changing multiple button keyboard light colours

## Known Bugs
* Profiles are not saved when the app closes
* If the keyboard has been paired before, and connecting the keyboard will cause the app to not detect the keyboard (restarting the app fixes this)
* If the keyboard has been paired before, and connecting the keyboard after launching the app will cause the app to not detect the keyboard (restarting the app will fix this)

## License
The codebase and the project are released under the permissive MIT License.
Expand Down

0 comments on commit 83eba7d

Please sign in to comment.