优化LYNQ_CALL添加音量控制和优化LYNQ_SMS添加存储器位置的判断上库LYNQ_NW接口以及添加对应测试demo

Change-Id: Ic19a55f139d6fbf194dffc7ec878a51d1abf656c
diff --git a/mbtk/include/lynq/lynq_qser_network.h b/mbtk/include/lynq/lynq_qser_network.h
index e7727c2..fa0c5c5 100755
--- a/mbtk/include/lynq/lynq_qser_network.h
+++ b/mbtk/include/lynq/lynq_qser_network.h
@@ -365,6 +365,12 @@
     QSER_NW_NR_SIGNAL_INFO_T      nr_sig_info;
 }QSER_NW_SINGNAL_EVENT_IND_T;
 
+typedef enum 
+{
+    E_QSER_NW_RF_MODE_CFUN_0 = 0,    /**<  CFUN 0. */
+    E_QSER_NW_RF_MODE_CFUN_1 = 1,    /**<  CFUN 1. */
+    E_QSER_NW_RF_MODE_FLIGHT = 4,    /**<  Flight Mode, CFUN 4. */
+}E_QSER_NW_RF_MODE_TYPE_T;
 
 int qser_nw_client_init(nw_client_handle_type  *ph_nw);
 
@@ -419,6 +425,18 @@
     void* contextPtr
 );
 
+int qser_nw_set_rf_mode
+(
+    nw_client_handle_type       h_nw,
+    E_QSER_NW_RF_MODE_TYPE_T    rf_mode
+);
+
+int qser_nw_get_rf_mode
+(
+    nw_client_handle_type       h_nw,
+    E_QSER_NW_RF_MODE_TYPE_T    *rf_mode
+);
+
 #ifdef __cplusplus
 }
 #endif
diff --git a/mbtk/lynq_lib/src/lynq_network.c b/mbtk/lynq_lib/src/lynq_network.c
index 5212da5..da2cd97 100755
--- a/mbtk/lynq_lib/src/lynq_network.c
+++ b/mbtk/lynq_lib/src/lynq_network.c
@@ -1,56 +1,583 @@
 #include "lynq_qser_network.h"
