summaryrefslogtreecommitdiff
path: root/gsupplicant
diff options
context:
space:
mode:
authorSamuel Ortiz <sameo@linux.intel.com>2011-09-08 06:00:49 (GMT)
committerSamuel Ortiz <sameo@linux.intel.com>2011-09-12 10:06:01 (GMT)
commit66e533a6d154ad264b26ce63c3e1b7c908aa266c (patch)
tree46a68ad6fffb4987901788809c95ab762677f969 /gsupplicant
parent9b2a72efbf273815b19f3292617bbc9564a67b22 (diff)
downloadconnman-66e533a6d154ad264b26ce63c3e1b7c908aa266c.zip
connman-66e533a6d154ad264b26ce63c3e1b7c908aa266c.tar.gz
connman-66e533a6d154ad264b26ce63c3e1b7c908aa266c.tar.bz2
gsupplicant: Implement network properties changes notification
This is only used for propagatong signal changes for now.
Diffstat (limited to 'gsupplicant')
-rw-r--r--gsupplicant/gsupplicant.h2
-rw-r--r--gsupplicant/supplicant.c15
2 files changed, 17 insertions, 0 deletions
diff --git a/gsupplicant/gsupplicant.h b/gsupplicant/gsupplicant.h
index 5c453aa..c39d596 100644
--- a/gsupplicant/gsupplicant.h
+++ b/gsupplicant/gsupplicant.h
@@ -208,6 +208,8 @@ struct _GSupplicantCallbacks {
void (*scan_finished) (GSupplicantInterface *interface);
void (*network_added) (GSupplicantNetwork *network);
void (*network_removed) (GSupplicantNetwork *network);
+ void (*network_changed) (GSupplicantNetwork *network,
+ const char *property);
void (*debug) (const char *str);
};
diff --git a/gsupplicant/supplicant.c b/gsupplicant/supplicant.c
index 55e0abe..30bdd81 100644
--- a/gsupplicant/supplicant.c
+++ b/gsupplicant/supplicant.c
@@ -408,6 +408,18 @@ static void callback_network_removed(GSupplicantNetwork *network)
callbacks_pointer->network_removed(network);
}
+static void callback_network_changed(GSupplicantNetwork *network,
+ const char *property)
+{
+ if (callbacks_pointer == NULL)
+ return;
+
+ if (callbacks_pointer->network_changed == NULL)
+ return;
+
+ callbacks_pointer->network_changed(network, property);
+}
+
static void remove_interface(gpointer data)
{
GSupplicantInterface *interface = data;
@@ -1028,6 +1040,7 @@ done:
if (bss->signal > network->signal) {
network->signal = bss->signal;
network->best_bss = bss;
+ callback_network_changed(network, "Signal");
}
g_hash_table_replace(interface->bss_mapping, bss->path, network);
@@ -1896,6 +1909,8 @@ static void signal_bss_changed(const char *path, DBusMessageIter *iter)
}
SUPPLICANT_DBG("New network signal for %s %d dBm", network->ssid, network->signal);
+
+ callback_network_changed(network, "Signal");
}
static void wps_credentials(const char *key, DBusMessageIter *iter,