andyvorld / LGSTrayBattery

A tray app used to track battery levels of wireless Logitech mouse.
GNU General Public License v3.0
369 stars 30 forks source link

Crashes when Rescan device #45

Closed karanrahar closed 1 year ago

karanrahar commented 1 year ago

With my G935 connected to power, if I rescan devices, the icon crashes Here are the error logs -

System.IO.IOException: An error occurred while attempting to write to the device ---> Device.Net.Exceptions.NotInitializedException: The device has not been initialized at Hid.Net.Windows.WindowsHidHandler.WriteReportAsync(Byte[] data, Byte reportId, CancellationToken cancellationToken) in /_/src/Hid.Net/Windows/WindowsHidHandler.cs:line 205 at Hid.Net.HidDevice.WriteReportAsync(Byte[] data, Byte reportId, CancellationToken cancellationToken) in /_/src/Hid.Net/HidDevice.cs:line 189 --- End of inner exception stack trace --- at Hid.Net.HidDevice.WriteReportAsync(Byte[] data, Byte reportId, CancellationToken cancellationToken) in /_/src/Hid.Net/HidDevice.cs:line 189 at LGSTrayHID.LogiDeviceHandler.UpdateBatteryStatus() in E:\repos\LGSTrayBattery\LGSTrayHID\LogiDeviceHandler.cs:line 181 at LGSTrayHID.LogiDeviceHandler.UpdateBattery() in E:\repos\LGSTrayBattery\LGSTrayHID\LogiDeviceHandler.cs:line 168 at LGSTrayHID.HIDDeviceManager.UpdateDevicesAsync() in E:\repos\LGSTrayBattery\LGSTrayHID\HIDDeviceManager.cs:line 55 at LGSTrayGUI.MainWindowViewModel.<>c__DisplayClass26_01.<b2>d.MoveNext() in E:\repos\LGSTrayBattery\LGSTrayGUI\MainWindowViewModel.cs:line 164 --- End of stack trace from previous location --- at System.Threading.Tasks.Task.<>c.b128_1(Object state) at System.Threading.QueueUserWorkItemCallback.<>c.<.cctor>b__6_0(QueueUserWorkItemCallback quwi) at System.Threading.ExecutionContext.RunForThreadPoolUnsafe[TState](ExecutionContext executionContext, Action1 callback, TState& state) at System.Threading.QueueUserWorkItemCallback.Execute() at System.Threading.ThreadPoolWorkQueue.Dispatch() at System.Threading.PortableThreadPool.WorkerThread.WorkerThreadStart() at System.Threading.Thread.StartCallback()