}
}
- 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) {
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));
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);
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);
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;
}
#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"
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;
*/
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. */
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. */
};
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;
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;
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;
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;
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
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)
{
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);
}
}
- 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;
}
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);
sprintf(pDisplayName, "[%s]", strTmp);
else
sprintf(pDisplayName, "[%d]", MsgId);
+#else
+ sprintf(pDisplayName, "[%d]", MsgId);
+#endif
return;
}
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);
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));
{
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
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);
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));
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);
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);
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);
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);
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;
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++)
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,};