当前位置: 首页>>代码示例>>C++>>正文


C++ dbus_message_iter_next函数代码示例

本文整理汇总了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;
}
开发者ID:SpOlErOk38,项目名称:gconf-dbus,代码行数:44,代码来源:gconf-dbus-utils.c

示例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);
	}
}
开发者ID:manjurajv,项目名称:connman,代码行数:19,代码来源:bluetooth_legacy.c

示例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;
}
开发者ID:bhull2010,项目名称:mate-keyring,代码行数:43,代码来源:gkd-secret-service.c

示例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;
}
开发者ID:Jubei-Mitsuyoshi,项目名称:aaa-connman-ui,代码行数:43,代码来源:agent.c

示例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;
}
开发者ID:Conjuror,项目名称:ofono,代码行数:19,代码来源:huawei-audio.c

示例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;
}
开发者ID:tidatida,项目名称:alarmd,代码行数:19,代码来源:codec.c

示例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);
}
开发者ID:richardxu,项目名称:panda-a4,代码行数:43,代码来源:monitor.c

示例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);
}
开发者ID:steafen,项目名称:dde,代码行数:19,代码来源:dbus_introspect.c

示例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;
}
开发者ID:Conjuror,项目名称:ofono,代码行数:19,代码来源:huawei-audio.c

示例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);
}
开发者ID:justinc1985,项目名称:IntelRangeley,代码行数:45,代码来源:phdc.c

示例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);
}
开发者ID:maemo-foss,项目名称:meego-cellular-matd,代码行数:20,代码来源:voicecall.c

示例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);
}
开发者ID:tidatida,项目名称:alarmd,代码行数:20,代码来源:codec.c

示例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);
}
开发者ID:laCour,项目名称:sunrise,代码行数:20,代码来源:main.cpp

示例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;
}
开发者ID:vlcchina,项目名称:vlc-player-experimental,代码行数:28,代码来源:dbus.c

示例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;
}
开发者ID:Airtau,项目名称:genivi,代码行数:20,代码来源:double.c


注:本文中的dbus_message_iter_next函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。