Fix device_info for factory.
Change-Id: I5817e6afef2707d054099009d0fd38fe3abe11ae
diff --git a/mbtk/libmbtk_lib/common/mbtk_device_info.c b/mbtk/libmbtk_lib/common/mbtk_device_info.c
index 7c53f33..670a320 100755
--- a/mbtk/libmbtk_lib/common/mbtk_device_info.c
+++ b/mbtk/libmbtk_lib/common/mbtk_device_info.c
@@ -260,7 +260,8 @@
return -1;
}
-int mbtk_dev_info_revision_get(char *revision_out, char *revision_in)
+int mbtk_dev_info_revision_get(char *revision_out, char *revision_in, char *project_cust, char *band_area,
+ char* build_time)
{
mbtk_device_info_basic_t info_basic;
memset(&info_basic, 0, sizeof(mbtk_device_info_basic_t));
@@ -270,12 +271,41 @@
return -1;
}
+ mbtk_device_info_modem_t info_modem;
+ memset(&info_modem, 0, sizeof(mbtk_device_info_modem_t));
+ result = mbtk_dev_info_read(MBTK_DEVICE_INFO_ITEM_MODEM, &info_modem, sizeof(mbtk_device_info_modem_t));
+ if(result) {
+ LOGE("mbtk_dev_info_read(MODEM) fail.");
+ return -1;
+ }
+
if(strlen((char*)info_basic.revision_out) > 0) {
memcpy(revision_out, info_basic.revision_out, strlen((char*)info_basic.revision_out));
}
if(strlen((char*)info_basic.revision_in) > 0) {
memcpy(revision_in, info_basic.revision_in, strlen((char*)info_basic.revision_in));
}
+ if(strlen((char*)info_basic.project_cust) > 0) {
+ memcpy(project_cust, info_basic.project_cust, strlen((char*)info_basic.project_cust));
+ }
+ if(strlen((char*)info_basic.build_time) > 0) {
+ memcpy(build_time, info_basic.build_time, strlen((char*)info_basic.build_time));
+ }
+
+ switch(info_modem.band_area) {
+ case MBTK_MODEM_BAND_AREA_CN:
+ memcpy(band_area, "CN", 2);
+ break;
+ case MBTK_MODEM_BAND_AREA_EU:
+ memcpy(band_area, "EU", 2);
+ break;
+ case MBTK_MODEM_BAND_AREA_SA:
+ memcpy(band_area, "SA", 2);
+ break;
+ default:
+ memcpy(band_area, "DEF", 3);
+ break;
+ }
return 0;
}