BasedHardware / omi

AI wearables
https://omi.me
MIT License
3.64k stars 460 forks source link

Force clean cached bt device before ble disconnect, prevent the edeca… #847

Closed beastoin closed 1 month ago

beastoin commented 1 month ago

…se on the fast reconnecting

Summary by Entelligence.AI

- Refactor: Enhanced Bluetooth device disconnection process in the Flutter application. The update ensures a clean state by clearing cached Bluetooth device data before disconnecting, improving reliability on fast reconnects.
github-actions[bot] commented 1 month ago

Image description Entelligence.AI

Walkthrough

This update enhances the Bluetooth device disconnection process in a Flutter application. It ensures that cached device data is cleared only after disconnection, preventing potential issues during rapid reconnections. The changes also include code refactoring to remove redundancy and improve maintainability.

Changes

Files Summary
app/lib/pages/home/device.dart, app/lib/pages/home/device_settings.dart The changes enforce a clean state by setting BTDeviceStruct and deviceName to empty strings before disconnecting the Bluetooth device. Redundant code for setting these values post-disconnection has been removed. The disconnection process now precedes clearing of cached device info, mitigating issues on fast reconnecting.

🎉 Here's to the code that's lean and mean,

To the bugs that are no longer seen.

With each pull request, we strive,

To make our app more alive. 🚀

So here's to the devs, working night and day,

Making sure everything's A-OK! 👏


Uplevel your code reviews with Entelligence.AI Pro ### Entelligence.AI Pro If you like this project, please support us by purchasing the [Pro version](https://Entelligence.AI.ai). The Pro version has advanced context, superior noise reduction and several proprietary improvements compared to the open source version. Moreover, Entelligence.AI Pro is free for open source projects.