Bluetooth (Linux): improve performance when showDisconnected == false

If no connected devices found, no dbus calls will be emitted

Fix #1450
This commit is contained in:
Carter Li
2024-12-20 11:07:09 +08:00
parent 4bef801337
commit 4f807f26a9
6 changed files with 28 additions and 8 deletions
+3 -3
View File
@@ -59,7 +59,7 @@ static void printDevice(FFBluetoothOptions* options, const FFBluetoothResult* de
void ffPrintBluetooth(FFBluetoothOptions* options)
{
FF_LIST_AUTO_DESTROY devices = ffListCreate(sizeof (FFBluetoothResult));
const char* error = ffDetectBluetooth(&devices);
const char* error = ffDetectBluetooth(options, &devices);
if(error)
{
@@ -155,11 +155,11 @@ void ffGenerateBluetoothJsonConfig(FFBluetoothOptions* options, yyjson_mut_doc*
ffPercentGenerateJsonConfig(doc, module, defaultOptions.percent, options->percent);
}
void ffGenerateBluetoothJsonResult(FF_MAYBE_UNUSED FFBluetoothOptions* options, yyjson_mut_doc* doc, yyjson_mut_val* module)
void ffGenerateBluetoothJsonResult(FFBluetoothOptions* options, yyjson_mut_doc* doc, yyjson_mut_val* module)
{
FF_LIST_AUTO_DESTROY results = ffListCreate(sizeof(FFBluetoothResult));
const char* error = ffDetectBluetooth(&results);
const char* error = ffDetectBluetooth(options, &results);
if (error)
{
yyjson_mut_obj_add_str(doc, module, "error", error);