fota reboot stats flag

Change-Id: Ia308bfc182dea80ed478c1885660291e716d7500
diff --git a/mbtk/include/lynq/lynq-qser-fota.h b/mbtk/include/lynq/lynq-qser-fota.h
index 2a8cfd6..bbc674c 100755
--- a/mbtk/include/lynq/lynq-qser-fota.h
+++ b/mbtk/include/lynq/lynq-qser-fota.h
@@ -14,6 +14,15 @@
 extern "C" {

 #endif

 

+

+/*******************************************************************************

+* @brief get reboot upgrade status 

+  @param 

+    NULL

+  @return 

+        if reboot the other system successfully return 1, else return 0

+ *******************************************************************************/

+int lynq_get_reboot_upgrade_status(void);

 int lynq_get_upgrade_status(void);

 int lynq_fota_set_addr_value(char        *value,int size);

 int lynq_fota_nrestart(void);

diff --git a/mbtk/include/mbtk/mbtk_fota.h b/mbtk/include/mbtk/mbtk_fota.h
index 8724166..bf166d8 100755
--- a/mbtk/include/mbtk/mbtk_fota.h
+++ b/mbtk/include/mbtk/mbtk_fota.h
@@ -95,6 +95,8 @@
 

 int mbtk_fota_status(void);

 

+int mbtk_fota_get_asr_reboot_cnt_flag(void);

+

 #ifdef __cplusplus

 }

 #endif

diff --git a/mbtk/liblynq_lib/src/lynq_fota.c b/mbtk/liblynq_lib/src/lynq_fota.c
index b6cabd9..1ac1b68 100755
--- a/mbtk/liblynq_lib/src/lynq_fota.c
+++ b/mbtk/liblynq_lib/src/lynq_fota.c
@@ -104,3 +104,8 @@
     return mbtk_fota_status();
 }
 
+int lynq_get_reboot_upgrade_status(void)
+{
+    return mbtk_fota_get_asr_reboot_cnt_flag();
+}
+
diff --git a/mbtk/libmbtk_fota/mbtk_fota.c b/mbtk/libmbtk_fota/mbtk_fota.c
index dcf10ba..298d31a 100755
--- a/mbtk/libmbtk_fota/mbtk_fota.c
+++ b/mbtk/libmbtk_fota/mbtk_fota.c
@@ -363,7 +363,7 @@
     return 1;

 }

 

-static int get_asr_reboot_cnt_flag(void)

+int mbtk_fota_get_asr_reboot_cnt_flag(void)

 {

     int fd = 0, ret = 0;

     char buf[10] ={0};

@@ -385,17 +385,16 @@
     int reboot_cnd =  atoi(buf);

     if(reboot_cnd)

     {

-        fota_dowload_flag = 4;

+        ret = 1;

     }

     close(fd);

 

-    return 0;

+    return ret;

 }

 

 

 int mbtk_fota_status(void)

 {

-    get_asr_reboot_cnt_flag();

     return fota_dowload_flag;

 }