void
nm_wimax_nsp_export_to_dbus (NMWimaxNsp *self)
{
	NMWimaxNspPrivate *priv;
	NMDBusManager *mgr;
	DBusGConnection *g_connection;
	static guint32 counter = 0;

	g_return_if_fail (NM_IS_WIMAX_NSP (self));

	priv = GET_PRIVATE (self);

	g_return_if_fail (priv->dbus_path == NULL);

	mgr = nm_dbus_manager_get ();
	g_assert (mgr);

	g_connection = nm_dbus_manager_get_connection (mgr);
	g_assert (g_connection);

	priv->dbus_path = g_strdup_printf (NM_DBUS_PATH_WIMAX_NSP "/%d", counter++);
	dbus_g_connection_register_g_object (g_connection, priv->dbus_path, G_OBJECT (self));

	g_object_unref (mgr);
}
NMWimaxNspNetworkType
nm_wimax_nsp_get_network_type (NMWimaxNsp *self)
{
	g_return_val_if_fail (NM_IS_WIMAX_NSP (self), 0);

	return GET_PRIVATE (self)->network_type;
}
guint32
nm_wimax_nsp_get_signal_quality (NMWimaxNsp *self)
{
	g_return_val_if_fail (NM_IS_WIMAX_NSP (self), 0);

	return GET_PRIVATE (self)->signal_quality;
}
const char *
nm_wimax_nsp_get_name (NMWimaxNsp *self)
{
	g_return_val_if_fail (NM_IS_WIMAX_NSP (self), NULL);

	return GET_PRIVATE (self)->name;
}
Exemple #5
0
/**
 * nm_wimax_nsp_get_name:
 * @nsp: a #NMWimaxNsp
 *
 * Gets the name of the wimax NSP
 *
 * Returns: the name
 **/
const char *
nm_wimax_nsp_get_name (NMWimaxNsp *nsp)
{
	g_return_val_if_fail (NM_IS_WIMAX_NSP (nsp), NULL);

	_nm_object_ensure_inited (NM_OBJECT (nsp));
	return NM_WIMAX_NSP_GET_PRIVATE (nsp)->name;
}
Exemple #6
0
/**
 * nm_wimax_nsp_get_network_type:
 * @nsp: a #NMWimaxNsp
 *
 * Gets the network type of the wimax NSP.
 *
 * Returns: the network type
 **/
NMWimaxNspNetworkType
nm_wimax_nsp_get_network_type (NMWimaxNsp *nsp)
{
	g_return_val_if_fail (NM_IS_WIMAX_NSP (nsp), NM_WIMAX_NSP_NETWORK_TYPE_UNKNOWN);

	_nm_object_ensure_inited (NM_OBJECT (nsp));
	return NM_WIMAX_NSP_GET_PRIVATE (nsp)->network_type;
}
Exemple #7
0
/**
 * nm_wimax_nsp_get_signal_quality:
 * @nsp: a #NMWimaxNsp
 *
 * Gets the WPA signal quality of the wimax NSP.
 *
 * Returns: the signal quality
 **/
guint32
nm_wimax_nsp_get_signal_quality (NMWimaxNsp *nsp)
{
	g_return_val_if_fail (NM_IS_WIMAX_NSP (nsp), 0);

	_nm_object_ensure_inited (NM_OBJECT (nsp));
	return NM_WIMAX_NSP_GET_PRIVATE (nsp)->signal_quality;
}
Exemple #8
0
void
nm_wimax_nsp_export_to_dbus (NMWimaxNsp *self)
{
	NMWimaxNspPrivate *priv;
	static guint32 counter = 0;

	g_return_if_fail (NM_IS_WIMAX_NSP (self));

	priv = GET_PRIVATE (self);

	g_return_if_fail (priv->dbus_path == NULL);

	priv->dbus_path = g_strdup_printf (NM_DBUS_PATH_WIMAX_NSP "/%d", counter++);
	nm_dbus_manager_register_object (nm_dbus_manager_get (), priv->dbus_path, self);
}
gboolean
nm_wimax_nsp_check_compatible (NMWimaxNsp *self,
							   NMConnection *connection)
{
	NMWimaxNspPrivate *priv;
	NMSettingWimax *s_wimax;

	g_return_val_if_fail (NM_IS_WIMAX_NSP (self), FALSE);
	g_return_val_if_fail (NM_IS_CONNECTION (connection), FALSE);

	priv = GET_PRIVATE (self);

	s_wimax = nm_connection_get_setting_wimax (connection);
	if (!s_wimax)
		return FALSE;

	return g_strcmp0 (nm_wimax_nsp_get_name (self), nm_setting_wimax_get_network_name (s_wimax)) == 0;
}