#include <stdio.h>
-#include <stdlib.h>
#include <stdint.h>
#include <stdbool.h>
#include <errno.h>
return -ECOMM;
}
-static GVariant *append_g_variant(const char *sig, const char *param[])
-{
- GVariantBuilder builder;
- char *ch;
- int i;
- struct dbus_byte *bytes;
-
- if (!sig || !param)
- return NULL;
-
- g_variant_builder_init(&builder, G_VARIANT_TYPE_TUPLE);
-
- for (ch = (char *)sig, i = 0; *ch != '\0'; ++i, ++ch) {
- switch (*ch) {
- case 'i':
- g_variant_builder_add(&builder, "i", atoi(param[i]));
- break;
- case 'u':
- g_variant_builder_add(&builder, "u", strtoul(param[i], NULL, 10));
- break;
- case 't':
- g_variant_builder_add(&builder, "t", atoll(param[i]));
- break;
- case 's':
- g_variant_builder_add(&builder, "s", param[i]);
- break;
- case 'a':
- ++ch;
- switch (*ch) {
- case 'y':
- ++i;
- bytes = (struct dbus_byte *)param[i];
- g_variant_builder_add(&builder, "@ay",
- g_variant_new_from_data(G_VARIANT_TYPE("ay"),
- bytes->data, bytes->size, TRUE, NULL, NULL));
- break;
- default:
- break;
- }
- break;
- default:
- return NULL;
- }
- }
-
- return g_variant_builder_end(&builder);
-}
-
static struct proxy_node *find_matched_proxy_node(const char *dest,
const char *path,
const char *interface)
return result;
}
-int dbus_method_sync(const char *dest, const char *path,
- const char *interface, const char *method,
- const char *sig, const char *param[])
-{
- return dbus_method_sync_var(dest,
- path,
- interface,
- method,
- append_g_variant(sig, param));
-}
-
//LCOV_EXCL_START Not called Callback
static void feedback_signal_callback(GDBusConnection *conn,
const gchar *sender,
int dbus_method_sync_var(const char *dest, const char *path,
const char *interface, const char *method, GVariant *param);
-int dbus_method_sync(const char *dest, const char *path,
- const char *interface, const char *method,
- const char *sig, const char *param[]);
/**
* If result is NULL, err is set.