DBus: expands Get(U)Int to (u)int64

This commit is contained in:
Carter Li
2026-05-11 23:24:45 +08:00
parent 43ddbdca85
commit efca4f3597
5 changed files with 40 additions and 16 deletions
+1 -1
View File
@@ -69,7 +69,7 @@ static bool detectBluetoothValue(FFDBusData* dbus, DBusMessageIter* iter, FFBlue
} else if (ffStrEquals(deviceProperty, "Icon")) {
ffDBusGetString(dbus, &dictIter, &device->type);
} else if (ffStrEquals(deviceProperty, "Percentage")) {
uint32_t percentage;
uint64_t percentage;
if (ffDBusGetUint(dbus, &dictIter, &percentage)) {
device->battery = (uint8_t) percentage;
}
@@ -56,12 +56,15 @@ static const char* detectBluetoothProperty(FFBluetoothRadioResult* device, FFDBu
} else if (ffStrEquals(deviceProperty, "Alias")) {
ffDBusGetString(dbus, &dictIter, &device->name);
} else if (ffStrEquals(deviceProperty, "Manufacturer")) {
uint32_t vendorId;
uint64_t vendorId;
if (ffDBusGetUint(dbus, &dictIter, &vendorId)) {
ffStrbufSetStatic(&device->vendor, ffBluetoothRadioGetVendor(vendorId));
ffStrbufSetStatic(&device->vendor, ffBluetoothRadioGetVendor((uint32_t) vendorId));
}
} else if (ffStrEquals(deviceProperty, "Version")) {
ffDBusGetUint(dbus, &dictIter, (uint32_t*) &device->lmpVersion);
uint64_t version;
if (ffDBusGetUint(dbus, &dictIter, &version)) {
device->lmpVersion = (int32_t) version;
}
} else if (ffStrEquals(deviceProperty, "Powered")) {
ffDBusGetBool(dbus, &dictIter, &device->enabled);
} else if (ffStrEquals(deviceProperty, "Discoverable")) {