本文整理汇总了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函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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;
}
}
开发者ID:gunchleoc,项目名称:NetworkManager,代码行数:27,代码来源:nm-device-wimax.c
示例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);
}
开发者ID:aelarabawy,项目名称:NetworkManager,代码行数:35,代码来源:nm-device-wimax.c
示例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);
}
开发者ID:NetworkManager,项目名称:NetworkManager,代码行数:18,代码来源:nm-device-wimax.c
示例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);
}
开发者ID:aelarabawy,项目名称:NetworkManager,代码行数:28,代码来源:nm-device-wimax.c
示例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;
}
开发者ID:NetworkManager,项目名称:NetworkManager,代码行数:19,代码来源:nm-device-wimax.c
示例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;
}
}
开发者ID:NetworkManager,项目名称:NetworkManager,代码行数:31,代码来源:nm-device-wimax.c
示例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;
}
开发者ID:NetworkManager,项目名称:NetworkManager,代码行数:19,代码来源:nm-device-wimax.c
示例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;
}
开发者ID:hicham-haouari,项目名称:NetworkManager-ADSL-Support,代码行数:31,代码来源:nm-device-wimax.c
示例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;
}
开发者ID:hicham-haouari,项目名称:NetworkManager-ADSL-Support,代码行数:32,代码来源:nm-device-wimax.c
示例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);
}
开发者ID:hicham-haouari,项目名称:NetworkManager-ADSL-Support,代码行数:32,代码来源:nm-device-wimax.c
示例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;
}
开发者ID:hicham-haouari,项目名称:NetworkManager-ADSL-Support,代码行数:7,代码来源:nm-device-wimax.c
示例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);
}
开发者ID:hicham-haouari,项目名称:NetworkManager-ADSL-Support,代码行数:27,代码来源:nm-device-wimax.c
示例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);
}
}
开发者ID:hicham-haouari,项目名称:NetworkManager-ADSL-Support,代码行数:34,代码来源:nm-device-wimax.c
示例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;
}
开发者ID:aelarabawy,项目名称:NetworkManager,代码行数:7,代码来源:nm-device-wimax.c
示例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);
}
开发者ID:aelarabawy,项目名称:NetworkManager,代码行数:25,代码来源:nm-device-wimax.c
示例16: nm_device_wimax_get_active_nsp
/**
* nm_device_wimax_get_active_nsp:
* @wimax: a #NMDeviceWimax
*
* Gets the active #NMWimaxNsp.
*
* Returns: (transfer full): the access point or %NULL if none is active
*
* Deprecated: 1.2: WiMAX is no longer supported.
**/
NMWimaxNsp *
nm_device_wimax_get_active_nsp (NMDeviceWimax *wimax)
{
NMDeviceState state;
g_return_val_if_fail (NM_IS_DEVICE_WIMAX (wimax), NULL);
state = nm_device_get_state (NM_DEVICE (wimax));
switch (state) {
case NM_DEVICE_STATE_PREPARE:
case NM_DEVICE_STATE_CONFIG:
case NM_DEVICE_STATE_NEED_AUTH:
case NM_DEVICE_STATE_IP_CONFIG:
case NM_DEVICE_STATE_IP_CHECK:
case NM_DEVICE_STATE_SECONDARIES:
case NM_DEVICE_STATE_ACTIVATED:
case NM_DEVICE_STATE_DEACTIVATING:
break;
default:
return NULL;
break;
}
return NM_DEVICE_WIMAX_GET_PRIVATE (wimax)->active_nsp;
}
开发者ID:NetworkManager,项目名称:NetworkManager,代码行数:35,代码来源:nm-device-wimax.c
示例17: nm_device_wimax_get_bsid
/**
* nm_device_wimax_get_bsid:
* @self: a #NMDeviceWimax
*
* Gets the ID of the serving Base Station when the device is connected.
*
* Returns: the ID of the serving Base Station, or %NULL
*
* Deprecated: 1.2: WiMAX is no longer supported.
**/
const char *
nm_device_wimax_get_bsid (NMDeviceWimax *self)
{
g_return_val_if_fail (NM_IS_DEVICE_WIMAX (self), NULL);
return nm_str_not_empty (NM_DEVICE_WIMAX_GET_PRIVATE (self)->bsid);
}
开发者ID:NetworkManager,项目名称:NetworkManager,代码行数:17,代码来源:nm-device-wimax.c
示例18: nm_device_wimax_get_tx_power
/**
* nm_device_wimax_get_tx_power:
* @self: a #NMDeviceWimax
*
* Average power of the last burst transmitted by the device, in units of
* 0.5 dBm. i.e. a TxPower of -11 represents an actual device TX power of
* -5.5 dBm. Has no meaning when the device is not connected.
*
* Returns: the TX power in dBm, or 0
*
* Deprecated: 1.2: WiMAX is no longer supported.
**/
gint
nm_device_wimax_get_tx_power (NMDeviceWimax *self)
{
g_return_val_if_fail (NM_IS_DEVICE_WIMAX (self), 0);
return NM_DEVICE_WIMAX_GET_PRIVATE (self)->tx_power;
}
开发者ID:NetworkManager,项目名称:NetworkManager,代码行数:19,代码来源:nm-device-wimax.c
示例19: is_available
static gboolean
is_available (NMDevice *device)
{
NMDeviceWimaxPrivate *priv = NM_DEVICE_WIMAX_GET_PRIVATE (device);
const char *iface = nm_device_get_iface (device);
if (!priv->enabled) {
nm_log_dbg (LOGD_WIMAX, "(%s): not available because not enabled", iface);
return FALSE;
}
if (!priv->wimaxd_enabled) {
nm_log_dbg (LOGD_WIMAX, "(%s): not available because not enabled in wimaxd", iface);
return FALSE;
}
if (!nm_wimax_util_sdk_is_initialized ()) {
nm_log_dbg (LOGD_WIMAX, "(%s): not available because WiMAX SDK not initialized", iface);
return FALSE;
}
if (!priv->sdk) {
nm_log_dbg (LOGD_WIMAX, "(%s): not available because not known to WiMAX SDK", iface);
return FALSE;
}
return iwmxsdk_status_get (priv->sdk) >= WIMAX_API_DEVICE_STATUS_Ready;
}
开发者ID:aelarabawy,项目名称:NetworkManager,代码行数:28,代码来源:nm-device-wimax.c
示例20: set_enabled
static void
set_enabled (NMDevice *device, gboolean enabled)
{
NMDeviceWimax *self = NM_DEVICE_WIMAX (device);
NMDeviceWimaxPrivate *priv = NM_DEVICE_WIMAX_GET_PRIVATE (self);
gboolean old_available;
int ret;
const char *iface;
iface = nm_device_get_iface (NM_DEVICE (self));
nm_log_dbg (LOGD_WIMAX, "(%s): setting radio enabled %d -> %d",
iface, priv->enabled, enabled);
if (priv->enabled == enabled)
return;
old_available = nm_device_is_available (NM_DEVICE (device));
priv->enabled = enabled;
nm_log_dbg (LOGD_WIMAX, "(%s): radio now %s",
iface, priv->enabled ? "enabled" : "disabled");
/* Set the WiMAX device RF state to the current user-specified enabled state */
if (priv->sdk) {
ret = iwmx_sdk_rf_state_set (priv->sdk,
enabled ? WIMAX_API_RF_ON : WIMAX_API_RF_OFF);
if (ret < 0 && ret != -EINPROGRESS) {
nm_log_warn (LOGD_WIMAX, "(%s): failed to %s radio",
iface, priv->enabled ? "enable" : "disable");
}
}
update_availability (self, old_available);
}
开发者ID:aelarabawy,项目名称:NetworkManager,代码行数:34,代码来源:nm-device-wimax.c
注:本文中的NM_DEVICE_WIMAX_GET_PRIVATE函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论