Del dev_info v1
Change-Id: Iaa89db40f960f30dfefe6f455dbe886c9d2bb2df
diff --git a/build.sh b/build.sh
index a048741..ea89bb7 100755
--- a/build.sh
+++ b/build.sh
@@ -21,7 +21,7 @@
export BUILD_GCC_VERSION=`cat config | grep CONFIG_GCC_VERSION | cut -d '=' -f 2`
-export MBTK_DEV_INFO_VERSION=`cat config | grep CONFIG_DEV_INFO_VERSION | cut -d '=' -f 2`
+#export MBTK_DEV_INFO_VERSION=`cat config | grep CONFIG_DEV_INFO_VERSION | cut -d '=' -f 2`
export CONFIG_MBTK_5G_SUPPORT=`cat config | grep CONFIG_MBTK_5G_SUPPORT | cut -d '=' -f 2`
if [ -n "$1" ] ;then
@@ -156,7 +156,7 @@
{
echo BUILD_STD_LIBC=$BUILD_STD_LIBC
echo MBTK_SOURCE_VERSION=$MBTK_SOURCE_VERSION
- echo MBTK_DEV_INFO_VERSION=$MBTK_DEV_INFO_VERSION
+# echo MBTK_DEV_INFO_VERSION=$MBTK_DEV_INFO_VERSION
}
function main()
diff --git a/configs/config-default b/configs/config-default
index 2cc0655..7a3bc7a 100755
--- a/configs/config-default
+++ b/configs/config-default
@@ -5,7 +5,7 @@
CONFIG_GCC_VERSION=13.3
# dev_info version : 1 / 2
-CONFIG_DEV_INFO_VERSION=2
+#CONFIG_DEV_INFO_VERSION=2
# mbtk_source version : 1 / 2
CONFIG_MBTK_SOURCE_VERSION=2
diff --git a/mbtk/Make.defines b/mbtk/Make.defines
index 41a894f..5389eb5 100755
--- a/mbtk/Make.defines
+++ b/mbtk/Make.defines
@@ -78,9 +78,9 @@
DEFINE += -DMBTK_SOURCE_VERSION_2
endif
-ifeq ($(MBTK_DEV_INFO_VERSION), 2)
-DEFINE += -DMBTK_DEV_INFO_VERSION_2
-endif
+#ifeq ($(MBTK_DEV_INFO_VERSION), 2)
+#DEFINE += -DMBTK_DEV_INFO_VERSION_2
+#endif
ifeq ($(CONFIG_MBTK_5G_SUPPORT), Y)
DEFINE += -DMBTK_5G_SUPPORT
diff --git a/mbtk/include/mbtk/mbtk_device.h b/mbtk/include/mbtk/mbtk_device.h
index 1e026b2..7beb84d 100755
--- a/mbtk/include/mbtk/mbtk_device.h
+++ b/mbtk/include/mbtk/mbtk_device.h
@@ -6,13 +6,13 @@
* Author : lb
* Date : 2023/12/30 11:36:35
*/
-#ifndef _MBTK_DEVICE_H
-#define _MBTK_DEVICE_H
+#ifndef _MBTK_DEVICE_V2_H
+#define _MBTK_DEVICE_V2_H
//#include "mbtk_type.h"
#define MBTK_DEVICE_INFO_PARTITION_NAME "device_info"
#define MBTK_DEVICE_INFO_PARTITION_TAG 0x87878787
-#define MBTK_DEVICE_INFO_CURR_VERSION 1
+#define MBTK_DEVICE_INFO_CURR_VERSION 2
#define MBTK_DEV_INFO_PARTITION_ADDR 0x02A20000
@@ -22,27 +22,51 @@
#define MBTK_BAND_ALL_TDLTE_DEFAULT 482 // TDD-LTE : ASR default.
#define MBTK_BAND_ALL_FDDLTE_DEFAULT 134742231 // FDD-LTE : ASR default.
#define MBTK_BAND_ALL_EXT_LTE_DEFAULT 0 // EXT-LTE
+#define MBTK_BAND_ALL_NR_3_DEFAULT 0
+#define MBTK_BAND_ALL_NR_2_DEFAULT 24576 // n78/n79
+#define MBTK_BAND_ALL_NR_1_DEFAULT 256 // n41
+#define MBTK_BAND_ALL_NR_0_DEFAULT 134217877 // n1/n3/n5/n8/n28
+
#define MBTK_BAND_CN_GSM_DEFAULT 11 // GSM : B3/B8 (PGSM 900/DCS GSM 1800/EGSM 900)
#define MBTK_BAND_CN_WCDMA_DEFAULT 145 // WCDMA : B1/B5/B8
#define MBTK_BAND_CN_TDLTE_DEFAULT 482 // TDD-LTE : B34/B38/B39/B40/B41
#define MBTK_BAND_CN_FDDLTE_DEFAULT 149 // FDD-LTE : B1/B3/B5/B8
#define MBTK_BAND_CN_EXT_LTE_DEFAULT 0 // EXT-LTE
+#define MBTK_BAND_CN_NR_3_DEFAULT 0
+#define MBTK_BAND_CN_NR_2_DEFAULT 24576 // n78/n79
+#define MBTK_BAND_CN_NR_1_DEFAULT 384 // n40/n41
+#define MBTK_BAND_CN_NR_0_DEFAULT 134217877 // n1/n3/n5/n8/n28
+
#define MBTK_BAND_EU_GSM_DEFAULT 11 // GSM : B3/B8 (PGSM 900/DCS GSM 1800/EGSM 900)
#define MBTK_BAND_EU_WCDMA_DEFAULT 145 // WCDMA : B1/B5/B8
#define MBTK_BAND_EU_TDLTE_DEFAULT 416 // TDD-LTE : B38/B40/B41
#define MBTK_BAND_EU_FDDLTE_DEFAULT 134742229 // FDD-LTE : B1/B3/B5/B7/B8/B20/B28
#define MBTK_BAND_EU_EXT_LTE_DEFAULT 0 // EXT-LTE
+#define MBTK_BAND_EU_NR_3_DEFAULT 0
+#define MBTK_BAND_EU_NR_2_DEFAULT 12352 // n71/n77/n78
+#define MBTK_BAND_EU_NR_1_DEFAULT 416 // n38/n40/n41
+#define MBTK_BAND_EU_NR_0_DEFAULT 134742229 // n1/n3/n5/n7/n8/n20/n28
+
#define MBTK_BAND_SA_GSM_DEFAULT 79 // GSM : B2/B3/B5/B8(GSM 850/PGSM 900/EGSM 900/DCS GSM 1800/PCS GSM 1900)
#define MBTK_BAND_SA_WCDMA_DEFAULT 155 // WCDMA : B1/B2/B4/B5/B8
#define MBTK_BAND_SA_TDLTE_DEFAULT 128 // TDD-LTE : B40
#define MBTK_BAND_SA_FDDLTE_DEFAULT 134217951 // FDD-LTE : B1/B2/B3/B4/B5/B7/B8/B28
#define MBTK_BAND_SA_EXT_LTE_DEFAULT 2 // EXT-LTE : B66
+#define MBTK_BAND_SA_NR_3_DEFAULT MBTK_BAND_ALL_NR_3_DEFAULT
+#define MBTK_BAND_SA_NR_2_DEFAULT MBTK_BAND_ALL_NR_2_DEFAULT
+#define MBTK_BAND_SA_NR_1_DEFAULT MBTK_BAND_ALL_NR_1_DEFAULT
+#define MBTK_BAND_SA_NR_0_DEFAULT MBTK_BAND_ALL_NR_0_DEFAULT
#define MBTK_DEVICE_INFO_ITEM_STR_BASIC "BASIC"
#define MBTK_DEVICE_INFO_ITEM_STR_FOTA "FOTA"
#define MBTK_DEVICE_INFO_ITEM_STR_MODEM "MODEM"
#define MBTK_DEVICE_INFO_ITEM_STR_LOG "LOG"
+#define MBTK_DEVICE_INFO_ITEM_ADDR_BASIC 0x100 // Header is 0x100
+#define MBTK_DEVICE_INFO_ITEM_ADDR_FOTA 0x500 // Basic is 1k
+#define MBTK_DEVICE_INFO_ITEM_ADDR_MODEM 0x900 // Fota is 1k
+#define MBTK_DEVICE_INFO_ITEM_ADDR_LOG 0xD00 // Modem is 1k
+
#define MBTK_NET_SUPPORT_2G (1)
#define MBTK_NET_SUPPORT_3G (1<<1)
#define MBTK_NET_SUPPORT_4G (1<<2)
@@ -108,11 +132,17 @@
uint8 name[16];
uint32 version; // Default : 0x01
mbtk_modem_band_area_enum band_area;
+ uint32 net_pref; // Refor to : mbtk_net_pref_enum
+ uint32 net_support; // 1:GSM 2:WCDMA 4:LTE 8:NR
uint32 band_gsm;
uint32 band_wcdma;
uint32 band_tdlte;
uint32 band_fddlte;
uint32 band_lte_ext;
+ uint32 band_nr_3;
+ uint32 band_nr_2;
+ uint32 band_nr_1;
+ uint32 band_nr_0;
} mbtk_device_info_modem_t;
typedef struct {
@@ -131,4 +161,5 @@
int mbtk_dev_info_read(mbtk_device_info_item_enum item_type, void *item_ptr, int item_size);
int mbtk_dev_info_write(mbtk_device_info_item_enum item_type, void *item_ptr, int item_size);
-#endif /* _MBTK_DEVICE_H */
+#endif /* _MBTK_DEVICE_V2_H */
+
diff --git a/mbtk/include/mbtk/mbtk_device_v2.h b/mbtk/include/mbtk/mbtk_device_v2.h
deleted file mode 100755
index 7beb84d..0000000
--- a/mbtk/include/mbtk/mbtk_device_v2.h
+++ /dev/null
@@ -1,165 +0,0 @@
-/*
-* mbtk_device.h
-*
-* MBTK device_info partition data header.
-*
-* Author : lb
-* Date : 2023/12/30 11:36:35
-*/
-#ifndef _MBTK_DEVICE_V2_H
-#define _MBTK_DEVICE_V2_H
-//#include "mbtk_type.h"
-
-#define MBTK_DEVICE_INFO_PARTITION_NAME "device_info"
-#define MBTK_DEVICE_INFO_PARTITION_TAG 0x87878787
-#define MBTK_DEVICE_INFO_CURR_VERSION 2
-
-#define MBTK_DEV_INFO_PARTITION_ADDR 0x02A20000
-
-// 78,147,482,134742231
-#define MBTK_BAND_ALL_GSM_DEFAULT 78 // GSM : ASR default.
-#define MBTK_BAND_ALL_WCDMA_DEFAULT 147 // WCDMA : ASR default.
-#define MBTK_BAND_ALL_TDLTE_DEFAULT 482 // TDD-LTE : ASR default.
-#define MBTK_BAND_ALL_FDDLTE_DEFAULT 134742231 // FDD-LTE : ASR default.
-#define MBTK_BAND_ALL_EXT_LTE_DEFAULT 0 // EXT-LTE
-#define MBTK_BAND_ALL_NR_3_DEFAULT 0
-#define MBTK_BAND_ALL_NR_2_DEFAULT 24576 // n78/n79
-#define MBTK_BAND_ALL_NR_1_DEFAULT 256 // n41
-#define MBTK_BAND_ALL_NR_0_DEFAULT 134217877 // n1/n3/n5/n8/n28
-
-#define MBTK_BAND_CN_GSM_DEFAULT 11 // GSM : B3/B8 (PGSM 900/DCS GSM 1800/EGSM 900)
-#define MBTK_BAND_CN_WCDMA_DEFAULT 145 // WCDMA : B1/B5/B8
-#define MBTK_BAND_CN_TDLTE_DEFAULT 482 // TDD-LTE : B34/B38/B39/B40/B41
-#define MBTK_BAND_CN_FDDLTE_DEFAULT 149 // FDD-LTE : B1/B3/B5/B8
-#define MBTK_BAND_CN_EXT_LTE_DEFAULT 0 // EXT-LTE
-#define MBTK_BAND_CN_NR_3_DEFAULT 0
-#define MBTK_BAND_CN_NR_2_DEFAULT 24576 // n78/n79
-#define MBTK_BAND_CN_NR_1_DEFAULT 384 // n40/n41
-#define MBTK_BAND_CN_NR_0_DEFAULT 134217877 // n1/n3/n5/n8/n28
-
-#define MBTK_BAND_EU_GSM_DEFAULT 11 // GSM : B3/B8 (PGSM 900/DCS GSM 1800/EGSM 900)
-#define MBTK_BAND_EU_WCDMA_DEFAULT 145 // WCDMA : B1/B5/B8
-#define MBTK_BAND_EU_TDLTE_DEFAULT 416 // TDD-LTE : B38/B40/B41
-#define MBTK_BAND_EU_FDDLTE_DEFAULT 134742229 // FDD-LTE : B1/B3/B5/B7/B8/B20/B28
-#define MBTK_BAND_EU_EXT_LTE_DEFAULT 0 // EXT-LTE
-#define MBTK_BAND_EU_NR_3_DEFAULT 0
-#define MBTK_BAND_EU_NR_2_DEFAULT 12352 // n71/n77/n78
-#define MBTK_BAND_EU_NR_1_DEFAULT 416 // n38/n40/n41
-#define MBTK_BAND_EU_NR_0_DEFAULT 134742229 // n1/n3/n5/n7/n8/n20/n28
-
-#define MBTK_BAND_SA_GSM_DEFAULT 79 // GSM : B2/B3/B5/B8(GSM 850/PGSM 900/EGSM 900/DCS GSM 1800/PCS GSM 1900)
-#define MBTK_BAND_SA_WCDMA_DEFAULT 155 // WCDMA : B1/B2/B4/B5/B8
-#define MBTK_BAND_SA_TDLTE_DEFAULT 128 // TDD-LTE : B40
-#define MBTK_BAND_SA_FDDLTE_DEFAULT 134217951 // FDD-LTE : B1/B2/B3/B4/B5/B7/B8/B28
-#define MBTK_BAND_SA_EXT_LTE_DEFAULT 2 // EXT-LTE : B66
-#define MBTK_BAND_SA_NR_3_DEFAULT MBTK_BAND_ALL_NR_3_DEFAULT
-#define MBTK_BAND_SA_NR_2_DEFAULT MBTK_BAND_ALL_NR_2_DEFAULT
-#define MBTK_BAND_SA_NR_1_DEFAULT MBTK_BAND_ALL_NR_1_DEFAULT
-#define MBTK_BAND_SA_NR_0_DEFAULT MBTK_BAND_ALL_NR_0_DEFAULT
-
-#define MBTK_DEVICE_INFO_ITEM_STR_BASIC "BASIC"
-#define MBTK_DEVICE_INFO_ITEM_STR_FOTA "FOTA"
-#define MBTK_DEVICE_INFO_ITEM_STR_MODEM "MODEM"
-#define MBTK_DEVICE_INFO_ITEM_STR_LOG "LOG"
-
-#define MBTK_DEVICE_INFO_ITEM_ADDR_BASIC 0x100 // Header is 0x100
-#define MBTK_DEVICE_INFO_ITEM_ADDR_FOTA 0x500 // Basic is 1k
-#define MBTK_DEVICE_INFO_ITEM_ADDR_MODEM 0x900 // Fota is 1k
-#define MBTK_DEVICE_INFO_ITEM_ADDR_LOG 0xD00 // Modem is 1k
-
-#define MBTK_NET_SUPPORT_2G (1)
-#define MBTK_NET_SUPPORT_3G (1<<1)
-#define MBTK_NET_SUPPORT_4G (1<<2)
-#define MBTK_NET_SUPPORT_5G (1<<3)
-
-typedef enum {
- MBTK_DEVICE_INFO_ITEM_BASIC = 0,
- MBTK_DEVICE_INFO_ITEM_FOTA,
- MBTK_DEVICE_INFO_ITEM_MODEM,
- MBTK_DEVICE_INFO_ITEM_LOG,
-
- MBTK_DEVICE_INFO_ITEM_NUM
-} mbtk_device_info_item_enum;
-
-typedef struct {
- mbtk_device_info_item_enum item;
- uint32 addr;
-} mbtk_device_info_item_header_t;
-
-typedef struct {
- uint32 tag;
- uint32 version; // Default : 0x01
- uint32 item_count;
- mbtk_device_info_item_header_t item_header[MBTK_DEVICE_INFO_ITEM_NUM];
-} mbtk_device_info_header_t;
-
-typedef enum {
- MBTK_REBOOT_FLAG_NORMAL = 0,
- MBTK_REBOOT_FLAG_DOWNLOAD,
- MBTK_REBOOT_FLAG_POWER_OFF, //Power off and restart
- MBTK_REBOOT_FLAG_HARDWARE, //Hardware restart
- MBTK_REBOOT_FLAG_COMMAND, //"reboot" "reboot -f" Command restart
- MBTK_REBOOT_FLAG_ABNORMAL, //Abnormal restart
- MBTK_REBOOT_FLAG_UNKNOWN, //unknown restart
-} mbtk_device_info_reboot_flag_enum;
-
-typedef struct {
- uint8 name[16];
- uint32 version; // Default : 0x01
- uint8 project[16]; // T108 / L508_X6
- uint8 project_cust[16]; // T108_C1 / L508_X6_C1 (Refer to: Custom_Model in blf file.)
- uint32 ab_support; // 1 for ab
- mbtk_device_info_reboot_flag_enum reboot_flag;
- uint8 revision_out[48]; // L508_X6v01.01b04.00
- uint8 revision_in[64];
- uint8 build_time[64];
-} mbtk_device_info_basic_t;
-
-typedef struct {
- uint8 name[16];
- uint32 version; // Default : 0x01
- uint32 state; //
-} mbtk_device_info_fota_t;
-
-typedef enum {
- MBTK_MODEM_BAND_AREA_ALL,
- MBTK_MODEM_BAND_AREA_CN,
- MBTK_MODEM_BAND_AREA_EU,
- MBTK_MODEM_BAND_AREA_SA
-} mbtk_modem_band_area_enum;
-
-typedef struct {
- uint8 name[16];
- uint32 version; // Default : 0x01
- mbtk_modem_band_area_enum band_area;
- uint32 net_pref; // Refor to : mbtk_net_pref_enum
- uint32 net_support; // 1:GSM 2:WCDMA 4:LTE 8:NR
- uint32 band_gsm;
- uint32 band_wcdma;
- uint32 band_tdlte;
- uint32 band_fddlte;
- uint32 band_lte_ext;
- uint32 band_nr_3;
- uint32 band_nr_2;
- uint32 band_nr_1;
- uint32 band_nr_0;
-} mbtk_device_info_modem_t;
-
-typedef struct {
- uint8 name[16];
- uint32 version; // Default : 0x01
- uint32 state; //
-} mbtk_device_info_log_t;
-
-
-/*
-* MBTK_DEVICE_INFO_ITEM_BASIC - mbtk_device_info_basic_t
-* MBTK_DEVICE_INFO_ITEM_FOTA - mbtk_device_info_fota_t
-* MBTK_DEVICE_INFO_ITEM_MODEM - mbtk_device_info_modem_t
-* MBTK_DEVICE_INFO_ITEM_LOG - mbtk_device_info_log_t
-*/
-int mbtk_dev_info_read(mbtk_device_info_item_enum item_type, void *item_ptr, int item_size);
-int mbtk_dev_info_write(mbtk_device_info_item_enum item_type, void *item_ptr, int item_size);
-
-#endif /* _MBTK_DEVICE_V2_H */
-
diff --git a/mbtk/libmbtk_lib/common/mbtk_device_info.c b/mbtk/libmbtk_lib/common/mbtk_device_info.c
index d1cb7de..c185d00 100755
--- a/mbtk/libmbtk_lib/common/mbtk_device_info.c
+++ b/mbtk/libmbtk_lib/common/mbtk_device_info.c
@@ -28,12 +28,7 @@
#include "mbtk_str.h"
#include "mbtk_mtd.h"
-#ifdef MBTK_DEV_INFO_VERSION_2
-#include "mbtk_device_v2.h"
-#else
#include "mbtk_device.h"
-#endif
-
/*
* MBTK_DEVICE_INFO_ITEM_BASIC - mbtk_device_info_basic_t
diff --git a/mbtk/mbtk_rild_v2/inc/ril_info.h b/mbtk/mbtk_rild_v2/inc/ril_info.h
index 23a4ee6..558d3f9 100755
--- a/mbtk/mbtk_rild_v2/inc/ril_info.h
+++ b/mbtk/mbtk_rild_v2/inc/ril_info.h
@@ -16,11 +16,7 @@
#include "atchannel.h"
#include "at_tok.h"
#include "mbtk_list.h"
-#ifdef MBTK_DEV_INFO_VERSION_2
-#include "mbtk_device_v2.h"
-#else
#include "mbtk_device.h"
-#endif
#include "mbtk_queue.h"
#include "mbtk_ril.h"
diff --git a/mbtk/mbtk_rild_v2/src/main.c b/mbtk/mbtk_rild_v2/src/main.c
index 0823105..a608201 100755
--- a/mbtk/mbtk_rild_v2/src/main.c
+++ b/mbtk/mbtk_rild_v2/src/main.c
@@ -2790,7 +2790,6 @@
mbtk_device_info_modem_t info_modem;
memset(&band_info.band_support, 0, sizeof(mbtk_band_info_t));
memset(&info_modem, 0, sizeof(mbtk_device_info_modem_t));
-#ifdef MBTK_DEV_INFO_VERSION_2
if(mbtk_dev_info_read(MBTK_DEVICE_INFO_ITEM_MODEM, &(info_modem), sizeof(mbtk_device_info_modem_t))) {
LOGD("mbtk_dev_info_read(MODEM) fail, use default band.");
band_info.band_area = MBTK_MODEM_BAND_AREA_ALL;
@@ -2846,39 +2845,6 @@
band_info.band_support.nr_1_band = info_modem.band_nr_1;
band_info.band_support.nr_0_band = info_modem.band_nr_0;
}
-#else
- if(mbtk_dev_info_read(MBTK_DEVICE_INFO_ITEM_MODEM, &(info_modem), sizeof(mbtk_device_info_modem_t))) {
- LOGD("mbtk_dev_info_read(MODEM) fail, use default band.");
- band_info.band_area = MBTK_MODEM_BAND_AREA_ALL;
- band_info.band_support.net_pref = MBTK_NET_PREF_GSM_UMTS_LTE_LTE_PREF; // 15
- band_info.net_support = MBTK_NET_SUPPORT_2G | MBTK_NET_SUPPORT_3G | MBTK_NET_SUPPORT_4G;
-
- band_info.band_support.gsm_band = MBTK_BAND_ALL_GSM_DEFAULT;
- band_info.band_support.umts_band = MBTK_BAND_ALL_WCDMA_DEFAULT;
- band_info.band_support.tdlte_band = MBTK_BAND_ALL_TDLTE_DEFAULT;
- band_info.band_support.fddlte_band = MBTK_BAND_ALL_FDDLTE_DEFAULT;
- band_info.band_support.lte_ext_band = MBTK_BAND_ALL_EXT_LTE_DEFAULT;
-
- band_info.band_support.nr_3_band = 0;
- band_info.band_support.nr_2_band = 0;
- band_info.band_support.nr_1_band = 0;
- band_info.band_support.nr_0_band = 0;
- } else {
- band_info.band_area = info_modem.band_area;
- band_info.net_support = MBTK_NET_SUPPORT_2G | MBTK_NET_SUPPORT_3G | MBTK_NET_SUPPORT_4G;
- band_info.band_support.net_pref = MBTK_NET_PREF_GSM_UMTS_LTE_LTE_PREF; // 15
- band_info.band_support.gsm_band = info_modem.band_gsm;
- band_info.band_support.umts_band = info_modem.band_wcdma;
- band_info.band_support.tdlte_band = info_modem.band_tdlte;
- band_info.band_support.fddlte_band = info_modem.band_fddlte;
- band_info.band_support.lte_ext_band = info_modem.band_lte_ext;
-
- band_info.band_support.nr_3_band = 0;
- band_info.band_support.nr_2_band = 0;
- band_info.band_support.nr_1_band = 0;
- band_info.band_support.nr_0_band = 0;
- }
-#endif
}
static void* ril_process_thread(void* arg)
diff --git a/mbtk/mbtk_rild_v2/src/ril_net.c b/mbtk/mbtk_rild_v2/src/ril_net.c
index 649fd72..7042954 100755
--- a/mbtk/mbtk_rild_v2/src/ril_net.c
+++ b/mbtk/mbtk_rild_v2/src/ril_net.c
@@ -27,15 +27,7 @@
static bool net_support_check(uint32 net_type, uint32 net_flag)
{
-#ifdef MBTK_DEV_INFO_VERSION_2
return (net_type & net_flag);
-#else
- if(net_flag == MBTK_NET_SUPPORT_5G) {
- return FALSE;
- } else {
- return TRUE;
- }
-#endif
}
/*
diff --git a/mbtk/mbtk_utils/device_info.c b/mbtk/mbtk_utils/device_info.c
index da66f3d..a25016d 100755
--- a/mbtk/mbtk_utils/device_info.c
+++ b/mbtk/mbtk_utils/device_info.c
@@ -2,11 +2,7 @@
#include "mbtk_type.h"
#include "mbtk_utils.h"
-#ifdef MBTK_DEV_INFO_VERSION_2
-#include "mbtk_device_v2.h"
-#else
#include "mbtk_device.h"
-#endif
static char* band_2_str(mbtk_modem_band_area_enum band_area)
@@ -24,7 +20,6 @@
}
}
-#ifdef MBTK_DEV_INFO_VERSION_2
static char* net_support_str_get(uint32 net_support)
{
static char net_str[100] = {0};
@@ -62,7 +57,6 @@
}
return net_str;
}
-#endif
static char* band_str_get(uint32 band, int index)
{
@@ -119,7 +113,6 @@
return -1;
}
-#ifdef MBTK_DEV_INFO_VERSION_2
printf("net_pref:%d\n", info_modem.net_pref);
printf("net_support:%s\n", net_support_str_get(info_modem.net_support));
printf("Band:%s\n", band_2_str(info_modem.band_area));
@@ -132,14 +125,6 @@
printf("Band NR_2:0x%08x(%s)\n", info_modem.band_nr_2, band_str_get(info_modem.band_nr_2, 2));
printf("Band NR_1:0x%08x(%s)\n", info_modem.band_nr_1, band_str_get(info_modem.band_nr_1, 1));
printf("Band NR_0:0x%08x(%s)\n", info_modem.band_nr_0, band_str_get(info_modem.band_nr_0, 0));
-#else
- printf("Band:%s\n", band_2_str(info_modem.band_area));
- printf("Band GSM:0x%08x(%s)\n", info_modem.band_gsm, band_str_get(info_modem.band_gsm, 0));
- printf("Band WCDMA:0x%08x(%s)\n", info_modem.band_wcdma, band_str_get(info_modem.band_wcdma, 0));
- printf("Band TDLTE:0x%08x(%s)\n", info_modem.band_tdlte, band_str_get(info_modem.band_tdlte, 1));
- printf("Band FDDLTE:0x%08x(%s)\n", info_modem.band_fddlte, band_str_get(info_modem.band_fddlte, 0));
- printf("Band EXT_LTE:0x%08x(%s)\n", info_modem.band_lte_ext, band_str_get(info_modem.band_lte_ext, 0));
-#endif
return 0;
}
diff --git a/mbtk/mbtk_utils/mbtk_reboot.c b/mbtk/mbtk_utils/mbtk_reboot.c
index 3a85294..a355235 100755
--- a/mbtk/mbtk_utils/mbtk_reboot.c
+++ b/mbtk/mbtk_utils/mbtk_reboot.c
@@ -1,10 +1,7 @@
#include <string.h>
#include "mbtk_type.h"
-#ifdef MBTK_DEV_INFO_VERSION_2
-#include "mbtk_device_v2.h"
-#else
+
#include "mbtk_device.h"
-#endif
#include "mbtk_utils.h"
#if 0
static char* band_2_str(mbtk_modem_band_area_enum band_area)
diff --git a/mbtk/mbtk_utils_linux/Makefile b/mbtk/mbtk_utils_linux/Makefile
index 6683eb2..c2427bc 100755
--- a/mbtk/mbtk_utils_linux/Makefile
+++ b/mbtk/mbtk_utils_linux/Makefile
@@ -1,9 +1,9 @@
BUILD_ROOT = $(shell pwd)/..
include $(BUILD_ROOT)/Make.defines
-ifeq ($(MBTK_DEV_INFO_VERSION), 2)
-DEFINE = -DMBTK_DEV_INFO_VERSION_2
-endif
+#ifeq ($(MBTK_DEV_INFO_VERSION), 2)
+#DEFINE = -DMBTK_DEV_INFO_VERSION_2
+#endif
INC_DIR += \
-I$(LOCAL_PATH)
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));
diff --git a/mbtk/mbtk_utils_linux/ota_update.c b/mbtk/mbtk_utils_linux/ota_update.c
index dbc7bd0..ca2ef7a 100755
--- a/mbtk/mbtk_utils_linux/ota_update.c
+++ b/mbtk/mbtk_utils_linux/ota_update.c
@@ -8,11 +8,7 @@
#include <fcntl.h>
#include "mbtk_type.h"
-#ifdef MBTK_DEV_INFO_VERSION_2
-#include "mbtk_device_v2.h"
-#else
#include "mbtk_device.h"
-#endif
/*
* revision_out start from 0x1000.