mirror of
https://git.kernel.org/pub/scm/network/wireless/iwd.git
synced 2024-11-22 14:49:24 +01:00
dbus: add dbus_dict_append_bool
This commit is contained in:
parent
c550fb01f9
commit
1ff34e3f0f
11
src/dbus.c
11
src/dbus.c
@ -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)
|
||||
{
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user