DBus: rename ffDBusGetValue to ffDBusGetString; add ffDBusGetUint16

This commit is contained in:
Carter Li
2024-07-28 10:54:26 +08:00
parent a102f0505c
commit db1fbe0a30
4 changed files with 31 additions and 12 deletions
+3 -3
View File
@@ -61,11 +61,11 @@ static void detectBluetoothValue(FFDBusData* dbus, DBusMessageIter* iter, FFBlue
dbus->lib->ffdbus_message_iter_next(&dictIter);
if(ffStrEquals(deviceProperty, "Address"))
ffDBusGetValue(dbus, &dictIter, &device->address);
ffDBusGetString(dbus, &dictIter, &device->address);
else if(ffStrEquals(deviceProperty, "Name"))
ffDBusGetValue(dbus, &dictIter, &device->name);
ffDBusGetString(dbus, &dictIter, &device->name);
else if(ffStrEquals(deviceProperty, "Icon"))
ffDBusGetValue(dbus, &dictIter, &device->type);
ffDBusGetString(dbus, &dictIter, &device->type);
else if(ffStrEquals(deviceProperty, "Percentage"))
ffDBusGetByte(dbus, &dictIter, &device->battery);
else if(ffStrEquals(deviceProperty, "Connected"))
+4 -4
View File
@@ -61,13 +61,13 @@ static bool getBusProperties(FFDBusData* data, const char* busName, FFMediaResul
data->lib->ffdbus_message_iter_next(&dictIterator);
if(ffStrEquals(key, "xesam:title"))
ffDBusGetValue(data, &dictIterator, &result->song);
ffDBusGetString(data, &dictIterator, &result->song);
else if(ffStrEquals(key, "xesam:album"))
ffDBusGetValue(data, &dictIterator, &result->album);
ffDBusGetString(data, &dictIterator, &result->album);
else if(ffStrEquals(key, "xesam:artist"))
ffDBusGetValue(data, &dictIterator, &result->artist);
ffDBusGetString(data, &dictIterator, &result->artist);
else if(ffStrEquals(key, "xesam:url"))
ffDBusGetValue(data, &dictIterator, &result->url);
ffDBusGetString(data, &dictIterator, &result->url);
if(result->song.length > 0 && result->artist.length > 0 && result->album.length > 0 && result->url.length > 0)
break;