+#include "mbtk_type.h"
+#include "mbtk_info_api.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+
+mbtk_info_handle_t* lynq_nw_info_handle = NULL;
+uint64_t tmp_mode = 0xFF;
+
+nw_client_handle_type g_nw_val = -1;
+
+
+typedef struct
+{
+    QSER_NW_RxMsgHandlerFunc_t handlerPtr;
+    void* contextPtr;
+} lynq_cust_cb_func;
+
+static lynq_cust_cb_func lynq_func_cb_handle;
+
+static int roaming_pref = 1;  // Open roaming for default.
+
+typedef enum {
+    RADIO_TECH_3GPP = 1, /* 3GPP Technologies - GSM, WCDMA */
+    RADIO_TECH_3GPP2 = 2 /* 3GPP2 Technologies - CDMA */
+} RIL_RadioTechnologyFamily;
+
+
+typedef struct
+{
+    uint8 *lynq_operator_l;
+    uint8 *lynq_operator_s;
+    uint32 lynq_mcc_mnc;
+} lynq_operator_mcc_mnc_t;
+
+static lynq_operator_mcc_mnc_t lynq_operator_mcc_mnc[] =
+{
+    {"China Mobile","CMCC",46000},
+    {"China Unicom","CU",46001},
+    {"China Mobile","CMCC",46002},
+    {"China Telecom","CT",46003},
+    {"China Mobile","CMCC",46004},
+    {"China Telecom","CT",46005},
+    {"China Unicom","CU",46006},
+    {"China Mobile","CMCC",46007},
+    {"China Mobile","CMCC",46008},
+    {"China Unicom","CU",46009},
+    {"China Telecom","CT",46011}
+};
+
+void lynq_nw_state_change_cb(const void* data, int data_len)
+{
+    uint8 *net_data = NULL;
+
+    net_data = (uint8*)data;
+    log_hex(">>>data",data,data_len);
+
+    if (net_data == NULL)
+    {
+        LOG(">>>NO DATA");
+    }
+    else
+    {
+        LOG(">>>net_data =[%0x]\n",*net_data[2]);
+    }
+    
+/*
+    uint8 data[3];
+    data[0] = (uint8)MBTK_NET_CS_STATE;
+
+    net_data[0] = *(uint8 *)(data);                                 //MBTK_NET_PS_STATE
+    net_data[1] = *(uint8 *)(data + sizeof(uint8));                 //mbtk_net_reg_state_enum state Reg State
+    net_data[2] = *(uint8 *)(data + sizeof(uint8) + sizeof(uint8)); //act
+*/
+
+    if(roaming_pref == 0)
+    {
+        mbtk_modem_info_t info;
+        if(*net_data == 5)
+        {
+            info.fun=4;
+        }
+        else
+            info.fun=1;
+        info.rst=0;
+        mbtk_set_modem_fun(lynq_nw_info_handle, &info);
+    }
+    
+    if(lynq_func_cb_handle.handlerPtr != NULL)
+    {
+        //lynq_func_cb_handle.handlerPtr(g_nw_val, NW_IND_VOICE_REG_EVENT_IND_FLAG,&(net_data[2]), sizeof(&(net_data[2])), NULL);
+        lynq_func_cb_handle.handlerPtr(g_nw_val, NW_IND_DATA_REG_EVENT_IND_FLAG,&(net_data[2]), sizeof(&(net_data[2])), NULL);
+        //lynq_func_cb_handle.handlerPtr(g_nw_val, NW_IND_SIGNAL_STRENGTH_EVENT_IND_FLAG,&(net_data[2]), sizeof(&(net_data[2])), NULL);
+    }
+}
+
+
+static uint8 lynq_net_pre_change(bool mbtk_2_lynq,int net_mode)
+{
+    uint8 mbtk_net_pre = 0xFF;
+
+#if 0
+    此参数表在别处使用
+    E_QSER_NW_RADIO_TECH_TD_SCDMA = 1,                                       Y3     1
+    E_QSER_NW_RADIO_TECH_GSM      = 2,    /**<  GSM; only supports voice. */ YL2    0
+    E_QSER_NW_RADIO_TECH_HSPAP    = 3,    /**<  HSPA+. */                      3    1
+    E_QSER_NW_RADIO_TECH_LTE      = 4,    /**<  LTE. */                        4    5
+    E_QSER_NW_RADIO_TECH_EHRPD    = 5,    /**<  EHRPD. */                      3    1
+    E_QSER_NW_RADIO_TECH_EVDO_B   = 6,    /**<  EVDO B. */                   D3     1
+    E_QSER_NW_RADIO_TECH_HSPA     = 7,    /**<  HSPA. */                      3     1
+    E_QSER_NW_RADIO_TECH_HSUPA    = 8,    /**<  HSUPA. */                     3.5   1
+    E_QSER_NW_RADIO_TECH_HSDPA    = 9,    /**<  HSDPA. */                     3.5   1
+    E_QSER_NW_RADIO_TECH_EVDO_A   = 10,   /**<  EVDO A. */                   D3     1
+    E_QSER_NW_RADIO_TECH_EVDO_0   = 11,   /**<  EVDO 0. */                   D3     1
+    E_QSER_NW_RADIO_TECH_1xRTT    = 12,   /**<  1xRTT. */                       2   0
+    E_QSER_NW_RADIO_TECH_IS95B    = 13,   /**<  IS95B. */                       3   0
+    E_QSER_NW_RADIO_TECH_IS95A    = 14,   /**<  IS95A. */                       3   0
+    E_QSER_NW_RADIO_TECH_UMTS     = 15,   /**<  UMTS. */                     L3     1
+    E_QSER_NW_RADIO_TECH_EDGE     = 16,   /**<  EDGE. */                      2.75  0
+    E_QSER_NW_RADIO_TECH_GPRS     = 17,   /**<  GPRS. */                      2.5   0
+    E_QSER_NW_RADIO_TECH_NONE     = 18    /**<  No technology selected. */
+#endif
+    /*
+    0 : GSM only
+    1 : UMTS only
+    2 : GSM/UMTS(auto)
+    3 : GSM/UMTS(GSM preferred)
+    4 : GSM/UMTS(UMTS preferred)
+    5 : LTE only
+    6 : GSM/LTE(auto)
+    7 : GSM/LTE(GSM preferred)
+    8 : GSM/LTE(LTE preferred)
+    9 : UMTS/LTE(auto)
+    10 : UMTS/LTE(UMTS preferred)
+    11 : UMTS/LTE(LTE preferred)
+    12 : GSM/UMTS/LTE(auto)
+    13 : GSM/UMTS/LTE(GSM preferred)
+    14 : GSM/UMTS/LTE(UMTS preferred)
+    15 : GSM/UMTS/LTE(LTE preferred)
+    */
+
+    if(mbtk_2_lynq) {
+        switch(net_mode)
+        {
+            //使用之前set的tmp_mode的值来进行回显get
+            case QSER_NW_MODE_GSM:
+                mbtk_net_pre = QSER_NW_MODE_GSM;
+                break;
+            case QSER_NW_MODE_WCDMA:
+                mbtk_net_pre = QSER_NW_MODE_WCDMA;
+                break;
+            case QSER_NW_MODE_CDMA:
+                mbtk_net_pre = QSER_NW_MODE_CDMA;
+                break;
+            case QSER_NW_MODE_EVDO:
+                mbtk_net_pre = QSER_NW_MODE_EVDO;
+                break;
+            case QSER_NW_MODE_LTE:
+                mbtk_net_pre = QSER_NW_MODE_LTE;
+                break;
+            case QSER_NW_MODE_TDSCDMA:
+                mbtk_net_pre = QSER_NW_MODE_TDSCDMA;
+                break;
+            default:
+                mbtk_net_pre = 0xFF;
+                break;
+        }
+    } else {
+        switch(net_mode)
+        {
+            //只做234G的only下配 MBTK_NET_PREF_GSM_ONLY/MBTK_NET_PREF_UMTS_ONLY/MBTK_NET_PREF_LTE_ONLY
+            case QSER_NW_MODE_GSM:
+                mbtk_net_pre = MBTK_NET_PREF_GSM_ONLY;
+                break;
+            case QSER_NW_MODE_WCDMA:
+                mbtk_net_pre = MBTK_NET_PREF_GSM_UMTS_UMTS_PREF;
+                break;
+            case QSER_NW_MODE_CDMA:
+                mbtk_net_pre = MBTK_NET_PREF_GSM_UMTS_UMTS_PREF;
+                break;
+            case QSER_NW_MODE_EVDO:
+                mbtk_net_pre = MBTK_NET_PREF_GSM_UMTS_UMTS_PREF;
+                break;
+            case QSER_NW_MODE_LTE:
+                mbtk_net_pre = MBTK_NET_PREF_GSM_UMTS_LTE_LTE_PREF;
+                break;
+            case QSER_NW_MODE_TDSCDMA:
+                mbtk_net_pre = MBTK_NET_PREF_GSM_UMTS_UMTS_PREF;
+                break;
+            default:
+                mbtk_net_pre = 0xFF;
+                break;
+        }
+    }
+    return mbtk_net_pre;
+}
 
 int qser_nw_client_init(nw_client_handle_type *ph_nw)
 {
-    UNUSED(ph_nw);
+    //UNUSED(ph_nw);
 
+    if(lynq_nw_info_handle == NULL)
+    {
+        lynq_nw_info_handle = mbtk_info_handle_get();
+        if(lynq_nw_info_handle)
+        {
+            printf("creat lynq_nw_info_handle is success\n");
+            *ph_nw = lynq_nw_info_handle->client_fd;
+            g_nw_val = lynq_nw_info_handle->client_fd;
+        }
+        else
+        {
+            printf("creat lynq_nw_info_handle is fail\n");
+            return -1;
+        }
+    }
+    
     return 0;
 }
 
 int qser_nw_client_deinit(nw_client_handle_type h_nw)
 {
-    UNUSED(h_nw);
+    //UNUSED(h_nw);
+    if (h_nw != g_nw_val || g_nw_val == -1)
+    {
+        printf("handle NULL\n");
+        return -1;
+    }
+
+    if(lynq_nw_info_handle)
+    {
+        mbtk_info_handle_free(&lynq_nw_info_handle);
+    }
+    else
+    {
+        printf("deinit lynq_nw_info_handle is fail\n");
+        return -1;
+    }
 
     return 0;
 }
 
 int qser_nw_set_config(nw_client_handle_type h_nw,QSER_NW_CONFIG_INFO_T *pt_info)
 {
-    UNUSED(h_nw);
-    UNUSED(pt_info);
+    //UNUSED(h_nw);
+    //UNUSED(pt_info);
+    if (h_nw != g_nw_val || g_nw_val == -1)
+    {
+        printf("handle NULL\n");
+        return -1;
+    }
+
+    if(lynq_nw_info_handle == NULL)
+    {
+        printf("lynq_nw_info_handle == NULL.\n");
+        return -1;
+    }
+
+    if(pt_info == NULL)
+    {
+        printf("pt_info == NULL.\n");
+        return -1;
+    }
+
+    roaming_pref = pt_info->roaming_pref;
+
+    mbtk_band_info_t band;
+    memset(&band, 0, sizeof(mbtk_band_info_t));
+    tmp_mode = pt_info->preferred_nw_mode;//临时保存一下原本的mode
+
+    //printf("tmp_mode = [%llu]",tmp_mode);
+    band.net_pref = lynq_net_pre_change(FALSE, pt_info->preferred_nw_mode);
+    printf("band.net_pref = [%d]\n",band.net_pref);
+
+    if(band.net_pref == 0xFF)
+    {
+        LOGE("lynq_net_pre_change() fail.");
+        return -1;
+    }
+
+    if(mbtk_current_band_set(lynq_nw_info_handle, &band))
+    {
+        return -1;
+    }
 
     return 0;
 }
 
 int qser_nw_get_operator_name(nw_client_handle_type h_nw, QSER_NW_OPERATOR_NAME_INFO_T *pt_info)
 {
-    UNUSED(h_nw);
-    UNUSED(pt_info);
+    //UNUSED(h_nw);
+    //UNUSED(pt_info);
+    if (h_nw != g_nw_val || g_nw_val == -1)
+    {
+        printf("handle NULL\n");
+        return -1;
+    }
 
-    return 0;
+    if(lynq_nw_info_handle == NULL)
+    {
+        printf("lynq_nw_info_handle == NULL.\n");
+        return -1;
+    }
+
+    if(pt_info == NULL)
+    {
+        printf("pt_info == NULL.\n");
+        return -1;
+    }
+
+    char OperatorFN[128];
+    char OperatorSH[128];
+    char MccMnc[128];
+    mbtk_net_info_t net;
+    if(!mbtk_net_sel_mode_get(lynq_nw_info_handle, &net) && net.plmn > 0)
+    {
+        // printf("Net : %d, %d, %d\n", net.net_sel_mode, net.net_type, net.plmn);
+        int i = 0;
+        while(i < ARRAY_SIZE(lynq_operator_mcc_mnc))
+        {
+            if(lynq_operator_mcc_mnc[i].lynq_mcc_mnc == net.plmn)
+                break;
+            i++;
+        }
+
+        if(i == ARRAY_SIZE(lynq_operator_mcc_mnc))   // No found mcc&mnc
+        {
+            strcpy(OperatorFN, "UNKNOWN");
+            strcpy(OperatorSH, "UNKNOWN");
+            sprintf(MccMnc, "%d", net.plmn);
+        }
+        else
+        {
+            strcpy(OperatorFN, lynq_operator_mcc_mnc[i].lynq_operator_l);
+            strcpy(OperatorSH, lynq_operator_mcc_mnc[i].lynq_operator_s);
+            sprintf(MccMnc, "%d", lynq_operator_mcc_mnc[i].lynq_mcc_mnc);
+        }
+        memset(pt_info->long_eons,0,128);
+        memcpy(pt_info->long_eons,lynq_operator_mcc_mnc[i].lynq_operator_l,strlen(lynq_operator_mcc_mnc[i].lynq_operator_l));
+        memset(pt_info->short_eons,0,128);
+        memcpy(pt_info->short_eons,lynq_operator_mcc_mnc[i].lynq_operator_s,strlen(lynq_operator_mcc_mnc[i].lynq_operator_s));
+        memset(pt_info->mcc,0,4);
+        memset(pt_info->mnc,0,4);
+        sprintf(pt_info->mcc, "%d", (lynq_operator_mcc_mnc[i].lynq_mcc_mnc)/100);
+        sprintf(pt_info->mnc, "%d", (lynq_operator_mcc_mnc[i].lynq_mcc_mnc)%100);
+        //pt_info->act;
+        return 0;
+    }
+
+    return -1;
 }
 
 int qser_nw_get_reg_status(nw_client_handle_type h_nw, QSER_NW_REG_STATUS_INFO_T *pt_info)
 {
-    UNUSED(h_nw);
-    UNUSED(pt_info);
+    //UNUSED(h_nw);
+    //UNUSED(pt_info);
+    if (h_nw != g_nw_val || g_nw_val == -1)
+    {
+        printf("handle NULL\n");
+        return -1;
+    }
+
+    if(lynq_nw_info_handle == NULL)
+    {
+        printf("lynq_nw_info_handle == NULL.\n");
+        return -1;
+    }
+
+    if(pt_info == NULL)
+    {
+        printf("pt_info == NULL.\n");
+        return -1;
+    }
+
+    /*VOICE/DATA/IMS*/
+    mbtk_net_reg_info_t reg;
+    int err = mbtk_net_reg_get(lynq_nw_info_handle, &reg);
+    if(err)
+    {
+        LOGE("mbtk_net_reg_get fail.");
+        return -1;
+    }
+    else
+    {
+        memset(pt_info, 0x0, sizeof(QSER_NW_REG_STATUS_INFO_T));
+
+
+        char OperatorFN[128];
+        char OperatorSH[128];
+        char MccMnc[128];
+        mbtk_net_info_t net;
+        if(!mbtk_net_sel_mode_get(lynq_nw_info_handle, &net) && net.plmn > 0)
+        {
+            // printf("Net : %d, %d, %d\n", net.net_sel_mode, net.net_type, net.plmn);
+            int i = 0;
+            while(i < ARRAY_SIZE(lynq_operator_mcc_mnc))
+            {
+                if(lynq_operator_mcc_mnc[i].lynq_mcc_mnc == net.plmn)
+                    break;
+                i++;
+            }
+        
+            if(i == ARRAY_SIZE(lynq_operator_mcc_mnc))   // No found mcc&mnc
+            {
+                strcpy(OperatorFN, "UNKNOWN");
+                strcpy(OperatorSH, "UNKNOWN");
+                sprintf(MccMnc, "%d", net.plmn);
+            }
+            else
+            {
+                sprintf(MccMnc, "%d", lynq_operator_mcc_mnc[i].lynq_mcc_mnc);
+            }
+            sprintf(pt_info->data_registration_details_3gpp.mcc, "%d", (lynq_operator_mcc_mnc[i].lynq_mcc_mnc)/100);
+            sprintf(pt_info->data_registration_details_3gpp.mnc, "%d", (lynq_operator_mcc_mnc[i].lynq_mcc_mnc)%100);
+            sprintf(pt_info->voice_registration_details_3gpp.mcc, "%d", (lynq_operator_mcc_mnc[i].lynq_mcc_mnc)/100);
+            sprintf(pt_info->voice_registration_details_3gpp.mnc, "%d", (lynq_operator_mcc_mnc[i].lynq_mcc_mnc)%100);
+            //pt_info->act;
+        }
+
+        //暂时未知是否其他也被使用,现根据ql模块的传输情况,
+        //只配置3gpp,涉及call,data状态没有对应的匹配的就没有赋值
+
+        pt_info->voice_registration_valid = FALSE;
+        //pt_info->voice_registration
+
+        pt_info->data_registration_valid = FALSE;
+        //pt_info->data_registration
+
+        pt_info->voice_registration_details_3gpp_valid = TRUE;
+        pt_info->voice_registration_details_3gpp.lac = reg.lac;
+        pt_info->voice_registration_details_3gpp.cid = reg.ci;
+        //补位填0 or 1
+        pt_info->voice_registration_details_3gpp.tech_domain = 1;
+        pt_info->voice_registration_details_3gpp.roaming = 0;
+        pt_info->voice_registration_details_3gpp.forbidden = 0;
+        pt_info->voice_registration_details_3gpp.psc = 0;
+        pt_info->voice_registration_details_3gpp.tac = 0;
+
+        pt_info->data_registration_details_3gpp_valid = TRUE;
+        pt_info->data_registration_details_3gpp.lac = reg.lac;
+        pt_info->data_registration_details_3gpp.cid = reg.ci;
+        //补位填0 or 1
+        pt_info->data_registration_details_3gpp.tech_domain = 1;
+        pt_info->data_registration_details_3gpp.roaming = 0;
+        pt_info->data_registration_details_3gpp.forbidden = 0;
+        pt_info->data_registration_details_3gpp.psc = 0;
+        pt_info->data_registration_details_3gpp.tac = 0;
+
+
+        pt_info->voice_registration_details_3gpp2_valid = FALSE;
+        //pt_info->voice_registration_details_3gpp2
+
+        pt_info->data_registration_details_3gpp2_valid = FALSE;
+        //pt_info->data_registration_details_3gpp2
+
+
+        switch(reg.type)
+        {
+            case MBTK_RADIO_TECH_GSM:
+            case MBTK_RADIO_TECH_GSM_COMPACT:
+            case MBTK_RADIO_TECH_GSM_EGPRS:
+            case MBTK_RADIO_TECH_UTRAN_HSPA:
+            {
+                pt_info->data_registration_details_3gpp.radio_tech = E_QSER_NW_RADIO_TECH_GPRS;
+                pt_info->voice_registration_details_3gpp.radio_tech = E_QSER_NW_RADIO_TECH_GSM;
+                break;
+            }
+            case MBTK_RADIO_TECH_UTRAN:
+            case MBTK_RADIO_TECH_UTRAN_HSDPA:
+            case MBTK_RADIO_TECH_UTRAN_HSUPA:
+            case MBTK_RADIO_TECH_UTRAN_HSDPA_HSUPA:
+            {
+                pt_info->data_registration_details_3gpp.radio_tech = E_QSER_NW_RADIO_TECH_UMTS;
+                pt_info->voice_registration_details_3gpp.radio_tech = E_QSER_NW_RADIO_TECH_UMTS;
+                break;
+            }
+            case MBTK_RADIO_TECH_E_UTRAN:
+            {
+                pt_info->data_registration_details_3gpp.radio_tech = E_QSER_NW_RADIO_TECH_LTE;
+                pt_info->voice_registration_details_3gpp.radio_tech = E_QSER_NW_RADIO_TECH_LTE;
+                break;
+            }
+            default:
+            {
+                pt_info->data_registration_details_3gpp.radio_tech = E_QSER_NW_RADIO_TECH_NONE;
+                pt_info->voice_registration_details_3gpp.radio_tech = E_QSER_NW_RADIO_TECH_NONE;
+                break;
+            }
+        }
+    }
 
     return 0;
 }
 
 int qser_nw_get_signal_strength(nw_client_handle_type h_nw,QSER_NW_SIGNAL_STRENGTH_INFO_T *pt_info)
 {
-    UNUSED(h_nw);
-    UNUSED(pt_info);
+    //UNUSED(h_nw);
+    //UNUSED(pt_info);
+    if (h_nw != g_nw_val || g_nw_val == -1)
+    {
+        printf("handle NULL\n");
+        return -1;
+    }
+
+    if(lynq_nw_info_handle == NULL)
+    {
+        printf("lynq_nw_info_handle == NULL.\n");
+        return -1;
+    }
+
+    if(pt_info == NULL)
+    {
+        printf("pt_info == NULL.\n");
+        return -1;
+    }
+
+    int ret;
+    mbtk_signal_info_t signal;
+    ret = mbtk_net_signal_get(lynq_nw_info_handle, &signal);
+    if(ret != 0) {
+        LOGE("mbtk_net_signal_get fail.");
+        return -1;
+    }
+    else
+    {
+        memset(pt_info, 0x0, sizeof(QSER_NW_SIGNAL_STRENGTH_INFO_T));
+        if(signal.type == MBTK_RADIO_TECH_GSM || signal.type == MBTK_RADIO_TECH_GSM_COMPACT || \
+           signal.type == MBTK_RADIO_TECH_GSM_EGPRS)              //GSM
+        {
+            pt_info->gsm_sig_info_valid = TRUE;
+            pt_info->gsm_sig_info.rssi = signal.rssi;
+        }
+        else if(signal.type == MBTK_RADIO_TECH_E_UTRAN)     //LTE
+        {
+            pt_info->lte_sig_info_valid = TRUE;
+            pt_info->lte_sig_info.rsrp = signal.rsrp;
+            pt_info->lte_sig_info.rsrq = signal.rsrq;
+            pt_info->lte_sig_info.snr = 0;                  //->MBTK接口无该参数,写死值为0
+            pt_info->lte_sig_info.rssi = signal.rssi;
+        }
+        else if (signal.type == MBTK_RADIO_TECH_UTRAN || signal.type == MBTK_RADIO_TECH_UTRAN_HSDPA || \
+                 signal.type == MBTK_RADIO_TECH_UTRAN_HSUPA || signal.type == MBTK_RADIO_TECH_UTRAN_HSDPA_HSUPA ||  \
+                 signal.type == MBTK_RADIO_TECH_UTRAN_HSPA )//WCDMA
+        {
+            pt_info->wcdma_sig_info_valid = TRUE;
+            pt_info->wcdma_sig_info.rssi = signal.rssi;
+            pt_info->wcdma_sig_info.ecio = 0;               //->MBTK接口无该参数,写死值为0
+        }
+        else
+        {
+            return -1;
+        }
+    }
 
     return 0;
 }
 
 int qser_nw_add_rx_msg_handler (nw_client_handle_type h_nw, QSER_NW_RxMsgHandlerFunc_t handlerPtr, void* contextPtr)
 {
-    UNUSED(h_nw);
-    UNUSED(handlerPtr);
-    UNUSED(contextPtr);
+    //UNUSED(h_nw);
+    //UNUSED(handlerPtr);
+    //UNUSED(contextPtr);
+
+    if (h_nw != g_nw_val || g_nw_val == -1)
+    {
+        printf("handle NULL\n");
+        return -1;
+    }
+
+    if(lynq_nw_info_handle == NULL)
+    {
+        printf("lynq_nw_info_handle == NULL.\n");
+        return -1;
+    }
+
+    lynq_func_cb_handle.handlerPtr = handlerPtr;
+    lynq_func_cb_handle.contextPtr = contextPtr;
+
+    mbtk_net_state_change_cb_reg(lynq_nw_info_handle, lynq_nw_state_change_cb);
 
     return 0;
 }
