本文整理汇总了C++中NM_DEVICE_WIMAX_GET_PRIVATE函数的典型用法代码示例。如果您正苦于以下问题:C++ NM_DEVICE_WIMAX_GET_PRIVATE函数的具体用法?C++ NM_DEVICE_WIMAX_GET_PRIVATE怎么用?C++ NM_DEVICE_WIMAX_GET_PRIVATE使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了NM_DEVICE_WIMAX_GET_PRIVATE函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: clean_up_nsps
static void
clean_up_nsps (NMDeviceWimax *self, gboolean notify)
{
NMDeviceWimaxPrivate *priv;
g_return_if_fail (NM_IS_DEVICE_WIMAX (self));
priv = NM_DEVICE_WIMAX_GET_PRIVATE (self);
if (priv->active_nsp) {
g_object_unref (priv->active_nsp);
priv->active_nsp = NULL;
}
if (priv->nsps) {
while (priv->nsps->len) {
NMWimaxNsp *nsp = NM_WIMAX_NSP (g_ptr_array_index (priv->nsps, 0));
if (notify)
g_signal_emit (self, signals[NSP_REMOVED], 0, nsp);
g_ptr_array_remove (priv->nsps, nsp);
g_object_unref (nsp);
}
g_ptr_array_free (priv->nsps, TRUE);
priv->nsps = NULL;
}
}
示例2: dispose
static void
dispose (GObject *object)
{
NMDeviceWimax *self = NM_DEVICE_WIMAX (object);
NMDeviceWimaxPrivate *priv = NM_DEVICE_WIMAX_GET_PRIVATE (self);
if (priv->disposed)
goto done;
priv->disposed = TRUE;
clear_activation_timeout (self);
clear_link_timeout (self);
clear_connected_poll (self);
if (priv->sdk_action_defer_id)
g_source_remove (priv->sdk_action_defer_id);
if (priv->sdk) {
iwmx_sdk_set_callbacks (priv->sdk, NULL, NULL, NULL, NULL, NULL, NULL);
wmxsdk_unref (priv->sdk);
}
g_free (priv->bsid);
set_current_nsp (self, NULL);
g_slist_free_full (priv->nsp_list, g_object_unref);
iwmx_sdk_new_callback_unregister (wmx_new_sdk_cb, self);
nm_wimax_util_sdk_unref ();
done:
G_OBJECT_CLASS (nm_device_wimax_parent_class)->dispose (object);
}
示例3: nm_device_wimax_get_hw_address
/**
* nm_device_wimax_get_hw_address:
* @wimax: a #NMDeviceWimax
*
* Gets the hardware (MAC) address of the #NMDeviceWimax
*
* Returns: the hardware address. This is the internal string used by the
* device, and must not be modified.
*
* Deprecated: 1.2: WiMAX is no longer supported.
**/
const char *
nm_device_wimax_get_hw_address (NMDeviceWimax *wimax)
{
g_return_val_if_fail (NM_IS_DEVICE_WIMAX (wimax), NULL);
return nm_str_not_empty (NM_DEVICE_WIMAX_GET_PRIVATE (wimax)->hw_address);
}
示例4: wmx_new_sdk_cb
static void
wmx_new_sdk_cb (struct wmxsdk *sdk, void *user_data)
{
NMDeviceWimax *self = NM_DEVICE_WIMAX (user_data);
NMDeviceWimaxPrivate *priv = NM_DEVICE_WIMAX_GET_PRIVATE (self);
/* We only track one wmxsdk at a time because the WiMAX SDK is pretty stupid */
if (priv->sdk) {
nm_log_dbg (LOGD_WIMAX, "(%s): WiMAX interface already known", sdk->ifname);
return;
}
nm_log_dbg (LOGD_WIMAX, "(%s): new WiMAX interface (%s)", sdk->ifname, sdk->name);
/* Now that we have an SDK, schedule an idle handler to start the device up */
priv->sdk = wmxsdk_ref (sdk);
iwmx_sdk_set_callbacks(priv->sdk,
wmx_state_change_cb,
wmx_media_status_cb,
wmx_connect_result_cb,
wmx_scan_result_cb,
wmx_removed_cb,
self);
iwmx_sdk_set_fast_reconnect_enabled (priv->sdk, 0);
if (!priv->sdk_action_defer_id)
priv->sdk_action_defer_id = g_idle_add (sdk_action_defer_cb, self);
}
示例5: nm_device_wimax_get_nsps
/**
* nm_device_wimax_get_nsps:
* @wimax: a #NMDeviceWimax
*
* Gets all the scanned NSPs of the #NMDeviceWimax.
*
* Returns: (element-type NMWimaxNsp): a #GPtrArray containing
* all the scanned #NMWimaxNsps.
* The returned array is owned by the client and should not be modified.
*
* Deprecated: 1.2: WiMAX is no longer supported.
**/
const GPtrArray *
nm_device_wimax_get_nsps (NMDeviceWimax *wimax)
{
g_return_val_if_fail (NM_IS_DEVICE_WIMAX (wimax), NULL);
return NM_DEVICE_WIMAX_GET_PRIVATE (wimax)->nsps;
}
示例6: state_changed_cb
static void
state_changed_cb (NMDevice *device, GParamSpec *pspec, gpointer user_data)
{
NMDeviceWimax *self = NM_DEVICE_WIMAX (device);
NMDeviceWimaxPrivate *priv = NM_DEVICE_WIMAX_GET_PRIVATE (self);
NMDeviceState state;
state = nm_device_get_state (device);
switch (state) {
case NM_DEVICE_STATE_UNKNOWN:
case NM_DEVICE_STATE_UNMANAGED:
case NM_DEVICE_STATE_UNAVAILABLE:
case NM_DEVICE_STATE_DISCONNECTED:
case NM_DEVICE_STATE_FAILED:
if (priv->active_nsp) {
g_object_unref (priv->active_nsp);
priv->active_nsp = NULL;
}
_nm_object_queue_notify (NM_OBJECT (device), NM_DEVICE_WIMAX_ACTIVE_NSP);
clear_link_status (self);
break;
case NM_DEVICE_STATE_PREPARE:
case NM_DEVICE_STATE_CONFIG:
case NM_DEVICE_STATE_NEED_AUTH:
case NM_DEVICE_STATE_IP_CONFIG:
clear_link_status (self);
break;
default:
break;
}
}
示例7: nm_device_wimax_get_center_frequency
/**
* nm_device_wimax_get_center_frequency:
* @self: a #NMDeviceWimax
*
* Gets the center frequency (in KHz) of the radio channel the device is using
* to communicate with the network when connected. Has no meaning when the
* device is not connected.
*
* Returns: the center frequency in KHz, or 0
*
* Deprecated: 1.2: WiMAX is no longer supported.
**/
guint
nm_device_wimax_get_center_frequency (NMDeviceWimax *self)
{
g_return_val_if_fail (NM_IS_DEVICE_WIMAX (self), 0);
return NM_DEVICE_WIMAX_GET_PRIVATE (self)->center_freq;
}
示例8: real_act_stage1_prepare
static NMActStageReturn
real_act_stage1_prepare (NMDevice *device, NMDeviceStateReason *reason)
{
NMDeviceWimaxPrivate *priv = NM_DEVICE_WIMAX_GET_PRIVATE (device);
NMActRequest *req;
GSList *iter;
const char *path;
clear_link_timeout (NM_DEVICE_WIMAX (device));
req = nm_device_get_act_request (device);
if (!req)
goto err;
path = nm_act_request_get_specific_object (req);
if (!path)
goto err;
for (iter = priv->nsp_list; iter; iter = iter->next) {
NMWimaxNsp *nsp = NM_WIMAX_NSP (iter->data);
if (!strcmp (path, nm_wimax_nsp_get_dbus_path (nsp))) {
set_current_nsp (NM_DEVICE_WIMAX (device), nsp);
return NM_ACT_STAGE_RETURN_SUCCESS;
}
}
err:
*reason = NM_DEVICE_STATE_REASON_NONE;
return NM_ACT_STAGE_RETURN_FAILURE;
}
示例9: real_act_stage2_config
static NMActStageReturn
real_act_stage2_config (NMDevice *device, NMDeviceStateReason *reason)
{
NMDeviceWimaxPrivate *priv = NM_DEVICE_WIMAX_GET_PRIVATE (device);
NMConnection *connection;
NMSettingWimax *s_wimax;
const char *nsp;
int ret;
connection = nm_act_request_get_connection (nm_device_get_act_request (device));
g_assert (connection);
s_wimax = NM_SETTING_WIMAX (nm_connection_get_setting (connection, NM_TYPE_SETTING_WIMAX));
g_assert (s_wimax);
nsp = nm_setting_wimax_get_network_name (s_wimax);
g_assert (nsp);
priv->connect_failed = FALSE;
ret = iwmx_sdk_connect (priv->sdk, nsp);
if (ret < 0 && ret != -EINPROGRESS) {
nm_log_err (LOGD_WIMAX, "(%s): failed to connect to NSP '%s'",
nm_device_get_iface (device), nsp);
*reason = NM_DEVICE_STATE_REASON_CONFIG_FAILED;
return NM_ACT_STAGE_RETURN_FAILURE;
}
/* FIXME: Is 40 seconds good estimation? I have no idea */
priv->activation_timeout_id = g_timeout_add_seconds (40, activation_timed_out, device);
return NM_ACT_STAGE_RETURN_POSTPONE;
}
示例10: real_update_hw_address
static void
real_update_hw_address (NMDevice *dev)
{
NMDeviceWimax *self = NM_DEVICE_WIMAX (dev);
NMDeviceWimaxPrivate *priv = NM_DEVICE_WIMAX_GET_PRIVATE (self);
struct ifreq req;
int fd;
const char *iface;
iface = nm_device_get_iface (dev);
fd = socket (PF_INET, SOCK_DGRAM, 0);
if (fd < 0) {
nm_log_warn (LOGD_HW, "(%s): couldn't open control socket.", iface);
return;
}
memset (&req, 0, sizeof (struct ifreq));
strncpy (req.ifr_name, nm_device_get_iface (dev), IFNAMSIZ);
errno = 0;
if (ioctl (fd, SIOCGIFHWADDR, &req) < 0) {
nm_log_err (LOGD_HW | LOGD_WIMAX,
"(%s): failed to read hardware address (error %d)",
iface, errno);
} else {
memcpy (&priv->hw_addr, &req.ifr_hwaddr.sa_data, ETH_ALEN);
g_object_notify (G_OBJECT (self), NM_DEVICE_WIMAX_HW_ADDRESS);
}
close (fd);
}
示例11: nm_device_wimax_get_active_nsp
NMWimaxNsp *
nm_device_wimax_get_active_nsp (NMDeviceWimax *self)
{
g_return_val_if_fail (NM_IS_DEVICE_WIMAX (self), NULL);
return NM_DEVICE_WIMAX_GET_PRIVATE (self)->current_nsp;
}
示例12: set_current_nsp
static void
set_current_nsp (NMDeviceWimax *self, NMWimaxNsp *new_nsp)
{
NMDeviceWimaxPrivate *priv = NM_DEVICE_WIMAX_GET_PRIVATE (self);
NMWimaxNsp *old_nsp;
char *old_path = NULL;
old_nsp = priv->current_nsp;
if (old_nsp) {
old_path = g_strdup (nm_wimax_nsp_get_dbus_path (old_nsp));
priv->current_nsp = NULL;
}
if (new_nsp)
priv->current_nsp = g_object_ref (new_nsp);
if (old_nsp)
g_object_unref (old_nsp);
/* Only notify if it's really changed */
if ( (!old_path && new_nsp)
|| (old_path && !new_nsp)
|| (old_path && new_nsp && strcmp (old_path, nm_wimax_nsp_get_dbus_path (new_nsp))))
g_object_notify (G_OBJECT (self), NM_DEVICE_WIMAX_ACTIVE_NSP);
g_free (old_path);
}
示例13: device_state_changed
static void
device_state_changed (NMDevice *device,
NMDeviceState new_state,
NMDeviceState old_state,
NMDeviceStateReason reason,
gpointer user_data)
{
NMDeviceWimax *self = NM_DEVICE_WIMAX (device);
NMDeviceWimaxPrivate *priv = NM_DEVICE_WIMAX_GET_PRIVATE (self);
if (new_state < NM_DEVICE_STATE_DISCONNECTED)
remove_all_nsps (self);
/* Request initial NSP list */
if ( new_state == NM_DEVICE_STATE_DISCONNECTED
&& old_state < NM_DEVICE_STATE_DISCONNECTED) {
if (priv->sdk)
iwmx_sdk_get_networks (priv->sdk);
}
if (new_state == NM_DEVICE_STATE_FAILED || new_state <= NM_DEVICE_STATE_DISCONNECTED)
clear_activation_timeout (self);
if (new_state == NM_DEVICE_STATE_ACTIVATED) {
/* poll link quality and BSID */
clear_connected_poll (self);
priv->poll_id = g_timeout_add_seconds (10, connected_poll_cb, self);
connected_poll_cb (self);
} else {
clear_link_timeout (self);
clear_connected_poll (self);
set_link_status (self, NULL);
}
}
示例14: nm_device_wimax_init
static void
nm_device_wimax_init (NMDeviceWimax *self)
{
NMDeviceWimaxPrivate *priv = NM_DEVICE_WIMAX_GET_PRIVATE (self);
priv->status = WIMAX_API_DEVICE_STATUS_UnInitialized;
}
示例15: set_current_nsp
static void
set_current_nsp (NMDeviceWimax *self, NMWimaxNsp *new_nsp)
{
NMDeviceWimaxPrivate *priv = NM_DEVICE_WIMAX_GET_PRIVATE (self);
NMWimaxNsp *old_nsp;
gboolean path_changed = FALSE;
old_nsp = priv->current_nsp;
priv->current_nsp = NULL;
if (new_nsp)
priv->current_nsp = g_object_ref (new_nsp);
if (old_nsp && new_nsp) {
path_changed = (g_strcmp0 (nm_wimax_nsp_get_dbus_path (old_nsp),
nm_wimax_nsp_get_dbus_path (new_nsp)) != 0);
}
/* Only notify if it's really changed */
if (old_nsp != new_nsp || path_changed)
g_object_notify (G_OBJECT (self), NM_DEVICE_WIMAX_ACTIVE_NSP);
if (old_nsp)
g_object_unref (old_nsp);
}