本文整理汇总了C++中dbus_message_iter_next函数的典型用法代码示例。如果您正苦于以下问题:C++ dbus_message_iter_next函数的具体用法?C++ dbus_message_iter_next怎么用?C++ dbus_message_iter_next使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了dbus_message_iter_next函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: gconf_dbus_utils_get_entries
/* Get a list of entries from an array. */
GSList *
gconf_dbus_utils_get_entries (DBusMessageIter *iter, const gchar *dir)
{
GSList *entries;
DBusMessageIter array_iter;
entries = NULL;
dbus_message_iter_recurse (iter, &array_iter);
/* Loop through while there are structs (entries). */
while (dbus_message_iter_get_arg_type (&array_iter) == DBUS_TYPE_STRUCT)
{
gchar *key;
GConfValue *value;
gboolean is_default;
gboolean is_writable;
gchar *schema_name;
GConfEntry *entry;
if (!utils_get_entry_values_stringified (&array_iter,
&key,
&value,
&is_default,
&is_writable,
&schema_name))
break;
entry = gconf_entry_new_nocopy (gconf_concat_dir_and_key (dir, key), value);
gconf_entry_set_is_default (entry, is_default);
gconf_entry_set_is_writable (entry, is_writable);
if (schema_name)
gconf_entry_set_schema_name (entry, schema_name);
entries = g_slist_prepend (entries, entry);
dbus_message_iter_next (&array_iter);
}
return entries;
}
示例2: check_networks
static void check_networks(DBusMessageIter *array)
{
DBusMessageIter value;
if (dbus_message_iter_get_arg_type(array) != DBUS_TYPE_ARRAY)
return;
dbus_message_iter_recurse(array, &value);
while (dbus_message_iter_get_arg_type(&value) == DBUS_TYPE_OBJECT_PATH) {
const char *path;
dbus_message_iter_get_basic(&value, &path);
add_network(path);
dbus_message_iter_next(&value);
}
}
示例3: service_method_create_with_master_password
static DBusMessage*
service_method_create_with_master_password (GkdSecretService *self, DBusMessage *message)
{
DBusError derr = DBUS_ERROR_INIT;
DBusMessageIter iter, array;
DBusMessage *reply = NULL;
GkdSecretSecret *secret = NULL;
GckAttributes *attrs = NULL;
gchar *path;
/* Parse the incoming message */
if (!dbus_message_has_signature (message, "a{sv}(oayays)"))
return NULL;
if (!dbus_message_iter_init (message, &iter))
g_return_val_if_reached (NULL);
attrs = gck_attributes_new ();
dbus_message_iter_recurse (&iter, &array);
if (!gkd_secret_property_parse_all (&array, SECRET_COLLECTION_INTERFACE, attrs)) {
gck_attributes_unref (attrs);
return dbus_message_new_error (message, DBUS_ERROR_INVALID_ARGS,
"Invalid properties argument");
}
dbus_message_iter_next (&iter);
secret = gkd_secret_secret_parse (self, message, &iter, &derr);
if (secret == NULL) {
gck_attributes_unref (attrs);
return gkd_secret_error_to_reply (message, &derr);
}
gck_attributes_add_boolean (attrs, CKA_TOKEN, TRUE);
path = gkd_secret_create_with_secret (attrs, secret, &derr);
gck_attributes_unref (attrs);
gkd_secret_secret_free (secret);
if (path == NULL)
return gkd_secret_error_to_reply (message, &derr);
reply = dbus_message_new_method_return (message);
dbus_message_append_args (reply, DBUS_TYPE_OBJECT_PATH, &path, DBUS_TYPE_INVALID);
g_free (path);
return reply;
}
示例4: parse_input_request
static bool parse_input_request(DBusMessageIter *arg, void *user_data)
{
struct agent_input_data *data = user_data;
const char *name;
printf("parse_input_request\n");
if (cui_dbus_get_basic(arg, DBUS_TYPE_STRING, &name) != 0)
return FALSE;
dbus_message_iter_next(arg);
if (g_strcmp0(name, "Passphrase") == 0)
data->passphrase = TRUE;
else if (g_strcmp0(name, "WPS") == 0)
data->wpspin = TRUE;
else if (g_strcmp0(name, "Name") == 0)
data->hidden = TRUE;
else if (g_strcmp0(name, "Identity") == 0)
data->identity = TRUE;
else if (g_strcmp0(name, "Username") == 0)
data->login = TRUE;
else if (g_strcmp0(name, "PreviousPassphrase") == 0) {
DBusMessageIter dict;
const char **value;
const char *type;
dbus_message_iter_recurse(arg, &dict);
cui_dbus_get_dict_entry_basic(&dict,
"Type", DBUS_TYPE_STRING, &type);
if (g_strcmp0(type, "psk") == 0)
value = &data->previous_passphrase;
else if (g_strcmp0(type, "wpspin") == 0)
value = &data->previous_wpspin;
cui_dbus_get_dict_entry_basic(&dict,
"Value", DBUS_TYPE_STRING, &value);
}
return FALSE;
}
示例5: audio_changed
static gboolean audio_changed(DBusConnection *conn,
DBusMessage *msg, void *user_data)
{
struct modem_data *modem = user_data;
DBusMessageIter iter, value;
const char *key;
if (dbus_message_iter_init(msg, &iter) == FALSE)
return TRUE;
dbus_message_iter_get_basic(&iter, &key);
dbus_message_iter_next(&iter);
dbus_message_iter_recurse(&iter, &value);
audio_set(modem, key, &value);
return TRUE;
}
示例6: decode_string
void
decode_string(DBusMessageIter *iter, int *err, const char **pval)
{
const char *tmp = 0;
if( err != 0 )
{
if( dbus_message_iter_get_arg_type(iter) == DBUS_TYPE_STRING )
{
dbus_message_iter_get_basic(iter, &tmp);
dbus_message_iter_next(iter);
}
else
{
SET_ERR;
}
}
*pval = tmp;
}
示例7: btd_error_invalid_args
static DBusMessage *set_property(DBusConnection *conn,
DBusMessage *msg, void *data)
{
struct monitor *monitor = data;
const char *property;
DBusMessageIter iter;
DBusMessageIter sub;
const char *level;
if (!dbus_message_iter_init(msg, &iter))
return btd_error_invalid_args(msg);
if (dbus_message_iter_get_arg_type(&iter) != DBUS_TYPE_STRING)
return btd_error_invalid_args(msg);
dbus_message_iter_get_basic(&iter, &property);
dbus_message_iter_next(&iter);
if (dbus_message_iter_get_arg_type(&iter) != DBUS_TYPE_VARIANT)
return btd_error_invalid_args(msg);
dbus_message_iter_recurse(&iter, &sub);
if (dbus_message_iter_get_arg_type(&sub) != DBUS_TYPE_STRING)
return btd_error_invalid_args(msg);
dbus_message_iter_get_basic(&sub, &level);
if (g_str_equal("ImmediateAlertLevel", property)) {
if (monitor->enabled.findme == FALSE &&
monitor->enabled.pathloss == FALSE)
return btd_error_not_available(msg);
return set_immediate_alert(conn, msg, level, data);
} else if (g_str_equal("LinkLossAlertLevel", property)) {
if (monitor->enabled.linkloss == FALSE)
return btd_error_not_available(msg);
return set_link_loss_alert(conn, msg, level, data);
}
return btd_error_invalid_args(msg);
}
示例8: handle_signal_callback
void handle_signal_callback(gpointer no_used_key, struct SignalInfo* info, DBusMessage *msg)
{
NOUSED(no_used_key);
DBusMessageIter iter;
dbus_message_iter_init(msg, &iter);
int num = g_slist_length(info->signatures);
JSValueRef *params = g_new(JSValueRef, num);
for (int i=0; i<num; i++) {
params[i] = dbus_to_js(get_global_context(), &iter);
if (!dbus_message_iter_next(&iter)) {
}
}
g_assert(info->callback != NULL);
JSObjectCallAsFunction(get_global_context(),
info->callback, NULL,
num, params, NULL);
g_free(params);
}
示例9: call_added
static gboolean call_added(DBusConnection *conn,
DBusMessage *msg, void *user_data)
{
struct modem_data *modem = user_data;
DBusMessageIter iter, dict;
const char *path;
if (dbus_message_iter_init(msg, &iter) == FALSE)
return TRUE;
dbus_message_iter_get_basic(&iter, &path);
dbus_message_iter_next(&iter);
dbus_message_iter_recurse(&iter, &dict);
create_call(modem, path, &iter);
return TRUE;
}
示例10: DBG
/*
* Phdc Manager requests to be removed from the existing list of managers.
*/
static DBusMessage *dbus_unregister_phdc_agent(DBusConnection *conn,
DBusMessage *msg, void *data)
{
struct near_phdc_data *mgr;
DBusMessageIter iter;
const char *path, *role, *sender;
DBG("conn %p", conn);
if (!dbus_message_iter_init(msg, &iter))
return error_invalid_arguments(msg);
if (dbus_message_iter_get_arg_type(&iter) != DBUS_TYPE_OBJECT_PATH)
return error_invalid_arguments(msg);
sender = dbus_message_get_sender(msg);
dbus_message_iter_get_basic(&iter, &path);
dbus_message_iter_next(&iter);
if (dbus_message_iter_get_arg_type(&iter) != DBUS_TYPE_STRING)
return error_invalid_arguments(msg);
dbus_message_iter_get_basic(&iter, &role);
/* look for specific path */
mgr = search_mgr_list_by_path(path);
if (!mgr)
return error_not_found(msg);
DBG("%s", mgr->sender);
if (strncmp(sender, mgr->sender, strlen(mgr->sender)))
return error_permission_denied(msg);
/* remove it */
near_p2p_unregister(mgr->p2p_driver);
g_hash_table_remove(mgr_list, mgr->p2p_driver->service_name);
return g_dbus_create_reply(msg, DBUS_TYPE_INVALID);
}
示例11: ring_callback
static void ring_callback (plugin_t *p, DBusMessage *msg, void *data)
{
at_modem_t *m = data;
DBusMessageIter call;
/* Skip call object path */
if (!dbus_message_iter_init (msg, &call)
|| dbus_message_iter_get_arg_type (&call) != DBUS_TYPE_OBJECT_PATH)
return;
dbus_message_iter_next (&call);
/* Only care about incoming or waiting calls */
const char *str = ofono_dict_find_string (&call, "State");
if (str == NULL)
return;
if (!strcmp (str, "incoming"))
incoming_call (p, &call, m);
if (!strcmp (str, "waiting"))
waiting_call (p, &call, m);
}
示例12: decode_bool
void
decode_bool(DBusMessageIter *iter, int *err, int *pval)
{
dbus_bool_t val = 0;
if( *err == 0 )
{
if( dbus_message_iter_get_arg_type(iter) == DBUS_TYPE_BOOLEAN )
{
dbus_message_iter_get_basic(iter, &val);
dbus_message_iter_next(iter);
}
else
{
SET_ERR;
}
}
*pval = (val != 0);
}
示例13: handleDD
void handleDD(DBusMessage *msg, double *a, double *b) {
DBusMessageIter args;
if (!dbus_message_iter_init(msg, &args)) {
fprintf(stderr, ERR_ARGS_EMPTY);
} else if (DBUS_TYPE_DOUBLE != dbus_message_iter_get_arg_type(&args)) {
fprintf(stderr, ERR_ARG_TYPE_D);
}
dbus_message_iter_get_basic(&args, a);
if (!dbus_message_iter_next(&args)) {
fprintf(stderr, ERR_ARGS_MISSING);
} else if (DBUS_TYPE_DOUBLE != dbus_message_iter_get_arg_type(&args)) {
fprintf(stderr, ERR_ARG_TYPE_D);
}
dbus_message_iter_get_basic(&args, b);
}
示例14: DemarshalSetPropertyValue
/**
* DemarshalSetPropertyValue() extracts the new property value from a
* org.freedesktop.DBus.Properties.Set method call message.
*
* @return int VLC_SUCCESS on success
* @param DBusMessage *p_msg a org.freedesktop.DBus.Properties.Set method call
* @param void *p_arg placeholder for the demarshalled value
*/
int DemarshalSetPropertyValue( DBusMessage *p_msg, void *p_arg )
{
int i_type;
bool b_valid_input = FALSE;
DBusMessageIter in_args, variant;
dbus_message_iter_init( p_msg, &in_args );
do
{
i_type = dbus_message_iter_get_arg_type( &in_args );
if( DBUS_TYPE_VARIANT == i_type )
{
dbus_message_iter_recurse( &in_args, &variant );
dbus_message_iter_get_basic( &variant, p_arg );
b_valid_input = TRUE;
}
} while( dbus_message_iter_next( &in_args ) );
return b_valid_input ? VLC_SUCCESS : VLC_EGENERIC;
}
示例15: getDouble
t_ilm_bool getDouble(t_ilm_message message, t_ilm_float* value)
{
t_ilm_bool returnValue = ILM_FALSE;
dbusmessage* msg = (dbusmessage*)message;
t_ilm_int type = dbus_message_iter_get_arg_type(&msg->iter);
if (DBUS_TYPE_DOUBLE == type)
{
dbus_message_iter_get_basic(&msg->iter, value);
dbus_message_iter_next(&msg->iter);
returnValue = ILM_TRUE;
}
else
{
printf("ERROR: expected: DBUS_TYPE_DOUBLE,received ");
printTypeName(type);
}
return returnValue;
}