@@ -69,4 +596,79 @@
     UNUSED(pt_info);
 
     return 0;
-}
\ No newline at end of file
+}
+
+int qser_nw_set_rf_mode (nw_client_handle_type h_nw, E_QSER_NW_RF_MODE_TYPE_T rf_mode)
+{
+    //UNUSED(h_nw);
+    //UNUSED(rf_mode);
+    int ret;
+
+    if (h_nw != g_nw_val || g_nw_val == -1)
+    {
+        printf("handle NULL\n");
+        return -1;
+    }
+
+    if(lynq_nw_info_handle == NULL)
+    {
+        printf("lynq_nw_info_handle == NULL.\n");
+        return -1;
+    }
+
+    if (rf_mode == 4)
+    {
+        printf("Flight Mode no Support Now\n");
+        return -1;
+    }
+
+    ret = mbtk_radio_state_set(lynq_nw_info_handle, rf_mode);
+    if (ret != 0)
+    {
+        LOGE("mbtk_radio_state_set fail.");
+        return -1;
+    }
+    else
+    {
+        printf("qser_nw_set_rf_mode is success\n");
+    }
+
+    return 0;
+}
+
+int qser_nw_get_rf_mode (nw_client_handle_type h_nw, E_QSER_NW_RF_MODE_TYPE_T *rf_mode)
+{
+    //UNUSED(h_nw);
+    //UNUSED(rf_mode);
+    int ret;
+    int tmp_rf;
+
+    if (h_nw != g_nw_val || g_nw_val == -1)
+    {
+        printf("handle NULL\n");
+        return -1;
+    }
+
+    if(lynq_nw_info_handle == NULL)
+    {
+        printf("lynq_nw_info_handle == NULL.\n");
+        return -1;
+    }
+
+    ret = mbtk_radio_state_get(lynq_nw_info_handle, &tmp_rf);
+    if (ret != 0)
+    {
+        LOGE("mbtk_radio_state_get fail.");
+        return -1;
+    }
+    else
+    {
+        printf("qser_nw_get_rf_mode is success\n");
+        *rf_mode = tmp_rf;
+    }
+
+
+    return 0;
+}
+
+
diff --git a/mbtk/lynq_lib/src/lynq_sms.c b/mbtk/lynq_lib/src/lynq_sms.c
index 1d28ce9..bde4083 100755
--- a/mbtk/lynq_lib/src/lynq_sms.c
+++ b/mbtk/lynq_lib/src/lynq_sms.c
@@ -160,6 +160,7 @@
     char resp[RES_NUM_MIN] = {0};
     char pdu_data[512] = {0};
     char phone_lenth[10] = {0};
