Del dev_info v1
Change-Id: Iaa89db40f960f30dfefe6f455dbe886c9d2bb2df
diff --git a/mbtk/mbtk_utils_linux/device_info_generate.c b/mbtk/mbtk_utils_linux/device_info_generate.c
index 58afe45..4d4ec37 100755
--- a/mbtk/mbtk_utils_linux/device_info_generate.c
+++ b/mbtk/mbtk_utils_linux/device_info_generate.c
@@ -8,30 +8,17 @@
#include <fcntl.h>
#include "mbtk_type.h"
-
-#ifdef MBTK_DEV_INFO_VERSION_2
-#include "mbtk_device_v2.h"
-#else
#include "mbtk_device.h"
-#endif
-
static mbtk_device_info_header_t info_header = {
.tag = MBTK_DEVICE_INFO_PARTITION_TAG,
.version = MBTK_DEVICE_INFO_CURR_VERSION,
.item_count = MBTK_DEVICE_INFO_ITEM_NUM,
.item_header = {
-#ifdef MBTK_DEV_INFO_VERSION_2
{MBTK_DEVICE_INFO_ITEM_BASIC, MBTK_DEVICE_INFO_ITEM_ADDR_BASIC},
{MBTK_DEVICE_INFO_ITEM_FOTA, MBTK_DEVICE_INFO_ITEM_ADDR_FOTA},
{MBTK_DEVICE_INFO_ITEM_MODEM, MBTK_DEVICE_INFO_ITEM_ADDR_MODEM},
{MBTK_DEVICE_INFO_ITEM_LOG, MBTK_DEVICE_INFO_ITEM_ADDR_LOG},
-#else
- {MBTK_DEVICE_INFO_ITEM_BASIC, 0},
- {MBTK_DEVICE_INFO_ITEM_FOTA, 0},
- {MBTK_DEVICE_INFO_ITEM_MODEM, 0},
- {MBTK_DEVICE_INFO_ITEM_LOG, 0},
-#endif
}
};
@@ -57,21 +44,17 @@
.name = MBTK_DEVICE_INFO_ITEM_STR_MODEM,
.version = MBTK_DEVICE_INFO_CURR_VERSION,
.band_area = MBTK_MODEM_BAND_AREA_ALL, // Default for all bands.
-#ifdef MBTK_DEV_INFO_VERSION_2
.net_pref = 15, // Default *band is 15
.net_support = MBTK_NET_SUPPORT_2G | MBTK_NET_SUPPORT_3G | MBTK_NET_SUPPORT_4G, // Default support 2G/3G/4G
-#endif
.band_gsm = MBTK_BAND_ALL_GSM_DEFAULT,
.band_wcdma = MBTK_BAND_ALL_WCDMA_DEFAULT,
.band_tdlte = MBTK_BAND_ALL_TDLTE_DEFAULT,
.band_fddlte = MBTK_BAND_ALL_FDDLTE_DEFAULT,
.band_lte_ext = MBTK_BAND_ALL_EXT_LTE_DEFAULT,
-#ifdef MBTK_DEV_INFO_VERSION_2
.band_nr_3 = MBTK_BAND_ALL_NR_3_DEFAULT,
.band_nr_2 = MBTK_BAND_ALL_NR_2_DEFAULT,
.band_nr_1 = MBTK_BAND_ALL_NR_1_DEFAULT,
.band_nr_0 = MBTK_BAND_ALL_NR_0_DEFAULT
-#endif
};
static mbtk_device_info_log_t item_log = {
@@ -82,24 +65,11 @@
static void help()
{
-#ifdef MBTK_DEV_INFO_VERSION_2
printf("device_info_generate -a [a/ab] -b [revision_out] -c [revision_in] -d [project] -e [project_cust] -f [cn/eu/all] -g [build_time] -h [net_pref] -i [net_support] -o [out_bin]\n");
-#else
- printf("device_info_generate -a [a/ab] -b [revision_out] -c [revision_in] -d [project] -e [project_cust] -f [cn/eu/all] -g [build_time] -o [out_bin]\n");
-#endif
}
static int update_and_write_header(int fd, mbtk_device_info_header_t *header)
{
-#ifdef MBTK_DEV_INFO_VERSION_2
-
-#else
- header->item_header[MBTK_DEVICE_INFO_ITEM_BASIC].addr = sizeof(mbtk_device_info_header_t);
- header->item_header[MBTK_DEVICE_INFO_ITEM_FOTA].addr = header->item_header[MBTK_DEVICE_INFO_ITEM_BASIC].addr + sizeof(mbtk_device_info_basic_t);
- header->item_header[MBTK_DEVICE_INFO_ITEM_MODEM].addr = header->item_header[MBTK_DEVICE_INFO_ITEM_FOTA].addr + sizeof(mbtk_device_info_fota_t);
- header->item_header[MBTK_DEVICE_INFO_ITEM_LOG].addr = header->item_header[MBTK_DEVICE_INFO_ITEM_MODEM].addr + sizeof(mbtk_device_info_modem_t);
-#endif
-
if(sizeof(mbtk_device_info_header_t) != write(fd, header, sizeof(mbtk_device_info_header_t))) {
printf("Write header fail:%d\n", errno);
return -1;
@@ -168,7 +138,6 @@
return 0;
}
-#ifdef MBTK_DEV_INFO_VERSION_2
static char* net_support_str_get(uint32 net_support)
{
static char net_str[100] = {0};
@@ -206,7 +175,7 @@
}
return net_str;
}
-#endif
+
/*
*
* device_info_generate -a [a/ab] -b [revision_out] -c [revision_in] -d [project] -e [project_cust] -f [cn/eu/sa/all] -o [out_bin]
@@ -216,11 +185,7 @@
{
int ch;
char out_bin[128] = {0};
-#ifdef MBTK_DEV_INFO_VERSION_2
while((ch = getopt(argc, argv, "a:b:c:d:e:f:g:h:i:o:"))!= -1){
-#else
- while((ch = getopt(argc, argv, "a:b:c:d:e:f:g:o:"))!= -1){
-#endif
switch(ch)
{
case 'a':
@@ -257,12 +222,10 @@
item_modem.band_tdlte = MBTK_BAND_CN_TDLTE_DEFAULT;
item_modem.band_fddlte = MBTK_BAND_CN_FDDLTE_DEFAULT;
item_modem.band_lte_ext = MBTK_BAND_CN_EXT_LTE_DEFAULT;
-#ifdef MBTK_DEV_INFO_VERSION_2
item_modem.band_nr_3 = MBTK_BAND_CN_NR_3_DEFAULT;
item_modem.band_nr_2 = MBTK_BAND_CN_NR_2_DEFAULT;
item_modem.band_nr_1 = MBTK_BAND_CN_NR_1_DEFAULT;
item_modem.band_nr_0 = MBTK_BAND_CN_NR_0_DEFAULT;
-#endif
} else if(strcmp(optarg, "eu") == 0) {
item_modem.band_area = MBTK_MODEM_BAND_AREA_EU;
item_modem.band_gsm = MBTK_BAND_EU_GSM_DEFAULT;
@@ -270,12 +233,10 @@
item_modem.band_tdlte = MBTK_BAND_EU_TDLTE_DEFAULT;
item_modem.band_fddlte = MBTK_BAND_EU_FDDLTE_DEFAULT;
item_modem.band_lte_ext = MBTK_BAND_EU_EXT_LTE_DEFAULT;
-#ifdef MBTK_DEV_INFO_VERSION_2
item_modem.band_nr_3 = MBTK_BAND_EU_NR_3_DEFAULT;
item_modem.band_nr_2 = MBTK_BAND_EU_NR_2_DEFAULT;
item_modem.band_nr_1 = MBTK_BAND_EU_NR_1_DEFAULT;
item_modem.band_nr_0 = MBTK_BAND_EU_NR_0_DEFAULT;
-#endif
} else if(strcmp(optarg, "sa") == 0) {
item_modem.band_area = MBTK_MODEM_BAND_AREA_SA;
item_modem.band_gsm = MBTK_BAND_SA_GSM_DEFAULT;
@@ -283,12 +244,10 @@
item_modem.band_tdlte = MBTK_BAND_SA_TDLTE_DEFAULT;
item_modem.band_fddlte = MBTK_BAND_SA_FDDLTE_DEFAULT;
item_modem.band_lte_ext = MBTK_BAND_SA_EXT_LTE_DEFAULT;
-#ifdef MBTK_DEV_INFO_VERSION_2
item_modem.band_nr_3 = MBTK_BAND_SA_NR_3_DEFAULT;
item_modem.band_nr_2 = MBTK_BAND_SA_NR_2_DEFAULT;
item_modem.band_nr_1 = MBTK_BAND_SA_NR_1_DEFAULT;
item_modem.band_nr_0 = MBTK_BAND_SA_NR_0_DEFAULT;
-#endif
} else {
item_modem.band_area = MBTK_MODEM_BAND_AREA_ALL;
item_modem.band_gsm = MBTK_BAND_ALL_GSM_DEFAULT;
@@ -296,16 +255,13 @@
item_modem.band_tdlte = MBTK_BAND_ALL_TDLTE_DEFAULT;
item_modem.band_fddlte = MBTK_BAND_ALL_FDDLTE_DEFAULT;
item_modem.band_lte_ext = MBTK_BAND_ALL_EXT_LTE_DEFAULT;
-#ifdef MBTK_DEV_INFO_VERSION_2
item_modem.band_nr_3 = MBTK_BAND_ALL_NR_3_DEFAULT;
item_modem.band_nr_2 = MBTK_BAND_ALL_NR_2_DEFAULT;
item_modem.band_nr_1 = MBTK_BAND_ALL_NR_1_DEFAULT;
item_modem.band_nr_0 = MBTK_BAND_ALL_NR_0_DEFAULT;
-#endif
printf("Set to default band.\n");
}
break;
-#ifdef MBTK_DEV_INFO_VERSION_2
case 'h':
item_modem.net_pref = (uint32)atoi(optarg);
printf("Set net_pref to %d success.\n", item_modem.net_pref);
@@ -315,7 +271,6 @@
printf("Set net_support to %d(%s) success.\n", item_modem.net_support,
net_support_str_get(item_modem.net_support));
break;
-#endif
case 'g':
if(strlen(optarg) > 0)
memcpy(item_basic.build_time, optarg, strlen(optarg));