add_get_absys_type
Change-Id: I4c5c361adcda3663917dca172d9813fe7494ea8f
diff --git a/mbtk/libmbtk_lib/fota/mbtk_fota.c b/mbtk/libmbtk_lib/fota/mbtk_fota.c
index 68e2ba0..323ec9b 100755
--- a/mbtk/libmbtk_lib/fota/mbtk_fota.c
+++ b/mbtk/libmbtk_lib/fota/mbtk_fota.c
@@ -8,10 +8,20 @@
#include <pthread.h>
#include <libubox/blobmsg_json.h>
#include "libubus.h"
-#include "mbtk_fota.h"
+
#include <semaphore.h>
#include <cutils/properties.h>
+#include <libubox/blob.h>
+#include <libubox/uloop.h>
+#include <libubox/usock.h>
+#include <libubox/list.h>
+#include <libubus.h>
+#include <uci.h>
+#include <sys/ioctl.h>
+#include <mtd/mtd-user.h>
+
+#include "mbtk_fota.h"
#include "mbtk_log.h"
@@ -425,3 +435,73 @@
MBTK_SOURCE_INFO_PRINT("mbtk_fota_lib");
}
+int mbtk_fota_get_active_absys_type(void)
+{
+ int type = 0;
+ char tmp_type[] ={0};
+
+ property_get("persist.mbtk.absys_active", tmp_type, "0");
+ type = atoi(tmp_type);
+ if (type == 97)
+ {
+ type = mbtk_sys_A;
+ }
+ else if (type == 98)
+ {
+ type = mbtk_sys_B;
+ }
+ else
+ {
+ LOGE("get_active_absys_type %s fail",tmp_type);
+ type = -1;
+ }
+
+ return type;
+}
+
+int mbtk_fota_get_tmp_absys_type(void)
+{
+ int type = 0;
+ char tmp_type[] ={0};
+
+ property_get("persist.mbtk.absys_tmp", tmp_type, "0");
+ type = atoi(tmp_type);
+ if (type == 97)
+ {
+ type = mbtk_sys_A;
+ }
+ else if (type == 98)
+ {
+ type = mbtk_sys_B;
+ }
+ else
+ {
+ LOGE("get_tmp_absys_type %s fail",tmp_type);
+ type = -1;
+ }
+
+ return type;
+}
+
+int mbtk_fota_get_sync_absys_type(void)
+{
+ int type = 0;
+ char tmp_type[] ={0};
+
+ property_get("persist.mbtk.absys_sync", tmp_type, "0");
+ type = atoi(tmp_type);
+
+ return type;
+}
+
+int mbtk_fota_get_mtd_check_type(void)
+{
+ int type = 0;
+ char tmp_type[] ={0};
+
+ property_get("persist.mbtk.mtd_check", tmp_type, "0");
+ type = atoi(tmp_type);
+
+ return type;
+}
+