From d0d05384ac22828c86b58864d5cd15ec5cd3d728 Mon Sep 17 00:00:00 2001
From: Philippe Coval
Date: Mon, 17 Sep 2018 11:03:56 +0200
Subject: [PATCH] iotjs: Fix (re)connected status in callback
Note: TizenRT wifi manager "attempt" callback name missleaded me,
maybe it could be renamed.
Change-Id: Ie4a5bcb397fb7959f2c5954d7a7569052ccc39fb
Forwarded: https://github.com/Samsung/TizenRT/pull/2319
Signed-off-by: Philippe Coval
---
apps/examples/iotjs_startup/iotjs_startup_main.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/apps/examples/iotjs_startup/iotjs_startup_main.c b/apps/examples/iotjs_startup/iotjs_startup_main.c
index dc0a4e4a53..c20d2f6e7c 100644
--- a/apps/examples/iotjs_startup/iotjs_startup_main.c
+++ b/apps/examples/iotjs_startup/iotjs_startup_main.c
@@ -54,7 +54,8 @@ static void iotjs_startup_wifi_connect(void);
static void iotjs_startup_wifi_sta_connected(wifi_manager_result_e status)
{
printf("log: %s status=0x%x\n", __FUNCTION__, status);
- g_is_connected = true;
+ g_is_connected = ((status == WIFI_MANAGER_SUCCESS) ||
+ (status == WIFI_MANAGER_ALREADY_CONNECTED));
}
static void iotjs_startup_wifi_sta_disconnected(wifi_manager_disconnect_e status)