diff options
Diffstat (limited to 'binding-wifi/wifi-api.c')
-rw-r--r-- | binding-wifi/wifi-api.c | 30 |
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); } /* |