+    char mem[10] = {0};
     char *p = pdu_data;
     int mode = 0;
     int err = 0;
@@ -178,6 +179,29 @@
     else
         return -1;
 
+    //设置存储器
+
+    if (pt_sms_info->storage == 0)
+    {
+        strncpy(mem, "SM", 2);
+    }
+    else if (pt_sms_info->storage == 1)
+    {
+        strncpy(mem, "ME", 2);
+    }
+    else
+    {
+        printf("qser_sms_deletefromstorage storage is no Support \n");
+    }
+
+    memset(resp, 0, sizeof(resp));
+    err = mbtk_sms_cpms_set(sms_info_handle, mem, resp);
+    if(err) {
+        printf("Error : %d\n", err);
+    } else {
+        printf("cpms set success. resp:%s\n", resp);
+    }
+
     if(data == NULL)
     {
         printf("qser_sms_send_sms data NULL\n");
@@ -332,6 +356,9 @@
     char cmgd[128] = {0};
     int err = 0;
     int id_x = -1;
+    int t_storage = 0;
+    char mem[10] = {0};
+    char resp[RES_NUM_MIN] = {0};
 
     if (h_sms != g_sms_val || g_sms_val == -1)
     {
@@ -352,6 +379,29 @@
         return -1;
     }
 
+    t_storage = pt_sms_storage->storage; //设置存储器
+
+    if (t_storage == 0)
+    {
+        strncpy(mem, "SM", 2);
+    }
+    else if (t_storage == 1)
+    {
+        strncpy(mem, "ME", 2);
+    }
+    else
+    {
+        printf("qser_sms_deletefromstorage storage is no Support \n");
+    }
+
+    memset(resp, 0, sizeof(resp));
+    err = mbtk_sms_cpms_set(sms_info_handle, mem, resp);
+    if(err) {
+        printf("Error : %d\n", err);
+    } else {
+        printf("cpms set success. resp:%s\n", resp);
+    }
+
     id_x = pt_sms_storage->storage_idx;//获取idx的值
 
     if(id_x == -1)      //delete all
diff --git a/mbtk/lynq_lib/src/lynq_voice_call.c b/mbtk/lynq_lib/src/lynq_voice_call.c
index c7e67ff..96e6f63 100755
--- a/mbtk/lynq_lib/src/lynq_voice_call.c
+++ b/mbtk/lynq_lib/src/lynq_voice_call.c
Binary files differ
diff --git a/mbtk/test/asr1806/lynq_call_test.c b/mbtk/test/asr1806/lynq_call_test.c
index 00fe145..7885848 100755
--- a/mbtk/test/asr1806/lynq_call_test.c
+++ b/mbtk/test/asr1806/lynq_call_test.c
@@ -360,7 +360,7 @@
             }
         case 8:
             {
-            qser_voice_set_speech_volume(&lv_voll);
+            qser_voice_get_speech_volume(&lv_voll);
             printf("volume level = %d\n",lv_voll);
             break;
             }
