sensboston / BLEConsole

Bluetooth Low Energy device console app
https://sensboston.github.io/BLEConsole
MIT License
196 stars 73 forks source link

Unsubscribe does not work correctly #34

Open dlkeng opened 9 months ago

dlkeng commented 9 months ago

Using the "unsub all" command does not actually work! In the file "Program.cs", it appears that line 1322 never returns to complete the unsubscribe operation.

I found the following changes allow the unsubscribe to work: Line 1303: was: static async void Unsubscribe(string param) change to: static async Task Unsubscribe(string param)

Line 793: was: if (_subscribers.Count > 0) Unsubscribe("all"); change to: if (_subscribers.Count > 0) await Unsubscribe("all");

Line 790: was: static void CloseDevice() change to: static async Task CloseDevice()

Line 742: was: CloseDevice(); change to: await CloseDevice();

Line 380: was: Unsubscribe(parameters); change to: await Unsubscribe(parameters);

Line 334: was: CloseDevice(); change to: await CloseDevice();

Line 286: insert: if (_selectedDevice != null) { await CloseDevice(); }

sensboston commented 9 months ago

@dlkeng, please provide your changes by the usual way: