本文整理汇总了C++中NM_AP_GET_PRIVATE函数的典型用法代码示例。如果您正苦于以下问题:C++ NM_AP_GET_PRIVATE函数的具体用法?C++ NM_AP_GET_PRIVATE怎么用?C++ NM_AP_GET_PRIVATE使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了NM_AP_GET_PRIVATE函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: nm_ap_get_address
const char *
nm_ap_get_address (const NMAccessPoint *ap)
{
g_return_val_if_fail (NM_IS_AP (ap), NULL);
return NM_AP_GET_PRIVATE (ap)->address;
}
示例2: nm_ap_get_freq
guint32
nm_ap_get_freq (NMAccessPoint *ap)
{
g_return_val_if_fail (NM_IS_AP (ap), 0);
return NM_AP_GET_PRIVATE (ap)->freq;
}
示例3: nm_ap_get_mode
NM80211Mode
nm_ap_get_mode (NMAccessPoint *ap)
{
g_return_val_if_fail (NM_IS_AP (ap), NM_802_11_MODE_UNKNOWN);
return NM_AP_GET_PRIVATE (ap)->mode;
}
示例4: nm_ap_is_hotspot
gboolean
nm_ap_is_hotspot (NMAccessPoint *ap)
{
g_return_val_if_fail (NM_IS_AP (ap), FALSE);
return NM_AP_GET_PRIVATE (ap)->hotspot;
}
示例5: nm_ap_set_ssid
void
nm_ap_set_ssid (NMAccessPoint *ap, const guint8 *ssid, gsize len)
{
NMAccessPointPrivate *priv;
g_return_if_fail (NM_IS_AP (ap));
g_return_if_fail (ssid == NULL || len > 0);
priv = NM_AP_GET_PRIVATE (ap);
/* same SSID */
if ((ssid && priv->ssid) && (len == priv->ssid->len)) {
if (!memcmp (ssid, priv->ssid->data, len))
return;
}
if (priv->ssid) {
g_byte_array_free (priv->ssid, TRUE);
priv->ssid = NULL;
}
if (ssid) {
priv->ssid = g_byte_array_new ();
g_byte_array_append (priv->ssid, ssid, len);
}
g_object_notify (G_OBJECT (ap), NM_AP_SSID);
}
示例6: nm_ap_get_strength
gint8
nm_ap_get_strength (NMAccessPoint *ap)
{
g_return_val_if_fail (NM_IS_AP (ap), 0);
return NM_AP_GET_PRIVATE (ap)->strength;
}
示例7: nm_ap_set_timestamp
void nm_ap_set_timestamp (NMAccessPoint *ap, glong sec, glong usec)
{
NMAccessPointPrivate *priv;
g_return_if_fail (NM_IS_AP (ap));
priv = NM_AP_GET_PRIVATE (ap);
priv->timestamp.tv_sec = sec;
priv->timestamp.tv_usec = usec;
}
示例8: get_property
static void
get_property (GObject *object, guint prop_id,
GValue *value, GParamSpec *pspec)
{
NMAccessPointPrivate *priv = NM_AP_GET_PRIVATE (object);
GArray * ssid;
int len;
int i;
switch (prop_id) {
case PROP_FLAGS:
g_value_set_uint (value, priv->flags);
break;
case PROP_WPA_FLAGS:
g_value_set_uint (value, priv->wpa_flags);
break;
case PROP_RSN_FLAGS:
g_value_set_uint (value, priv->rsn_flags);
break;
case PROP_SSID:
len = priv->ssid ? priv->ssid->len : 0;
ssid = g_array_sized_new (FALSE, TRUE, sizeof (unsigned char), len);
for (i = 0; i < len; i++)
g_array_append_val (ssid, priv->ssid->data[i]);
g_value_set_boxed (value, ssid);
g_array_free (ssid, TRUE);
break;
case PROP_FREQUENCY:
g_value_set_uint (value, priv->freq);
break;
case PROP_HW_ADDRESS:
g_value_set_string (value, priv->address);
break;
case PROP_MODE:
g_value_set_uint (value, priv->mode);
break;
case PROP_MAX_BITRATE:
g_value_set_uint (value, priv->max_bitrate);
break;
case PROP_STRENGTH:
g_value_set_schar (value, priv->strength);
break;
case PROP_LAST_SEEN:
g_value_set_int (value,
priv->last_seen > 0
? (gint) nm_utils_monotonic_timestamp_as_boottime (priv->last_seen, NM_UTILS_NS_PER_SECOND)
: -1);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}
示例9: nm_ap_init
static void
nm_ap_init (NMAccessPoint *ap)
{
NMAccessPointPrivate *priv = NM_AP_GET_PRIVATE (ap);
priv->dbus_path = NULL;
priv->mode = NM_802_11_MODE_INFRA;
priv->flags = NM_802_11_AP_FLAGS_NONE;
priv->wpa_flags = NM_802_11_AP_SEC_NONE;
priv->rsn_flags = NM_802_11_AP_SEC_NONE;
priv->broadcast = TRUE;
}
示例10: nm_ap_set_rsn_flags
static void
nm_ap_set_rsn_flags (NMAccessPoint *ap, NM80211ApSecurityFlags flags)
{
NMAccessPointPrivate *priv;
g_return_if_fail (NM_IS_AP (ap));
priv = NM_AP_GET_PRIVATE (ap);
if (priv->rsn_flags != flags) {
priv->rsn_flags = flags;
g_object_notify (G_OBJECT (ap), NM_AP_RSN_FLAGS);
}
}
示例11: nm_ap_set_strength
void nm_ap_set_strength (NMAccessPoint *ap, const gint8 strength)
{
NMAccessPointPrivate *priv;
g_return_if_fail (NM_IS_AP (ap));
priv = NM_AP_GET_PRIVATE (ap);
if (priv->strength != strength) {
priv->strength = strength;
g_object_notify (G_OBJECT (ap), NM_AP_STRENGTH);
}
}
示例12: finalize
static void
finalize (GObject *object)
{
NMAccessPointPrivate *priv = NM_AP_GET_PRIVATE (object);
g_free (priv->dbus_path);
if (priv->ssid)
g_byte_array_free (priv->ssid, TRUE);
g_slist_foreach (priv->user_addresses, (GFunc)g_free, NULL);
g_slist_free (priv->user_addresses);
G_OBJECT_CLASS (nm_ap_parent_class)->finalize (object);
}
示例13: mode_to_char
static char
mode_to_char (NMAccessPoint *self)
{
NMAccessPointPrivate *priv = NM_AP_GET_PRIVATE (self);
if (priv->mode == NM_802_11_MODE_ADHOC)
return '*';
if (priv->hotspot)
return '#';
if (priv->fake)
return '-';
return ' ';
}
示例14: nm_ap_set_max_bitrate
void
nm_ap_set_max_bitrate (NMAccessPoint *ap, guint32 bitrate)
{
NMAccessPointPrivate *priv;
g_return_if_fail (NM_IS_AP (ap));
priv = NM_AP_GET_PRIVATE (ap);
if (priv->max_bitrate != bitrate) {
priv->max_bitrate = bitrate;
g_object_notify (G_OBJECT (ap), NM_AP_MAX_BITRATE);
}
}
示例15: nm_ap_set_last_seen
static void
nm_ap_set_last_seen (NMAccessPoint *ap, gint32 last_seen)
{
NMAccessPointPrivate *priv;
g_return_if_fail (NM_IS_AP (ap));
priv = NM_AP_GET_PRIVATE (ap);
if (priv->last_seen != last_seen) {
priv->last_seen = last_seen;
g_object_notify (G_OBJECT (ap), NM_AP_LAST_SEEN);
}
}