diff --git a/mbtk/test/asr1806/lynq_nw_test.c b/mbtk/test/asr1806/lynq_nw_test.c
new file mode 100755
index 0000000..62c231d
--- /dev/null
+++ b/mbtk/test/asr1806/lynq_nw_test.c
@@ -0,0 +1,389 @@
+#include "lynq_qser_network.h"
+#include "mbtk_type.h"
+#include "mbtk_info_api.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+
+char *tech_domain[] = {"NONE", "3GPP", "3GPP2"};
+char *radio_tech[] = {"unknown", 
+    "TD_SCDMA", "GSM",      "HSPAP",    "LTE",      "EHRPD",    "EVDO_B", 
+    "HSPA",     "HSUPA",    "HSDPA",    "EVDO_A",   "EVDO_0",   "1xRTT", 
+    "IS95B",    "IS95A",    "UMTS",     "EDGE",     "GPRS",     "NONE"};
+
+void nw_event_ind_handler (
+    nw_client_handle_type h_nw, 
+    u_int32_t ind_flag, 
+    void                  *ind_msg_buf, 
+    u_int32_t              ind_msg_len, 
+    void                  *contextPtr)
+{
+    switch(ind_flag) {
+        case NW_IND_VOICE_REG_EVENT_IND_FLAG:
+            {
+                printf(">>>>>NW_IND_VOICE_REG_EVENT_IND_FLAG!!! \n");
+                QSER_NW_VOICE_REG_EVENT_IND_T *ind = (QSER_NW_VOICE_REG_EVENT_IND_T*)ind_msg_buf;
+                printf("Recv event indication : VOICE REG EVENT\n");
+                
+                if(ind==NULL)
+                {
+                     printf("ind is NULL\n");
+                     break;
+                }
+                /*
+                if(ind->registration_valid)
+                {
+                    printf("voice_registration: \ntech_domain=%s, radio_tech=%s, roaming=%d, registration_state=%d\n", 
+                            ind->registration.tech_domain, 
+                            ind->registration.radio_tech,
+                            ind->registration.roaming,
+                            ind->registration.registration_state);
+                }
+                */
+                if(ind->registration_details_3gpp_valid)
+                {
+                    printf("voice_registration_details_3gpp: \ntech_domain=%s, radio_tech=%s, mcc=%s, mnc=%s, roaming=%d, forbidden=%d, cid=0x%X, lac=%d, psc=%d, tac=%d\n", 
+                            ind->registration_details_3gpp.tech_domain, 
+                            ind->registration_details_3gpp.radio_tech,
+                            ind->registration_details_3gpp.mcc,
+                            ind->registration_details_3gpp.mnc,
+                            ind->registration_details_3gpp.roaming,
+                            ind->registration_details_3gpp.forbidden,                    
+                            ind->registration_details_3gpp.cid,
+                            ind->registration_details_3gpp.lac,
+                            ind->registration_details_3gpp.psc,
+                            ind->registration_details_3gpp.tac);
+                }
+                /*
+                if(ind->registration_details_3gpp2_valid)
+                {
+                    printf("voice_registration_details_3gpp2: \ntech_domain=%s, radio_tech=%s, mcc=%s, mnc=%s, roaming=%d, forbidden=%d, sid=%d, nid=%d, bsid=%d\n", 
+                            ind->registration_details_3gpp2.tech_domain, 
+                            ind->registration_details_3gpp2.radio_tech,
+                            ind->registration_details_3gpp2.mcc,
+                            ind->registration_details_3gpp2.mnc,
+                            ind->registration_details_3gpp2.roaming,
+                            ind->registration_details_3gpp2.forbidden,                    
+                            ind->registration_details_3gpp2.sid,
+                            ind->registration_details_3gpp2.nid,
+                            ind->registration_details_3gpp2.bsid);
+                }
+                */
+                break;
+            }
+        case NW_IND_DATA_REG_EVENT_IND_FLAG:
+            {
+                printf(">>>>>NW_IND_DATA_REG_EVENT_IND_FLAG!!! \n");
+                QSER_NW_DATA_REG_EVENT_IND_T *ind = (QSER_NW_DATA_REG_EVENT_IND_T*)ind_msg_buf;
+
+                printf("Recv event indication : DATA REG EVENT\n");
+                
+                if(ind==NULL)
+                {
+                     printf("ind is NULL\n");
+                     break;
+                }
+                /*
+                if(ind->registration_valid)
+                {
+                    printf("data_registration: \ntech_domain=%s, radio_tech=%s, roaming=%d, registration_state=%d\n", 
+                            ind->registration.tech_domain, 
+                            ind->registration.radio_tech,
+                            ind->registration.roaming,
+                            ind->registration.registration_state);
+                }
+                */
+                if(ind->registration_details_3gpp_valid)
+                {
+                    printf("data_registration_details_3gpp: \ntech_domain=%s, radio_tech=%s, mcc=%s, mnc=%s, roaming=%d, forbidden=%d, cid=0x%X, lac=%d, psc=%d, tac=%d\n", 
+                            ind->registration_details_3gpp.tech_domain, 
+                            ind->registration_details_3gpp.radio_tech,
+                            ind->registration_details_3gpp.mcc,
+                            ind->registration_details_3gpp.mnc,
+                            ind->registration_details_3gpp.roaming,
+                            ind->registration_details_3gpp.forbidden,                    
+                            ind->registration_details_3gpp.cid,
+                            ind->registration_details_3gpp.lac,
+                            ind->registration_details_3gpp.psc,
+                            ind->registration_details_3gpp.tac);
+                }
+                /*
+                if(ind->registration_details_3gpp2_valid)
+                {
+                    printf("data_registration_details_3gpp2: \ntech_domain=%s, radio_tech=%s, mcc=%s, mnc=%s, roaming=%d, forbidden=%d, prl=%d, css=%d, sid=%d, nid=%d, bsid=%d\n", 
+                            ind->registration_details_3gpp2.tech_domain, 
+                            ind->registration_details_3gpp2.radio_tech,
+                            ind->registration_details_3gpp2.mcc,
+                            ind->registration_details_3gpp2.mnc,
+                            ind->registration_details_3gpp2.roaming,
+                            ind->registration_details_3gpp2.forbidden,   
+                            ind->registration_details_3gpp2.inPRL,
+                            ind->registration_details_3gpp2.css,
+                            ind->registration_details_3gpp2.sid,
+                            ind->registration_details_3gpp2.nid,
+                            ind->registration_details_3gpp2.bsid);
+                }
+                */
+                break;
+            }
+        case NW_IND_SIGNAL_STRENGTH_EVENT_IND_FLAG:
+            {
+                printf(">>>>>NW_IND_SIGNAL_STRENGTH_EVENT_IND_FLAG!!! \n");
+                QSER_NW_SINGNAL_EVENT_IND_T *ind = (QSER_NW_SINGNAL_EVENT_IND_T*)ind_msg_buf;
+
+                printf("Recv event indication : SIGNAL STRENGTH EVENT\n");
+                
+                if(ind==NULL)
+                {
+                     printf("ind is NULL\n");
+                     break;
+                }
+
+                if(ind->gsm_sig_info_valid)
+                {
+                    printf("gsm_sig_info: rssi=%d\n", 
+                            ind->gsm_sig_info.rssi);
+                } 
+
+                if(ind->wcdma_sig_info_valid)
+                {
+                    printf("wcdma_sig_info: rssi=%d, ecio=%d\n", 
+                            ind->wcdma_sig_info.rssi, 
+                            ind->wcdma_sig_info.ecio);
+                }
+                /*
+                if(ind->tdscdma_sig_info_valid)
+                {
+                    printf("tdscdma_sig_info: rssi=%d, rscp=%d, ecio=%d, sinr=%d\n", 
+                            ind->tdscdma_sig_info.rssi, 
+                            ind->tdscdma_sig_info.rscp,
+                            ind->tdscdma_sig_info.ecio,
+                            ind->tdscdma_sig_info.sinr);
+                } 
+                */
+                if(ind->lte_sig_info_valid)
+                {
+                    printf("lte_sig_info: rssi=%d, rsrq=%d, rsrp=%d, snr=%d\n", 
+                            ind->lte_sig_info.rssi, 
+                            ind->lte_sig_info.rsrq,
+                            ind->lte_sig_info.rsrp,
+                            ind->lte_sig_info.snr);
+                } 
+                /*
+                if(ind->cdma_sig_info_valid)
+                {
+                    printf("cdma_sig_info: rssi=%d, ecio=%d\n", 
+                            ind->cdma_sig_info.rssi, 
+                            ind->cdma_sig_info.ecio);
+                } 
+                if(ind->hdr_sig_info_valid)
+                {
+                    printf("hdr_sig_info: rssi=%d, ecio=%d, sinr=%d, io=%d\n", 
+                            ind->hdr_sig_info.rssi, 
+                            ind->hdr_sig_info.ecio,
+                            ind->hdr_sig_info.sinr,
+                            ind->hdr_sig_info.io);
+                }
+                */
+                break;
+            }        
+        default:
+            printf(">>>>>NO DATA!!! \n");
+            break;
+    }
+}
+
+
+int main(int argc, char *argv[])
+{
+    char operator[10];
+    int opt;
+    int lv_voll = 0;
+    nw_client_handle_type handle = -1;
+    mbtk_log_init("radio", "NW_TEST");
+
+    while(1)
+    {
+        printf("=========network main=========\n"
+            "\t0 exit\n"
+            "\t1 network init\n"
+            "\t2 network add rx msg handle\n"
+            "\t3 network band set config\n"
+            "\t4 network get operator name\n"
+            "\t5 network get reg status\n"
+            "\t6 network get signal strength\n"
+            "\t7 network set oos config\n"
+            "\t8 network get oos config\n"
+            "\t9 network set rf config\n"
+            "\t10 network get rf config\n"
+            "\t11 network deinit\n"
+            "operator: >> ");
+
+        fgets(operator, sizeof(operator), stdin);
+        fflush(stdin);
+        opt = atoi(operator);
+        switch (opt)
+        {
+        case 0:
+            printf("main exit\n");
+            return 0;
+        case 1:
+            qser_nw_client_init(&handle);
+            printf("test>>: handle = %d\n",handle);
+            break;
+        case 2:
+            qser_nw_add_rx_msg_handler(handle, nw_event_ind_handler, NULL);
+            break;
+        case 3:
+            {
+            //漫游开关现在不支持,所以就不用配置
+            printf("please input \n"
+                    "\t1:GSM \n"
+                    "\t2:WCDMA \n"
+                    "\t4:CDMA \n"
+                    "\t8:EVDO \n"
+                    "\t16:LTE \n"
+                    "\t32:TDSCDMA \n"
+            );
+            fgets(operator, sizeof(operator), stdin);
+            fflush(stdin);
+            opt = atoi(operator);
+            QSER_NW_CONFIG_INFO_T t_info;
+            switch(opt)
+            {
+                case 1:
+                    t_info.preferred_nw_mode = QSER_NW_MODE_GSM;//2G CMCC/CU
+                    break;
+                case 2:
+                    t_info.preferred_nw_mode = QSER_NW_MODE_WCDMA;//3G CU
+                    break;
+                case 4:
+                    t_info.preferred_nw_mode = QSER_NW_MODE_CDMA;//3G CT
+                    break;
+                case 8:
+                    t_info.preferred_nw_mode = QSER_NW_MODE_EVDO;//3G CT
+                    break;
+                case 16:
+                    t_info.preferred_nw_mode = QSER_NW_MODE_LTE;//4G  全网通
+                    break;
+                case 32:
+                    t_info.preferred_nw_mode = QSER_NW_MODE_TDSCDMA;//3G CMCC
+                    break;
+                default:
+                    t_info.preferred_nw_mode = QSER_NW_MODE_LTE;//4G
+                    break;
+            }
+            //t_info.preferred_nw_mode = QSER_NW_MODE_LTE;
+            qser_nw_set_config(handle, &t_info);
+            break;
+            }
+        case 4:
+            {
+            QSER_NW_OPERATOR_NAME_INFO_T t_info;
+            int err = qser_nw_get_operator_name(handle, &t_info);
+            if(err) {
+                printf("Error : %d\n", err);
+            } else {
+                printf("Operator : %s, %s, %s, %s\n", t_info.long_eons, t_info.short_eons, t_info.mcc, t_info.mnc);
+            }
+            break;
+            }
+        case 5:
+            {
+            QSER_NW_REG_STATUS_INFO_T reg;
+            int err = qser_nw_get_reg_status(handle, &reg);
+            if(err) {
+                printf("Error : %d\n", err);
+            } else {
+                 if(reg.voice_registration_details_3gpp_valid)
+                 {
+                     printf("voice_registration_details_3gpp: \ntech_domain=%s, radio_tech=%s, mcc=%s, mnc=%s, roaming=%d, forbidden=%d, cid=0x%X, lac=%d, psc=%d, tac=%d\n", 
+                         tech_domain[reg.voice_registration_details_3gpp.tech_domain], 
+                         radio_tech[reg.voice_registration_details_3gpp.radio_tech],
+                         reg.voice_registration_details_3gpp.mcc,
+                         reg.voice_registration_details_3gpp.mnc,
+                         reg.voice_registration_details_3gpp.roaming,
+                         reg.voice_registration_details_3gpp.forbidden,                    
+                         reg.voice_registration_details_3gpp.cid,
+                         reg.voice_registration_details_3gpp.lac,
+                         reg.voice_registration_details_3gpp.psc,
+                         reg.voice_registration_details_3gpp.tac);
+                 }
+                 if(reg.data_registration_details_3gpp_valid)
+                 {
+                     printf("data_registration_details_3gpp: \ntech_domain=%s, radio_tech=%s, mcc=%s, mnc=%s, roaming=%d, forbidden=%d, cid=0x%X, lac=%d, psc=%d, tac=%d\n", 
+                         tech_domain[reg.data_registration_details_3gpp.tech_domain], 
+                         radio_tech[reg.data_registration_details_3gpp.radio_tech],
+                         reg.data_registration_details_3gpp.mcc,
+                         reg.data_registration_details_3gpp.mnc,
+                         reg.data_registration_details_3gpp.roaming,
+                         reg.data_registration_details_3gpp.forbidden,                    
+                         reg.data_registration_details_3gpp.cid,
+                         reg.data_registration_details_3gpp.lac,
+                         reg.data_registration_details_3gpp.psc,
+                         reg.data_registration_details_3gpp.tac);
+                 }
+                //printf("Data Reg: radio_tech = %d, lac = %x, cid = %x\n", reg.data_registration_details_3gpp.radio_tech, reg.data_registration_details_3gpp.lac, reg.data_registration_details_3gpp.cid);
+                //printf("Voice Reg: radio_tech = %d, lac = %x, cid = %x\n", reg.voice_registration_details_3gpp.radio_tech, reg.voice_registration_details_3gpp.lac, reg.voice_registration_details_3gpp.cid);
+            }
+            break;
+            }
+        case 6:
+            {
+            QSER_NW_SIGNAL_STRENGTH_INFO_T sig;
+            int err = qser_nw_get_signal_strength(handle, &sig);
+            if(err) {
+                printf("Error : %d\n", err);
+            } else {
+                if (sig.gsm_sig_info_valid == TRUE)
+                    printf("Signal GSM: rssi = %d\n", sig.gsm_sig_info.rssi);
+                else if (sig.lte_sig_info_valid == TRUE)
+                    printf("Signal LTE: rssi = %d, rsrp = %d, rsrq = %d, snr = %d\n", sig.lte_sig_info.rssi , sig.lte_sig_info.rsrp, sig.lte_sig_info.rsrq, sig.lte_sig_info.snr);
+                else if (sig.wcdma_sig_info_valid == TRUE)
+                    printf("Signal UTRAN: rssi = %d, ecio = %d\n", sig.wcdma_sig_info.rssi , sig.wcdma_sig_info.ecio);
+                else
+                    printf("Signal type not supported \n");
+            }
+            break;
+            }
+        case 7:
+            {
+            qser_nw_set_oos_config(NULL, NULL);
+            break;
+            }
+        case 8:
+            {
+            qser_nw_get_oos_config(NULL, NULL);
+            break;
+            }
+        case 9:
+            {
+            printf("please input 0 or 1: \n");
+            fgets(operator, sizeof(operator), stdin);
+            fflush(stdin);
+            opt = atoi(operator);
+            if (opt == 0 || opt == 1)
+                qser_nw_set_rf_mode(handle, opt);
+            else
+                printf(">>>Please re-enter\n");
+            break;
+            }
+        case 10:
+            {
+            int rf_t;
+            qser_nw_get_rf_mode(handle, &rf_t);
+            printf(">>>rf_mode = [%d]\n",rf_t);
+            break;
+            }
+        case 11:
+            qser_nw_client_deinit(handle);
+            break;
+        default:
+            break;
+        }
+
+    }
+
+    return 0;
+}
+
diff --git a/mbtk/test/asr1806/lynq_qser_sms_test.c b/mbtk/test/asr1806/lynq_qser_sms_test.c
index 143ffac..358464c 100755
--- a/mbtk/test/asr1806/lynq_qser_sms_test.c
+++ b/mbtk/test/asr1806/lynq_qser_sms_test.c
@@ -275,7 +275,7 @@
 

     while(1)

     {

-        printf("=========audio main=========\n"

+        printf("=========sms main=========\n"

             "\t0 exit\n"

             "\t1 sms init\n"

             "\t2 send text sms\n"

@@ -316,6 +316,7 @@
                 int len = strlen(tmp);

                 int num_len = strlen(num);

                 test_sms_info.format = 0;

+                test_sms_info.storage = 1; //默认 ME

                 //test_sms_info.sms_data_len = len;

                 memcpy(test_sms_info.sms_data, tmp, len);

                 memcpy(test_sms_info.src_addr, num, num_len);

@@ -333,6 +334,7 @@
                 int len = strlen(tmp);

                 int num_len = strlen(num);

                 test_sms_info.format = 2;

+                test_sms_info.storage = 1; //默认 ME

                 //test_sms_info.sms_data_len = len;

                 memcpy(test_sms_info.sms_data, tmp, len);

                 memcpy(test_sms_info.src_addr, num, num_len);

@@ -340,23 +342,46 @@
                 qser_sms_send_sms(handle, &test_sms_info);

                 break;

             }

-       //     printf("please input volume (0~100): \n");

-       //     fgets(operator, sizeof(operator), stdin);

-       //     fflush(stdin);

-       //     opt = atoi(operator);

-        //    lynq_delete_sms(opt);

             break;

         case 5:

-            printf("please input index (0~50): \n");

-            fgets(operator, sizeof(operator), stdin);

-            fflush(stdin);

-            opt = atoi(operator);

-       //     lynq_list_sms(1, opt, "ALL" );

-            break;

+            {

+                printf("No such interface \n");

+                /*

+                memset(operator, 0x00, sizeof(operator));

+                printf("please input index (0~50): \n");

+                fgets(operator, sizeof(operator), stdin);

+                fflush(stdin);

+                opt = atoi(operator);

+                */

+                break;

+            }

         case 6:

             {

                 memset(&test_sms_storage, 0x00, sizeof(QSER_sms_storage_info_t));

-                test_sms_storage.storage_idx = 1;

+                memset(operator,0x00, sizeof(operator));

+                printf("please input index \n");

+                fgets(operator, sizeof(operator), stdin);

+                fflush(stdin);

+                opt = atoi(operator);

+                int t_index = opt;

+                memset(operator,0x00, sizeof(operator));

+                printf("please input Storage area\n"

+                        "\t 0 : Message store to UIM(SIM) \n"

+                        "\t 1 : Message store to NV(ME) \n"

+                        "\t default :   store to NV(ME) \n");

+                fgets(operator, sizeof(operator), stdin);

+                fflush(stdin);

+                opt = atoi(operator);

+

+                if (opt == 0 || opt == 1)

+                {

+                    test_sms_storage.storage = opt;

+                }

+                else

+                {

+                    test_sms_storage.storage = 1;

+                }

+                test_sms_storage.storage_idx = t_index;

                 qser_sms_deletefromstorage(handle, &test_sms_storage);

                 break;

             }

@@ -369,15 +394,9 @@
                 break;

             }

         case 8:

-        //    printf("please input service num: \n");

-        //    fgets(phonenumter, sizeof(phonenumter), stdin);

-        //    fflush(stdin);

-        //    memcpy(phonenumter, "+8613800280500", "+8613800280500");

-            

-        //    ret= ql_sms_set_sms_center_address(phonenumter);

             {

                 memset(&test_sca_cfg, 0x00, sizeof(QSER_sms_service_center_cfg_t));

-                char *num = "+8613800280500";//成都移动中心号码不用更改

+                char *num = "+8613800280500";//成都移动中心号码不用更改(根据情况可以写死值或者动态获取)

                 int len = strlen(num);

                 memcpy(test_sca_cfg.service_center_addr, num, len);