-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Possible fix ajchellew/zwiftplay#7 #8
base: main
Are you sure you want to change the base?
Conversation
Add the IDisposable interface and Dispose method to the ZwiftPlayBleManager class. RegisterCharacteristics handles TaskCanceledException that can occur during BLE characteristic registration and provides clear feedback about the connection state. ConnectAsync method with proper null checks: checking for null references before proceeding with the BLE connection steps. ConnectAsync method more robust by using async/await properly and adding error handling.
The RequestLEScanAsync method needs BluetoothLEScanOptions. Handle the ObjectDisposedException by updating the scanning task. Enhance the error handling in Program.cs by adding TaskCanceledException to catch blocks. Add a null check for the ManufacturerData in the AdvertisementReceived event handler: This will ensure the code handles BLE advertisements without manufacturer data correctly and continues scanning for valid Zwift Play controllers.
Awesome, this is pretty much what I had fixed, but I'm a terrible github user.. so nothing was ever submitted.. I've been using more or less the same code for two weeks. I haven't had any issues with the 'unprocessed type 42' stuff.. and I know nothing of BT, so its blackmagic to me.. I've been using this console for indievelo to change virtual gears, change spotify music, brakes, u turn, etc.. fun times :) Glad my controllers have a use again! |
AllowUnsafeBlocks
Unreachable part removed
Minor changes
Added logging class and methods Moved some config parameters to new class
Just some changes to add a logging facility, helping to identify decrypt issue. |
SendKeys no longer defined in code, instead moved to config and can be set on command line as well (--sendkeys)
Moved SendKeys to configuration and command line |
Added keyboard mapping to configuration |
- Moved configuration to JSON file. -- Moved BleScanConfig part into AppSettings. - Added MappingFile optionto use a JSON file which contains keyboard mapping. -- Added default TPVirtual.json file. -- Keyboard mapping allows shift key combinations to use - More robust BT device implementation with cleanup -- Possible ToDo: implement BLE retry logic - App class now IDisposable
|
Hi,
these changes might fix #7
Still some work to do, as I encounter unknown messages:
But before I continue let's fix this state.
Best
Oliver