• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ NM_DEVICE_BT_GET_PRIVATE函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中NM_DEVICE_BT_GET_PRIVATE函数的典型用法代码示例。如果您正苦于以下问题:C++ NM_DEVICE_BT_GET_PRIVATE函数的具体用法?C++ NM_DEVICE_BT_GET_PRIVATE怎么用?C++ NM_DEVICE_BT_GET_PRIVATE使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了NM_DEVICE_BT_GET_PRIVATE函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: nm_device_bt_get_capabilities

guint32 nm_device_bt_get_capabilities (NMDeviceBt *self)
{
	g_return_val_if_fail (self != NULL, NM_BT_CAPABILITY_NONE);
	g_return_val_if_fail (NM_IS_DEVICE_BT (self), NM_BT_CAPABILITY_NONE);

	return NM_DEVICE_BT_GET_PRIVATE (self)->capabilities;
}
开发者ID:T100012,项目名称:NetworkManager,代码行数:7,代码来源:nm-device-bt.c


示例2: set_property

static void
set_property (GObject *object, guint prop_id,
              const GValue *value, GParamSpec *pspec)
{
	NMDeviceBtPrivate *priv = NM_DEVICE_BT_GET_PRIVATE (object);

	switch (prop_id) {
	case PROP_HW_ADDRESS:
		/* Construct only */
		priv->bdaddr = g_ascii_strup (g_value_get_string (value), -1);
		if (!nm_utils_hwaddr_aton (priv->bdaddr, ARPHRD_ETHER, &priv->hw_addr))
			nm_log_err (LOGD_HW, "Failed to convert BT address '%s'", priv->bdaddr);
		break;
	case PROP_BT_NAME:
		/* Construct only */
		priv->name = g_value_dup_string (value);
		break;
	case PROP_BT_CAPABILITIES:
		/* Construct only */
		priv->capabilities = g_value_get_uint (value);
		break;
	default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
		break;
	}
}
开发者ID:T100012,项目名称:NetworkManager,代码行数:26,代码来源:nm-device-bt.c


示例3: nm_device_bt_get_name

/**
 * nm_device_bt_get_name:
 * @device: a #NMDeviceBt
 *
 * Gets the name of the #NMDeviceBt.
 *
 * Returns: the name of the device
 **/
const char *
nm_device_bt_get_name (NMDeviceBt *device)
{
	g_return_val_if_fail (NM_IS_DEVICE_BT (device), NULL);

	_nm_object_ensure_inited (NM_OBJECT (device));
	return NM_DEVICE_BT_GET_PRIVATE (device)->name;
}
开发者ID:Impulse2000,项目名称:NetworkManager,代码行数:16,代码来源:nm-device-bt.c


示例4: nm_device_bt_get_capabilities

/**
 * nm_device_bt_get_capabilities:
 * @device: a #NMDeviceBt
 *
 * Returns the Bluetooth device's usable capabilities.
 *
 * Returns: a combination of #NMBluetoothCapabilities
 **/
NMBluetoothCapabilities
nm_device_bt_get_capabilities (NMDeviceBt *device)
{
	g_return_val_if_fail (NM_IS_DEVICE_BT (device), NM_BT_CAPABILITY_NONE);

	_nm_object_ensure_inited (NM_OBJECT (device));
	return NM_DEVICE_BT_GET_PRIVATE (device)->bt_capabilities;
}
开发者ID:Impulse2000,项目名称:NetworkManager,代码行数:16,代码来源:nm-device-bt.c


示例5: get_hw_address

static const guint8 *
get_hw_address (NMDevice *device, guint *out_len)
{
    NMDeviceBtPrivate *priv = NM_DEVICE_BT_GET_PRIVATE (device);

    *out_len = sizeof (priv->hw_addr);
    return priv->hw_addr;
}
开发者ID:vzupanovic,项目名称:Network-Manager-p.0.9.8.2,代码行数:8,代码来源:nm-device-bt.c


示例6: bluez_property_changed

