3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-11-22 14:39:39 +01:00

dbus: add dbus_dict_append_bool

This commit is contained in:
Denis Kenzior 2014-10-23 16:48:32 -05:00
parent c550fb01f9
commit 1ff34e3f0f
2 changed files with 13 additions and 0 deletions

View File

@ -48,6 +48,17 @@ void dbus_dict_append_string(struct l_dbus_message_builder *builder,
l_dbus_message_builder_leave_dict(builder);
}
void dbus_dict_append_bool(struct l_dbus_message_builder *builder,
const char *key, bool boolval)
{
l_dbus_message_builder_enter_dict(builder, "sv");
l_dbus_message_builder_append_basic(builder, 's', key);
l_dbus_message_builder_enter_variant(builder, "b");
l_dbus_message_builder_append_basic(builder, 'b', &boolval);
l_dbus_message_builder_leave_variant(builder);
l_dbus_message_builder_leave_dict(builder);
}
static void request_name_callback(struct l_dbus_message *message,
void *user_data)
{

View File

@ -33,6 +33,8 @@ struct l_dbus *dbus_get_bus(void);
void dbus_dict_append_string(struct l_dbus_message_builder *builder,
const char *key, const char *strval);
void dbus_dict_append_bool(struct l_dbus_message_builder *builder,
const char *key, bool boolval);
bool dbus_init(void);
bool dbus_exit(void);