Fix band config for SA
Change-Id: I9702403827b5a9f9507ab48b4868a0b3b74118b9
diff --git a/mbtk/include/mbtk/mbtk_device.h b/mbtk/include/mbtk/mbtk_device.h
index fcf9846..63e5398 100755
--- a/mbtk/include/mbtk/mbtk_device.h
+++ b/mbtk/include/mbtk/mbtk_device.h
@@ -21,18 +21,22 @@
#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_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_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_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/B66
+#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_DEVICE_INFO_ITEM_STR_BASIC "BASIC"
#define MBTK_DEVICE_INFO_ITEM_STR_FOTA "FOTA"
diff --git a/mbtk/include/mbtk/mbtk_info_api.h b/mbtk/include/mbtk/mbtk_info_api.h
old mode 100644
new mode 100755
index caa762a..ecf2516
--- a/mbtk/include/mbtk/mbtk_info_api.h
+++ b/mbtk/include/mbtk/mbtk_info_api.h
@@ -162,6 +162,7 @@
uint16 umts_band; // mbtk_umts_band_enum
uint32 tdlte_band; // mbtk_tdlte_band_enum
uint32 fddlte_band; // mbtk_fddlte_band_enum
+ uint32 lte_ext_band; // mbtk_lte_ext_band_enum
} __attribute__((packed)) mbtk_band_info_t;
typedef struct
@@ -472,7 +473,7 @@
typedef struct{
uint8_t mode;
- uint32_t oosPhase[3]; //单位为秒
+ uint32_t oosPhase[3]; //单位为秒
} mbtk_oos_info;
/**************led enum*********/
@@ -933,9 +934,9 @@
int mbtk_mute_state_get(mbtk_info_handle_t* handle, int *mute_state);
//Wake-up control
int mbtk_wakeup_state_set(mbtk_info_handle_t* handle, uint32 wakeup_state);
-//Get the searching interval of OOS
+//Get the searching interval of OOS
int mbtk_oos_get(mbtk_info_handle_t* handle, mbtk_oos_info *oos_info);
-//Set the searching interval of OOS
+//Set the searching interval of OOS
int mbtk_oos_set(mbtk_info_handle_t* handle, mbtk_oos_info *oos_info);
diff --git a/mbtk/libmbtk_ril/mbtk_info.h b/mbtk/libmbtk_ril/mbtk_info.h
index 1ba7ab8..d8bef07 100755
--- a/mbtk/libmbtk_ril/mbtk_info.h
+++ b/mbtk/libmbtk_ril/mbtk_info.h
@@ -147,7 +147,7 @@
// mbtk_net_ims
MBTK_INFO_ID_NET_IMS_REQ,
MBTK_INFO_ID_NET_IMS_RSP,
-
+
MBTK_INFO_ID_NET_END,
@@ -238,7 +238,7 @@
MBTK_INFO_ID_OOS_STA_RSP,
MBTK_INFO_ID_OOS_STA_END,
-
+
//led
MBTK_INFO_ID_LED_BEGIN = 8000,
MBTK_INFO_ID_LED_REQ,
@@ -286,7 +286,7 @@
MBTK_INFO_ERR_CID, // CID error.
MBTK_INFO_ERR_TIMEOUT, // Timeout.
MBTK_INFO_ERR_TIME_FORMAT, // Time format error.
-
+
//mbtk wyq for data_call add start
MBTK_INFO_ERR_CID_EXIST,
MBTK_INFO_ERR_CID_NO_EXIST,
@@ -381,6 +381,15 @@
MBTK_FDDLTE_BAND_20 = 524288
} mbtk_fddlte_band_enum;
+typedef enum
+{
+ MBTK_LTE_EXT_BAND_65 = 1,
+ MBTK_LTE_EXT_BAND_66 = 2,
+ MBTK_LTE_EXT_BAND_67 = 4,
+ MBTK_LTE_EXT_BAND_68 = 8,
+ MBTK_LTE_EXT_BAND_69 = 16
+} mbtk_lte_ext_band_enum;
+
/*
0: unknown
1: available
diff --git a/mbtk/mbtk_rild/src/mbtk_info_server.c b/mbtk/mbtk_rild/src/mbtk_info_server.c
index 435fb62..ea7e3ff 100755
--- a/mbtk/mbtk_rild/src/mbtk_info_server.c
+++ b/mbtk/mbtk_rild/src/mbtk_info_server.c
@@ -24,9 +24,6 @@
#include "mbtk_device.h"
typedef struct {
- bool band_set_success;
-
- mbtk_modem_band_area_enum band_area;
uint32 band_gsm;
uint32 band_wcdma;
uint32 band_tdlte;
@@ -44,6 +41,8 @@
static pthread_cond_t urc_cond;
static pthread_mutex_t urc_mutex;
static band_set_info_t band_set_info;
+static bool band_set_success = FALSE;
+static mbtk_modem_band_area_enum band_area;
static mbtk_band_info_t band_support;
net_info_t net_info;
@@ -331,11 +330,11 @@
#if 1
// 79,147,482,524503
- band_support.gsm_band = (uint16)79;
- band_support.umts_band = (uint16)147;
- band_support.tdlte_band = (uint32)482;
- band_support.fddlte_band = (uint32)134742231;
- //band_support.fddlte_band = (uint32)524503;
+ band_support.gsm_band = (uint16)79; // GSM : B2/B3/B5/B8(GSM 850/PGSM 900/EGSM 900/DCS GSM 1800/PCS GSM 1900)
+ band_support.umts_band = (uint16)155; // WCDMA : B1/B2/B4/B5/B8
+ band_support.tdlte_band = (uint32)482; // TDD-LTE : B34/B38/B39/B40/B41
+ band_support.fddlte_band = (uint32)134742239; // FDD-LTE : B1/B2/B3/B4/B5/B7/B8/B20/B28
+ band_support.lte_ext_band = (uint32)2; // B66
band_support.net_pref = (uint8)0;
#else
ATResponse *response = NULL;
@@ -1426,6 +1425,11 @@
goto exit;
}
+ if((band->lte_ext_band & band_support.lte_ext_band) != band->lte_ext_band) {
+ LOG("EXT_LTE band error.");
+ goto exit;
+ }
+
if(band->net_pref == 0xFF) { // No change net_pref.
int tmp_int;
err = at_send_command_singleline("AT*BAND?", "*BAND:", &response);
@@ -1451,7 +1455,11 @@
at_response_free(response);
}
- sprintf(cmd, "AT*BAND=%d,%d,%d,%d,%d", band->net_pref, band->gsm_band, band->umts_band, band->tdlte_band, band->fddlte_band);
+ if(band->lte_ext_band > 0) {
+ sprintf(cmd, "AT*BAND=%d,%d,%d,%d,%d,,,,%d", band->net_pref, band->gsm_band, band->umts_band, band->tdlte_band, band->fddlte_band, band->lte_ext_band);
+ } else {
+ sprintf(cmd, "AT*BAND=%d,%d,%d,%d,%d", band->net_pref, band->gsm_band, band->umts_band, band->tdlte_band, band->fddlte_band);
+ }
}
err = at_send_command(cmd, &response);
@@ -1588,6 +1596,42 @@
}
band->fddlte_band = (uint32)tmp_int;
+ // roamingConfig
+ err = at_tok_nextint(&line, &tmp_int);
+ if (err < 0)
+ {
+ goto exit;
+ }
+
+ // srvDomain
+ err = at_tok_nextint(&line, &tmp_int);
+ if (err < 0)
+ {
+ goto exit;
+ }
+
+ // bandPriorityFlag
+ err = at_tok_nextint(&line, &tmp_int);
+ if (err < 0)
+ {
+ goto exit;
+ }
+
+ //
+ err = at_tok_nextint(&line, &tmp_int);
+ if (err < 0)
+ {
+ goto exit;
+ }
+
+ // ltebandExt
+ err = at_tok_nextint(&line, &tmp_int);
+ if (err < 0)
+ {
+ goto exit;
+ }
+ band->lte_ext_band = (uint32)tmp_int;
+
log_hex("BAND", band, sizeof(mbtk_band_info_t));
exit:
@@ -4669,6 +4713,7 @@
if(pack->data_len == sizeof(uint8)) {
if(*(pack->data)) { // Get current bands.
mbtk_band_info_t band;
+ memset(&band, 0x0, sizeof(mbtk_band_info_t));
if(req_band_get(&band, &cme_err) || cme_err != MBTK_INFO_ERR_CME_NON)
{
if(cme_err != MBTK_INFO_ERR_CME_NON) {
@@ -4981,14 +5026,14 @@
}
break;
}
- case MBTK_INFO_ID_NET_APN_DEL_REQ:
+ case MBTK_INFO_ID_NET_APN_DEL_REQ:
{
- if(pack->data_len == 0 || pack->data == NULL)
+ if(pack->data_len == 0 || pack->data == NULL)
{
err = MBTK_INFO_ERR_UNSUPPORTED;
LOG("Unsupported delete apn .");
}
- else
+ else
{
int profile = pack->data[0];
if(req_apn_del(profile, &cme_err) || cme_err != MBTK_INFO_ERR_CME_NON)
@@ -6345,22 +6390,25 @@
int cme_err = MBTK_INFO_ERR_CME_NON;
band.net_pref = MBTK_NET_PREF_GSM_UMTS_LTE_LTE_PREF; // 15
- band.gsm_band = band_set_info.band_gsm;
- band.umts_band = band_set_info.band_wcdma;
+ band.gsm_band = (uint16)band_set_info.band_gsm;
+ band.umts_band = (uint16)band_set_info.band_wcdma;
band.tdlte_band = band_set_info.band_tdlte;
band.fddlte_band = band_set_info.band_fddlte;
+ band.lte_ext_band = band_set_info.band_lte_ext;
+
if(req_band_set(&band, &cme_err) || cme_err != MBTK_INFO_ERR_CME_NON)
{
LOG("Set band fail.");
}
else // Set band success.
{
- band_set_info.band_set_success = TRUE;
- if(band_set_info.band_area == MBTK_MODEM_BAND_AREA_CN) {
+ log_hex("BAND-2", &band_set_info, sizeof(band_set_info_t));
+ band_set_success = TRUE;
+ if(band_area == MBTK_MODEM_BAND_AREA_CN) {
property_set("persist.mbtk.band_config", "CN");
- } else if(band_set_info.band_area == MBTK_MODEM_BAND_AREA_EU) {
+ } else if(band_area == MBTK_MODEM_BAND_AREA_EU) {
property_set("persist.mbtk.band_config", "EU");
- } else if(band_set_info.band_area == MBTK_MODEM_BAND_AREA_SA) {
+ } else if(band_area == MBTK_MODEM_BAND_AREA_SA) {
property_set("persist.mbtk.band_config", "SA");
} else {
property_set("persist.mbtk.band_config", "ALL");
@@ -6411,7 +6459,7 @@
if( (signal_globe.type != tmp_signal.type) || (signal_globe.rssi != tmp_signal.rssi) || (signal_globe.rxlev != tmp_signal.rxlev) ||
(signal_globe.ber != tmp_signal.ber) || (signal_globe.rscp != tmp_signal.rscp) || (signal_globe.ecno != tmp_signal.ecno) ||
(signal_globe.rsrq != tmp_signal.rsrq) || (signal_globe.rsrp != tmp_signal.rsrp) )
-
+
{
signal_globe.type = signal.type;
signal_globe.rssi = signal.rssi;
@@ -6662,17 +6710,17 @@
mbtk_device_info_modem_t info_modem;
memset(&band_set_info, 0, sizeof(band_set_info_t));
memset(&info_modem, 0, sizeof(mbtk_device_info_modem_t));
- band_set_info.band_set_success = FALSE;
+ band_set_success = FALSE;
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_set_info.band_area = MBTK_MODEM_BAND_AREA_ALL;
+ band_area = MBTK_MODEM_BAND_AREA_ALL;
band_set_info.band_gsm = MBTK_BAND_ALL_GSM_DEFAULT;
band_set_info.band_wcdma = MBTK_BAND_ALL_WCDMA_DEFAULT;
band_set_info.band_tdlte = MBTK_BAND_ALL_TDLTE_DEFAULT;
band_set_info.band_fddlte = MBTK_BAND_ALL_FDDLTE_DEFAULT;
- band_set_info.band_lte_ext = 0;
+ band_set_info.band_lte_ext = MBTK_BAND_ALL_EXT_LTE_DEFAULT;
} else {
- band_set_info.band_area = info_modem.band_area;
+ band_area = info_modem.band_area;
band_set_info.band_gsm = info_modem.band_gsm;
band_set_info.band_wcdma = info_modem.band_wcdma;
band_set_info.band_tdlte = info_modem.band_tdlte;
@@ -6681,7 +6729,7 @@
}
bool is_first = TRUE;
- while(!band_set_info.band_set_success) {
+ while(!band_set_success) {
info_urc_msg_t *urc = (info_urc_msg_t*)malloc(sizeof(info_urc_msg_t));
if(!urc)
{
@@ -6696,9 +6744,9 @@
if(is_first) {
is_first = FALSE;
} else {
- LOGE("*BAND exec error, will retry in 3s.");
+ LOGE("*BAND exec error, will retry in 5s.");
}
- sleep(3);
+ sleep(5);
}
}
diff --git a/mbtk/mbtk_utils/device_info.c b/mbtk/mbtk_utils/device_info.c
index 0993c06..b8207e7 100755
--- a/mbtk/mbtk_utils/device_info.c
+++ b/mbtk/mbtk_utils/device_info.c
@@ -9,6 +9,8 @@
return "CN";
case MBTK_MODEM_BAND_AREA_EU:
return "EU";
+ case MBTK_MODEM_BAND_AREA_SA:
+ return "SA";
default:
return "ALL";
}
@@ -51,6 +53,7 @@
printf("Band WCDMA:0x%08x\n", info_modem.band_wcdma);
printf("Band TDLTE:0x%08x\n", info_modem.band_tdlte);
printf("Band FDDLTE:0x%08x\n", info_modem.band_fddlte);
+ printf("Band EXT_LTE:0x%08x\n", info_modem.band_lte_ext);
return 0;
}
diff --git a/mbtk/mbtk_utils_linux/device_info_generate.c b/mbtk/mbtk_utils_linux/device_info_generate.c
index 0102031..b44ea1d 100755
--- a/mbtk/mbtk_utils_linux/device_info_generate.c
+++ b/mbtk/mbtk_utils_linux/device_info_generate.c
@@ -47,7 +47,7 @@
.band_wcdma = MBTK_BAND_ALL_WCDMA_DEFAULT,
.band_tdlte = MBTK_BAND_ALL_TDLTE_DEFAULT,
.band_fddlte = MBTK_BAND_ALL_FDDLTE_DEFAULT,
- .band_lte_ext = 0
+ .band_lte_ext = MBTK_BAND_ALL_EXT_LTE_DEFAULT
};
static mbtk_device_info_log_t item_log = {
@@ -161,24 +161,28 @@
item_modem.band_wcdma = MBTK_BAND_CN_WCDMA_DEFAULT;
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;
} else if(strcmp(optarg, "eu") == 0) {
item_modem.band_area = MBTK_MODEM_BAND_AREA_EU;
item_modem.band_gsm = MBTK_BAND_EU_GSM_DEFAULT;
item_modem.band_wcdma = MBTK_BAND_EU_WCDMA_DEFAULT;
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;
} else if(strcmp(optarg, "sa") == 0) {
item_modem.band_area = MBTK_MODEM_BAND_AREA_SA;
item_modem.band_gsm = MBTK_BAND_SA_GSM_DEFAULT;
item_modem.band_wcdma = MBTK_BAND_SA_WCDMA_DEFAULT;
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;
} else {
item_modem.band_area = MBTK_MODEM_BAND_AREA_ALL;
item_modem.band_gsm = MBTK_BAND_ALL_GSM_DEFAULT;
item_modem.band_wcdma = MBTK_BAND_ALL_WCDMA_DEFAULT;
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;
printf("Set to default band.\n");
}
break;
diff --git a/mbtk/test/libmbtk_ril/mbtk_info_test.c b/mbtk/test/libmbtk_ril/mbtk_info_test.c
index 0c60df3..143ff1e 100755
--- a/mbtk/test/libmbtk_ril/mbtk_info_test.c
+++ b/mbtk/test/libmbtk_ril/mbtk_info_test.c
@@ -517,6 +517,7 @@
}
} else if(!strncasecmp(cmd, "band", 4)){ // "band" or "band support" or "band 0 79 147 482 524503"
mbtk_band_info_t band;
+ memset(&band, 0x0, sizeof(mbtk_band_info_t));
if(!strcasecmp(cmd, "band")) { // Get
err = mbtk_current_band_get(info_handle, &band);
if(err) {