static void
bluez_property_changed (DBusGProxy *proxy,
                        const char *property,
                        GValue *value,
                        gpointer user_data)
{
	NMDevice *device = NM_DEVICE (user_data);
	NMDeviceBt *self = NM_DEVICE_BT (user_data);
	NMDeviceBtPrivate *priv = NM_DEVICE_BT_GET_PRIVATE (self);
	gboolean connected;
	NMDeviceState state;
	const char *prop_str = "(unknown)";

	if (G_VALUE_HOLDS_STRING (value))
		prop_str = g_value_get_string (value);
	else if (G_VALUE_HOLDS_BOOLEAN (value))
		prop_str = g_value_get_boolean (value) ? "true" : "false";

	nm_log_dbg (LOGD_BT, "(%s): bluez property '%s' changed to '%s'",
	            nm_device_get_iface (device),
	            property,
	            prop_str);

	if (strcmp (property, "Connected"))
		return;

	state = nm_device_get_state (device);
	connected = g_value_get_boolean (value);
	if (connected) {
		if (state == NM_DEVICE_STATE_CONFIG) {
			nm_log_dbg (LOGD_BT, "(%s): connected to the device",
			            nm_device_get_iface (device));

			priv->connected = TRUE;
			check_connect_continue (self);
		}
	} else {
		gboolean fail = FALSE;

		/* Bluez says we're disconnected from the device.  Suck. */

		if (nm_device_is_activating (device)) {
			nm_log_info (LOGD_BT,
			             "Activation (%s/bluetooth): bluetooth link disconnected.",
			             nm_device_get_iface (device));
			fail = TRUE;
		} else if (state == NM_DEVICE_STATE_ACTIVATED) {
			nm_log_info (LOGD_BT, "(%s): bluetooth link disconnected.",
			             nm_device_get_iface (device));
			fail = TRUE;
		}

		if (fail) {
			nm_device_state_changed (device, NM_DEVICE_STATE_FAILED, NM_DEVICE_STATE_REASON_CARRIER);
			priv->connected = FALSE;
		}
	}
}
开发者ID:eugeni,项目名称:NetworkManager-mdv,代码行数:58,代码来源:nm-device-bt.c


示例7: act_stage3_ip6_config_start

static NMActStageReturn
act_stage3_ip6_config_start (NMDevice *device,
                             NMIP6Config **out_config,
                             NMDeviceStateReason *reason)
{
    NMDeviceBtPrivate *priv = NM_DEVICE_BT_GET_PRIVATE (device);
    NMActStageReturn ret;

    if (priv->bt_type == NM_BT_CAPABILITY_DUN) {
        ret = nm_modem_stage3_ip6_config_start (NM_DEVICE_BT_GET_PRIVATE (device)->modem,
                                                device,
                                                NM_DEVICE_CLASS (nm_device_bt_parent_class),
                                                reason);
    } else
        ret = NM_DEVICE_CLASS (nm_device_bt_parent_class)->act_stage3_ip6_config_start (device, out_config, reason);

    return ret;
}
开发者ID:vzupanovic,项目名称:Network-Manager-p.0.9.8.2,代码行数:18,代码来源:nm-device-bt.c


示例8: dispose

static void
dispose (GObject *object)
{
	NMDeviceBtPrivate *priv = NM_DEVICE_BT_GET_PRIVATE (object);

	g_clear_object (&priv->proxy);

	G_OBJECT_CLASS (nm_device_bt_parent_class)->dispose (object);
}
开发者ID:Impulse2000,项目名称:NetworkManager,代码行数:9,代码来源:nm-device-bt.c


示例9: finalize

static void
finalize (GObject *object)
{
	NMDeviceBtPrivate *priv = NM_DEVICE_BT_GET_PRIVATE (object);

	g_free (priv->hw_address);
	g_free (priv->name);

	G_OBJECT_CLASS (nm_device_bt_parent_class)->finalize (object);
}
开发者ID:GalliumOS,项目名称:network-manager,代码行数:10,代码来源:nm-device-bt.c


示例10: constructed

static void
constructed (GObject *object)
{
	NMDeviceBtPrivate *priv = NM_DEVICE_BT_GET_PRIVATE (object);

	G_OBJECT_CLASS (nm_device_bt_parent_class)->constructed (object);

	priv->proxy = _nm_object_new_proxy (NM_OBJECT (object), NULL, NM_DBUS_INTERFACE_DEVICE_BLUETOOTH);
	register_properties (NM_DEVICE_BT (object));
}
开发者ID:Impulse2000,项目名称:NetworkManager,代码行数:10,代码来源:nm-device-bt.c


示例11: real_check_connection_compatible

