This commit is contained in:
Denis 2023-12-26 15:00:57 +01:00
parent 6abee8e0e8
commit 8021eba1e4
No known key found for this signature in database
GPG key ID: DD9B63F805CF5C03

View file

@ -1205,21 +1205,7 @@ static int rc71l_platform_leds(const dev_in_settings_t *const conf, uint8_t r, u
}
// Append the property name and the new value to the message
dbus_message_append_args(message, DBUS_TYPE_STRING, &target_interface_name, DBUS_TYPE_STRING, &property_name, DBUS_TYPE_INVALID);
// Initialize an iterator for the message arguments
DBusMessageIter iter;
dbus_message_iter_init_append(message, &iter);
// Open the variant container
DBusMessageIter variantIter;
dbus_message_iter_open_container(&iter, DBUS_TYPE_VARIANT, "u", &variantIter);
// Append the uint32 value to the variant container
dbus_message_iter_append_basic(&variantIter, DBUS_TYPE_UINT32, &new_brightness);
// Close the variant container
dbus_message_iter_close_container(&iter, &variantIter);
dbus_message_append_args(message, DBUS_TYPE_STRING, &target_interface_name, DBUS_TYPE_STRING, &property_name, DBUS_TYPE_VARIANT, "v", DBUS_TYPE_UINT32, &new_brightness, DBUS_TYPE_INVALID);
// Send the message
DBusMessage *reply = dbus_connection_send_with_reply_and_block(platform->dbus_conn, message, -1, &platform->dbus_error);
@ -1235,7 +1221,7 @@ static int rc71l_platform_leds(const dev_in_settings_t *const conf, uint8_t r, u
// Handle the reply if needed
// Free the D-Bus message
dbus_message_unref(message);
//dbus_message_unref(message);
return 0;
}