modify cb setting
authorChangseok Oh <seok.oh@samsung.com>
Wed, 5 Sep 2012 10:28:11 +0000 (19:28 +0900)
committerChangseok Oh <seok.oh@samsung.com>
Wed, 5 Sep 2012 11:28:43 +0000 (20:28 +0900)
framework/setting-handler/MsgSettingHandler.cpp
include/common/MsgInternalTypes.h
include/common/MsgSettingTypes.h
include/mapi/msg_types.h
mapi/msg_setting.cpp
packaging/msg-service.spec
plugin/sms_plugin/SmsPluginCallback.cpp
plugin/sms_plugin/SmsPluginCbMsgHandler.cpp
plugin/sms_plugin/SmsPluginSatHandler.cpp
plugin/sms_plugin/SmsPluginSetting.cpp
proxy/MsgHandleSetting.cpp

index ee403aa..247dd89 100755 (executable)
@@ -746,14 +746,6 @@ msg_error_t MsgSetCBMsgOpt(const MSG_SETTING_S *pSetting, bool bSetSim)
                }
        }
 
-       MsgSettingGetBool(CB_ALL_CHANNEL, &bValue);
-       if (bValue != cbOpt.bAllChannel) {
-               if (MsgSettingSetBool(CB_ALL_CHANNEL, cbOpt.bAllChannel) != MSG_SUCCESS) {
-                       MSG_DEBUG("Error to set config data [%s]", CB_ALL_CHANNEL);
-                       return MSG_ERR_SET_SETTING;
-               }
-       }
-
        iValue = MsgSettingGetInt(CB_MAX_SIM_COUNT);
        if (iValue != cbOpt.maxSimCnt) {
                if (MsgSettingSetInt(CB_MAX_SIM_COUNT, cbOpt.maxSimCnt) != MSG_SUCCESS) {
@@ -780,9 +772,15 @@ msg_error_t MsgSetCBMsgOpt(const MSG_SETTING_S *pSetting, bool bSetSim)
                        break;
 
                memset(keyName, 0x00, sizeof(keyName));
-               snprintf(keyName, DEF_BUF_LEN, "%s/%d", CB_CHANNEL_ID, i);
+               snprintf(keyName, DEF_BUF_LEN, "%s/%d", CB_CHANNEL_ID_FROM, i);
+
+               if ((err = MsgSettingSetInt(keyName, cbOpt.channelData.channelInfo[i].from)) != MSG_SUCCESS)
+                       break;
+
+               memset(keyName, 0x00, sizeof(keyName));
+               snprintf(keyName, DEF_BUF_LEN, "%s/%d", CB_CHANNEL_ID_TO, i);
 
-               if ((err = MsgSettingSetInt(keyName, cbOpt.channelData.channelInfo[i].id)) != MSG_SUCCESS)
+               if ((err = MsgSettingSetInt(keyName, cbOpt.channelData.channelInfo[i].to)) != MSG_SUCCESS)
                        break;
 
                memset(keyName, 0x00, sizeof(keyName));
@@ -1052,8 +1050,6 @@ void MsgGetCBMsgOpt(MSG_SETTING_S *pSetting)
 
        MsgSettingGetBool(CB_RECEIVE, &pSetting->option.cbMsgOpt.bReceive);
 
-       MsgSettingGetBool(CB_ALL_CHANNEL, &pSetting->option.cbMsgOpt.bAllChannel);
-
        pSetting->option.cbMsgOpt.maxSimCnt = MsgSettingGetInt(CB_MAX_SIM_COUNT);
 
        pSetting->option.cbMsgOpt.channelData.channelCnt = MsgSettingGetInt(CB_CHANNEL_COUNT);
@@ -1066,9 +1062,14 @@ void MsgGetCBMsgOpt(MSG_SETTING_S *pSetting)
                MsgSettingGetBool(keyName, &pSetting->option.cbMsgOpt.channelData.channelInfo[i].bActivate);
 
                memset(keyName, 0x00, sizeof(keyName));
-               snprintf(keyName, DEF_BUF_LEN, "%s/%d", CB_CHANNEL_ID, i);
+               snprintf(keyName, DEF_BUF_LEN, "%s/%d", CB_CHANNEL_ID_FROM, i);
+               pSetting->option.cbMsgOpt.channelData.channelInfo[i].from = MsgSettingGetInt(keyName);
+               MSG_DEBUG("channel[%d]: from: %d", i, pSetting->option.cbMsgOpt.channelData.channelInfo[i].from);
 
-               pSetting->option.cbMsgOpt.channelData.channelInfo[i].id = MsgSettingGetInt(keyName);
+               memset(keyName, 0x00, sizeof(keyName));
+               snprintf(keyName, DEF_BUF_LEN, "%s/%d", CB_CHANNEL_ID_TO, i);
+               pSetting->option.cbMsgOpt.channelData.channelInfo[i].to = MsgSettingGetInt(keyName);
+               MSG_DEBUG("channel[%d]: to: %d", i, pSetting->option.cbMsgOpt.channelData.channelInfo[i].to);
 
                memset(keyName, 0x00, sizeof(keyName));
                snprintf(keyName, DEF_BUF_LEN, "%s/%d", CB_CHANNEL_NAME, i);
@@ -1076,6 +1077,7 @@ void MsgGetCBMsgOpt(MSG_SETTING_S *pSetting)
                tmpValue = MsgSettingGetString(keyName);
                if (tmpValue != NULL) {
                        strncpy(pSetting->option.cbMsgOpt.channelData.channelInfo[i].name, tmpValue, CB_CHANNEL_NAME_MAX);
+                       MSG_DEBUG("channel[%d]: channel_name: %s", i, pSetting->option.cbMsgOpt.channelData.channelInfo[i].name);
                        free(tmpValue);
                        tmpValue = NULL;
                }
index 72722bc..cb208ea 100755 (executable)
 #define CB_MAX_SIM_COUNT                       DEFAULT_CB_MSG_OPT_PATH"/max_sim_count"
 #define CB_CHANNEL_COUNT                       DEFAULT_CB_MSG_OPT_PATH"/channel_count"
 #define CB_CHANNEL_ACTIVATE            DEFAULT_CB_MSG_OPT_PATH"/channel_activate"
-#define CB_CHANNEL_ID                                  DEFAULT_CB_MSG_OPT_PATH"/channel_id"
+#define CB_CHANNEL_ID_FROM             DEFAULT_CB_MSG_OPT_PATH"/channel_id_from"
+#define CB_CHANNEL_ID_TO               DEFAULT_CB_MSG_OPT_PATH"/channel_id_to"
 #define CB_CHANNEL_NAME                        DEFAULT_CB_MSG_OPT_PATH"/channel_name"
 #define CB_LANGUAGE                                    DEFAULT_CB_MSG_OPT_PATH"/language"
 
index b42b6e2..9b5bd40 100755 (executable)
@@ -235,7 +235,8 @@ typedef struct
 typedef struct
 {
        bool                    bActivate;                                                      /**< Indicates whether the CB channel is activate or passive. */
-       unsigned int    id;                                                                     /**< Indicates the ID of a CB channel. */
+       unsigned int    from;                                                           /**< Indicates the start ID of a CB channel range. */
+       unsigned int    to;                                                                     /**< Indicates the end ID of a CB channel range. */
        char                    name[CB_CHANNEL_NAME_MAX+1];            /**< Indicates the name of a CB channel. */
 } MSG_CB_CHANNEL_INFO_S;
 
@@ -351,17 +352,15 @@ typedef struct
  */
 typedef struct
 {
-       bool                                    bReceive;               /**< Indicates whether the CB message is received or not. */
-       bool                                    bAllChannel;            /**< Indicates whether All Channel's CB message is received or not. */
+       bool                            bReceive;               /**< Indicates whether the CB message is received or not. */
        int                                     maxSimCnt;              /**< Indicates the number of channels which can be stored in SIM. */
        MSG_CB_CHANNEL_S        channelData;            /**< Indicates the cell broadcasting channel information. */
-       bool                                    bLanguage[CB_LANG_TYPE_MAX];            /**< Indicates whether the language name of a cell broadcasting message is set or not. */
+       bool                            bLanguage[CB_LANG_TYPE_MAX];            /**< Indicates whether the language name of a cell broadcasting message is set or not. */
 } MSG_CBMSG_OPT_S;
 
 typedef struct
 {
        bool                                    bReceive;               /**< Indicates whether the CB message is received or not. */
-       bool                                    bAllChannel;            /**< Indicates whether All Channel's CB message is received or not. */
        int                                     maxSimCnt;              /**< Indicates the number of channels which can be stored in SIM. */
        msg_struct_list_s       *channelData;           /**< Indicates the cell broadcasting channel information. */
        bool                                    bLanguage[CB_LANG_TYPE_MAX];            /**< Indicates whether the language name of a cell broadcasting message is set or not. */
index d2286d2..491c2f6 100755 (executable)
@@ -439,7 +439,8 @@ enum _MSG_STRUCT_CB_OPT_E {
 
 enum _MSG_STRUCT_CB_CHANNEL_INFO_E {
        MSG_CB_CHANNEL_ACTIVATE_BOOL = MSG_STRUCT_SETTING_CB_CHANNEL_INFO+1,    /**< Indicates whether the CB channel is activate or passive. */
-       MSG_CB_CHANNEL_ID_INT,                                          /**< Indicates the ID of a CB channel. */
+       MSG_CB_CHANNEL_ID_FROM_INT,                                             /**< Indicates the ID of a CB channel. */
+       MSG_CB_CHANNEL_ID_TO_INT,                                               /**< Indicates the ID of a CB channel. */
        MSG_CB_CHANNEL_NAME_STR                                         /**< Indicates the name of a CB channel. */
 };
 
index 33b9110..6240ef5 100755 (executable)
@@ -593,9 +593,6 @@ bool msg_get_cb_option_bool(void *cb_opt, int field)
        case MSG_CB_RECEIVE_BOOL :
                ret = cb_opt_data->bReceive;
                break;
-       case MSG_CB_RECEIVE_ALL_CHANNEL_BOOL :
-               ret = cb_opt_data->bAllChannel;
-               break;
        case MSG_CB_LANGUAGE_TYPE_ALL_BOOL :
                ret = cb_opt_data->bLanguage[MSG_CBLANG_TYPE_ALL];
                break;
@@ -647,9 +644,6 @@ int msg_set_cb_option_bool(void *cb_opt, int field, bool value)
        case MSG_CB_RECEIVE_BOOL :
                cb_opt_data->bReceive = value;
                break;
-       case MSG_CB_RECEIVE_ALL_CHANNEL_BOOL :
-               cb_opt_data->bAllChannel = value;
-               break;
        case MSG_CB_LANGUAGE_TYPE_ALL_BOOL :
                cb_opt_data->bLanguage[MSG_CBLANG_TYPE_ALL] = value;
                break;
@@ -720,8 +714,11 @@ int msg_get_cb_channel_info_int(void *cb_ch_info, int field)
 
        switch (field)
        {
-       case MSG_CB_CHANNEL_ID_INT :
-               ret = cb_ch_data->id;
+       case MSG_CB_CHANNEL_ID_FROM_INT :
+               ret = cb_ch_data->from;
+               break;
+       case MSG_CB_CHANNEL_ID_TO_INT :
+               ret = cb_ch_data->to;
                break;
        default :
                break;
@@ -741,8 +738,11 @@ int msg_set_cb_channel_info_int(void *cb_ch_info, int field, int value)
 
        switch (field)
        {
-       case MSG_CB_CHANNEL_ID_INT :
-               cb_ch_data->id = value;
+       case MSG_CB_CHANNEL_ID_FROM_INT :
+               cb_ch_data->from = value;
+               break;
+       case MSG_CB_CHANNEL_ID_TO_INT :
+               cb_ch_data->to = value;
                break;
        default :
                ret = MSG_ERR_INVALID_PARAMETER;
index 47d1ee8..b626d5a 100755 (executable)
@@ -253,11 +253,10 @@ vconftool set -t bool db/private/msg-service/push_msg/recv_option 1
 vconftool set -t int db/private/msg-service/push_msg/service_load 1
 
 # CB Msg Options
-vconftool set -t bool db/private/msg-service/cb_msg/receive 0
-vconftool set -t bool db/private/msg-service/cb_msg/all_channel 0
+vconftool set -t bool db/private/msg-service/cb_msg/receive 1 -f
 vconftool set -t int db/private/msg-service/cb_msg/max_sim_count 0
 vconftool set -t int db/private/msg-service/cb_msg/channel_count 0
-vconftool set -t bool db/private/msg-service/cb_msg/language/0 0
+vconftool set -t bool db/private/msg-service/cb_msg/language/0 1 -f
 vconftool set -t bool db/private/msg-service/cb_msg/language/1 0
 vconftool set -t bool db/private/msg-service/cb_msg/language/2 0
 vconftool set -t bool db/private/msg-service/cb_msg/language/3 0
index 60ab3c0..337a4e7 100755 (executable)
@@ -614,18 +614,13 @@ void TapiEventGetCBConfig(TapiHandle *handle, int result, void *data, void *user
 
        TelSmsCbConfig_t* pCBConfig = (TelSmsCbConfig_t*)data;
 
-       cbOpt.bReceive = (bool)pCBConfig->bCBEnabled;
-
-       if (pCBConfig->SelectedId == 0x01)
-               cbOpt.bAllChannel = true;
-       else if (pCBConfig->SelectedId == 0x02)
-               cbOpt.bAllChannel = false;
+       cbOpt.bReceive = (bool)pCBConfig->CBEnabled;
 
        cbOpt.maxSimCnt = pCBConfig->MsgIdMaxCount;
 
-       MSG_DEBUG("Receive [%d], All Channel [%d], Max SIM Count [%d]", cbOpt.bReceive, cbOpt.bAllChannel, cbOpt.maxSimCnt);
+       MSG_DEBUG("Receive [%d], Max SIM Count [%d]", cbOpt.bReceive, cbOpt.maxSimCnt);
 
-       cbOpt.channelData.channelCnt = pCBConfig->MsgIdCount;
+       cbOpt.channelData.channelCnt = pCBConfig->MsgIdRangeCount;
 
        if (cbOpt.channelData.channelCnt > CB_CHANNEL_MAX)
        {
@@ -641,11 +636,12 @@ void TapiEventGetCBConfig(TapiHandle *handle, int result, void *data, void *user
 
        for (int i = 0; i < cbOpt.channelData.channelCnt; i++)
        {
-               cbOpt.channelData.channelInfo[i].bActivate = cbOpt.bReceive;
-               cbOpt.channelData.channelInfo[i].id = pCBConfig->MsgIDs[i];
+               cbOpt.channelData.channelInfo[i].bActivate = pCBConfig->MsgIDs[i].Net3gpp.Selected;
+               cbOpt.channelData.channelInfo[i].from = pCBConfig->MsgIDs[i].Net3gpp.FromMsgId;
+               cbOpt.channelData.channelInfo[i].to = pCBConfig->MsgIDs[i].Net3gpp.ToMsgId;
                memset(cbOpt.channelData.channelInfo[i].name, 0x00, CB_CHANNEL_NAME_MAX+1);
 
-               MSG_DEBUG("Channel ID [%d]", cbOpt.channelData.channelInfo[i].id);
+               MSG_DEBUG("Channel FROM [%d], Channel TO [%d] ", cbOpt.channelData.channelInfo[i].from, cbOpt.channelData.channelInfo[i].to);
        }
 
        SmsPluginSetting::instance()->setCbConfigEvent(&cbOpt, true);
index 0089238..82d22f5 100755 (executable)
@@ -301,43 +301,34 @@ bool SmsPluginCbMsgHandler::checkCbOpt(SMS_CBMSG_PAGE_S CbPage, bool *pJavaMsg)
                }
        }
 
-       bool bAllChannel = false;
-       MsgSettingGetBool(CB_ALL_CHANNEL, &bAllChannel);
+       int MsgIdCnt = MsgSettingGetInt(CB_CHANNEL_COUNT);
 
-       // Receive All Channel = FALSE
-       if (!bAllChannel)
-       {
-               MSG_DEBUG("RECEIVE ALL CHANNEL = FALSE");
+       bool bActivate = false;
+       int MsgId_from = 0, MsgId_to = 0;
 
-               int MsgIdCnt = MsgSettingGetInt(CB_CHANNEL_COUNT);
+       for (int i = 0; i < MsgIdCnt; i++)
+       {
+               memset(keyName, 0x00, sizeof(keyName));
+               sprintf(keyName, "%s/%d", CB_CHANNEL_ACTIVATE, i);
 
-               bool bActivate = false;
-               int MsgId = 0;
+               MsgSettingGetBool(keyName, &bActivate);
 
-               for (int i = 0; i < MsgIdCnt; i++)
-               {
-                       memset(keyName, 0x00, sizeof(keyName));
-                       sprintf(keyName, "%s/%d", CB_CHANNEL_ACTIVATE, i);
+               memset(keyName, 0x00, sizeof(keyName));
+               sprintf(keyName, "%s/%d", CB_CHANNEL_ID_FROM, i);
 
-                       MsgSettingGetBool(keyName, &bActivate);
+               MsgId_from = MsgSettingGetInt(keyName);
 
-                       memset(keyName, 0x00, sizeof(keyName));
-                       sprintf(keyName, "%s/%d", CB_CHANNEL_ID, i);
+               memset(keyName, 0x00, sizeof(keyName));
+               sprintf(keyName, "%s/%d", CB_CHANNEL_ID_TO, i);
 
-                       MsgId = MsgSettingGetInt(keyName);
+               MsgId_to = MsgSettingGetInt(keyName);
 
-                       if (bActivate == true && CbPage.pageHeader.msgId == MsgId)
-                       {
-                               MSG_DEBUG("FIND CHANNEL = [%d]", MsgId);
-                               return true;
-                       }
+               if (bActivate == true && CbPage.pageHeader.msgId >= MsgId_from && CbPage.pageHeader.msgId <= MsgId_to)
+               {
+                       MSG_DEBUG("FIND CHANNEL = [%d]", CbPage.pageHeader.msgId);
+                       return true;
                }
        }
-       else    // Receive All Channel = TRUE
-       {
-               MSG_DEBUG("RECEIVE ALL CHANNEL = TRUE");
-               return true;
-       }
 
        return false;
 }
@@ -737,18 +728,23 @@ void SmsPluginCbMsgHandler::getDisplayName(unsigned short MsgId, char *pDisplayN
        int MsgIdCnt = MsgSettingGetInt(CB_CHANNEL_COUNT);
 
        char keyName[128];
+       char from[128];
+       char to[128];
        char strTmp[CB_CHANNEL_NAME_MAX+1];
 
        for (int i = 0; i < MsgIdCnt; i++)
        {
-               memset(keyName, 0x00, sizeof(keyName));
-               sprintf(keyName, "%s/%d", CB_CHANNEL_ID, i);
+               memset(from, 0x00, sizeof(from));
+               sprintf(from, "%s/%d", CB_CHANNEL_ID_FROM, i);
 
-               if (MsgId == MsgSettingGetInt(keyName))
+               memset(to, 0x00, sizeof(to));
+               sprintf(to, "%s/%d", CB_CHANNEL_ID_TO, i);
+
+               if (MsgId >= MsgSettingGetInt(from) && MsgId <= MsgSettingGetInt(to))
                {
                        char *channelName = NULL;
                        MSG_DEBUG("FIND MSG ID = [%d]", MsgId);
-
+#if 0
                        memset(keyName, 0x00, sizeof(keyName));
                        sprintf(keyName, "%s/%d", CB_CHANNEL_NAME, i);
 
@@ -767,6 +763,9 @@ void SmsPluginCbMsgHandler::getDisplayName(unsigned short   MsgId, char *pDisplayN
                                sprintf(pDisplayName, "[%s]", strTmp);
                        else
                                sprintf(pDisplayName, "[%d]", MsgId);
+#else
+                       sprintf(pDisplayName, "[%d]", MsgId);
+#endif
 
                        return;
                }
index 60dd028..180dcb1 100755 (executable)
@@ -372,12 +372,6 @@ void       SmsPluginSatHandler::initCBConfig()
                return;
        }
 
-       if (MsgSettingSetBool(CB_ALL_CHANNEL, settingData.option.cbMsgOpt.bAllChannel) != MSG_SUCCESS)
-       {
-               THROW(MsgException::SMS_PLG_ERROR, "Error to set config data [%s]", CB_ALL_CHANNEL);
-               return;
-       }
-
        if (MsgSettingSetInt(CB_MAX_SIM_COUNT, settingData.option.cbMsgOpt.maxSimCnt) != MSG_SUCCESS)
        {
                THROW(MsgException::SMS_PLG_ERROR, "Error to set config data [%s]", CB_MAX_SIM_COUNT);
@@ -402,9 +396,15 @@ void       SmsPluginSatHandler::initCBConfig()
                        break;
 
                memset(keyName, 0x00, sizeof(keyName));
-               sprintf(keyName, "%s/%d", CB_CHANNEL_ID, i);
+               sprintf(keyName, "%s/%d", CB_CHANNEL_ID_FROM, i);
+
+               if ((err = MsgSettingSetInt(keyName, settingData.option.cbMsgOpt.channelData.channelInfo[i].from)) != MSG_SUCCESS)
+                       break;
+
+               memset(keyName, 0x00, sizeof(keyName));
+               sprintf(keyName, "%s/%d", CB_CHANNEL_ID_TO, i);
 
-               if ((err = MsgSettingSetInt(keyName, settingData.option.cbMsgOpt.channelData.channelInfo[i].id)) != MSG_SUCCESS)
+               if ((err = MsgSettingSetInt(keyName, settingData.option.cbMsgOpt.channelData.channelInfo[i].to)) != MSG_SUCCESS)
                        break;
 
                memset(keyName, 0x00, sizeof(keyName));
index 4f58d91..520e3f4 100755 (executable)
@@ -292,13 +292,13 @@ msg_error_t SmsPluginSetting::addCbOpt(MSG_CBMSG_OPT_S *pCbOpt)
 {
        msg_error_t err = MSG_SUCCESS;
 
-       MSG_DEBUG("Receive [%d], All Channel [%d], Max SIM Count [%d]", pCbOpt->bReceive, pCbOpt->bAllChannel, pCbOpt->maxSimCnt);
+       MSG_DEBUG("Receive [%d], Max SIM Count [%d]", pCbOpt->bReceive, pCbOpt->maxSimCnt);
 
        MSG_DEBUG("Channel Count [%d]", pCbOpt->channelData.channelCnt);
 
        for (int i = 0; i < pCbOpt->channelData.channelCnt; i++)
        {
-               MSG_DEBUG("Channel ID [%d]", pCbOpt->channelData.channelInfo[i].id);
+               MSG_DEBUG("Channel FROM [%d], Channel TO [%d]", pCbOpt->channelData.channelInfo[i].from, pCbOpt->channelData.channelInfo[i].to);
        }
 
        // Set Setting Data into Vconf
@@ -308,12 +308,6 @@ msg_error_t SmsPluginSetting::addCbOpt(MSG_CBMSG_OPT_S *pCbOpt)
                return MSG_ERR_SET_SETTING;
        }
 
-       if (MsgSettingSetBool(CB_ALL_CHANNEL, pCbOpt->bAllChannel) != MSG_SUCCESS)
-       {
-               MSG_DEBUG("Error to set config data [%s]", CB_ALL_CHANNEL);
-               return MSG_ERR_SET_SETTING;
-       }
-
        if (MsgSettingSetInt(CB_MAX_SIM_COUNT, pCbOpt->maxSimCnt) != MSG_SUCCESS)
        {
                MSG_DEBUG("Error to set config data [%s]", CB_MAX_SIM_COUNT);
@@ -337,9 +331,15 @@ msg_error_t SmsPluginSetting::addCbOpt(MSG_CBMSG_OPT_S *pCbOpt)
                        break;
 
                memset(keyName, 0x00, sizeof(keyName));
-               sprintf(keyName, "%s/%d", CB_CHANNEL_ID, i);
+               sprintf(keyName, "%s/%d", CB_CHANNEL_ID_FROM, i);
+
+               if ((err = MsgSettingSetInt(keyName, pCbOpt->channelData.channelInfo[i].from)) != MSG_SUCCESS)
+                       break;
+
+               memset(keyName, 0x00, sizeof(keyName));
+               sprintf(keyName, "%s/%d", CB_CHANNEL_ID_TO, i);
 
-               if ((err = MsgSettingSetInt(keyName, pCbOpt->channelData.channelInfo[i].id)) != MSG_SUCCESS)
+               if ((err = MsgSettingSetInt(keyName, pCbOpt->channelData.channelInfo[i].to)) != MSG_SUCCESS)
                        break;
 
                memset(keyName, 0x00, sizeof(keyName));
@@ -362,8 +362,6 @@ void SmsPluginSetting::getCbOpt(MSG_SETTING_S *pSetting)
 
        MsgSettingGetBool(CB_RECEIVE, &pSetting->option.cbMsgOpt.bReceive);
 
-       MsgSettingGetBool(CB_ALL_CHANNEL, &pSetting->option.cbMsgOpt.bAllChannel);
-
        pSetting->option.cbMsgOpt.maxSimCnt = MsgSettingGetInt(CB_MAX_SIM_COUNT);
 
        pSetting->option.cbMsgOpt.channelData.channelCnt = MsgSettingGetInt(CB_CHANNEL_COUNT);
@@ -376,9 +374,14 @@ void SmsPluginSetting::getCbOpt(MSG_SETTING_S *pSetting)
                MsgSettingGetBool(keyName, &pSetting->option.cbMsgOpt.channelData.channelInfo[i].bActivate);
 
                memset(keyName, 0x00, sizeof(keyName));
-               sprintf(keyName, "%s/%d", CB_CHANNEL_ID, i);
+               sprintf(keyName, "%s/%d", CB_CHANNEL_ID_FROM, i);
+
+               pSetting->option.cbMsgOpt.channelData.channelInfo[i].from = MsgSettingGetInt(keyName);
+
+               memset(keyName, 0x00, sizeof(keyName));
+               sprintf(keyName, "%s/%d", CB_CHANNEL_ID_TO, i);
 
-               pSetting->option.cbMsgOpt.channelData.channelInfo[i].id = MsgSettingGetInt(keyName);
+               pSetting->option.cbMsgOpt.channelData.channelInfo[i].to = MsgSettingGetInt(keyName);
 
                memset(keyName, 0x00, sizeof(keyName));
                sprintf(keyName, "%s/%d", CB_CHANNEL_NAME, i);
@@ -597,25 +600,24 @@ bool SmsPluginSetting::getParam(int Index, MSG_SMSC_DATA_S *pSmscData)
 
 bool SmsPluginSetting::setCbConfig(const MSG_CBMSG_OPT_S *pCbOpt)
 {
-       int reqId = 0;
-
        int ret = TAPI_API_SUCCESS;
 
        TelSmsCbConfig_t cbConfig = {};
 
-       cbConfig.bCBEnabled = (int)pCbOpt->bReceive;
-
-       if (pCbOpt->bAllChannel == true)
-               cbConfig.SelectedId = 0x01;
-       else
-               cbConfig.SelectedId = 0x02;
-
-       cbConfig.MsgIdCount = pCbOpt->channelData.channelCnt;
+       cbConfig.CBEnabled = (int)pCbOpt->bReceive;
+       cbConfig.Net3gppType = TAPI_NETTEXT_NETTYPE_3GPP;
+       cbConfig.MsgIdMaxCount = pCbOpt->maxSimCnt;
+       cbConfig.MsgIdRangeCount = pCbOpt->channelData.channelCnt;
 
-       for (int i = 0; i < cbConfig.MsgIdCount; i++)
+       for (int i = 0; i < cbConfig.MsgIdRangeCount; i++)
        {
-               cbConfig.MsgIDs[i] = (unsigned short)pCbOpt->channelData.channelInfo[i].id;
+               cbConfig.MsgIDs[i].Net3gpp.Selected = (unsigned short)pCbOpt->channelData.channelInfo[i].bActivate;
+               cbConfig.MsgIDs[i].Net3gpp.FromMsgId = (unsigned short)pCbOpt->channelData.channelInfo[i].from;
+               cbConfig.MsgIDs[i].Net3gpp.ToMsgId = (unsigned short)pCbOpt->channelData.channelInfo[i].to;
+
+               MSG_DEBUG("FROM: %d, TO: %d", cbConfig.MsgIDs[i].Net3gpp.FromMsgId, cbConfig.MsgIDs[i].Net3gpp.ToMsgId);
        }
+       MSG_DEBUG("CBEnabled: %d, range_count: %d", cbConfig.CBEnabled, cbConfig.MsgIdRangeCount);
 
        ret = tel_set_sms_cb_config(pTapiHandle, &cbConfig, TapiEventSetConfigData, NULL);
 
@@ -645,8 +647,6 @@ bool SmsPluginSetting::setCbConfig(const MSG_CBMSG_OPT_S *pCbOpt)
 
 bool SmsPluginSetting::getCbConfig(MSG_CBMSG_OPT_S *pCbOpt)
 {
-       int reqId = 0;
-
        int ret = TAPI_API_SUCCESS;
 
        ret = tel_get_sms_cb_config(pTapiHandle, TapiEventGetCBConfig, NULL);
index 7efb912..716cdf8 100755 (executable)
@@ -204,7 +204,6 @@ msg_error_t MsgHandle::getCBOption(msg_struct_t msg_struct)
                memcpy(&cb_opt_tmp, pEvent->data, sizeof(MSG_CBMSG_OPT_S));
 
                MSG_CBMSG_OPT_HIDDEN_S *pTmp = (MSG_CBMSG_OPT_HIDDEN_S *)cb_opt->data;
-               pTmp->bAllChannel = cb_opt_tmp.bAllChannel;
                pTmp->bReceive = cb_opt_tmp.bReceive;
                pTmp->maxSimCnt = cb_opt_tmp.maxSimCnt;
 
@@ -250,7 +249,6 @@ msg_error_t MsgHandle::setCBOption(msg_struct_t msg_struct)
        MSG_CBMSG_OPT_S cb_opt_tmp = {0,};
        MSG_CBMSG_OPT_HIDDEN_S *cb_msg_opt = (MSG_CBMSG_OPT_HIDDEN_S *)cb_opt->data;
 
-       cb_opt_tmp.bAllChannel = cb_msg_opt->bAllChannel;
        cb_opt_tmp.bReceive = cb_msg_opt->bReceive;
        cb_opt_tmp.maxSimCnt = cb_msg_opt->maxSimCnt;
        for (int i = 0; i < CB_LANG_TYPE_MAX; i++)
@@ -263,7 +261,7 @@ msg_error_t MsgHandle::setCBOption(msg_struct_t msg_struct)
 
        for (i = 0; i < cb_opt_tmp.channelData.channelCnt; i++) {
                pStructTmp = (msg_struct_s *)cb_ch_list->msg_struct_info[i];
-               memcpy(&(cb_opt_tmp.channelData.channelInfo[i]), &pStructTmp->data, sizeof(MSG_CB_CHANNEL_INFO_S));
+               memcpy(&(cb_opt_tmp.channelData.channelInfo[i]), pStructTmp->data, sizeof(MSG_CB_CHANNEL_INFO_S));
        }
 
        MSG_SETTING_S pSetting = {0,};