static gboolean
real_check_connection_compatible (NMDevice *device,
                                  NMConnection *connection,
                                  GError **error)
{
	NMDeviceBtPrivate *priv = NM_DEVICE_BT_GET_PRIVATE (device);
	NMSettingConnection *s_con;
	NMSettingBluetooth *s_bt;
	const GByteArray *array;
	char *str;
	int addr_match = FALSE;
	guint32 bt_type;

	s_con = NM_SETTING_CONNECTION (nm_connection_get_setting (connection, NM_TYPE_SETTING_CONNECTION));
	g_assert (s_con);

	if (strcmp (nm_setting_connection_get_connection_type (s_con), NM_SETTING_BLUETOOTH_SETTING_NAME)) {
		g_set_error (error,
		             NM_BT_ERROR, NM_BT_ERROR_CONNECTION_NOT_BT,
		             "The connection was not a Bluetooth connection.");
		return FALSE;
	}

	s_bt = NM_SETTING_BLUETOOTH (nm_connection_get_setting (connection, NM_TYPE_SETTING_BLUETOOTH));
	if (!s_bt) {
		g_set_error (error,
		             NM_BT_ERROR, NM_BT_ERROR_CONNECTION_INVALID,
		             "The connection was not a valid Bluetooth connection.");
		return FALSE;
	}

	array = nm_setting_bluetooth_get_bdaddr (s_bt);
	if (!array || (array->len != ETH_ALEN)) {
		g_set_error (error,
		             NM_BT_ERROR, NM_BT_ERROR_CONNECTION_INVALID,
		             "The connection did not contain a valid Bluetooth address.");
		return FALSE;
	}

	bt_type = get_connection_bt_type (connection);
	if (!(bt_type & priv->capabilities)) {
		g_set_error (error,
		             NM_BT_ERROR, NM_BT_ERROR_CONNECTION_INCOMPATIBLE,
		             "The connection was not compatible with the device's capabilities.");
		return FALSE;
	}

	str = g_strdup_printf ("%02X:%02X:%02X:%02X:%02X:%02X",
	                       array->data[0], array->data[1], array->data[2],
	                       array->data[3], array->data[4], array->data[5]);
	addr_match = !strcmp (priv->bdaddr, str);
	g_free (str);

	return addr_match;
}
开发者ID:eugeni,项目名称:NetworkManager-mdv,代码行数:55,代码来源:nm-device-bt.c


示例12: device_state_changed

static void
device_state_changed (NMDevice *device,
                      NMDeviceState new_state,
                      NMDeviceState old_state,
                      NMDeviceStateReason reason)
{
    NMDeviceBtPrivate *priv = NM_DEVICE_BT_GET_PRIVATE (device);

    if (priv->modem)
        nm_modem_device_state_changed (priv->modem, new_state, old_state, reason);
}
开发者ID:vzupanovic,项目名称:Network-Manager-p.0.9.8.2,代码行数:11,代码来源:nm-device-bt.c


示例13: modem_find_timeout

static gboolean
modem_find_timeout (gpointer user_data)
{
	NMDeviceBt *self = NM_DEVICE_BT (user_data);

	NM_DEVICE_BT_GET_PRIVATE (self)->timeout_id = 0;
	nm_device_state_changed (NM_DEVICE (self),
	                         NM_DEVICE_STATE_FAILED,
	                         NM_DEVICE_STATE_REASON_MODEM_NOT_FOUND);
	return FALSE;
}
开发者ID:eugeni,项目名称:NetworkManager-mdv,代码行数:11,代码来源:nm-device-bt.c


示例14: is_available

static gboolean
is_available (NMDevice *dev)
{
    NMDeviceBt *self = NM_DEVICE_BT (dev);
    NMDeviceBtPrivate *priv = NM_DEVICE_BT_GET_PRIVATE (self);

    /* PAN doesn't need ModemManager, so devices that support it are always available */
    if (priv->capabilities & NM_BT_CAPABILITY_NAP)
        return TRUE;

    /* DUN requires ModemManager */
    return priv->mm_running;
}
开发者ID:vzupanovic,项目名称:Network-Manager-p.0.9.8.2,代码行数:13,代码来源:nm-device-bt.c


示例15: bt_connect_timeout

static gboolean
bt_connect_timeout (gpointer user_data)
{
	NMDeviceBt *self = NM_DEVICE_BT (user_data);

	nm_log_dbg (LOGD_BT, "(%s): initial connection timed out",
	            nm_device_get_iface (NM_DEVICE (self)));

	NM_DEVICE_BT_GET_PRIVATE (self)->timeout_id = 0;
	nm_device_state_changed (NM_DEVICE (self),
	                         NM_DEVICE_STATE_FAILED,
	                         NM_DEVICE_STATE_REASON_BT_FAILED);
	return FALSE;
}
开发者ID:eugeni,项目名称:NetworkManager-mdv,代码行数:14,代码来源:nm-device-bt.c


示例16: constructed

static void
constructed (GObject *object)
{
	NMDeviceBtPrivate *priv = NM_DEVICE_BT_GET_PRIVATE (object);

	G_OBJECT_CLASS (nm_device_bt_parent_class)->constructed (object);

	priv->proxy = dbus_g_proxy_new_for_name (nm_object_get_connection (NM_OBJECT (object)),
	                                         NM_DBUS_SERVICE,
	                                         nm_object_get_path (NM_OBJECT (object)),
	                                         NM_DBUS_INTERFACE_DEVICE_BLUETOOTH);

	register_properties (NM_DEVICE_BT (object));
}
开发者ID:T100012,项目名称:NetworkManager,代码行数:14,代码来源:nm-device-bt.c


