summaryrefslogtreecommitdiffstats
path: root/binding-wifi
diff options
context:
space:
mode:
authorMatt Ranostay <matt.ranostay@konsulko.com>2017-12-14 21:27:11 -0800
committerJan-Simon Moeller <jsmoeller@linuxfoundation.org>2017-12-17 23:23:14 +0000
commitb502af811a782bdda3a6c56567fdc2c7f7b44609 (patch)
treec465167a582619f59e37233f22bf8baa12aff7f7 /binding-wifi
parentc95935852a8af88684270c368b88e22a6ba11ab3 (diff)
binding: wifi: set initial Wi-Fi HMI state
Wait for homescreen service to become active and set initial Wi-Fi state Bug-AGL: SPEC-1197 Change-Id: I46c9eeb14b392b4cc6e580d6dd86695849c59484 Signed-off-by: Matt Ranostay <matt.ranostay@konsulko.com>
Diffstat (limited to 'binding-wifi')
-rw-r--r--binding-wifi/wifi-api.c30
1 files changed, 29 insertions, 1 deletions
diff --git a/binding-wifi/wifi-api.c b/binding-wifi/wifi-api.c
index 7dcc603..45341e3 100644
--- a/binding-wifi/wifi-api.c
+++ b/binding-wifi/wifi-api.c
@@ -667,12 +667,40 @@ static const struct afb_verb_v2 binding_verbs[] = {
{ } /* marker for end of the array */
};
+
+gboolean initial_homescreen(gpointer ptr)
+{
+ struct wifiStatus *status = g_try_malloc0(sizeof(struct wifiStatus));
+ GError *error = NULL;
+ int ret = 0;
+
+ ret = wifi_state(status);
+
+ if (ret < 0) {
+ g_object_unref(status);
+ return TRUE;
+ }
+
+ error = setHMIStatus(status->connected == 1 ? BAR_FULL : BAR_NO);
+ g_error_free(error);
+
+ return ret != NULL;
+}
+
+static void *thread_func()
+{
+ g_timeout_add_seconds(5, initial_homescreen, NULL);
+ g_main_loop_run(g_main_loop_new(NULL, FALSE));
+}
+
static int init()
{
+ pthread_t thread_id;
+
event_add("passkey");
event_add("networkList");
- return 0;
+ return pthread_create(&thread_id, NULL, thread_func, NULL);
}
/*