Device cleanup (#592)
- Replaced device_find_\* usage by device_get_\* variants. - Removed deprecated device_find_\* functions. - Improved reliability of Bluetooth scanning, pairing, connection, and HID host lifecycle behavior, including peer auto-connect handling. - Improved Bluetooth/USB status indicators and clarified “Eject failed” alerts with the affected mount path.
This commit is contained in:
committed by
GitHub
parent
3354924359
commit
d1f06cb774
@@ -46,8 +46,12 @@ static void onEnableOnBootParentClicked(lv_event_t* event) {
|
||||
|
||||
static void onScanButtonClicked(lv_event_t* event) {
|
||||
auto bt = std::static_pointer_cast<BtManage>(getCurrentApp());
|
||||
Device* dev = device_find_first_active_by_type(&BLUETOOTH_TYPE);
|
||||
Device* dev = nullptr;
|
||||
device_get_first_active_by_type(&BLUETOOTH_TYPE, &dev);
|
||||
bool scanning = dev ? bluetooth_is_scanning(dev) : false;
|
||||
if (dev) {
|
||||
device_put(dev);
|
||||
}
|
||||
bt->getBindings().onScanToggled(!scanning);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user