示例17: register_properties

static void
register_properties (NMDeviceBt *device)
{
	NMDeviceBtPrivate *priv = NM_DEVICE_BT_GET_PRIVATE (device);
	const NMPropertiesInfo property_info[] = {
		{ NM_DEVICE_BT_HW_ADDRESS,   &priv->hw_address },
		{ NM_DEVICE_BT_NAME,         &priv->name },
		{ NM_DEVICE_BT_CAPABILITIES, &priv->bt_capabilities },
		{ NULL },
	};

	_nm_object_register_properties (NM_OBJECT (device),
	                                priv->proxy,
	                                property_info);
}
开发者ID:Impulse2000,项目名称:NetworkManager,代码行数:15,代码来源:nm-device-bt.c


示例18: check_connection_available

static gboolean
check_connection_available (NMDevice *device, NMConnection *connection)
{
    NMDeviceBtPrivate *priv = NM_DEVICE_BT_GET_PRIVATE (device);
    guint32 bt_type;

    bt_type = get_connection_bt_type (connection);
    if (!(bt_type & priv->capabilities))
        return FALSE;

    /* DUN connections aren't available without ModemManager */
    if (bt_type == NM_BT_CAPABILITY_DUN && priv->mm_running == FALSE)
        return FALSE;

    return TRUE;
}
开发者ID:vzupanovic,项目名称:Network-Manager-p.0.9.8.2,代码行数:16,代码来源:nm-device-bt.c


示例19: bluez_connect_cb

static void
bluez_connect_cb (DBusGProxy *proxy,
                  DBusGProxyCall *call_id,
                  void *user_data)
{
	NMDeviceBt *self = NM_DEVICE_BT (user_data);
	NMDeviceBtPrivate *priv = NM_DEVICE_BT_GET_PRIVATE (self);
	GError *error = NULL;
	char *device;

	if (dbus_g_proxy_end_call (proxy, call_id, &error,
	                           G_TYPE_STRING, &device,
	                           G_TYPE_INVALID) == FALSE) {
		nm_log_warn (LOGD_BT, "Error connecting with bluez: %s",
		             error && error->message ? error->message : "(unknown)");
		g_clear_error (&error);

		nm_device_state_changed (NM_DEVICE (self),
		                         NM_DEVICE_STATE_FAILED,
		                         NM_DEVICE_STATE_REASON_BT_FAILED);
		return;
	}

	if (!device || !strlen (device)) {
		nm_log_warn (LOGD_BT, "Invalid network device returned by bluez");

		nm_device_state_changed (NM_DEVICE (self),
		                         NM_DEVICE_STATE_FAILED,
		                         NM_DEVICE_STATE_REASON_BT_FAILED);
	}

	if (priv->bt_type == NM_BT_CAPABILITY_DUN) {
		g_free (priv->rfcomm_iface);
		priv->rfcomm_iface = device;
	} else if (priv->bt_type == NM_BT_CAPABILITY_NAP) {
		nm_device_set_ip_iface (NM_DEVICE (self), device);
		g_free (device);
	}

	nm_log_dbg (LOGD_BT, "(%s): connect request successful",
	            nm_device_get_iface (NM_DEVICE (self)));

	/* Stage 3 gets scheduled when Bluez says we're connected */
	priv->have_iface = TRUE;
	check_connect_continue (self);
}
开发者ID:eugeni,项目名称:NetworkManager-mdv,代码行数:46,代码来源:nm-device-bt.c


示例20: init_dbus

static void
init_dbus (NMObject *object)
{
	NMDeviceBtPrivate *priv = NM_DEVICE_BT_GET_PRIVATE (object);
	const NMPropertiesInfo property_info[] = {
		{ NM_DEVICE_BT_HW_ADDRESS,   &priv->hw_address },
		{ NM_DEVICE_BT_NAME,         &priv->name },
		{ NM_DEVICE_BT_CAPABILITIES, &priv->bt_capabilities },
		{ NULL },
	};

	NM_OBJECT_CLASS (nm_device_bt_parent_class)->init_dbus (object);

	_nm_object_register_properties (object,
	                                NM_DBUS_INTERFACE_DEVICE_BLUETOOTH,
	                                property_info);
}
开发者ID:GalliumOS,项目名称:network-manager,代码行数:17,代码来源:nm-device-bt.c



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ NM_DEVICE_CLASS函数代码示例发布时间:2022-05-30
下一篇:
C++ NM_DEVICE函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap