C++ NM_DEVICE_BT_GET_PRIVATE函数代码示例(c++get_private函数的15个代码示例)

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


C++ NM_DEVICE_BT_GET_PRIVATE函数代码示例(c++get_private函数的15个代码示例)

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

本文标签属性:

示例:示例图

代码:代码生成器

NM_DEVICE_BT_GET_PRIVATE:NM_DEVICE_BT_GET_PRIVATE

上一篇:Java VoltageSensor类代码示例(javavoltagesensor代码示例汇总)
下一篇:Golang RequestBundle.VerifyEmail方法代码示例

为您推荐