Both SMS plugin and SMS CDMA plugin should be loaded and work according to the current network(GSM/CDMA).
Applied the changes for MPR1320.
Change-Id: I9eb77b5f9651b3a0e0c7728286374a8dcd765039
SET(MMS-PLUGIN-LIB msg_mms_plugin)
SET(MSG-MGR msg-manager)
-IF(_FEATURE_SMS_CDMA)
- ADD_DEFINITIONS("-DFEATURE_SMS_CDMA")
-ENDIF(_FEATURE_SMS_CDMA)
-
ADD_DEFINITIONS("-D_FILE_OFFSET_BITS=64")
ADD_DEFINITIONS(-DTZ_SYS_RO_APP_PATH="${TZ_SYS_RO_APP}")
ADD_SUBDIRECTORY(framework)
ADD_SUBDIRECTORY(proxy)
ADD_SUBDIRECTORY(mapi)
-IF(_FEATURE_SMS_CDMA)
-ADD_SUBDIRECTORY(plugin/sms_cdma_plugin)
-ELSE(_FEATURE_SMS_CDMA)
ADD_SUBDIRECTORY(plugin/sms_plugin)
-ENDIF(_FEATURE_SMS_CDMA)
ADD_SUBDIRECTORY(plugin/mms_plugin)
ADD_SUBDIRECTORY(manager)
CONFIGURE_FILE(msg-service.pc.in msg-service.pc @ONLY)
INSTALL(FILES ${CMAKE_BINARY_DIR}/msg-service.pc DESTINATION ${LIBDIR}/pkgconfig)
-IF(_FEATURE_SMS_CDMA)
- INSTALL(FILES ${CMAKE_SOURCE_DIR}/config/msg-service-db.CDMA.sql DESTINATION /usr/share/msg-service RENAME msg-service-db.sql)
-ELSE(_FEATURE_SMS_CDMA)
- INSTALL(FILES ${CMAKE_SOURCE_DIR}/config/msg-service-db.sql DESTINATION /usr/share/msg-service RENAME msg-service-db.sql)
-ENDIF(_FEATURE_SMS_CDMA)
+# DB file
+INSTALL(FILES ${CMAKE_SOURCE_DIR}/config/msg-service-db.sql DESTINATION /usr/share/msg-service RENAME msg-service-db.sql)
+++ /dev/null
-PRAGMA user_version=1;
-
-CREATE TABLE MSG_CONVERSATION_TABLE
-(
- CONV_ID INTEGER PRIMARY KEY ,
- UNREAD_CNT INTEGER DEFAULT 0 ,
- SMS_CNT INTEGER DEFAULT 0 ,
- MMS_CNT INTEGER DEFAULT 0 ,
- MAIN_TYPE INTEGER DEFAULT 0 ,
- SUB_TYPE INTEGER DEFAULT 0 ,
- MSG_DIRECTION INTEGER DEFAULT 0 ,
- DISPLAY_TIME DATETIME ,
- DISPLAY_NAME TEXT NOT NULL DEFAULT '' ,
- MSG_TEXT TEXT NOT NULL DEFAULT '' ,
- TRANSLATION INTEGER DEFAULT 0,
- SENDER_LANG INTEGER DEFAULT 0,
- RECEIVER_LANG INTEGER DEFAULT 0,
- ONLY_RECEIVE INTEGER DEFAULT 0,
- INCLUDE_ORGMSG INTEGER DEFAULT 0,
- LAST_MSG_ID INTEGER DEFAULT 0
-);
-
-CREATE TABLE MSG_ADDRESS_TABLE
-(
- ADDRESS_ID INTEGER PRIMARY KEY ,
- CONV_ID INTEGER NOT NULL ,
- ADDRESS_TYPE INTEGER ,
- RECIPIENT_TYPE INTEGER ,
- ADDRESS_VAL TEXT NOT NULL DEFAULT '' ,
- CONTACT_ID INTEGER ,
- ADDR_BOOK_ID INTEGER ,
- FIRST_NAME TEXT NOT NULL DEFAULT '' ,
- LAST_NAME TEXT NOT NULL DEFAULT '' ,
- MIDDLE_NAME TEXT NOT NULL DEFAULT '' ,
- PREFIX TEXT NOT NULL DEFAULT '' ,
- SUFFIX TEXT NOT NULL DEFAULT '' ,
- IMAGE_PATH TEXT NOT NULL DEFAULT '' ,
- SYNC_TIME DATETIME ,
-
- FOREIGN KEY (CONV_ID) REFERENCES MSG_CONVERSATION_TABLE (CONV_ID)
-);
-
-CREATE TABLE MSG_FOLDER_TABLE
-(
- FOLDER_ID INTEGER PRIMARY KEY ,
- FOLDER_NAME TEXT NOT NULL ,
- FOLDER_TYPE INTEGER DEFAULT 0
-);
-
-CREATE TABLE MSG_MESSAGE_TABLE
-(
- MSG_ID INTEGER PRIMARY KEY ,
- CONV_ID INTEGER NOT NULL ,
- FOLDER_ID INTEGER NOT NULL ,
- STORAGE_ID INTEGER NOT NULL ,
- MAIN_TYPE INTEGER NOT NULL ,
- SUB_TYPE INTEGER NOT NULL ,
- DISPLAY_TIME DATETIME ,
- DATA_SIZE INTEGER DEFAULT 0 ,
- NETWORK_STATUS INTEGER DEFAULT 0 ,
- READ_STATUS INTEGER DEFAULT 0 ,
- PROTECTED INTEGER DEFAULT 0 ,
- PRIORITY INTEGER DEFAULT 0 ,
- MSG_DIRECTION INTEGER NOT NULL ,
- SCHEDULED_TIME DATETIME ,
- BACKUP INTEGER DEFAULT 0 ,
- SUBJECT TEXT NOT NULL DEFAULT '' ,
- MSG_DATA TEXT NOT NULL DEFAULT '' ,
- THUMB_PATH TEXT NOT NULL DEFAULT '' ,
- MSG_TEXT TEXT NOT NULL DEFAULT '' ,
- ATTACHMENT_COUNT INTEGER DEFAULT 0 ,
-
- FOREIGN KEY (CONV_ID) REFERENCES MSG_CONVERSATION_TABLE (CONV_ID) ,
- FOREIGN KEY (FOLDER_ID) REFERENCES MSG_FOLDER_TABLE (FOLDER_ID)
-);
-
-CREATE TABLE MSG_SIM_TABLE
-(
- SIM_ID INTEGER PRIMARY KEY ,
- MSG_ID INTEGER NOT NULL ,
-
- FOREIGN KEY(MSG_ID) REFERENCES MSG_MESSAGE_TABLE(MSG_ID)
-);
-
-CREATE TABLE MSG_PUSH_TABLE
-(
- MSG_ID INTEGER PRIMARY KEY ,
- ACTION INTEGER ,
- CREATED INTEGER ,
- EXPIRES INTEGER ,
- ID TEXT NOT NULL DEFAULT '' ,
- HREF TEXT NOT NULL DEFAULT '' ,
- CONTENT TEXT NOT NULL DEFAULT '' ,
-
- FOREIGN KEY(MSG_ID) REFERENCES MSG_MESSAGE_TABLE(MSG_ID)
-);
-
-CREATE TABLE MSG_CBMSG_TABLE
-(
- MSG_ID INTEGER PRIMARY KEY ,
- CB_MSG_ID INTEGER NOT NULL ,
-
- FOREIGN KEY(MSG_ID) REFERENCES MSG_MESSAGE_TABLE(MSG_ID)
-);
-
-CREATE TABLE MSG_SYNCML_TABLE
-(
- MSG_ID INTEGER PRIMARY KEY ,
- EXT_ID INTEGER NOT NULL ,
- PINCODE INTEGER NOT NULL ,
-
- FOREIGN KEY(MSG_ID) REFERENCES MSG_MESSAGE_TABLE(MSG_ID)
-);
-
-CREATE TABLE MSG_SCHEDULED_TABLE
-(
- MSG_ID INTEGER PRIMARY KEY ,
- ALARM_ID INTEGER NOT NULL ,
-
- FOREIGN KEY(MSG_ID) REFERENCES MSG_MESSAGE_TABLE(MSG_ID)
-);
-
-CREATE TABLE MSG_SMS_SENDOPT_TABLE
-(
- MSG_ID INTEGER PRIMARY KEY ,
- DELREP_REQ INTEGER NOT NULL ,
- KEEP_COPY INTEGER NOT NULL ,
- REPLY_PATH INTEGER NOT NULL ,
- ENCODE_TYPE INTEGER NOT NULL ,
-
- FOREIGN KEY(MSG_ID) REFERENCES MSG_MESSAGE_TABLE(MSG_ID)
-);
-
-CREATE TABLE MSG_FILTER_TABLE
-(
- FILTER_ID INTEGER PRIMARY KEY ,
- FILTER_TYPE INTEGER NOT NULL ,
- FILTER_VALUE TEXT NOT NULL ,
- FILTER_ACTIVE INTEGER DEFAULT 0
-);
-
-CREATE TABLE MSG_MMS_MESSAGE_TABLE
-(
- MSG_ID INTEGER PRIMARY KEY ,
- TRANSACTION_ID TEXT NOT NULL DEFAULT '' ,
- MESSAGE_ID TEXT NOT NULL DEFAULT '' ,
- FWD_MESSAGE_ID TEXT NOT NULL DEFAULT '' ,
- CONTENTS_LOCATION TEXT NOT NULL DEFAULT '' ,
- FILE_PATH TEXT NOT NULL DEFAULT '' ,
- VERSION INTEGER NOT NULL ,
- DATA_TYPE INTEGER DEFAULT -1 ,
- DATE DATETIME ,
- HIDE_ADDRESS INTEGER DEFAULT 0 ,
- ASK_DELIVERY_REPORT INTEGER DEFAULT 0 ,
- REPORT_ALLOWED INTEGER DEFAULT 0 ,
- READ_REPORT_ALLOWED_TYPE INTEGER DEFAULT 0 ,
- ASK_READ_REPLY INTEGER DEFAULT 0 ,
- READ INTEGER DEFAULT 0 ,
- READ_REPORT_SEND_STATUS INTEGER DEFAULT 0 ,
- READ_REPORT_SENT INTEGER DEFAULT 0 ,
- PRIORITY INTEGER DEFAULT 0 ,
- KEEP_COPY INTEGER DEFAULT 0 ,
- MSG_SIZE INTEGER NOT NULL ,
- MSG_CLASS INTEGER DEFAULT -1 ,
- EXPIRY_TIME DATETIME ,
- CUSTOM_DELIVERY_TIME INTEGER DEFAULT 0 ,
- DELIVERY_TIME DATETIME ,
- MSG_STATUS INTEGER DEFAULT -1 ,
-
- FOREIGN KEY(MSG_ID) REFERENCES MSG_MESSAGE_TABLE(MSG_ID)
-);
-
-CREATE TABLE MSG_MMS_PREVIEW_INFO_TABLE
-(
- MSG_ID INTEGER NOT NULL ,
- TYPE INTEGER,
- VALUE TEXT,
- COUNT INTEGER,
-
- FOREIGN KEY(MSG_ID) REFERENCES MSG_MESSAGE_TABLE(MSG_ID)
-);
-
-CREATE TABLE MSG_SMS_REPORT_TABLE
-(
- MSG_ID INTEGER NOT NULL ,
- ADDRESS_VAL TEXT NOT NULL DEFAULT '' ,
- MSG_REF INTEGER ,
- STATUS_TYPE INTEGER ,
- STATUS INTEGER DEFAULT 0 ,
- TIME DATETIME
-);
-
-CREATE TABLE MSG_REPORT_TABLE
-(
- MSG_ID INTEGER NOT NULL ,
- ADDRESS_VAL TEXT NOT NULL DEFAULT '' ,
- STATUS_TYPE INTEGER ,
- STATUS INTEGER DEFAULT 0 ,
- TIME DATETIME
-);
-
-CREATE TABLE MSG_PUSHCFG_TABLE
-(
- PUSH_ID INTEGER PRIMARY KEY ,
- CONTENT_TYPE TEXT NOT NULL DEFAULT '' ,
- APP_ID TEXT NOT NULL DEFAULT '' ,
- PKG_NAME TEXT NOT NULL DEFAULT '' ,
- LAUNCH INTEGER,
- APPCODE INTEGER,
- SECURE INTEGER
-);
-
-CREATE TABLE MSG_TMP_MSGID_TABLE
-(
- MSG_ID INTEGER
-);
-
-CREATE TABLE MSG_CB_CHANNEL_INFO_TABLE
-(
- CHANNEL_ID INTEGER PRIMARY KEY ,
- CHANNEL_ACTIVATION INTEGER DEFAULT 0,
- CHANNEL_FROM INTEGER DEFAULT 0,
- CHANNEL_TO INTEGER DEFAULT 0,
- CHANNEL_NAME TEXT NOT NULL DEFAULT ''
-);
-
-CREATE TABLE MSG_MULTIPART_TABLE
-(
- _ID INTEGER PRIMARY KEY AUTOINCREMENT,
- MSG_ID INTEGER NOT NULL ,
- SEQ INTEGER DEFAULT 0,
- CONTENT_TYPE TEXT,
- NAME TEXT,
- CHARSET INTEGER,
- CONTENT_ID TEXT,
- CONTENT_LOCATION TEXT,
- FILE_PATH TEXT,
- TEXT TEXT,
- TCS_LEVEL INTEGER DEFAULT -1,
- MALWARE_ALLOW INTEGER DEFAULT 0,
- THUMB_FILE_PATH TEXT,
-
- FOREIGN KEY(MSG_ID) REFERENCES MSG_MESSAGE_TABLE(MSG_ID)
-);
-
-CREATE TABLE MSG_CDMA_CB_CHANNEL_INFO_TABLE
-(
- CHANNEL_ID INTEGER PRIMARY KEY,
- CHANNEL_ACTIVATION INTEGER DEFAULT 0,
- CHANNEL_CATEGORY INTEGER DEFAULT 0,
- CHANNEL_LANGUAGE INTEGER DEFAULT 0,
- CHANNEL_NAME TEXT NOT NULL DEFAULT ''
-);
-
-CREATE TABLE MSG_UNIQUENESS_INFO_TABLE
-(
- MSG_ID INTEGER NOT NULL,
- TELE_MSG_ID INTEGER NOT NULL,
- ADDRESS TEXT DEFAULT '',
- SUB_ADDRESS TEXT DEFAULT '',
- TIME_STAMP TEXT DEFAULT '',
- TELESVC_ID INTEGER NOT NULL,
-
- FOREIGN KEY(MSG_ID) REFERENCES MSG_MESSAGE_TABLE(MSG_ID)
-);
-
-CREATE TABLE MSG_ADDRESS_TEMP_TABLE
-(
- ADDRESS_VAL TEXT NOT NULL DEFAULT ''
-);
-
-CREATE INDEX MSG_CONVERSATION_INDEX ON MSG_CONVERSATION_TABLE(CONV_ID);
-CREATE INDEX MSG_FOLDER_INDEX ON MSG_FOLDER_TABLE(FOLDER_ID);
-CREATE INDEX MSG_MESSAGE_INDEX ON MSG_MESSAGE_TABLE(MSG_ID, CONV_ID, FOLDER_ID);
-
-INSERT INTO MSG_FOLDER_TABLE VALUES (1, 'INBOX', 1);
-INSERT INTO MSG_FOLDER_TABLE VALUES (2, 'OUTBOX', 2);
-INSERT INTO MSG_FOLDER_TABLE VALUES (3, 'SENTBOX', 2);
-INSERT INTO MSG_FOLDER_TABLE VALUES (4, 'DRAFT', 3);
-INSERT INTO MSG_FOLDER_TABLE VALUES (5, 'CBMSGBOX', 1);
-INSERT INTO MSG_FOLDER_TABLE VALUES (6, 'SPAMBOX', 4);
-
-INSERT INTO MSG_PUSHCFG_TABLE VALUES (1, 'text/vnd.wap.si', 'X-Wap-Application-Id: x-wap-application:wml.ua', '', 0, 1, 0);
-INSERT INTO MSG_PUSHCFG_TABLE VALUES (2, 'application/vnd.wap.sic', 'X-Wap-Application-Id: x-wap-application:wml.ua', '', 0, 2, 0);
-INSERT INTO MSG_PUSHCFG_TABLE VALUES (3, 'text/vnd.wap.sl', 'X-Wap-Application-Id: x-wap-application:wml.ua', '', 0, 3, 0);
-INSERT INTO MSG_PUSHCFG_TABLE VALUES (4, 'application/vnd.wap.slc', 'X-Wap-Application-Id: x-wap-application:wml.ua', '', 0, 4, 0);
-INSERT INTO MSG_PUSHCFG_TABLE VALUES (5, 'text/vnd.wap.co', 'X-Wap-Application-Id: x-wap-application:wml.ua', '', 0, 5, 0);
-
-INSERT INTO MSG_PUSHCFG_TABLE VALUES (6, 'application/vnd.wap.coc', 'X-Wap-Application-Id: x-wap-application:wml.ua', '', 0, 6, 0);
-
-INSERT INTO MSG_PUSHCFG_TABLE VALUES (7, 'application/vnd.wap.mms-message', 'X-Wap-Application-Id: x-wap-application:mms.ua', '', 0, 7, 0);
-INSERT INTO MSG_PUSHCFG_TABLE VALUES (8, 'application/vnd.wap.sia', 'X-Wap-Application-Id: x-wap-application:push.sia', '', 0, 8, 0);
-INSERT INTO MSG_PUSHCFG_TABLE VALUES (9, 'application/vnd.syncml.dm+wbxml', 'X-Wap-Application-Id: x-wap-application:push.syncml.dm', '', 0, 9, 0);
-INSERT INTO MSG_PUSHCFG_TABLE VALUES (10, 'application/vnd.syncml.dm+xml', 'X-Wap-Application-Id: x-wap-application:push.syncml.dm', '', 0, 10, 0);
-
-INSERT INTO MSG_PUSHCFG_TABLE VALUES (11, 'application/vnd.syncml.notification', 'X-Wap-Application-Id: x-wap-application:push.syncml.dm', '', 0, 11, 0);
-INSERT INTO MSG_PUSHCFG_TABLE VALUES (12, 'application/vnd.syncml.ds.notification', 'X-Wap-Application-Id: x-wap-application:push.syncml.ds', '', 0, 12, 0);
-INSERT INTO MSG_PUSHCFG_TABLE VALUES (13, 'application/vnd.syncml+wbxml', 'X-Wap-Application-Id:x-wap-application:push.syncml', '', 0, 13, 0);
-INSERT INTO MSG_PUSHCFG_TABLE VALUES (14, 'application/vnd.wap.locc+wbxml', 'X-Wap-Application-Id: x-wap-application:loc.ua', '', 0, 14, 0);
-INSERT INTO MSG_PUSHCFG_TABLE VALUES (15, 'application/vnd.wap.loc+xml', 'X-Wap-Application-Id: x-wap-application:loc.ua', '', 0, 15, 0);
-
-INSERT INTO MSG_PUSHCFG_TABLE VALUES (16, 'application/vnd.oma.dd+xml', 'X-Wap-Application-Id: x-wap-application:loc.ua', '', 0, 16, 0);
-INSERT INTO MSG_PUSHCFG_TABLE VALUES (17, 'application/vnd.oma.drm.message', 'X-Wap-Application-Id: x-wap-application:drm.ua', '', 0, 17, 0);
-INSERT INTO MSG_PUSHCFG_TABLE VALUES (18, 'application/vnd.oma.drm.content', 'X-Wap-Application-Id: x-wap-application:drm.ua', '', 0, 18, 0);
-INSERT INTO MSG_PUSHCFG_TABLE VALUES (19, 'application/vnd.oma.drm.rights+xml', 'X-Wap-Application-Id: x-wap-application:drm.ua', '', 0, 19, 0);
-INSERT INTO MSG_PUSHCFG_TABLE VALUES (20, 'application/vnd.oma.drm.rights+wbxml', 'X-Wap-Application-Id: x-wap-application:drm.ua', '', 0, 20, 0);
-
-INSERT INTO MSG_PUSHCFG_TABLE VALUES (21, 'application/vnd.oma.drm.ro+xml', 'X-Wap-Application-Id: x-wap-application:drm.ua', '', 0, 21, 0);
-INSERT INTO MSG_PUSHCFG_TABLE VALUES (22, 'application/vnd.oma.drm.roap-pdu+xml', 'X-Wap-Application-Id: x-wap-application:drm.ua', '', 0, 22, 0);
-INSERT INTO MSG_PUSHCFG_TABLE VALUES (23, 'application/vnd.oma.drm.roap-trigger+xml', 'X-Wap-Application-Id: x-wap-application:drm.ua', '', 0, 23, 0);
-INSERT INTO MSG_PUSHCFG_TABLE VALUES (24, 'application/vnd.oma.drm.roap-trigger+wbxml', 'X-Wap-Application-Id: x-wap-application:drm.ua', '', 0, 24, 0);
-INSERT INTO MSG_PUSHCFG_TABLE VALUES (25, 'text/vnd.wap.connectivity-xml', 'X-Wap-Application-Id: x-wap-application:drm.ua', '', 0, 26, 0);
-
-INSERT INTO MSG_PUSHCFG_TABLE VALUES (26, 'application/vnd.wap.connectivity-wbxml', 'X-Wap-Application-Id: x-wap-samsung:provisioning.ua', '', 0, 27, 0);
-INSERT INTO MSG_PUSHCFG_TABLE VALUES (27, 'application/x-wap-prov.browser-settings', 'X-Wap-Application-Id: x-wap-samsung:provisioning.ua', '', 0, 28, 0);
-INSERT INTO MSG_PUSHCFG_TABLE VALUES (28, 'application/x-wap-prov.browser-bookmarks', 'X-Wap-Application-Id: x-wap-samsung:provisioning.ua', '', 0, 29, 0);
-INSERT INTO MSG_PUSHCFG_TABLE VALUES (29, 'application/x-wap-prov.syncset+xml', 'X-Wap-Application-Id: x-wap-samsung:provisioning.ua', '', 0, 30, 0);
-INSERT INTO MSG_PUSHCFG_TABLE VALUES (30, 'application/x-wap-prov.syncset+wbxml', 'X-Wap-Application-Id: x-wap-samsung:provisioning.ua', '', 0, 31, 0);
-
-INSERT INTO MSG_PUSHCFG_TABLE VALUES (33, 'application/vnd.wv.csp.cir', 'X-Wap-Application-Id: x-wap-application:wv.ua', '', 0, 34, 0);
-INSERT INTO MSG_PUSHCFG_TABLE VALUES (34, 'application/vnd.omaloc-supl-init', 'X-Wap-Application-Id: x-oma-application:ulp.ua', '', 0, 44, 0);
-
-INSERT INTO MSG_CDMA_CB_CHANNEL_INFO_TABLE VALUES (0, 1, 4096, 1, 'Presidential');
-INSERT INTO MSG_CDMA_CB_CHANNEL_INFO_TABLE VALUES (1, 1, 4097, 1, 'Extreme');
-INSERT INTO MSG_CDMA_CB_CHANNEL_INFO_TABLE VALUES (2, 1, 4098, 1, 'Severe');
-INSERT INTO MSG_CDMA_CB_CHANNEL_INFO_TABLE VALUES (3, 1, 4099, 1, 'Amber');
-INSERT INTO MSG_CDMA_CB_CHANNEL_INFO_TABLE VALUES (4, 0, 4100, 1, 'Test');
ADDRESS_VAL TEXT NOT NULL DEFAULT ''
);
+CREATE TABLE MSG_CDMA_CB_CHANNEL_INFO_TABLE
+(
+ CHANNEL_ID INTEGER PRIMARY KEY,
+ CHANNEL_ACTIVATION INTEGER DEFAULT 0,
+ CHANNEL_CATEGORY INTEGER DEFAULT 0,
+ CHANNEL_LANGUAGE INTEGER DEFAULT 0,
+ CHANNEL_NAME TEXT NOT NULL DEFAULT ''
+);
+
+CREATE TABLE MSG_UNIQUENESS_INFO_TABLE
+(
+ MSG_ID INTEGER NOT NULL,
+ TELE_MSG_ID INTEGER NOT NULL,
+ ADDRESS TEXT DEFAULT '',
+ SUB_ADDRESS TEXT DEFAULT '',
+ TIME_STAMP TEXT DEFAULT '',
+ TELESVC_ID INTEGER NOT NULL,
+
+ FOREIGN KEY(MSG_ID) REFERENCES MSG_MESSAGE_TABLE(MSG_ID)
+);
+
CREATE TABLE MSG_SENTFAIL_INDEX_TABLE
(
MSG_ID INTEGER PRIMARY KEY ,
INSERT INTO MSG_CB_CHANNEL_INFO_TABLE VALUES (0, 1, 0, 65535, '', 1);
INSERT INTO MSG_CB_CHANNEL_INFO_TABLE VALUES (1, 1, 0, 65535, '', 2);
+
+INSERT INTO MSG_CDMA_CB_CHANNEL_INFO_TABLE VALUES (0, 1, 4096, 1, 'Presidential alert');
+INSERT INTO MSG_CDMA_CB_CHANNEL_INFO_TABLE VALUES (1, 1, 4097, 1, 'Extreme alert');
+INSERT INTO MSG_CDMA_CB_CHANNEL_INFO_TABLE VALUES (2, 1, 4098, 1, 'Severe alert');
+INSERT INTO MSG_CDMA_CB_CHANNEL_INFO_TABLE VALUES (3, 1, 4099, 1, 'Amber alert');
+INSERT INTO MSG_CDMA_CB_CHANNEL_INFO_TABLE VALUES (4, 0, 4100, 1, 'Test alert');
${CMAKE_SOURCE_DIR}/include/framework
${CMAKE_SOURCE_DIR}/include/utils
${CMAKE_SOURCE_DIR}/include/externals
- ${CMAKE_SOURCE_DIR}/vobject-engine/include
+ ${CMAKE_SOURCE_DIR}/vobject-engine/include
)
INCLUDE(FindPkgConfig)
MSG_FATAL("Wrong result(evt type %d : %s) received", pEvent->eventType, MsgDbgEvtStr(pEvent->eventType));
/* THROW(MsgException::INCOMING_MSG_ERROR, "Wrong result(evt type %d : %s) received", pEvent->eventType, MsgDbgEvtStr(pEvent->eventType)); */
-#ifdef FEATURE_SMS_CDMA
memcpy(&(pMsg->msgId), pEvent->data, sizeof(msg_message_id_t));
-#endif
MSG_END();
return (pEvent->result);
}
-#ifdef FEATURE_SMS_CDMA
bool MsgCheckUniquenessListener(MSG_UNIQUE_INDEX_S *p_msg, msg_message_id_t msgId, bool bInsert)
{
MSG_BEGIN();
else
return false;
}
-#endif
msg_error_t MsgSimImsiListener(int sim_idx)
{
fwListener.pfCBMsgIncomingCb = &MsgIncomingCBMessageListener;
fwListener.pfSimMsgIncomingCb = &MsgSimMessageListener;
fwListener.pfResendMessageCb = &MsgResendMessageListener;
-#ifdef FEATURE_SMS_CDMA
fwListener.pfCheckUniquenessCb = &MsgCheckUniquenessListener;
-#endif
fwListener.pfSimInitImsiCb = &MsgSimImsiListener;
if (registerListener(&fwListener) != MSG_SUCCESS)
return MSG_ERR_INVALID_PLUGIN_HANDLE;
}
-#ifndef FEATURE_SMS_CDMA
msg_error_t MsgPlugin::deleteSimMessage(msg_sim_slot_id_t sim_idx, msg_sim_id_t SimMsgId)
{
- if (mPlgHandler.pfDeleteSimMessage != NULL)
+ if (mPlgHandler.pfDeleteSimMessage != NULL) {
return mPlgHandler.pfDeleteSimMessage(sim_idx, SimMsgId);
- else
+ } else {
return MSG_ERR_INVALID_PLUGIN_HANDLE;
+ }
}
else
return MSG_ERR_INVALID_PLUGIN_HANDLE;
}
-#else
-msg_error_t MsgPlugin::deleteSimMessage(msg_sim_id_t SimMsgId)
-{
- if (mPlgHandler.pfDeleteSimMessage != NULL)
- return mPlgHandler.pfDeleteSimMessage(SimMsgId);
- else
- return MSG_ERR_INVALID_PLUGIN_HANDLE;
-}
-msg_error_t MsgPlugin::setReadStatus(msg_sim_id_t SimMsgId)
-{
- if (mPlgHandler.pfSetReadStatus != NULL)
- return mPlgHandler.pfSetReadStatus(SimMsgId);
- else
- return MSG_ERR_INVALID_PLUGIN_HANDLE;
-}
-
-
-msg_error_t MsgPlugin::setMemoryStatus(msg_error_t Error)
-{
- if (mPlgHandler.pfSetMemoryStatus != NULL)
- return mPlgHandler.pfSetMemoryStatus(Error);
- else
- return MSG_ERR_INVALID_PLUGIN_HANDLE;
-}
-#endif
msg_error_t MsgPlugin::setConfigData(const MSG_SETTING_S *pSetting)
{
if (mPlgHandler.pfSetConfigData != NULL)
return MSG_ERR_INVALID_PLUGIN_HANDLE;
}
+
msg_error_t MsgPlugin::addMessage(MSG_MESSAGE_INFO_S *pMsgInfo, MSG_SENDINGOPT_INFO_S *pSendOptInfo, char *pFileData)
{
if (mPlgHandler.pfAddMessage != NULL) {
}
}
+
msg_error_t MsgPlugin::updateMessage(MSG_MESSAGE_INFO_S *pMsgInfo, MSG_SENDINGOPT_INFO_S *pSendOptInfo, char *pFileData)
{
if (mPlgHandler.pfUpdateMessage != NULL) {
case MSG_SMS_SENDOPT :
err = MsgSetSMSSendOpt(pSetting);
break;
-#ifndef FEATURE_SMS_CDMA
case MSG_SMSC_LIST :
/* Check SIM is present or not */
snprintf(keyName, sizeof(keyName), "%s/%d", MSG_SIM_CHANGED, pSetting->option.smscList.simIndex);
}
err = MsgSetSMSCList(pSetting, true);
break;
-#endif
case MSG_MMS_SENDOPT :
err = MsgSetMMSSendOpt(pSetting);
break;
msg_error_t err = MSG_SUCCESS;
MSG_CBMSG_OPT_S cbOpt;
-#ifndef FEATURE_SMS_CDMA
int iValue = 0;
-#endif
bool bValue = false;
char keyName[MAX_VCONFKEY_NAME_LEN];
msg_sim_slot_id_t simIndex;
simIndex = cbOpt.simIndex;
+ bool CDMASupported = MsgCheckFeatureSupport(MSG_TELEPHONY_CDMA_FEATURE);
+
MSG_DEBUG("SIM Index = [%d]", simIndex);
if (bSetSim == true) { /* if (bSetSim == true && simIndex != 0) { */
-#ifndef FEATURE_SMS_CDMA
- if (simIndex != 0) {
- memset(keyName, 0x00, sizeof(keyName));
- snprintf(keyName, sizeof(keyName), "%s/%d", CB_MAX_SIM_COUNT, simIndex);
- if (MsgSettingGetInt(keyName, &(cbOpt.maxSimCnt)) != MSG_SUCCESS) {
- MSG_INFO("MsgSettingGetInt() is failed");
- }
+ if (!CDMASupported) {
+ if (simIndex != 0) {
+ memset(keyName, 0x00, sizeof(keyName));
+ snprintf(keyName, sizeof(keyName), "%s/%d", CB_MAX_SIM_COUNT, simIndex);
+ if (MsgSettingGetInt(keyName, &(cbOpt.maxSimCnt)) != MSG_SUCCESS) {
+ MSG_WARN("MsgSettingGetInt() is failed");
+ }
- if (cbOpt.channelData.channelCnt > cbOpt.maxSimCnt) {
- MSG_DEBUG("Channel Count [%d] is over Max SIM Count [%d]", cbOpt.channelData.channelCnt, cbOpt.maxSimCnt);
- return MSG_ERR_SET_SIM_SET;
+ if (cbOpt.channelData.channelCnt > cbOpt.maxSimCnt) {
+ MSG_INFO("Channel Count [%d] is over Max SIM Count [%d]", cbOpt.channelData.channelCnt, cbOpt.maxSimCnt);
+ return MSG_ERR_SET_SIM_SET;
+ }
}
}
-#endif
+
err = MsgSetConfigInSim(pSetting);
if (err != MSG_SUCCESS) {
MSG_ERR("Error to set config data in sim [%d]", err);
}
}
-#ifndef FEATURE_SMS_CDMA
- if (simIndex == 0) {
- MSG_DEBUG("SIM Index for Setting CB Option = 0, Setting for CB_RECEIVE success");
- return MSG_SUCCESS;
- }
+ if (!CDMASupported) {
+ if (simIndex == 0) {
+ MSG_INFO("SIM Index for Setting CB Option = 0, Setting for CB_RECEIVE success");
+ return MSG_SUCCESS;
+ }
- memset(keyName, 0x00, sizeof(keyName));
- snprintf(keyName, sizeof(keyName), "%s/%d", CB_MAX_SIM_COUNT, simIndex);
- if (MsgSettingGetInt(keyName, &iValue) != MSG_SUCCESS) {
- MSG_INFO("MsgSettingGetInt() is failed");
- }
- if (iValue != cbOpt.maxSimCnt) {
- if (MsgSettingSetInt(keyName, cbOpt.maxSimCnt) != MSG_SUCCESS) {
- MSG_ERR("Error to set config data [%s]", keyName);
- return MSG_ERR_SET_SETTING;
+ memset(keyName, 0x00, sizeof(keyName));
+ snprintf(keyName, sizeof(keyName), "%s/%d", CB_MAX_SIM_COUNT, simIndex);
+ if (MsgSettingGetInt(keyName, &iValue) != MSG_SUCCESS) {
+ MSG_INFO("MsgSettingGetInt() is failed");
+ }
+
+ if (iValue != cbOpt.maxSimCnt) {
+ if (MsgSettingSetInt(keyName, cbOpt.maxSimCnt) != MSG_SUCCESS) {
+ MSG_ERR("Error to set config data [%s]", keyName);
+ return MSG_ERR_SET_SETTING;
+ }
}
}
-#endif
MsgDbHandler *dbHandle = getDbHandle();
- err = MsgStoAddCBChannelInfo(dbHandle, &cbOpt.channelData, simIndex);
+
+ if (CDMASupported == false) {
+ err = MsgStoAddCBChannelInfo(dbHandle, &cbOpt.channelData, simIndex);
+ } else {
+ err = MsgStoAddCBChannelInfo(dbHandle, &cbOpt.channelData);
+ }
MSG_DEBUG("MsgStoAddCBChannelInfo : err=[%d]", err);
-#ifndef FEATURE_SMS_CDMA
- if (bSetSim == true) {
- for (int i = MSG_CBLANG_TYPE_ALL; i < MSG_CBLANG_TYPE_MAX; i++) {
- memset(keyName, 0x00, sizeof(keyName));
- snprintf(keyName, DEF_BUF_LEN, "%s/%d", CB_LANGUAGE, i);
+ if (CDMASupported == false) {
+ if (bSetSim == true) {
+ for (int i = MSG_CBLANG_TYPE_ALL; i < MSG_CBLANG_TYPE_MAX; i++) {
+ memset(keyName, 0x00, sizeof(keyName));
+ snprintf(keyName, DEF_BUF_LEN, "%s/%d", CB_LANGUAGE, i);
- if (MsgSettingSetBool(keyName, cbOpt.bLanguage[i]) != MSG_SUCCESS) {
- MSG_ERR("Error to set config data [%s]", keyName);
- return MSG_ERR_SET_SETTING;
+ if (MsgSettingSetBool(keyName, cbOpt.bLanguage[i]) != MSG_SUCCESS) {
+ MSG_ERR("Error to set config data [%s]", keyName);
+ return MSG_ERR_SET_SETTING;
+ }
}
}
}
-#endif
return err;
}
memset(&(pSetting->option.cbMsgOpt), 0x00, sizeof(MSG_CBMSG_OPT_S));
+ bool CDMASupported = MsgCheckFeatureSupport(MSG_TELEPHONY_CDMA_FEATURE);
+
MSG_DEBUG("Sim index = [%d]", simIndex);
/* Keep simIndex */
return;
}
-#ifndef FEATURE_SMS_CDMA
- memset(keyName, 0x00, sizeof(keyName));
- snprintf(keyName, sizeof(keyName), "%s/%d", CB_MAX_SIM_COUNT, simIndex);
- if (MsgSettingGetInt(keyName, &(pSetting->option.cbMsgOpt.maxSimCnt)) != MSG_SUCCESS)
- MSG_INFO("MsgSettingGetInt() is failed");
-
-#endif
-
- err = MsgStoGetCBChannelInfo(dbHandle, &pSetting->option.cbMsgOpt.channelData, simIndex);
+ if (!CDMASupported) {
+ memset(keyName, 0x00, sizeof(keyName));
+ snprintf(keyName, sizeof(keyName), "%s/%d", CB_MAX_SIM_COUNT, simIndex);
+ if (MsgSettingGetInt(keyName, &(pSetting->option.cbMsgOpt.maxSimCnt)) != MSG_SUCCESS) {
+ MSG_ERR("MsgSettingGetInt() is failed");
+ }
- if (err != MSG_SUCCESS)
- MSG_ERR("MsgStoGetCBChannelInfo : err=[%d]", err);
+ err = MsgStoGetCBChannelInfo(dbHandle, &pSetting->option.cbMsgOpt.channelData, simIndex);
+ if (err != MSG_SUCCESS) {
+ MSG_ERR("MsgStoGetCBChannelInfo : err=[%d]", err);
+ }
-#ifndef FEATURE_SMS_CDMA
- for (int i = MSG_CBLANG_TYPE_ALL; i < MSG_CBLANG_TYPE_MAX; i++) {
- memset(keyName, 0x00, sizeof(keyName));
- snprintf(keyName, DEF_BUF_LEN, "%s/%d", CB_LANGUAGE, i);
+ for (int i = MSG_CBLANG_TYPE_ALL; i < MSG_CBLANG_TYPE_MAX; i++) {
+ memset(keyName, 0x00, sizeof(keyName));
+ snprintf(keyName, DEF_BUF_LEN, "%s/%d", CB_LANGUAGE, i);
- if (MsgSettingGetBool(keyName, &pSetting->option.cbMsgOpt.bLanguage[i]) != MSG_SUCCESS)
- MSG_INFO("MsgSettingGetBool() is failed");
+ if (MsgSettingGetBool(keyName, &pSetting->option.cbMsgOpt.bLanguage[i]) != MSG_SUCCESS) {
+ MSG_ERR("MsgSettingGetBool() is failed");
+ }
+ }
+ } else {
+ err = MsgStoGetCBChannelInfo(dbHandle, &pSetting->option.cbMsgOpt.channelData);
+ if (err != MSG_SUCCESS) {
+ MSG_ERR("MsgStoGetCBChannelInfo : err=[%d]", err);
+ }
}
-#endif
}
#include "MsgNotificationWrapper.h"
#include "MsgDevicedWrapper.h"
#include "MsgTransManager.h"
+#include "MsgUtilFunction.h"
using namespace std;
MsgRefreshAllNotification(true, false, MSG_ACTIVE_NOTI_TYPE_NONE);
- if (bRead == true) {
-#ifndef FEATURE_SMS_CDMA
+ bool CDMASupported = MsgCheckFeatureSupport(MSG_TELEPHONY_CDMA_FEATURE);
+
+ if (bRead == true && !CDMASupported) {
/* Get STORAGE_ID */
memset(sqlQuery, 0x00, sizeof(sqlQuery));
snprintf(sqlQuery, sizeof(sqlQuery), "SELECT STORAGE_ID FROM %s WHERE MSG_ID = %d;",
}
dbHandle->finalizeQuery();
}
-#endif
}
return MSG_SUCCESS;
char sqlQuery[MAX_QUERY_LEN+1];
MsgDbHandler *dbHandle = getDbHandle();
+ bool CDMASupported = MsgCheckFeatureSupport(MSG_TELEPHONY_CDMA_FEATURE);
/* delete report notification */
char tempAddr[MAX_ADDRESS_VAL_LEN+1];
memset(tempAddr, 0x00, sizeof(tempAddr));
dbHandle->beginTrans();
-#ifndef FEATURE_SMS_CDMA
/* Check sim message */
- if (storageId == MSG_STORAGE_SIM) {
+ if (!CDMASupported && storageId == MSG_STORAGE_SIM) {
msg_sim_id_t simMsgId;
msg_sim_slot_id_t sim_idx;
dbHandle->finalizeQuery();
}
-#endif
/* each type has to be handled in plug in ? */
if (msgType.mainType == MSG_SMS_TYPE) {
memset(sqlQuery, 0x00, sizeof(sqlQuery));
return MSG_ERR_DB_EXEC;
}
-#ifdef FEATURE_SMS_CDMA
- memset(sqlQuery, 0x00, sizeof(sqlQuery));
- snprintf(sqlQuery, sizeof(sqlQuery), "DELETE FROM %s WHERE MSG_ID = %d;", MSGFW_UNIQUENESS_INFO_TABLE_NAME, msgId);
+ if (CDMASupported == true) {
+ memset(sqlQuery, 0x00, sizeof(sqlQuery));
+ snprintf(sqlQuery, sizeof(sqlQuery), "DELETE FROM %s WHERE MSG_ID = %d;", MSGFW_UNIQUENESS_INFO_TABLE_NAME, msgId);
- /* Delete Message from uniqueness table */
- if (dbHandle->execQuery(sqlQuery) != MSG_SUCCESS) {
- dbHandle->endTrans(false);
- return MSG_ERR_DB_EXEC;
+ /* Delete Message from uniqueness table */
+ if (dbHandle->execQuery(sqlQuery) != MSG_SUCCESS) {
+ dbHandle->endTrans(false);
+ return MSG_ERR_DB_EXEC;
+ }
}
-#endif
if (convId > 0) {
/* Clear Conversation table */
queue<msg_thread_id_t> threadList, threadList2;
-#ifdef FEATURE_SMS_CDMA
- const char *tableList[] = {MSGFW_PUSH_MSG_TABLE_NAME, MSGFW_CB_MSG_TABLE_NAME,
- MSGFW_SYNCML_MSG_TABLE_NAME, MSGFW_SMS_SENDOPT_TABLE_NAME,
- MMS_PLUGIN_MESSAGE_TABLE_NAME, MSGFW_MMS_PREVIEW_TABLE_NAME,
- MSGFW_REPORT_TABLE_NAME, MSGFW_MESSAGE_TABLE_NAME,
- MSGFW_MMS_RECIPIENTS_TABLE_NAME, MSGFW_UNIQUENESS_INFO_TABLE_NAME,
- MSGFW_SENTFAIL_INDEX_TABLE_NAME};
-#else
- const char *tableList[] = {MSGFW_PUSH_MSG_TABLE_NAME, MSGFW_CB_MSG_TABLE_NAME,
- MSGFW_SYNCML_MSG_TABLE_NAME, MSGFW_SMS_SENDOPT_TABLE_NAME,
- MMS_PLUGIN_MESSAGE_TABLE_NAME, MSGFW_MMS_PREVIEW_TABLE_NAME,
- MSGFW_REPORT_TABLE_NAME, MSGFW_MESSAGE_TABLE_NAME,
- MSGFW_MMS_RECIPIENTS_TABLE_NAME, MSGFW_SENTFAIL_INDEX_TABLE_NAME};
-#endif
+ const char *tableList[] = { MSGFW_PUSH_MSG_TABLE_NAME, MSGFW_CB_MSG_TABLE_NAME, MSGFW_SYNCML_MSG_TABLE_NAME,
+ MSGFW_SMS_SENDOPT_TABLE_NAME,
+ MMS_PLUGIN_MESSAGE_TABLE_NAME, MSGFW_MMS_PREVIEW_TABLE_NAME,
+ MSGFW_REPORT_TABLE_NAME, MSGFW_MESSAGE_TABLE_NAME,
+ MSGFW_MMS_RECIPIENTS_TABLE_NAME, MSGFW_UNIQUENESS_INFO_TABLE_NAME,
+ MSGFW_SENTFAIL_INDEX_TABLE_NAME};
- int listCnt = sizeof(tableList)/sizeof(char *);
+ int listCnt = sizeof(tableList) / sizeof(char *);
int rowCnt = 0;
MsgDbHandler *dbHandle = getDbHandle();
signed char folder_id;
queue<msg_thread_id_t> threadList1, threadList2, threadList3;
-#ifdef FEATURE_SMS_CDMA
const char *tableList[] = {MMS_PLUGIN_MESSAGE_TABLE_NAME, MSGFW_MMS_PREVIEW_TABLE_NAME,
MSGFW_PUSH_MSG_TABLE_NAME, MSGFW_CB_MSG_TABLE_NAME,
MSGFW_SYNCML_MSG_TABLE_NAME, MSGFW_SMS_SENDOPT_TABLE_NAME,
MSGFW_SMS_REPORT_TABLE_NAME, MSGFW_MMS_MULTIPART_TABLE_NAME,
MSGFW_MMS_RECIPIENTS_TABLE_NAME, MSGFW_UNIQUENESS_INFO_TABLE_NAME,
MSGFW_SENTFAIL_INDEX_TABLE_NAME};
-#else
- const char *tableList[] = {MMS_PLUGIN_MESSAGE_TABLE_NAME, MSGFW_MMS_PREVIEW_TABLE_NAME,
- MSGFW_PUSH_MSG_TABLE_NAME, MSGFW_CB_MSG_TABLE_NAME,
- MSGFW_SYNCML_MSG_TABLE_NAME, MSGFW_SMS_SENDOPT_TABLE_NAME,
- MSGFW_REPORT_TABLE_NAME, MSGFW_MESSAGE_TABLE_NAME,
- MSGFW_SMS_REPORT_TABLE_NAME, MSGFW_MMS_MULTIPART_TABLE_NAME,
- MSGFW_MMS_RECIPIENTS_TABLE_NAME, MSGFW_SENTFAIL_INDEX_TABLE_NAME};
-#endif
int listCnt = sizeof(tableList)/sizeof(char *);
int rowCnt = 0;
break;
default: { /* Moving message to memory (when destination storage id is MSG_STORAGE_PHONE) */
-#ifndef FEATURE_SMS_CDMA
+ bool CDMASupported = MsgCheckFeatureSupport(MSG_TELEPHONY_CDMA_FEATURE);
+ if (!CDMASupported) {
bool bSimMsg = false;
int rowCnt = 0;
dbHandle->endTrans(true);
}
-#endif
}
- break;
+ }
+ break;
}
return MSG_SUCCESS;
return pMsg->msgId;
}
-#ifdef FEATURE_SMS_CDMA
+
msg_error_t MsgCheckUniqueness(bool bInsert, msg_message_id_t msgId, MSG_UNIQUE_INDEX_S *p_msg)
{
MSG_BEGIN();
return MSG_SUCCESS;
}
-#endif
+
msg_error_t MsgStoUpdateIMSI(int sim_idx)
{
delete [] (char*)msgIdList.msgIdList;
}
-#ifdef FEATURE_SMS_CDMA
eventSize = MsgMakeEvent(&msgInfo.msgId, sizeof(msg_message_id_t), MSG_EVENT_PLG_INCOMING_MSG_IND, err, (void**)ppEvent);
-#else
- eventSize = MsgMakeEvent(NULL, 0, MSG_EVENT_PLG_INCOMING_MSG_IND, err, (void**)ppEvent);
-#endif
if (msgInfo.bTextSms == false) {
MsgDeleteFile(msgInfo.msgData); /*ipc */
return eventSize;
}
-#ifdef FEATURE_SMS_CDMA
int MsgCheckUniquenessHandler(const MSG_CMD_S *pCmd, char **ppEvent)
{
MSG_BEGIN();
return eventSize;
}
-#endif
handlerMap[MSG_CMD_PLG_SENT_STATUS_CNF] = &MsgSentStatusHandler;
handlerMap[MSG_CMD_PLG_STORAGE_CHANGE_IND] = &MsgStorageChangeHandler;
- handlerMap[MSG_CMD_PLG_THREAD_CHANGE_IND] = &MsgThreadChangeHandler;
+ handlerMap[MSG_CMD_PLG_THREAD_CHANGE_IND] = &MsgThreadChangeHandler;
handlerMap[MSG_CMD_PLG_INCOMING_MSG_IND] = &MsgIncomingMsgHandler;
handlerMap[MSG_CMD_PLG_INCOMING_MMS_CONF] = &MsgIncomingMMSConfMsgHandler;
handlerMap[MSG_CMD_PLG_INCOMING_PUSH_IND] = &MsgIncomingPushMsgHandler;
handlerMap[MSG_CMD_DELETE_MESSAGE_BY_LIST] = &MsgDeleteMessageByListHandler;
handlerMap[MSG_CMD_ADD_SIM_MSG] = &MsgAddSimMessageHandler;
handlerMap[MSG_CMD_PLG_RESEND_MESSAGE] = &MsgResendMessageHandler;
-#ifdef FEATURE_SMS_CDMA
handlerMap[MSG_CMD_PLG_CHECK_UNIQUENESS] = &MsgCheckUniquenessHandler;
-#endif
handlerMap[MSG_CMD_UPDATE_IMSI] = &MsgUpdateIMSIHandler;
handlerMap[MSG_CMD_ALLOW_TCS_MESSAGE] = &MsgAllowTcsMessageHandler;
}
MSG_CMD_REG_REPORT_MSG_INCOMING_CB,
MSG_CMD_UPDATE_IMSI,
MSG_CMD_SET_TEMP_ADDRESS_TABLE,
-
-#ifdef FEATURE_SMS_CDMA
+/* 85 */
MSG_CMD_PLG_CHECK_UNIQUENESS,
-#endif
MSG_CMD_ALLOW_TCS_MESSAGE,
MSG_CMD_CHECK_PERMISSION,
MSG_EVENT_REG_REPORT_MSG_INCOMING_CB,
MSG_EVENT_UPDATE_IMSI,
MSG_EVENT_SET_TEMP_ADDRESS_TABLE,
-
-#ifdef FEATURE_SMS_CDMA
+/* 85 */
MSG_EVENT_PLG_CHECK_UNIQUENESS,
-#endif
MSG_EVENT_ALLOW_TCS_MESSAGE,
MSG_EVENT_CHECK_PERMISSION,
MSG_EVENT_REG_THREAD_CHANGE_CB,
#define DEFAULT_SETTING_PATH "db/private/msg-service"
#define DEFAULT_MSG_MEMORY_PATH "memory/private/msg-service"
-#ifdef FEATURE_SMS_CDMA
#define MSG_SIM_IMSI DEFAULT_MSG_MEMORY_PATH"/sim_imsi"
-#endif
+
#define MSG_SIM_SUBS_ID DEFAULT_MSG_MEMORY_PATH"/sim_subs_id"
#define MSG_SIM_CHANGED DEFAULT_MSG_MEMORY_PATH"/sim_changed"
#define SIM_USED_COUNT DEFAULT_SIM_COUNT_PATH"/used_cnt"
#define SIM_TOTAL_COUNT DEFAULT_SIM_COUNT_PATH"/total_cnt"
-#ifdef FEATURE_SMS_CDMA
#define MSG_MESSAGE_ID_COUNTER DEFAULT_GENERAL_OPT_PATH"/msg_id_counter"
-#endif
#define MSG_MESSAGE_DURING_CALL DEFAULT_GENERAL_OPT_PATH"/during_call"
#define MSG_DEFAULT_APP_ID "org.tizen.message"
#define MSG_TELEPHONY_SMS_FEATURE "http://tizen.org/feature/network.telephony.sms"
#define MSG_TELEPHONY_MMS_FEATURE "http://tizen.org/feature/network.telephony.mms"
+#define MSG_TELEPHONY_CDMA_FEATURE "http://tizen.org/feature/network.telephony.service.cdma"
#define MSG_TCS_MESSAGE "tcs_message"
msg_message_id_t msgId; /* Message Id of MSG_MESSAGE_TABLE */
} MSG_CB_MSG_S;
-#ifdef FEATURE_SMS_CDMA
typedef struct _MSG_UNIQUE_INDEX_S {
unsigned short tele_msgId;
char address[MAX_ADDRESS_VAL_LEN+1];
unsigned short serialNum;
unsigned short messageId; /**< Message Identifier */
} MSG_CB_DUPLICATE_S;
-#endif
/*==================================================================================================
*
*/
/*================================================================================================*/
-#ifdef FEATURE_SMS_CDMA
-typedef msg_error_t (*MsgPlgDeleteSimMessage)(msg_sim_id_t SimMsgId);
-#else
typedef msg_error_t (*MsgPlgDeleteSimMessage)(msg_sim_slot_id_t sim_idx, msg_sim_id_t SimMsgId);
-#endif
/**
*
*/
/*================================================================================================*/
-#ifdef FEATURE_SMS_CDMA
-typedef msg_error_t (*MsgPlgSetReadStatus)(msg_sim_id_t SimMsgId);
-#else
typedef msg_error_t (*MsgPlgSetReadStatus)(msg_sim_slot_id_t sim_idx, msg_sim_id_t SimMsgId);
-#endif
/**
*
*/
/*================================================================================================*/
-#ifdef FEATURE_SMS_CDMA
-typedef msg_error_t (*MsgPlgSetMemoryStatus)(msg_error_t Error);
-#else
typedef msg_error_t (*MsgPlgSetMemoryStatus)(msg_sim_slot_id_t sim_idx, msg_error_t Error);
-#endif
/* Setting API */
/**
typedef msg_error_t (*MsgPlgOnMmsConfIncoming)(MSG_MESSAGE_INFO_S *pMsgInfo, msg_request_id_t *pRequest);
typedef msg_error_t (*MsgPlgOnSimMessageIncoming)(MSG_MESSAGE_INFO_S *pMsgInfo, int *simIdList, msg_message_id_t *retMsgId, int listSize);
typedef msg_error_t (*MsgPlgOnResendMessage)(void);
-#ifdef FEATURE_SMS_CDMA
typedef bool (*MsgPlgCheckUniqueness)(MSG_UNIQUE_INDEX_S *p_msg, msg_message_id_t msgId, bool ischecked);
-#endif
typedef msg_error_t (*MsgPlgOnInitImsi)(int sim_idx);
/*==================================================================================================
MsgPlgOnMmsConfIncoming pfMmsConfIncomingCb; /** The function pointer of receive MMS conf */
MsgPlgOnSimMessageIncoming pfSimMsgIncomingCb; /** The function pointer of sim message callback */
MsgPlgOnResendMessage pfResendMessageCb;
-#ifdef FEATURE_SMS_CDMA
MsgPlgCheckUniqueness pfCheckUniquenessCb;
-#endif
MsgPlgOnInitImsi pfSimInitImsiCb;
};
char prefix[MAX_DISPLAY_NAME_LEN+1]; /**< Indicates the prefix of contact. */
char suffix[MAX_DISPLAY_NAME_LEN+1]; /**< Indicates the suffix of contact. */
char imagePath[MAX_IMAGE_PATH_LEN+1]; /**< Indicates the image path of contact. */
- char alerttonePath[MSG_FILEPATH_LEN_MAX+1]; /**< Indicates the message alert tone path of contact. */
- char vibrationPath[MSG_FILEPATH_LEN_MAX+1]; /**< Indicates the vibration path of contact. */
+ char alerttonePath[MSG_FILEPATH_LEN_MAX+1]; /**< Indicates the message alert tone path of contact. */
+ char vibrationPath[MSG_FILEPATH_LEN_MAX+1]; /**< Indicates the vibration path of contact. */
} MSG_CONTACT_INFO_S;
int MsgResendMessageHandler(const MSG_CMD_S *pCmd, char **ppEvent);
int MsgUpdateIMSIHandler(const MSG_CMD_S *pCmd, char **ppEvent);
int MsgAllowTcsMessageHandler(const MSG_CMD_S *pCmd, char **ppEvent);
-#ifdef FEATURE_SMS_CDMA
int MsgCheckUniquenessHandler(const MSG_CMD_S *pCmd, char **ppEvent);
-#endif
#endif /* MSG_CMD_HANDLER_H */
msg_error_t registerListener(MSG_PLUGIN_LISTENER_S *pListener);
msg_error_t saveSimMessage(MSG_MESSAGE_INFO_S *pMsgInfo, SMS_SIM_ID_LIST_S *pSimIdList);
-#ifndef FEATURE_SMS_CDMA
+
msg_error_t deleteSimMessage(msg_sim_slot_id_t sim_idx, msg_sim_id_t SimMsgId);
msg_error_t setReadStatus(msg_sim_slot_id_t sim_idx, msg_sim_id_t SimMsgId);
msg_error_t setMemoryStatus(msg_sim_slot_id_t sim_idx, msg_error_t Error);
-#else
- msg_error_t deleteSimMessage(msg_sim_id_t SimMsgId);
- msg_error_t setReadStatus(msg_sim_id_t SimMsgId);
- msg_error_t setMemoryStatus(msg_error_t Error);
-#endif
+
msg_error_t setConfigData(const MSG_SETTING_S *pSetting);
msg_error_t getConfigData(MSG_SETTING_S *pSetting);
msg_error_t MsgStoAddCBMsg(MSG_MESSAGE_INFO_S *pMsgInfo);
msg_error_t MsgStoCheckPushMsgValidation(MSG_PUSH_MESSAGE_S *pPushMsg, bool *pbProceed);
msg_error_t MsgStoUpdateAllAddress();
-#ifdef FEATURE_SMS_CDMA
msg_error_t MsgCheckUniqueness(bool bInsert, msg_message_id_t msgId, MSG_UNIQUE_INDEX_S *p_msg);
-#endif
msg_error_t MsgStoUpdateIMSI(int sim_idx);
msg_error_t MsgStoAllowTcsMessage(msg_message_id_t msgId);
msg_error_t MsgStoUpdateDPMRestrictedStatus(MSG_MAIN_TYPE_T msgType);
MSG_ENCODE_AUTO, /**< The string encoding type is AUTO */
MSG_ENCODE_GSM7BIT_ABNORMAL, /**< The string encoding type is GSM7BIT, but abnormal character included */
-#ifdef FEATURE_SMS_CDMA
+
MSG_ENCODE_EUCKR, /**< For EUC-KR(Korean) */
MSG_ENCODE_SHIFT_JIS, /**< For Shift-JIS(Japanese) */
MSG_ENCODE_ASCII7BIT, /**< the string encoding type is ASCII 7 BIT */
-#endif
};
} \
} while (0)
+#define MSG_ERR_M(expr, fmt, ...)\
+ do { \
+ if (expr) {\
+ MSG_ERR(fmt, ##__VA_ARGS__);\
+ } \
+ } while (0)
+
/*profile log macros*/
#define MSG_PROFILE_BEGIN(pfid) \
unsigned int __prf_l1_##pfid = __LINE__;\
#endif
#define MSGFW_CB_CHANNEL_INFO_TABLE_NAME "MSG_CB_CHANNEL_INFO_TABLE"
-#ifdef FEATURE_SMS_CDMA
#define MSGFW_CDMA_CB_CHANNEL_INFO_TABLE_NAME "MSG_CDMA_CB_CHANNEL_INFO_TABLE"
-#endif
#define MSGFW_SMS_SENDOPT_TABLE_NAME "MSG_SMS_SENDOPT_TABLE"
#define MSGFW_SMS_REPORT_TABLE_NAME "MSG_SMS_REPORT_TABLE"
#define MSGFW_MMS_MULTIPART_TABLE_NAME "MSG_MULTIPART_TABLE"
#define MSGFW_MMS_RECIPIENTS_TABLE_NAME "MSG_MMS_RECIPIENTS_TABLE"
-#ifdef FEATURE_SMS_CDMA
#define MSGFW_UNIQUENESS_INFO_TABLE_NAME "MSG_UNIQUENESS_INFO_TABLE"
-#endif
#define MSGFW_TMP_MSGID_TABLE_NAME "MSG_TMP_MSGID_TABLE"
INCLUDE FILES
==================================================================================================*/
#include <map>
+#include "msg_types.h"
/*==================================================================================================
int convertUTF8ToGSM7bit(OUT unsigned char *pDestText, IN int maxLength, IN const unsigned char *pSrcText, IN int srcTextLen, OUT MSG_LANGUAGE_ID_T *pLangId, OUT bool *bIncludeAbnormalChar);
int convertUTF8ToUCS2(OUT unsigned char *pDestText, IN int maxLength, IN const unsigned char *pSrcText, IN int srcTextLen);
- int convertUTF8ToAuto(OUT unsigned char *pDestText, IN int maxLength, IN const unsigned char *pSrcText, IN int srcTextLen, OUT msg_encode_type_t *pCharType);
+ int convertUTF8ToAuto(OUT unsigned char *pDestText, IN int maxLength, IN const unsigned char *pSrcText, IN int srcTextLen, IN msg_encode_type_t defaultEncodingType, OUT msg_encode_type_t *pCharType);
int convertGSM7bitToUTF8(OUT unsigned char *pDestText, IN int maxLength, IN const unsigned char *pSrcText, IN int srcTextLen, IN MSG_LANG_INFO_S *pLangInfo);
int convertUCS2ToUTF8(OUT unsigned char *pDestText, IN int maxLength, IN const unsigned char *pSrcText, IN int srcTextLen);
~MsgTextConvert();
int convertUCS2ToGSM7bit(OUT unsigned char *pDestText, IN int maxLength, IN const unsigned char *pSrcText, IN int srcTextLen, OUT MSG_LANGUAGE_ID_T *pLangId, OUT bool *bIncludeAbnormalChar);
-#ifndef FEATURE_SMS_CDMA
int convertUCS2ToGSM7bitAuto(OUT unsigned char *pDestText, IN int maxLength, IN const unsigned char *pSrcText, IN int srcTextLen, OUT bool *pUnknown);
-#else
int convertUCS2ToASCII(OUT unsigned char *pDestText, IN int maxLength, IN const unsigned char *pSrcText, IN int srcTextLen, OUT bool *pUnknown);
-#endif
int convertGSM7bitToUCS2(OUT unsigned char *pDestText, IN int maxLength, IN const unsigned char *pSrcText, IN int srcTextLen, IN MSG_LANG_INFO_S *pLangInfo);
msg_thread_id_t MsgGetThreadId(MsgDbHandler *pDbHandle, msg_message_id_t msgId);
-#ifdef FEATURE_SMS_CDMA
msg_error_t MsgStoAddCBChannelInfo(MsgDbHandler *pDbHandle, MSG_CB_CHANNEL_S *pCBChannel);
msg_error_t MsgStoGetCBChannelInfo(MsgDbHandler *pDbHandle, MSG_CB_CHANNEL_S *pCBChannel);
-#else
msg_error_t MsgStoAddCBChannelInfo(MsgDbHandler *pDbHandle, MSG_CB_CHANNEL_S *pCBChannel, msg_sim_slot_id_t simIndex);
msg_error_t MsgStoGetCBChannelInfo(MsgDbHandler *pDbHandle, MSG_CB_CHANNEL_S *pCBChannel, msg_sim_slot_id_t simIndex);
-#endif
bool MsgExistAddress(MsgDbHandler *pDbHandle, const MSG_MESSAGE_INFO_S *pMsg, msg_thread_id_t *pConvId);
bool MsgExistAddress(MsgDbHandler *pDbHandle, MSG_MESSAGE_INFO_S *pMsg, msg_thread_id_t convId, int index);
msg_error_t MsgStoDbSelectWithQuery(const char *query, char ***db_res, int *row_count, int *col_count);
void MsgStoDbFree(char **db_res);
-#ifdef FEATURE_SMS_CDMA
msg_error_t MsgStoClearUniquenessTable();
-#endif
-
#endif /* MSG_UTIL_STORAGE_H */
if (msg_text == NULL || text_size == NULL || segment_size == NULL || msg_encode_type_in == NULL)
return MSG_ERR_INVALID_PARAMETER;
-#ifdef FEATURE_SMS_CDMA
if (msg_encode_type_to > MSG_ENCODE_ASCII7BIT) {
-#else
- if (msg_encode_type_to > MSG_ENCODE_GSM7BIT_ABNORMAL) {
-#endif
MSG_FATAL("unsupported msg_encode_type [%d]", msg_encode_type_to);
return MSG_ERR_INVALID_PARAMETER;
}
case MSG_ENCODE_UCS2:
decodeLen = textCvt->convertUTF8ToUCS2(decodeData, bufSize, (const unsigned char*)msg_text, textSize);
break;
- case MSG_ENCODE_AUTO:
- decodeLen = textCvt->convertUTF8ToAuto(decodeData, bufSize, (const unsigned char*)msg_text, textSize, &encodeType);
- break;
+ case MSG_ENCODE_AUTO: {
+ msg_encode_type_t defaultEncodingType = MSG_ENCODE_GSM7BIT;
+ bool CDMASupported = MsgCheckFeatureSupport(MSG_TELEPHONY_CDMA_FEATURE);
+ if (CDMASupported) {
+ defaultEncodingType = MSG_ENCODE_ASCII7BIT;
+ }
+ decodeLen = textCvt->convertUTF8ToAuto(decodeData, bufSize, (const unsigned char*)msg_text, textSize, defaultEncodingType, &encodeType);
+ }
+ break;
default:
return MSG_ERR_INVALID_PARAMETER;
}
}
*msg_encode_type_in = MSG_ENCODE_UCS2;
-#ifdef FEATURE_SMS_CDMA
} else if (encodeType == MSG_ENCODE_ASCII7BIT) {
MSG_DEBUG("MSG_ENCODE_ASCII7BIT");
segSize = 160;
*msg_encode_type_in = MSG_ENCODE_GSM7BIT;
-#endif
-
} else {
MSG_DEBUG("Unsupported encode type.");
err = MSG_ERR_INVALID_PARAMETER;
#include <stdlib.h>
#include <time.h>
#include <curl/curl.h>
+#include "MsgUtilFunction.h"
#include "MmsPluginDebug.h"
#include "MmsPluginHttp.h"
#include "MmsPluginUserAgent.h"
static void __http_print_profile(CURL *curl);
static int __http_debug_cb(CURL *input_curl, curl_infotype input_info_type, char *input_data, size_t input_size, void *input_void);
-
static void __httpAllocHeaderInfo(curl_slist **responseHeaders, char *szUrl, int ulContentLen);
static bool __httpGetHeaderField(MMS_HTTP_HEADER_FIELD_T httpHeaderItem, char *szHeaderBuffer);
static void __httpGetHost(char *szUrl, char *szHost, int nBufferLen);
if (nResult) {
snprintf(pcheader, HTTP_REQUEST_LEN, "Accept-Encoding: %s", szBuffer);
MSG_DEBUG("%s", pcheader);
- *responseHeaders = curl_slist_append(*responseHeaders, pcheader);
+ *responseHeaders = curl_slist_append(*responseHeaders, pcheader);
}
*/
memset(szBuffer, 0, 1025);
*responseHeaders = curl_slist_append(*responseHeaders, pcheader);
}
-#if defined(FEATURE_SMS_CDMA)
- memset(szBuffer, 0, 1025);
- memset(pcheader, 0, HTTP_REQUEST_LEN);
- nResult = __httpGetHeaderField(MMS_HH_MDN, szBuffer);
+ bool CDMASupported = MsgCheckFeatureSupport(MSG_TELEPHONY_CDMA_FEATURE);
+ if (CDMASupported) {
+ memset(szBuffer, 0, 1025);
+ memset(pcheader, 0, HTTP_REQUEST_LEN);
+ nResult = __httpGetHeaderField(MMS_HH_MDN, szBuffer);
+ }
/* TODO : if it needs to check http header mdn value, add code to below. */
-#endif
if (ulContentLen > 0) /* if post transaction then Disable 'Expect: 100-contine' option */
*responseHeaders = curl_slist_append(*responseHeaders, "Expect:");
bool result;
result = false;
+ bool CDMASupported = MsgCheckFeatureSupport(MSG_TELEPHONY_CDMA_FEATURE);
if (szHeaderBuffer != NULL) {
switch (httpHeaderItem) {
case MMS_HH_CONTENT_TYPE:
snprintf((char *)szHeaderBuffer, 1024, "%s", MSG_MMS_HH_CONTENT_TYPE);
result = true;
break;
-
case MMS_HH_ACCEPT:
snprintf((char *)szHeaderBuffer, 1024, "%s", MSG_MMS_HH_ACCEPT);
result = true;
case MMS_HH_ACCEPT_CHARSET:
snprintf((char *)szHeaderBuffer, 1024, "%s", MSG_MMS_HH_CHARSET);
-#if defined(FEATURE_SMS_CDMA)
- result = false;
-#else
- result = true;
-#endif
+ if (CDMASupported) {
+ result = false;
+ } else {
+ result = true;
+ }
break;
case MMS_HH_ACCEPT_LANGUAGE:
snprintf((char *)szHeaderBuffer, 1024, "%s", MSG_MMS_HH_LANGUAGE);
result = true;
break;
-
case MMS_HH_ACCEPT_ENCODING:
snprintf((char *)szHeaderBuffer, 1024, "%s", MSG_MMS_HH_ENCODING);
result = true;
break;
-
case MMS_HH_USER_AGENT: {
-#if 0
- char szUserAgent[1024 + 1];
- char *uagent = NULL;
-
- if (MsgSettingGetString(VCONFKEY_BROWSER_USER_AGENT, &uagent) != MSG_SUCCESS) {
- MSG_INFO("MsgSettingGetString() is failed");
- }
-
- if (uagent && strlen(uagent) > 0) {
- MSG_SEC_INFO("Get UserAgent : %s = %s", VCONFKEY_BROWSER_USER_AGENT, uagent);
- memset(szUserAgent, 0x00, sizeof(szUserAgent));
- MmsRemoveMarkup(uagent, szUserAgent, sizeof(szUserAgent));
- } else {
- memset(szUserAgent, 0x00, sizeof(szUserAgent));
- MSG_SEC_INFO("Get Default UserAgent : %s", MSG_MMS_HH_USER_AGENT);
- snprintf(szUserAgent, 1024, "%s", MSG_MMS_HH_USER_AGENT);
- }
-
- snprintf((char *)szHeaderBuffer, 1024, "%s", szUserAgent);
- if (uagent) {
- free(uagent);
- uagent = NULL;
- }
-#else
- snprintf((char *)szHeaderBuffer, 1024, "%s", MSG_MMS_HH_USER_AGENT);
-#endif
- result = true;
- }
- break;
+ snprintf((char *)szHeaderBuffer, 1024, "%s", MSG_MMS_HH_USER_AGENT);
+ result = true;
+ }
+ break;
case MMS_HH_UA_PROFILE: {
- char *szUAProfile = NULL;
- if (MsgSettingGetString(MSG_MMS_UA_PROFILE, &szUAProfile) != MSG_SUCCESS) {
- MSG_INFO("MsgSettingGetString() is failed");
- }
+ char *szUAProfile = NULL;
+ if (MsgSettingGetString(MSG_MMS_UA_PROFILE, &szUAProfile) != MSG_SUCCESS) {
+ MSG_INFO("MsgSettingGetString() is failed");
+ }
- snprintf((char *)szHeaderBuffer, 1024, "%s", szUAProfile);
- if (szUAProfile) {
- free(szUAProfile);
- szUAProfile = NULL;
- }
- result = true;
+ snprintf((char *)szHeaderBuffer, 1024, "%s", szUAProfile);
+ if (szUAProfile) {
+ free(szUAProfile);
+ szUAProfile = NULL;
}
- break;
+ result = true;
+ }
+ break;
-#if defined(FEATURE_SMS_CDMA)
case MMS_HH_MDN: {
+ if (CDMASupported) {
/*
char *mdn = NULL;
if (MsgSettingGetString(MSG_SIM_MSISDN, &mdn) != MSG_SUCCESS) {
free(mdn);
mdn = NULL;
}
- break;
-*/
+ */
+ }
+ break;
}
-#endif
default:
MSG_WARN("invalid param [%d]", httpHeaderItem);
break;
MMS_HH_ACCEPT_ENCODING,
MMS_HH_USER_AGENT,
MMS_HH_UA_PROFILE,
-#if defined(FEATURE_SMS_CDMA)
MMS_HH_MDN
-#endif
} MMS_HTTP_HEADER_FIELD_E;
typedef enum _MMS_HTTP_TRANSACTION_TYPE_E {
+++ /dev/null
-CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
-PROJECT(sms-plugin CXX)
-
-SET(CMAKE_SKIP_BUILD_RPATH TRUE)
-
-IF("${CMAKE_BUILD_TYPE}" STREQUAL "")
- SET(CMAKE_BUILD_TYPE "Release")
-ENDIF("${CMAKE_BUILD_TYPE}" STREQUAL "")
-MESSAGE("Build type: ${CMAKE_BUILD_TYPE}")
-
-SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS} ${EXTRA_CFLAGS} -O0 -g -Wall")
-
-##########################################################
-# Define SMS Plugin
-##########################################################
-
-SET(SMS-PLUGIN-SRCS
- ${CMAKE_SOURCE_DIR}/plugin/sms_cdma_plugin/SmsCdmaPluginCallback.cpp
- ${CMAKE_SOURCE_DIR}/plugin/sms_cdma_plugin/SmsCdmaPluginCodec.cpp
- ${CMAKE_SOURCE_DIR}/plugin/sms_cdma_plugin/SmsCdmaPluginEventHandler.cpp
- ${CMAKE_SOURCE_DIR}/plugin/sms_cdma_plugin/SmsCdmaPluginMain.cpp
- ${CMAKE_SOURCE_DIR}/plugin/sms_cdma_plugin/SmsCdmaPluginParamCodec.cpp
- ${CMAKE_SOURCE_DIR}/plugin/sms_cdma_plugin/SmsCdmaPluginStorage.cpp
- ${CMAKE_SOURCE_DIR}/plugin/sms_cdma_plugin/SmsCdmaPluginTransport.cpp
- ${CMAKE_SOURCE_DIR}/plugin/sms_cdma_plugin/SmsCdmaPluginUAManager.cpp
- ${CMAKE_SOURCE_DIR}/plugin/sms_cdma_plugin/SmsCdmaPluginSetting.cpp
- ${CMAKE_SOURCE_DIR}/plugin/sms_cdma_plugin/SmsCdmaPluginWapPushHandler.cpp
-)
-
-INCLUDE_DIRECTORIES(
- ${CMAKE_SOURCE_DIR}/include/mapi
- ${CMAKE_SOURCE_DIR}/include/common
- ${CMAKE_SOURCE_DIR}/include/utils
- ${CMAKE_SOURCE_DIR}/include/externals
- ${CMAKE_CURRENT_SOURCE_DIR}/include
-)
-
-INCLUDE(FindPkgConfig)
-pkg_check_modules(sms_plugin_pkgs REQUIRED glib-2.0 tapi libxml-2.0 libwbxml2 dlog vconf gio-2.0 bundle eventsystem)
-
-FOREACH(flag ${sms_plugin_pkgs_CFLAGS})
- SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
-ENDFOREACH(flag)
-
-SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${EXTRA_CFLAGS}")
-
-ADD_DEFINITIONS("-DPREFIX=\"${CMAKE_INSTALL_PREFIX}\"")
-
-SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed")
-
-ADD_LIBRARY(${SMS-PLUGIN-LIB} SHARED ${SMS-PLUGIN-SRCS})
-TARGET_LINK_LIBRARIES(${SMS-PLUGIN-LIB} ${sms_plugin_pkgs_LDFLAGS} ${UTILS-LIB} ${EXTERNALS-LIB})
-
-IF(_FEATURE_TELEPHONY_ENABLE)
-INSTALL(TARGETS ${SMS-PLUGIN-LIB} LIBRARY DESTINATION ${LIBDIR})
-ENDIF(_FEATURE_TELEPHONY_ENABLE)
-
+++ /dev/null
-/*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd. All rights reserved
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
-*/
-
-#include <errno.h>
-
-#include "MsgDebug.h"
-#include "MsgException.h"
-#include "MsgGconfWrapper.h"
-
-#include "MsgMutex.h"
-#include "SmsCdmaPluginTransport.h"
-#include "SmsCdmaPluginStorage.h"
-#include "SmsCdmaPluginCallback.h"
-#include "SmsCdmaPluginEventHandler.h"
-#include "SmsCdmaPluginUAManager.h"
-#include "SmsCdmaPluginSetting.h"
-#include "SmsCdmaPluginMain.h"
-#include <gio/gio.h>
-#include <tzplatform_config.h>
-
-
-extern "C"
-{
- #include <tapi_common.h>
- #include <TelSms.h>
- #include <TapiUtility.h>
- #include <ITapiSim.h>
- #include <ITapiNetText.h>
-}
-
-#define BUS_NAME "org.tizen.system.storage"
-#define PATH_NAME "/Org/Tizen/System/Storage/Lowmem"
-#define INTERFACE_NAME BUS_NAME".lowmem"
-#define MEMBER_NAME "NeedCleanup"
-#define SIGNAL_VAL "Full"
-
-
-
-struct tapi_handle *pTapiHandle = NULL;
-bool isMemAvailable = true;
-
-GDBusConnection *gdbus_conn = NULL;
-GDBusProxy *gdbus_proxy = NULL;
-gint subs_id = 0;
-
-MsgMutex mx;
-MsgCndVar cv;
-
-
-void MsgResourceMonitorInit(void);
-void MsgResourceMonitorDeinit(void);
-
-/*==================================================================================================
- FUNCTION IMPLEMENTATION
-==================================================================================================*/
-
-static void MsgTapiInitCB(keynode_t *key, void* data)
-{
- MSG_DEBUG("MsgTapiInitCB is called.");
- mx.lock();
- cv.signal();
- mx.unlock();
-}
-
-
-msg_error_t MsgPlgCreateHandle(MSG_PLUGIN_HANDLER_S *pPluginHandle)
-{
- if (pPluginHandle == NULL) {
- MSG_DEBUG("SMS plugin: create handler error ");
- return MSG_ERR_NULL_POINTER;
- } else {
- pPluginHandle->pfInitialize = SmsPlgInitialize;
- pPluginHandle->pfFinalize = SmsPlgFinalize;
- pPluginHandle->pfRegisterListener = SmsPlgRegisterListener;
- pPluginHandle->pfSubmitRequest = SmsPlgSubmitRequest;
- pPluginHandle->pfSaveSimMessage = SmsPlgSaveSimMessage;
- pPluginHandle->pfDeleteSimMessage = SmsPlgDeleteSimMessage;
- pPluginHandle->pfSetReadStatus = SmsPlgSetReadStatus;
- pPluginHandle->pfSetMemoryStatus = SmsPlgSetMemoryStatus;
- pPluginHandle->pfSetConfigData = SmsPlgSetConfigData;
- pPluginHandle->pfGetConfigData = SmsPlgGetConfigData;
- pPluginHandle->pfAddMessage = SmsPlgAddMessage;
-
- MSG_DEBUG("SMS plugin: create handler OK");
- MSG_DEBUG("SMS plugin %p", pPluginHandle);
- }
-
- return MSG_SUCCESS;
-}
-
-
-msg_error_t MsgPlgDestroyHandle(MSG_PLUGIN_HANDLER_S *pPluginHandle)
-{
- if (pPluginHandle != NULL) {
- free(pPluginHandle);
- pPluginHandle = NULL;
- }
-
- MSG_DEBUG("SMS plugin: destory handler OK");
-
- return MSG_SUCCESS;
-}
-
-
-msg_error_t SmsPlgInitialize()
-{
- MSG_BEGIN();
-
- bool bReady = false;
-
- for (int i = 0; i < 100; i++) {
- if (MsgSettingGetBool(VCONFKEY_TELEPHONY_READY, &bReady) != MSG_SUCCESS)
- MSG_INFO("MsgSettingGetBool() is failed");
-
- MSG_DEBUG("Get VCONFKEY_TELEPHONY_READY [%d].", bReady ? 1 : 0);
-
- if (bReady)
- break;
-
- sleep(1);
- }
-
- if (!bReady) {
- MSG_DEBUG("Fail to wait telephony init complete.");
- return MSG_ERR_PLUGIN_TAPIINIT;
- }
-
- pTapiHandle = tel_init(NULL);
-
- if (pTapiHandle) {
- /* register event. */
- SmsPluginCallback::instance()->registerEvent();
-
- /* set sim change status. */
- MSG_DEBUG("Try to initialize SIM on init");
- SmsPluginSetting::instance()->setSimChangeStatus();
-
- /* set resource monitor */
- MsgResourceMonitorInit();
- }
-
- MSG_END();
-
- return MSG_SUCCESS;
-}
-
-
-msg_error_t SmsPlgFinalize()
-{
- MSG_BEGIN();
-
- MsgResourceMonitorDeinit();
-
- if (!pTapiHandle)
- return MSG_ERR_PLUGIN_TAPIINIT;
-
- SmsPluginCallback::instance()->deRegisterEvent();
-
- tel_deinit(pTapiHandle);
-
- MSG_END();
-
- return MSG_SUCCESS;
-}
-
-
-msg_error_t SmsPlgRegisterListener(MSG_PLUGIN_LISTENER_S *pListener)
-{
- MSG_BEGIN();
-
- SmsPluginEventHandler::instance()->registerListener(pListener);
-
- MSG_END();
-
- return MSG_SUCCESS;
-}
-
-
-msg_error_t SmsPlgSubmitRequest(MSG_REQUEST_INFO_S *pReqInfo)
-{
- msg_error_t err = MSG_SUCCESS;
-
- /* Add Submit SMS into DB */
- if (pReqInfo->msgInfo.msgId == 0) {
- if (pReqInfo->msgInfo.msgPort.valid == false) {
- err = SmsPluginStorage::instance()->checkMessage(&(pReqInfo->msgInfo));
-
- if (err != MSG_SUCCESS) {
- MSG_DEBUG("######## checkMessage Fail !! [err=%d]", err);
- return MSG_ERR_PLUGIN_STORAGE;
- }
-
- err = SmsPluginStorage::instance()->addSmsMessage(&(pReqInfo->msgInfo));
- if (err != MSG_SUCCESS) {
- MSG_DEBUG("######## addSmsMessage Fail !! [err=%d]", err);
- return MSG_ERR_PLUGIN_STORAGE;
- }
-
- if (SmsPluginStorage::instance()->addSmsSendOption(&(pReqInfo->msgInfo), &(pReqInfo->sendOptInfo)) != MSG_SUCCESS) {
- MSG_DEBUG("######## addSmsSendOption Fail !!");
- return MSG_ERR_PLUGIN_STORAGE;
- }
- }
- }
-
- sms_request_info_s *request = NULL;
-
- request = (sms_request_info_s *)calloc(1, sizeof(sms_request_info_s));
-
- if (request != NULL) {
- request->reqId = pReqInfo->reqId;
-
- memcpy(&(request->msgInfo), &(pReqInfo->msgInfo), sizeof(MSG_MESSAGE_INFO_S));
- memcpy(&(request->sendOptInfo), &(pReqInfo->sendOptInfo), sizeof(MSG_SENDINGOPT_INFO_S));
-
- /* Add Request into Queue and Start UA Manger */
- SmsPluginUAManager::instance()->addReqEntity(request);
-
- free(request);
- }
-
-
- return MSG_SUCCESS;
-}
-
-
-msg_error_t SmsPlgSaveSimMessage(const MSG_MESSAGE_INFO_S *pMsgInfo, SMS_SIM_ID_LIST_S *pSimIdList)
-{
- MSG_DEBUG("CDMA does not support sim card operations.");
- return MSG_SUCCESS;
-}
-
-
-msg_error_t SmsPlgDeleteSimMessage(msg_sim_id_t SimMsgId)
-{
- MSG_DEBUG("CDMA does not support sim card operations.");
- return MSG_SUCCESS;
-}
-
-
-msg_error_t SmsPlgSetReadStatus(msg_sim_id_t SimMsgId)
-{
- MSG_DEBUG("CDMA does not support sim card operations.");
- return MSG_SUCCESS;
-}
-
-
-msg_error_t SmsPlgSetMemoryStatus(msg_error_t Error)
-{
- int tapiRet = TAPI_API_SUCCESS;
- int status = TAPI_NETTEXT_PDA_MEMORY_STATUS_AVAILABLE;
-
- if (Error == MSG_ERR_SIM_STORAGE_FULL || Error == MSG_ERR_MESSAGE_COUNT_FULL) {
- status = TAPI_NETTEXT_PDA_MEMORY_STATUS_FULL;
- }
-
- MSG_DEBUG("Set Status : [%d]", status);
-
- tapiRet = tel_set_sms_memory_status(pTapiHandle, status, TapiEventMemoryStatus, NULL);
-
- if (tapiRet == TAPI_API_SUCCESS) {
- MSG_DEBUG("######## tel_set_sms_memory_status() Success !!! #######");
- } else {
- MSG_DEBUG("######## tel_set_sms_memory_status() Success !!! return : [%d] #######", tapiRet);
- }
-
- return MSG_SUCCESS;
-}
-
-
-msg_error_t SmsPlgSetConfigData(const MSG_SETTING_S *pSetting)
-{
- try {
- SmsPluginSetting::instance()->setConfigData(pSetting);
- } catch (MsgException& e) {
- MSG_FATAL("%s", e.what());
- return MSG_ERR_PLUGIN_SETTING;
- } catch (exception& e) {
- MSG_FATAL("%s", e.what());
- return MSG_ERR_PLUGIN_SETTING;
- }
-
- return MSG_SUCCESS;
-}
-
-
-msg_error_t SmsPlgGetConfigData(MSG_SETTING_S *pSetting)
-{
- try {
- SmsPluginSetting::instance()->getConfigData(pSetting);
- } catch (MsgException& e) {
- MSG_FATAL("%s", e.what());
- return MSG_ERR_PLUGIN_SETTING;
- } catch (exception& e) {
- MSG_FATAL("%s", e.what());
- return MSG_ERR_PLUGIN_SETTING;
- }
-
- return MSG_SUCCESS;
-}
-
-
-msg_error_t SmsPlgAddMessage(MSG_MESSAGE_INFO_S *pMsgInfo, MSG_SENDINGOPT_INFO_S* pSendOptInfo, char* pFileData)
-{
- MSG_DEBUG("CDMA does not support sim card operations.");
- return MSG_SUCCESS;
-}
-
-
-static void on_change_received(GDBusConnection *connection, const gchar *sender_name,
- const gchar *object_path, const gchar *interface_name, const gchar *signal_name,
- GVariant *parameters, gpointer user_data)
-{
- MSG_DEBUG("signal_name = [%s]", signal_name);
-
- if (g_strcmp0(signal_name, MEMBER_NAME) == 0) {
- gchar *str_val = NULL;
- gint path;
- g_variant_get(parameters, "(is)", &path, &str_val);
- MSG_DEBUG("path = [%i] and str_val = [%s]", path , str_val);
- if (path == TZ_SYS_USER && g_strcmp0(str_val, SIGNAL_VAL) == 0)
- {
- SmsPlgSetMemoryStatus(MSG_ERR_SIM_STORAGE_FULL);
- }
- }
-}
-
-
-void MsgResourceMonitorInit(void)
-{
- MSG_BEGIN();
-
- GError *error = NULL;
-
- if (gdbus_conn) {
- g_object_unref(gdbus_conn);
- gdbus_conn = NULL;
- }
-
- gdbus_conn = g_bus_get_sync(G_BUS_TYPE_SYSTEM, NULL, &error);
- if (error) {
- MSG_FATAL("g_bus_get_sync() failed : %s", error->message);
- g_error_free(error);
- error = NULL;
- goto _DBUS_ERROR;
- }
-
- if (gdbus_proxy) {
- g_object_unref(gdbus_proxy);
- gdbus_proxy = NULL;
- }
-
- gdbus_proxy = g_dbus_proxy_new_sync(gdbus_conn, G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES,
- NULL, BUS_NAME, PATH_NAME, INTERFACE_NAME, NULL, &error);
- if (error) {
- MSG_FATAL("G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES() failed : %s", error->message);
- g_error_free(error);
- error = NULL;
- goto _DBUS_ERROR;
- }
-
- subs_id = g_dbus_connection_signal_subscribe(gdbus_conn, NULL,
- INTERFACE_NAME, MEMBER_NAME, PATH_NAME,
- NULL, G_DBUS_SIGNAL_FLAGS_NONE,
- on_change_received,
- NULL, NULL);
- MSG_END();
- return;
-
-_DBUS_ERROR:
- if (gdbus_conn) {
- g_object_unref(gdbus_conn);
- gdbus_conn = NULL;
- }
-
- if (gdbus_proxy) {
- g_object_unref(gdbus_proxy);
- gdbus_proxy = NULL;
- }
-
- MSG_END();
- return;
-}
-
-
-void MsgResourceMonitorDeinit(void)
-{
- MSG_BEGIN();
-
- if (subs_id) {
- g_dbus_connection_signal_unsubscribe(gdbus_conn, subs_id);
- subs_id = 0;
- }
-
- if (gdbus_conn) {
- g_object_unref(gdbus_conn);
- gdbus_conn = NULL;
- }
-
- if (gdbus_proxy) {
- g_object_unref(gdbus_proxy);
- gdbus_proxy = NULL;
- }
-
- MSG_END();
-}
+++ /dev/null
-/*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd. All rights reserved
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
-*/
-
-#include <errno.h>
-
-#include "MsgDebug.h"
-#include "MsgCppTypes.h"
-#include "MsgException.h"
-#include "MsgContact.h"
-#include "MsgUtilFile.h"
-#include "MsgUtilStorage.h"
-#include "MsgUtilFunction.h"
-#include "MsgGconfWrapper.h"
-#include "MsgNotificationWrapper.h"
-
-#include "SmsCdmaPluginMain.h"
-#include "SmsCdmaPluginStorage.h"
-
-
-/*==================================================================================================
- IMPLEMENTATION OF SmsPluginStorage - Member Functions
-==================================================================================================*/
-SmsPluginStorage* SmsPluginStorage::pInstance = NULL;
-
-
-SmsPluginStorage::SmsPluginStorage()
-{
-}
-
-
-SmsPluginStorage::~SmsPluginStorage()
-{
-}
-
-
-SmsPluginStorage* SmsPluginStorage::instance()
-{
- if (!pInstance) {
- MSG_DEBUG("pInstance is NULL. Now creating instance.");
- pInstance = new SmsPluginStorage();
- }
-
- return pInstance;
-}
-
-
-msg_error_t SmsPluginStorage::insertMsgRef(MSG_MESSAGE_INFO_S *pMsg, unsigned char msgRef, int index)
-{
- MSG_BEGIN();
-
- time_t curTime = time(NULL);
-
- MsgDbHandler *dbHandle = getDbHandle();
- char sqlQuery[MAX_QUERY_LEN+1];
- char *normalNum = NULL;
-
- memset(sqlQuery, 0x00, sizeof(sqlQuery));
-
- normalNum = msg_normalize_number(pMsg->addressList[index].addressVal);
-
- MSG_SEC_DEBUG("Insert MsgID=[%d], Address=[%s], MsgRef=[%d], Time=[%d]", \
- pMsg->msgId, normalNum, (int)msgRef, (int)curTime);
-
- snprintf(sqlQuery, sizeof(sqlQuery), "INSERT INTO %s VALUES (%d, %s, %d, 0, -1, %d);",
- MSGFW_SMS_REPORT_TABLE_NAME, pMsg->msgId, normalNum, (int)msgRef, (int)curTime);
-
- if (dbHandle->execQuery(sqlQuery) != MSG_SUCCESS) {
- MSG_DEBUG("MsgExecQuery() : [%s]", sqlQuery);
- return MSG_ERR_DB_EXEC;
- }
-
- MSG_END();
-
- return MSG_SUCCESS;
-}
-
-
-msg_error_t SmsPluginStorage::updateMsgDeliverStatus(MSG_MESSAGE_INFO_S *pMsgInfo, unsigned char msgRef)
-{
- MSG_BEGIN();
-
- MsgDbHandler *dbHandle = getDbHandle();
- char sqlQuery[MAX_QUERY_LEN+1];
-
- msg_message_id_t msgId = 0;
- int rowCnt = 0;
- char *normalNum = NULL;
-
- normalNum = msg_normalize_number(pMsgInfo->addressList[0].addressVal);
-
- memset(sqlQuery, 0x00, sizeof(sqlQuery));
- snprintf(sqlQuery, sizeof(sqlQuery), "SELECT MSG_ID FROM %s WHERE ADDRESS_VAL = %s AND MSG_REF > 0 ORDER BY TIME ASC;",
- MSGFW_SMS_REPORT_TABLE_NAME, normalNum);
- MSG_DEBUG("[SQL Query] %s", sqlQuery);
-
- if (dbHandle->prepareQuery(sqlQuery) != MSG_SUCCESS)
- return MSG_ERR_DB_PREPARE;
-
- if (dbHandle->stepQuery() == MSG_ERR_DB_ROW)
- msgId = dbHandle->columnInt(0);
-
- dbHandle->finalizeQuery();
-
- pMsgInfo->msgId = msgId;
-
- /* Update Status - MSG_MESSAGE_TABLE */
- memset(sqlQuery, 0x00, sizeof(sqlQuery));
- snprintf(sqlQuery, sizeof(sqlQuery), "SELECT * FROM %s WHERE MSG_ID = %d AND MSG_REF > 0;",
- MSGFW_SMS_REPORT_TABLE_NAME, msgId);
-
- if (dbHandle->getTable(sqlQuery, &rowCnt, NULL) != MSG_SUCCESS)
- return MSG_ERR_DB_GETTABLE;
-
- MSG_DEBUG("Selected row count = [%d]", rowCnt);
-
- if (rowCnt == 1 && pMsgInfo->networkStatus == MSG_NETWORK_DELIVER_SUCCESS) {
- memset(sqlQuery, 0x00, sizeof(sqlQuery));
- snprintf(sqlQuery, sizeof(sqlQuery), "UPDATE %s SET NETWORK_STATUS = %d WHERE MSG_ID = %d;",
- MSGFW_MESSAGE_TABLE_NAME, (int)pMsgInfo->networkStatus, msgId);
- MSG_DEBUG("[SQL Query] %s", sqlQuery);
-
- if (dbHandle->execQuery(sqlQuery) != MSG_SUCCESS) {
- MSG_DEBUG("Query Failed : [%s]", sqlQuery);
- return MSG_ERR_DB_EXEC;
- }
- }
-
- /* Update Status - MSG_REPORT_TABLE */
- if (pMsgInfo->networkStatus == MSG_NETWORK_DELIVER_SUCCESS) {
- memset(sqlQuery, 0x00, sizeof(sqlQuery));
- snprintf(sqlQuery, sizeof(sqlQuery), "UPDATE %s SET MSG_REF = -1, STATUS = %d, TIME = %d WHERE MSG_ID = %d and ADDRESS_VAL = '%s';",
- MSGFW_SMS_REPORT_TABLE_NAME, 1, (int)pMsgInfo->displayTime, msgId, normalNum);
- MSG_DEBUG("[SQL Query] %s", sqlQuery);
-
- if (dbHandle->execQuery(sqlQuery) != MSG_SUCCESS) {
- MSG_DEBUG("Query Failed : [%s]", sqlQuery);
- return MSG_ERR_DB_EXEC;
- }
- } else if (pMsgInfo->networkStatus == MSG_NETWORK_DELIVER_EXPIRED) {
- memset(sqlQuery, 0x00, sizeof(sqlQuery));
- snprintf(sqlQuery, sizeof(sqlQuery), "UPDATE %s SET MSG_REF = -1, STATUS = %d, TIME = %d WHERE MSG_ID = %d and ADDRESS_VAL = '%s';",
- MSGFW_SMS_REPORT_TABLE_NAME, 0, (int)pMsgInfo->displayTime, msgId, normalNum);
- MSG_DEBUG("[SQL Query] %s", sqlQuery);
-
- if (dbHandle->execQuery(sqlQuery) != MSG_SUCCESS) {
- MSG_DEBUG("Query Failed : [%s]", sqlQuery);
- return MSG_ERR_DB_EXEC;
- }
- } else if (pMsgInfo->networkStatus == MSG_NETWORK_DELIVER_PENDING) {
- memset(sqlQuery, 0x00, sizeof(sqlQuery));
- snprintf(sqlQuery, sizeof(sqlQuery), "UPDATE %s SET MSG_REF = -1, STATUS = %d, TIME = %d WHERE MSG_ID = %d and ADDRESS_VAL = '%s';",
- MSGFW_SMS_REPORT_TABLE_NAME, 3, (int)pMsgInfo->displayTime, msgId, normalNum);
- MSG_DEBUG("[SQL Query] %s", sqlQuery);
-
- if (dbHandle->execQuery(sqlQuery) != MSG_SUCCESS) {
- MSG_DEBUG("Query Failed : [%s]", sqlQuery);
- return MSG_ERR_DB_EXEC;
- }
- } else if (pMsgInfo->networkStatus == MSG_NETWORK_DELIVER_FAIL) {
- memset(sqlQuery, 0x00, sizeof(sqlQuery));
- snprintf(sqlQuery, sizeof(sqlQuery), "UPDATE %s SET MSG_REF = -1, STATUS = %d, TIME = %d WHERE MSG_ID = %d and ADDRESS_VAL = '%s';",
- MSGFW_SMS_REPORT_TABLE_NAME, 8, (int)pMsgInfo->displayTime, msgId, normalNum);
- MSG_DEBUG("[SQL Query] %s", sqlQuery);
-
- if (dbHandle->execQuery(sqlQuery) != MSG_SUCCESS) {
- MSG_DEBUG("Query Failed : [%s]", sqlQuery);
- return MSG_ERR_DB_EXEC;
- }
- }
-
- MSG_END();
-
- return MSG_SUCCESS;
-}
-
-
-msg_error_t SmsPluginStorage::updateSentMsg(MSG_MESSAGE_INFO_S *pMsgInfo, msg_network_status_t status)
-{
- MSG_BEGIN();
-
- if (!pMsgInfo || (pMsgInfo && pMsgInfo->msgId <= 0)) {
- MSG_DEBUG("Invalid message id");
- return MSG_ERR_INVALID_MESSAGE_ID;
- }
-
- MsgDbHandler *dbHandle = getDbHandle();
- char sqlQuery[MAX_QUERY_LEN+1];
-
- memset(sqlQuery, 0x00, sizeof(sqlQuery));
-
- MSG_DEBUG("Update Msg ID : [%d], Network Status : [%d] ", pMsgInfo->msgId, status);
-
- /* Move Msg to SENTBOX */
- if (status == MSG_NETWORK_SEND_SUCCESS) {
- snprintf(sqlQuery, sizeof(sqlQuery), "UPDATE %s SET NETWORK_STATUS = %d, FOLDER_ID = %d WHERE MSG_ID = %d;",
- MSGFW_MESSAGE_TABLE_NAME, status, MSG_SENTBOX_ID, pMsgInfo->msgId);
- } else {
- snprintf(sqlQuery, sizeof(sqlQuery), "UPDATE %s SET NETWORK_STATUS = %d, READ_STATUS = 0 WHERE MSG_ID = %d;",
- MSGFW_MESSAGE_TABLE_NAME, status, pMsgInfo->msgId);
- }
-
- if (dbHandle->execQuery(sqlQuery) != MSG_SUCCESS) {
- MSG_DEBUG("MsgExecQuery() : [%s]", sqlQuery);
- return MSG_ERR_DB_EXEC;
- }
-
- if (status == MSG_NETWORK_SEND_SUCCESS) {
- MSG_DEBUG("MsgAddPhoneLog() : folderId [%d]", pMsgInfo->folderId);
- MsgAddPhoneLog(pMsgInfo);
- }
-
- MSG_END();
-
- return MSG_SUCCESS;
-}
-
-
-msg_error_t SmsPluginStorage::checkMessage(MSG_MESSAGE_INFO_S *pMsgInfo)
-{
- MSG_BEGIN();
-
- msg_error_t err = MSG_SUCCESS;
-
- /* Check whether storage is full or not */
- err = checkStorageStatus(pMsgInfo);
-
- if (err != MSG_SUCCESS) {
- if (pMsgInfo->msgType.classType == MSG_CLASS_0) {
- pMsgInfo->folderId = 0;
- err = MSG_SUCCESS;
-/* }
- else if (pMsgInfo->msgType.classType == MSG_CLASS_2 &&
- (pMsgInfo->msgType.subType == MSG_NORMAL_SMS || pMsgInfo->msgType.subType == MSG_REJECT_SMS)) {
- err = addClass2Message(pMsgInfo);
-*/
- } else if (pMsgInfo->msgType.subType == MSG_NOTIFICATIONIND_MMS) {
- err = MSG_SUCCESS;
- }
- return err;
- }
-
- /* Amend message information for type */
- if (pMsgInfo->msgType.subType == MSG_NORMAL_SMS || pMsgInfo->msgType.subType == MSG_REJECT_SMS) {
- MSG_DEBUG("Normal SMS");
-
- if (pMsgInfo->msgType.classType == MSG_CLASS_2) {
- /* err = addClass2Message(pMsgInfo); */
- } else if (pMsgInfo->msgType.classType == MSG_CLASS_0) {
- /* Class 0 Msg should be saved in hidden folder */
- pMsgInfo->folderId = 0;
- }
-
- } else if ((pMsgInfo->msgType.subType >= MSG_REPLACE_TYPE1_SMS) && (pMsgInfo->msgType.subType <= MSG_REPLACE_TYPE7_SMS)) {
- MSG_DEBUG("Replace SM Type [%d]", pMsgInfo->msgType.subType-3);
-
- if (pMsgInfo->msgType.classType == MSG_CLASS_2) {
- /* err = addClass2Message(pMsgInfo); */
- } else if (pMsgInfo->msgType.classType == MSG_CLASS_0) {
- /* Class 0 Msg should be saved in hidden folder */
- pMsgInfo->folderId = 0;
- pMsgInfo->msgType.subType = MSG_NORMAL_SMS;
- }
-
- } else if ((pMsgInfo->msgType.subType >= MSG_MWI_VOICE_SMS) && (pMsgInfo->msgType.subType <= MSG_MWI_OTHER_SMS)) {
- if (pMsgInfo->bStore == true) {
- MSG_DEBUG("MWI Message");
- /*
- if (pMsgInfo->msgType.classType == MSG_CLASS_2) {
- err = addClass2Message(pMsgInfo);
- }
- */
- }
- } else {
- MSG_DEBUG("No matching type [%d]", pMsgInfo->msgType.subType);
- }
-
- if (err == MSG_SUCCESS) {
- MSG_DEBUG("Success to check message !!");
- } else {
- MSG_DEBUG("fail to check message !! : [%d]", err);
- }
-
- return err;
-}
-
-
-msg_error_t SmsPluginStorage::addSmsMessage(MSG_MESSAGE_INFO_S *pMsgInfo)
-{
- msg_error_t err = MSG_SUCCESS;
-
- unsigned int rowId = 0;
- msg_thread_id_t convId = 0;
-
- MsgDbHandler *dbHandle = getDbHandle();
- dbHandle->beginTrans();
-
- if (pMsgInfo->nAddressCnt > 0) {
- err = MsgStoAddAddress(dbHandle, pMsgInfo, &convId);
-
- if (err != MSG_SUCCESS) {
- dbHandle->endTrans(false);
- return err;
- }
-
- pMsgInfo->threadId = convId;
- }
-
- /* Add Message Table */
- rowId = MsgStoAddMessageTable(dbHandle, pMsgInfo);
-
- if (rowId <= 0) {
- dbHandle->endTrans(false);
- return MSG_ERR_DB_ROW;
- }
-
- /* Update conversation table */
- err = MsgStoUpdateConversation(dbHandle, convId);
-
- if (err != MSG_SUCCESS) {
- dbHandle->endTrans(false);
- return err;
- }
-
- err = dbHandle->endTrans(true);
- if (err != MSG_SUCCESS) {
- return err;
- }
-
- pMsgInfo->msgId = (msg_message_id_t)rowId;
-
- MSG_END();
-
- return MSG_SUCCESS;
-}
-
-
-msg_error_t SmsPluginStorage::deleteSmsMessage(msg_message_id_t msgId)
-{
- MSG_BEGIN();
-
- MsgDbHandler *dbHandle = getDbHandle();
- char sqlQuery[MAX_QUERY_LEN+1];
-
- /* Get SUB_TYPE, STORAGE_ID */
- memset(sqlQuery, 0x00, sizeof(sqlQuery));
- snprintf(sqlQuery, sizeof(sqlQuery), "SELECT MAIN_TYPE, SUB_TYPE, FOLDER_ID, CONV_ID, SIM_INDEX \
- FROM %s WHERE MSG_ID = %d;",
- MSGFW_MESSAGE_TABLE_NAME, msgId);
-
- if (dbHandle->prepareQuery(sqlQuery) != MSG_SUCCESS)
- return MSG_ERR_DB_PREPARE;
-
- MSG_MESSAGE_TYPE_S msgType;
- msg_folder_id_t folderId;
-
- msg_thread_id_t convId;
- int simIndex;
-
- if (dbHandle->stepQuery() == MSG_ERR_DB_ROW) {
- msgType.mainType = dbHandle->columnInt(0);
- msgType.subType = dbHandle->columnInt(1);
- folderId = dbHandle->columnInt(2);
- convId = dbHandle->columnInt(3);
- simIndex = dbHandle->columnInt(4);
-
- MSG_DEBUG("Main Type:[%d] SubType:[%d] FolderId:[%d] ConversationId:[%d] simIndex:[%d]", msgType.mainType, msgType.subType, folderId, convId, simIndex);
- } else {
- MSG_DEBUG("MsgStepQuery() Error [%s]", sqlQuery);
- dbHandle->finalizeQuery();
- return MSG_ERR_DB_STEP;
- }
-
- dbHandle->finalizeQuery();
-
- dbHandle->beginTrans();
-
- memset(sqlQuery, 0x00, sizeof(sqlQuery));
- snprintf(sqlQuery, sizeof(sqlQuery), "DELETE FROM %s WHERE MSG_ID = %d;", MSGFW_SMS_SENDOPT_TABLE_NAME, msgId);
-
- /* Delete SMS Send Option */
- if (dbHandle->execQuery(sqlQuery) != MSG_SUCCESS) {
- dbHandle->endTrans(false);
- return MSG_ERR_DB_EXEC;
- }
-
- if (msgType.subType == MSG_CB_SMS || msgType.subType == MSG_JAVACB_SMS) {
- memset(sqlQuery, 0x00, sizeof(sqlQuery));
- snprintf(sqlQuery, sizeof(sqlQuery), "DELETE FROM %s WHERE MSG_ID = %d;", MSGFW_CB_MSG_TABLE_NAME, msgId);
-
- /* Delete Push Message from push table */
- if (dbHandle->execQuery(sqlQuery) != MSG_SUCCESS) {
- dbHandle->endTrans(false);
- return MSG_ERR_DB_EXEC;
- }
- } else if (msgType.subType >= MSG_WAP_SI_SMS && msgType.subType <= MSG_WAP_CO_SMS) {
- memset(sqlQuery, 0x00, sizeof(sqlQuery));
- snprintf(sqlQuery, sizeof(sqlQuery), "DELETE FROM %s WHERE MSG_ID = %d;", MSGFW_PUSH_MSG_TABLE_NAME, msgId);
-
- /* Delete Push Message from push table */
- if (dbHandle->execQuery(sqlQuery) != MSG_SUCCESS) {
- dbHandle->endTrans(false);
- return MSG_ERR_DB_EXEC;
- }
- } else if (msgType.subType == MSG_SYNCML_CP) {
- memset(sqlQuery, 0x00, sizeof(sqlQuery));
- snprintf(sqlQuery, sizeof(sqlQuery), "DELETE FROM %s WHERE MSG_ID = %d;", MSGFW_SYNCML_MSG_TABLE_NAME, msgId);
-
- /* Delete SyncML Message from syncML table */
- if (dbHandle->execQuery(sqlQuery) != MSG_SUCCESS) {
- dbHandle->endTrans(false);
- return MSG_ERR_DB_EXEC;
- }
- }
-
- /* Delete Message from msg table */
- memset(sqlQuery, 0x00, sizeof(sqlQuery));
- snprintf(sqlQuery, sizeof(sqlQuery), "DELETE FROM %s WHERE MSG_ID = %d;", MSGFW_MESSAGE_TABLE_NAME, msgId);
- if (dbHandle->execQuery(sqlQuery) != MSG_SUCCESS) {
- dbHandle->endTrans(false);
- return MSG_ERR_DB_EXEC;
- }
-
- /* Delete Message from msg_report table */
- memset(sqlQuery, 0x00, sizeof(sqlQuery));
- snprintf(sqlQuery, sizeof(sqlQuery), "DELETE FROM %s WHERE MSG_ID = %d;", MSGFW_SMS_REPORT_TABLE_NAME, msgId);
- if (dbHandle->execQuery(sqlQuery) != MSG_SUCCESS) {
- dbHandle->endTrans(false);
- return MSG_ERR_DB_EXEC;
- }
-
- /* Delete Message from msg_sim table */
- memset(sqlQuery, 0x00, sizeof(sqlQuery));
- snprintf(sqlQuery, sizeof(sqlQuery), "DELETE FROM %s WHERE MSG_ID = %d;", MSGFW_SIM_MSG_TABLE_NAME, msgId);
- if (dbHandle->execQuery(sqlQuery) != MSG_SUCCESS) {
- dbHandle->endTrans(false);
- return MSG_ERR_DB_EXEC;
- }
-
- /* Clear Conversation table */
- if (MsgStoClearConversationTable(dbHandle) != MSG_SUCCESS) {
- dbHandle->endTrans(false);
- return MSG_ERR_DB_EXEC;
- }
-
- /* Update conversation table.*/
- if (MsgStoUpdateConversation(dbHandle, convId) != MSG_SUCCESS) {
- dbHandle->endTrans(false);
- return MSG_ERR_STORAGE_ERROR;
- }
-
- dbHandle->endTrans(true);
-
- if (folderId == MSG_INBOX_ID) {
- msgType.classType = MSG_CLASS_NONE;
-
- /* Set memory status in SIM */
- if (MsgStoCheckMsgCntFull(dbHandle, &msgType, folderId) == MSG_SUCCESS) {
- MSG_DEBUG("Set Memory Status");
- SmsPlgSetMemoryStatus(MSG_SUCCESS);
- } else if (MsgStoCheckMsgCntFull(dbHandle, &msgType, folderId) == MSG_ERR_MESSAGE_COUNT_FULL) {
- MSG_DEBUG("Set Memory Status");
- SmsPlgSetMemoryStatus(MSG_ERR_MESSAGE_COUNT_FULL);
- } else {
- MSG_DEBUG("Storage event error :Failed to get space info ");
- }
- }
-
- /* MsgRefreshAllNotification(true, false, false); */
-
- return MSG_SUCCESS;
-}
-
-
-msg_error_t SmsPluginStorage::addSmsSendOption(MSG_MESSAGE_INFO_S *pMsg, MSG_SENDINGOPT_INFO_S *pSendOptInfo)
-{
- MSG_BEGIN();
-
- MsgDbHandler *dbHandle = getDbHandle();
- msg_error_t err = MSG_SUCCESS;
-
- if (pSendOptInfo->bSetting == false) {
- if (MsgSettingGetBool(SMS_SEND_DELIVERY_REPORT, &pSendOptInfo->bDeliverReq) != MSG_SUCCESS)
- MSG_INFO("MsgSettingGetBool() is failed");
-
- if (MsgSettingGetBool(SMS_SEND_REPLY_PATH, &pSendOptInfo->option.smsSendOptInfo.bReplyPath) != MSG_SUCCESS)
- MSG_INFO("MsgSettingGetBool() is failed");
- /*
- if (pSendOptInfo->bDeliverReq || pSendOptInfo->option.smsSendOptInfo.bReplyPath) {
- pSendOptInfo->bSetting = true;
- */
- if (MsgSettingGetBool(MSG_KEEP_COPY, &pSendOptInfo->bKeepCopy) != MSG_SUCCESS)
- MSG_INFO("MsgSettingGetBool() is failed");
- /* } */
- }
-
- /* if (pSendOptInfo->bSetting == true) { */
- char sqlQuery[MAX_QUERY_LEN+1];
-
- memset(sqlQuery, 0x00, sizeof(sqlQuery));
- snprintf(sqlQuery, sizeof(sqlQuery), "INSERT INTO %s VALUES (%d, %d, %d, %d, %d);",
- MSGFW_SMS_SENDOPT_TABLE_NAME, pMsg->msgId, pSendOptInfo->bDeliverReq,
- pSendOptInfo->bKeepCopy, pSendOptInfo->option.smsSendOptInfo.bReplyPath, pMsg->encodeType);
-
- MSG_DEBUG("Query = [%s]", sqlQuery);
-
- if (dbHandle->execQuery(sqlQuery) != MSG_SUCCESS) {
- err = MSG_ERR_DB_EXEC;
- }
- /* } */
-
- MSG_END();
-
- return err;
-}
-
-
-msg_error_t SmsPluginStorage::checkStorageStatus(MSG_MESSAGE_INFO_S *pMsgInfo)
-{
- msg_error_t err = MSG_SUCCESS;
-
- MsgDbHandler *dbHandle = getDbHandle();
- err = MsgStoCheckMsgCntFull(dbHandle, &(pMsgInfo->msgType), pMsgInfo->folderId);
-
- if (err != MSG_SUCCESS) {
- if (err == MSG_ERR_MESSAGE_COUNT_FULL) {
- bool bAutoErase = false;
-
- if (MsgSettingGetBool(MSG_AUTO_ERASE, &bAutoErase) != MSG_SUCCESS)
- MSG_INFO("MsgSettingGetBool() is failed");
-
- MSG_DEBUG("bAutoErase: %d", bAutoErase);
-
- if (bAutoErase == true) {
- msg_message_id_t msgId;
-
- /* Find the oldest message's msgId */
- err = MsgStoGetOldestMessage(dbHandle, pMsgInfo, &msgId);
-
- if (err != MSG_SUCCESS)
- return err;
-
- /* Delete the corresponding message. */
- err = deleteSmsMessage(msgId);
- }
- }
-
- return err;
- }
-
- return err;
-}
-
-
-msg_error_t SmsPluginStorage::getRegisteredPushEvent(char* pPushHeader, int *count, char *application_id, int app_id_len, char *content_type, int content_type_len)
-{
- msg_error_t err = MSG_SUCCESS;
-
- int rowCnt = 0, index = 0;
-
- MsgDbHandler *dbHandle = getDbHandle();
-
- char sqlQuery[MAX_QUERY_LEN+1] = {0, };
-
- memset(sqlQuery, 0x00, sizeof(sqlQuery));
-
- snprintf(sqlQuery, sizeof(sqlQuery), "SELECT CONTENT_TYPE, APP_ID, APPCODE FROM %s", MSGFW_PUSH_CONFIG_TABLE_NAME);
-
- err = dbHandle->getTable(sqlQuery, &rowCnt, &index);
- MSG_DEBUG("rowCnt: %d", rowCnt);
-
- if (err == MSG_ERR_DB_NORECORD) {
- dbHandle->freeTable();
- return MSG_SUCCESS;
- } else if (err != MSG_SUCCESS) {
- dbHandle->freeTable();
- return err;
- }
-
- char contentType[MAX_WAPPUSH_CONTENT_TYPE_LEN + 1] = {0, };
- char appId[MAX_WAPPUSH_ID_LEN + 1] = {0, };
- int appcode = 0, default_appcode = 0;
- bool found = false;
- char *_content_type = NULL, *_app_id = NULL;
- *count = 0;
-
-
- for (int i = 0; i < rowCnt; i++) {
- memset(contentType, 0, MAX_WAPPUSH_CONTENT_TYPE_LEN);
- memset(appId, 0, MAX_WAPPUSH_ID_LEN);
-
- dbHandle->getColumnToString(index++, MAX_WAPPUSH_CONTENT_TYPE_LEN + 1, contentType);
- dbHandle->getColumnToString(index++, MAX_WAPPUSH_ID_LEN + 1, appId);
- appcode = dbHandle->getColumnToInt(index++);
-
- /* MSG_DEBUG("content_type: %s, app_id: %s", content_type, app_id); */
- _content_type = strcasestr(pPushHeader, contentType);
- if (_content_type) {
- _app_id = strcasestr(pPushHeader, appId);
- if (appcode)
- default_appcode = appcode;
-
- if (_app_id) {
- PUSH_APPLICATION_INFO_S pInfo = {0, };
- pInfo.appcode = appcode;
- MSG_SEC_DEBUG("appcode: %d, app_id: %s", pInfo.appcode, appId);
- snprintf(application_id, app_id_len, "%s", appId);
- snprintf(content_type, content_type_len, "%s", contentType);
- pushAppInfoList.push_back(pInfo);
- (*count)++;
- found = true;
- }
- }
- }
-
- if (!found && default_appcode != SMS_WAP_APPLICATION_LBS) {
- /* perform default action. */
- PUSH_APPLICATION_INFO_S pInfo = {0, };
- pInfo.appcode = default_appcode;
- memset(appId, 0, MAX_WAPPUSH_ID_LEN + 1);
- snprintf(application_id, app_id_len, "%s", appId);
- snprintf(content_type, content_type_len, "%s", contentType);
- pushAppInfoList.push_back(pInfo);
- *count = 1;
- }
- dbHandle->freeTable();
-
- return err;
-}
-
-
-msg_error_t SmsPluginStorage::getnthPushEvent(int index, int *appcode)
-{
- msg_error_t err = MSG_SUCCESS;
- if ((unsigned int)index > pushAppInfoList.size() - 1)
- return MSG_ERR_INVALID_PARAMETER;
-
- std::list<PUSH_APPLICATION_INFO_S>::iterator it = pushAppInfoList.begin();
- int count = 0;
- for (; it != pushAppInfoList.end(); it++) {
- if (index == count) {
- *appcode = it->appcode;
- break;
- }
- count++;
- }
-
- return err;
-}
-
-
-msg_error_t SmsPluginStorage::releasePushEvent()
-{
- msg_error_t err = MSG_SUCCESS;
- std::list<PUSH_APPLICATION_INFO_S>::iterator it = pushAppInfoList.begin();
-
- for (; it != pushAppInfoList.end(); it++)
- it = pushAppInfoList.erase(it);
-
- return err;
-}
+++ /dev/null
-/*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd. All rights reserved
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
-*/
-
-#ifndef SMS_CDMA_PLUGIN_CALLBACK_H
-#define SMS_CDMA_PLUGIN_CALLBACK_H
-
-
-/*==================================================================================================
- INCLUDE FILES
-==================================================================================================*/
-#include <map>
-#include <vector>
-
-extern "C"
-{
- #include <tapi_common.h>
- #include <TelSms.h>
- #include <TelSim.h>
- #include <TapiUtility.h>
- #include <ITapiNetText.h>
- #include <ITapiNetwork.h>
-}
-
-/*==================================================================================================
- FUNCTION PROTOTYPES
-==================================================================================================*/
-void TapiEventDeviceReady(TapiHandle *handle, const char *noti_id, void *data, void *user_data);
-
-void TapiEventMsgIncoming(TapiHandle *handle, const char *noti_id, void *data, void *user_data);
-
-void TapiEventNetworkStatusChange(TapiHandle *handle, const char *noti_id, void *data, void *user_data);
-
-void TapiEventMemoryStatus(TapiHandle *handle, int result, void *data, void *user_data);
-
-void TapiEventSentStatus(TapiHandle *handle, int result, void *data, void *user_data);
-
-void TapiEventDeliveryReportCNF(TapiHandle *handle, int result, void *data, void *user_data);
-
-void TapiEventSetConfigData(TapiHandle *handle, int result, void *data, void *user_data);
-
-void TapiEventGetCBConfig(TapiHandle *handle, int result, void *data, void *user_data);
-
-void TapiEventSimRefreshed(TapiHandle *handle, const char *noti_id, void *data, void *user_data);
-
-void TapiEventGetMsisdnInfo(TapiHandle *handle, int result, void *data, void *user_data);
-
-
-/*==================================================================================================
- CLASS DEFINITIONS
-==================================================================================================*/
-class SmsPluginCallback
-{
-public:
- static SmsPluginCallback* instance();
-
- void registerEvent();
- void deRegisterEvent();
-
-private:
- SmsPluginCallback();
- ~SmsPluginCallback();
-
- static SmsPluginCallback* pInstance;
-};
-
-#endif /* SMS_CDMA_PLUGIN_CALLBACK_H */
+++ /dev/null
-/*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd. All rights reserved
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
-*/
-
-#ifndef SMS_CDMA_PLUGIN_MAIN_H
-#define SMS_CDMA_PLUGIN_MAIN_H
-
-
-/*==================================================================================================
- INCLUDE FILES
-==================================================================================================*/
-#include "SmsCdmaPluginTypes.h"
-#include "MsgPluginInterface.h"
-
-
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-
-/*==================================================================================================
- FUNCTION PROTOTYPES
-==================================================================================================*/
-msg_error_t SmsPlgInitialize();
-
-msg_error_t SmsPlgFinalize();
-
-msg_error_t SmsPlgRegisterListener(MSG_PLUGIN_LISTENER_S *pListener);
-
-msg_error_t SmsPlgSubmitRequest(MSG_REQUEST_INFO_S *pReqInfo);
-
-msg_error_t SmsPlgSaveSimMessage(const MSG_MESSAGE_INFO_S *pMsgInfo, SMS_SIM_ID_LIST_S *pSimIdList);
-
-msg_error_t SmsPlgDeleteSimMessage(msg_sim_id_t SimMsgId);
-
-msg_error_t SmsPlgGetSimMessage(msg_sim_id_t SimMsgId);
-
-msg_error_t SmsPlgSetReadStatus(msg_sim_id_t SimMsgId);
-
-msg_error_t SmsPlgSetMemoryStatus(msg_error_t Error);
-
-msg_error_t SmsPlgSetConfigData(const MSG_SETTING_S *pSetting);
-
-msg_error_t SmsPlgGetConfigData(MSG_SETTING_S *pSetting);
-
-msg_error_t SmsPlgAddMessage(MSG_MESSAGE_INFO_S *pMsgInfo, MSG_SENDINGOPT_INFO_S* pSendOptInfo, char* pFileData);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* SMS_CDMA_PLUGIN_MAIN_H */
#include "MsgGconfWrapper.h"
#include "MsgUtilFile.h"
#include "MsgUtilStorage.h"
-#include "SmsPluginUDCodec.h"
+#include "Sms3gppUDCodec.h"
#include "SmsPluginStorage.h"
-#include "SmsPluginEventHandler.h"
-#include "SmsPluginCbMsgHandler.h"
+#include "Sms3gppEventHandler.h"
+#include "Sms3gppCbMsgHandler.h"
#include "SmsPluginDSHandler.h"
/*==================================================================================================
- IMPLEMENTATION OF SmsPluginCbMsgHandler - Member Functions
+ IMPLEMENTATION OF Sms3gppCbMsgHandler - Member Functions
==================================================================================================*/
-SmsPluginCbMsgHandler* SmsPluginCbMsgHandler::pInstance = NULL;
+Sms3gppCbMsgHandler* Sms3gppCbMsgHandler::pInstance = NULL;
-SmsPluginCbMsgHandler::SmsPluginCbMsgHandler()
+
+Sms3gppCbMsgHandler::Sms3gppCbMsgHandler()
{
pageList.clear();
}
-SmsPluginCbMsgHandler::~SmsPluginCbMsgHandler()
+Sms3gppCbMsgHandler::~Sms3gppCbMsgHandler()
{
}
-SmsPluginCbMsgHandler* SmsPluginCbMsgHandler::instance()
+Sms3gppCbMsgHandler* Sms3gppCbMsgHandler::instance()
{
- if (!pInstance)
- pInstance = new SmsPluginCbMsgHandler();
+ if (!pInstance) {
+ pInstance = new Sms3gppCbMsgHandler();
+ }
return pInstance;
}
-void SmsPluginCbMsgHandler::handleCbMsg(TapiHandle *handle, TelSmsCbMsg_t *pCbMsg)
+void Sms3gppCbMsgHandler::handleCbMsg(TapiHandle *handle, TelSmsCbMsg_t *pCbMsg)
{
MSG_BEGIN();
break;
}
#else
- SMS_CB_NETWORK_TYPE_T type = pCbMsg->CbMsgType;
- SMS_CBMSG_PAGE_S CbMsgPage = {0};
+ SMS_3GPP_CB_NETWORK_TYPE_T type = pCbMsg->CbMsgType;
+ SMS_3GPP_CBMSG_PAGE_S CbMsgPage = {0};
switch (type) {
case SMS_CB_NETWORK_TYPE_2G_GSM :
#endif
/* Check CB Msg Options */
bool bJavaMsg = false;
-
int simIndex = SmsPluginDSHandler::instance()->getSimIndex(handle);
if (!checkCbOpt(&CbMsgPage, &bJavaMsg, simIndex)) {
- MSG_DEBUG("The CB Msg is not supported by option.");
+ MSG_ERR("Received CB Msg is not supported by option.");
return;
}
CbMsgPage.cbMsgType = SMS_CBMSG_TYPE_JAVACBS;
}
-
/* Check CB Pages */
unsigned char pageCnt = checkCbPage(&CbMsgPage);
-
if (pageCnt == CbMsgPage.pageHeader.totalPages) {
MSG_DEBUG("RECEIVED LAST MSG : %d", pageCnt);
- SMS_CBMSG_S *cbMsg = NULL;
- unique_ptr<SMS_CBMSG_S*, void(*)(SMS_CBMSG_S**)> buf(&cbMsg, unique_ptr_deleter);
- cbMsg = (SMS_CBMSG_S *)new char[sizeof(SMS_CBMSG_S)];
- memset(cbMsg, 0x00, sizeof(SMS_CBMSG_S));
+ SMS_3GPP_CBMSG_S *cbMsg = NULL;
+ unique_ptr<SMS_3GPP_CBMSG_S*, void(*)(SMS_3GPP_CBMSG_S**)> buf(&cbMsg, unique_ptr_deleter);
+ cbMsg = (SMS_3GPP_CBMSG_S *)new char[sizeof(SMS_3GPP_CBMSG_S)];
+ memset(cbMsg, 0x00, sizeof(SMS_3GPP_CBMSG_S));
MSG_MESSAGE_INFO_S msgInfo;
msg_error_t err = MSG_SUCCESS;
err = SmsPluginStorage::instance()->checkMessage(&msgInfo);
-
if (err == MSG_SUCCESS) {
bool is_duplicated = SmsPluginStorage::instance()->isDuplicatedCBMsg(&msgInfo);
if (is_duplicated == false) {
cbOutMsg.cbTextLen = convertTextToUtf8((unsigned char*)cbOutMsg.cbText, sizeof(cbOutMsg.cbText), cbMsg);
memset(cbOutMsg.language_type, 0x00, sizeof(cbOutMsg.language_type));
memcpy(cbOutMsg.language_type, CbMsgPage.pageHeader.dcs.iso639Lang, 3);
- err = SmsPluginEventHandler::instance()->callbackCBMsgIncoming(&cbOutMsg, &msgInfo);
+ err = Sms3gppEventHandler::instance()->callbackCBMsgIncoming(&cbOutMsg, &msgInfo);
if (err != MSG_SUCCESS)
MSG_WARN("callbackMsgIncoming() Error !! [%d]", err);
} else {
#if 0
/* insert message-id to internal CB message table */
- SmsPluginStorage *storageHandler = SmsPluginStorage::instance();
+ Sms3gppStorage *storageHandler = Sms3gppStorage::instance();
err = storageHandler->insertReceivedCBMessage(CbMsgPage);
if (err != MSG_SUCCESS) {
MSG_DEBUG("insertReceivedCBMessage() Error !! [%d]", err);
}
-void SmsPluginCbMsgHandler::handleEtwsMsg(TapiHandle *handle, TelSmsEtwsMsg_t *pEtwsMsg)
+void Sms3gppCbMsgHandler::handleEtwsMsg(TapiHandle *handle, TelSmsEtwsMsg_t *pEtwsMsg)
{
MSG_BEGIN();
msg_error_t err = MSG_SUCCESS;
TelSmsEtwsMsgType_t type = pEtwsMsg->EtwsMsgType;
- SMS_ETWS_PRIMARY_S etwsPn = {0, };
+ SMS_3GPP_ETWS_PRIMARY_S etwsPn = {0, };
MSG_CB_MSG_S cbOutMsg = {0, };
if (type != TAPI_NETTEXT_ETWS_PRIMARY) {
handleCbMsg(handle, (TelSmsCbMsg_t *)pEtwsMsg);
return;
}
+
DecodeEtwsMsg(pEtwsMsg, &etwsPn);
cbOutMsg.type = MSG_ETWS_SMS;
cbOutMsg.etwsWarningType = etwsPn.warningType;
memcpy (cbOutMsg.etwsWarningSecurityInfo, etwsPn.warningSecurityInfo, sizeof(cbOutMsg.etwsWarningSecurityInfo));
- err = SmsPluginEventHandler::instance()->callbackCBMsgIncoming(&cbOutMsg, NULL);
+ err = Sms3gppEventHandler::instance()->callbackCBMsgIncoming(&cbOutMsg, NULL);
if (err != MSG_SUCCESS)
MSG_DEBUG("callbackMsgIncoming() Error !! [%d]", err);
}
-void SmsPluginCbMsgHandler::Decode2gCbMsg(TelSmsCbMsg_t *pCbMsg, SMS_CBMSG_PAGE_S *pCbPage)
+void Sms3gppCbMsgHandler::Decode2gCbMsg(TelSmsCbMsg_t *pCbMsg, SMS_3GPP_CBMSG_PAGE_S *pCbPage)
{
unsigned char cbData[pCbMsg->Length+1] = {0};
memcpy(cbData, pCbMsg->szMsgData, pCbMsg->Length);
dataLen = (dataLen*8) / 7;
- SmsPluginUDCodec udCodec;
+ Sms3gppUDCodec udCodec;
char pageData[MAX_CBMSG_PAGE_SIZE*8/7] = {0};
int unpackLen = udCodec.unpack7bitChar(&cbData[6], dataLen, 0, pageData);
}
-void SmsPluginCbMsgHandler::DecodeEtwsMsg(TelSmsEtwsMsg_t *pEtwsMsg, SMS_ETWS_PRIMARY_S *pEtwsPn)
+void Sms3gppCbMsgHandler::DecodeEtwsMsg(TelSmsEtwsMsg_t *pEtwsMsg, SMS_3GPP_ETWS_PRIMARY_S *pEtwsPn)
{
if ( !pEtwsMsg || !pEtwsPn )
return;
MSG_DEBUG("warningType : [0x%04x]", pEtwsPn->msgId);
/* warning security information */
- memcpy(pEtwsPn->warningSecurityInfo, &EtwsData[6], sizeof(pEtwsPn->warningSecurityInfo)); /* 50bytes */
+ memcpy(pEtwsPn->warningSecurityInfo, &EtwsData[6], sizeof(pEtwsPn->warningSecurityInfo)); /* 50bytes */
for (unsigned int i = 0; i < sizeof(pEtwsPn->warningSecurityInfo); i++) {
MSG_DEBUG("warning secu info [%02x]", pEtwsPn->warningSecurityInfo[i]);
}
}
-void SmsPluginCbMsgHandler::Decode3gCbMsg(TelSmsCbMsg_t *pCbMsg, SMS_CBMSG_PAGE_S *pCbPage)
+void Sms3gppCbMsgHandler::Decode3gCbMsg(TelSmsCbMsg_t *pCbMsg, SMS_3GPP_CBMSG_PAGE_S *pCbPage)
{
unsigned char cbData[MAX_CBMSG_TOTAL_PAGE_SIZE + 1] = {0};
memcpy(cbData, pCbMsg->szMsgData, pCbMsg->Length);
}
MSG_INFO("[%s]", cbDataTmp);
- pCbPage->cbMsgType = (SMS_CBMSG_TYPE_T)cbData[0];
+ pCbPage->cbMsgType = (SMS_3GPP_CBMSG_TYPE_T)cbData[0];
pCbPage->pageHeader.msgId = (cbData[1] << 8) | cbData[2];
memcpy(cbMessage, &cbData[7+(i*MAX_CBMSG_PAGE_SIZE)+ i], dataLen);
dataLen = (dataLen*8) / 7;
- SmsPluginUDCodec udCodec;
+ Sms3gppUDCodec udCodec;
int unpackLen = udCodec.unpack7bitChar((const unsigned char *)cbMessage, dataLen, 0, pCbPage->pageData + offset);
offset += unpackLen;
}
MSG_DEBUG("Page Length : [%d], Page Data : [%s]", pCbPage->pageLength, pCbPage->pageData);
}
-unsigned short SmsPluginCbMsgHandler::encodeCbSerialNum(SMS_CBMSG_SERIAL_NUM_S snFields)
+unsigned short Sms3gppCbMsgHandler::encodeCbSerialNum(SMS_3GPP_CBMSG_SERIAL_NUM_S snFields)
{
unsigned short serialNum = 0;
return serialNum;
}
-int SmsPluginCbMsgHandler::getCMASType(unsigned short message_id)
+int Sms3gppCbMsgHandler::getCMASType(unsigned short message_id)
{
int ret = 0;
return ret;
}
-bool SmsPluginCbMsgHandler::checkCbOpt(SMS_CBMSG_PAGE_S *CbPage, bool *pJavaMsg, msg_sim_slot_id_t simIndex)
+bool Sms3gppCbMsgHandler::checkCbOpt(SMS_3GPP_CBMSG_PAGE_S *CbPage, bool *pJavaMsg, msg_sim_slot_id_t simIndex)
{
bool bReceive = false;
char keyName[MAX_VCONFKEY_NAME_LEN];
return false;
}
-unsigned char SmsPluginCbMsgHandler::checkCbPage(SMS_CBMSG_PAGE_S *CbPage)
+unsigned char Sms3gppCbMsgHandler::checkCbPage(SMS_3GPP_CBMSG_PAGE_S *CbPage)
{
unsigned char currPageCnt = 0;
#if 0
msg_error_t err = MSG_SUCCESS;
- SmsPluginStorage *storageHandler = SmsPluginStorage::instance();
+ Sms3gppStorage *storageHandler = Sms3gppStorage::instance();
err = storageHandler->isReceivedCBMessage(CbPage);
/* check existing message with cb internal table; */
return 0;
}
- pair<unsigned char, SMS_CBMSG_PAGE_S> newData(CbPage->pageHeader.page, *CbPage);
+ pair<unsigned char, SMS_3GPP_CBMSG_PAGE_S> newData(CbPage->pageHeader.page, *CbPage);
pageList[i].data.insert(newData);
MSG_DEBUG("PAGE DATA : %s", CbPage->pageData);
}
-void SmsPluginCbMsgHandler::MakeCbMsg(SMS_CBMSG_PAGE_S *CbPage, SMS_CBMSG_S *pCbMsg)
+void Sms3gppCbMsgHandler::MakeCbMsg(SMS_3GPP_CBMSG_PAGE_S *CbPage, SMS_3GPP_CBMSG_S *pCbMsg)
{
pCbMsg->cbMsgType = CbPage->cbMsgType;
pCbMsg->msgId = CbPage->pageHeader.msgId;
pCbMsg->recvTime = CbPage->pageHeader.recvTime;
pCbMsg->serialNum = encodeCbSerialNum(CbPage->pageHeader.serialNum);
- cbPageMap::iterator it;
+ Sms3gppCbPageMap::iterator it;
int offset = 0;
for (unsigned int i = 0; i < pageList.size(); i++) {
}
-void SmsPluginCbMsgHandler::convertCbMsgToMsginfo(SMS_CBMSG_S *pCbMsg, MSG_MESSAGE_INFO_S *pMsgInfo, msg_sim_slot_id_t simIndex)
+void Sms3gppCbMsgHandler::convertCbMsgToMsginfo(SMS_3GPP_CBMSG_S *pCbMsg, MSG_MESSAGE_INFO_S *pMsgInfo, msg_sim_slot_id_t simIndex)
{
pMsgInfo->msgId = (msg_message_id_t)pCbMsg->msgId;
pMsgInfo->serialNum = pCbMsg->serialNum;
}
-void SmsPluginCbMsgHandler::convertEtwsMsgToMsginfo(SMS_CBMSG_PAGE_S *EtwsMsg, MSG_MESSAGE_INFO_S *pMsgInfo, msg_sim_slot_id_t simIndex)
+void Sms3gppCbMsgHandler::convertEtwsMsgToMsginfo(SMS_3GPP_CBMSG_PAGE_S *EtwsMsg, MSG_MESSAGE_INFO_S *pMsgInfo, msg_sim_slot_id_t simIndex)
{
pMsgInfo->msgId = (msg_message_id_t)EtwsMsg->pageHeader.msgId;
memcpy(pMsgInfo->msgData, EtwsMsg->pageData, pMsgInfo->dataSize);
}
-int SmsPluginCbMsgHandler::convertTextToUtf8(unsigned char* outBuf, int outBufSize, SMS_CBMSG_S* pCbMsg)
+
+int Sms3gppCbMsgHandler::convertTextToUtf8(unsigned char* outBuf, int outBufSize, SMS_3GPP_CBMSG_S* pCbMsg)
{
int convertedTextSize = 0;
MSG_LANG_INFO_S langInfo = {0, };
return convertedTextSize;
}
-void SmsPluginCbMsgHandler::addToPageList(SMS_CBMSG_PAGE_S *CbPage)
+
+void Sms3gppCbMsgHandler::addToPageList(SMS_3GPP_CBMSG_PAGE_S *CbPage)
{
- CB_PAGE_INFO_S tmpInfo;
+ SMS_3GPP_CB_PAGE_INFO_S tmpInfo;
tmpInfo.geoScope = CbPage->pageHeader.serialNum.geoScope;
tmpInfo.msgCode = CbPage->pageHeader.serialNum.msgCode;
tmpInfo.pageCnt = 1;
tmpInfo.totalSize = CbPage->pageLength;
- pair<unsigned char, SMS_CBMSG_PAGE_S> newData(CbPage->pageHeader.page, *CbPage);
+ pair<unsigned char, SMS_3GPP_CBMSG_PAGE_S> newData(CbPage->pageHeader.page, *CbPage);
tmpInfo.data.insert(newData);
MSG_DEBUG("MSG DATA : %s", CbPage->pageData);
}
-void SmsPluginCbMsgHandler::removeFromPageList(SMS_CBMSG_PAGE_S *CbPage)
+void Sms3gppCbMsgHandler::removeFromPageList(SMS_3GPP_CBMSG_PAGE_S *CbPage)
{
unsigned int index;
}
-void SmsPluginCbMsgHandler::decodeCbMsgDCS(unsigned char dcsData, const unsigned char *pMsgData, SMS_CBMSG_DCS_S* pDcs)
+void Sms3gppCbMsgHandler::decodeCbMsgDCS(unsigned char dcsData, const unsigned char *pMsgData, SMS_3GPP_CBMSG_DCS_S* pDcs)
{
pDcs->codingGroup = SMS_CBMSG_CODGRP_GENERAL_DCS;
pDcs->classType = SMS_MSG_CLASS_NONE;
case 0x02:
case 0x03: {
pDcs->codingGroup = SMS_CBMSG_CODGRP_GENERAL_DCS;
- pDcs->langType = (SMS_CBMSG_LANG_TYPE_T)dcsData;
+ pDcs->langType = (SMS_3GPP_CBMSG_LANG_TYPE_T)dcsData;
}
break;
pDcs->bCompressed = (dcsData & 0x20) ? true : false;
if (dcsData & 0x10)
- pDcs->classType = (SMS_MSG_CLASS_T)(dcsData & 0x03);
+ pDcs->classType = (SMS_3GPP_MSG_CLASS_T)(dcsData & 0x03);
unsigned char tmpScheme = (dcsData & 0x0C) >> 2;
case 0x09: {
pDcs->bUDH = true;
pDcs->classType = (MSG_CLASS_TYPE_T)(dcsData & 0x03);
- pDcs->codingScheme = (SMS_CODING_SCHEME_T)((dcsData & 0x0C) >> 2);
+ pDcs->codingScheme = (SMS_3GPP_CODING_SCHEME_T)((dcsData & 0x0C) >> 2);
}
break;
}
-void SmsPluginCbMsgHandler::convertLangType(SMS_CBMSG_LANG_TYPE_T InType , MSG_CB_LANGUAGE_TYPE_T *pOutType)
+void Sms3gppCbMsgHandler::convertLangType(SMS_3GPP_CBMSG_LANG_TYPE_T InType , MSG_CB_LANGUAGE_TYPE_T *pOutType)
{
switch (InType) {
case SMS_CBMSG_LANG_GERMAN :
}
-unsigned long SmsPluginCbMsgHandler::getRecvTime()
+unsigned long Sms3gppCbMsgHandler::getRecvTime()
{
time_t recvTime;
}
-void SmsPluginCbMsgHandler::getDisplayName(unsigned short MsgId, char *pDisplayName, msg_sim_slot_id_t simIndex)
+void Sms3gppCbMsgHandler::getDisplayName(unsigned short MsgId, char *pDisplayName, msg_sim_slot_id_t simIndex)
{
MSG_CB_CHANNEL_S cbChannelInfo = {0, };
msg_error_t err = MSG_SUCCESS;
#include "MsgUtilFile.h"
#include "MsgGconfWrapper.h"
#include "MsgNotificationWrapper.h"
-#include "SmsPluginStorage.h"
-#include "SmsPluginTransport.h"
-#include "SmsPluginEventHandler.h"
-#include "SmsPluginWapPushHandler.h"
-#include "SmsPluginConcatHandler.h"
-#include "SmsPluginSimMsg.h"
#include "SmsPluginDSHandler.h"
+#include "SmsPluginStorage.h"
+#include "Sms3gppTransport.h"
+#include "Sms3gppEventHandler.h"
+#include "Sms3gppWapPushHandler.h"
+#include "Sms3gppConcatHandler.h"
+#include "Sms3gppSimMsg.h"
+#include "Sms3gppParamCodec.h"
+
/*==================================================================================================
- IMPLEMENTATION OF SmsPluginConcatHandler - Member Functions
+ IMPLEMENTATION OF Sms3gppConcatHandler - Member Functions
==================================================================================================*/
-SmsPluginConcatHandler* SmsPluginConcatHandler::pInstance = NULL;
+Sms3gppConcatHandler* Sms3gppConcatHandler::pInstance = NULL;
-SmsPluginConcatHandler::SmsPluginConcatHandler()
+Sms3gppConcatHandler::Sms3gppConcatHandler()
{
concatList.clear();
}
-SmsPluginConcatHandler::~SmsPluginConcatHandler()
+Sms3gppConcatHandler::~Sms3gppConcatHandler()
{
concatList.clear();
}
-SmsPluginConcatHandler* SmsPluginConcatHandler::instance()
+Sms3gppConcatHandler* Sms3gppConcatHandler::instance()
{
- if (!pInstance)
- pInstance = new SmsPluginConcatHandler();
+ if (!pInstance) {
+ pInstance = new Sms3gppConcatHandler();
+ }
return pInstance;
}
-bool SmsPluginConcatHandler::IsConcatMsg(SMS_USERDATA_S *pUserData)
+bool Sms3gppConcatHandler::IsConcatMsg(SMS_3GPP_USERDATA_S *pUserData)
{
MSG_BEGIN();
}
-void SmsPluginConcatHandler::handleConcatMsg(TapiHandle *handle, SMS_TPDU_S *pTpdu)
+void Sms3gppConcatHandler::handleConcatMsg(TapiHandle *handle, SMS_3GPP_TPDU_S *pTpdu)
{
MSG_BEGIN();
return;
}
- SMS_CONCAT_MSG_S msg = {0};
+ SMS_3GPP_CONCAT_MSG_S msg = {0};
msg.simIndex = SmsPluginDSHandler::instance()->getSimIndex(handle);
msg.totalSeg = pTpdu->data.deliver.userData.header[i].udh.concat8bit.totalSeg;
msg.seqNum = pTpdu->data.deliver.userData.header[i].udh.concat8bit.seqNum;
- memcpy(&(msg.timeStamp.time.absolute), &(pTpdu->data.deliver.timeStamp.time.absolute), sizeof(SMS_TIME_ABS_S));
- memcpy(&(msg.originAddress), &(pTpdu->data.deliver.originAddress), sizeof(SMS_ADDRESS_S));
- memcpy(&(msg.dcs), &(pTpdu->data.deliver.dcs), sizeof(SMS_DCS_S));
+ memcpy(&(msg.timeStamp.time.absolute), &(pTpdu->data.deliver.timeStamp.time.absolute), sizeof(SMS_3GPP_TIME_ABS_S));
+ memcpy(&(msg.originAddress), &(pTpdu->data.deliver.originAddress), sizeof(SMS_3GPP_ADDRESS_S));
+ memcpy(&(msg.dcs), &(pTpdu->data.deliver.dcs), sizeof(SMS_3GPP_DCS_S));
#if 0
if (msg.totalSeg > MAX_SEGMENT_NUM) {
msg.totalSeg = pTpdu->data.deliver.userData.header[i].udh.concat16bit.totalSeg;
msg.seqNum = pTpdu->data.deliver.userData.header[i].udh.concat16bit.seqNum;
- memcpy(&(msg.timeStamp.time.absolute), &(pTpdu->data.deliver.timeStamp.time.absolute), sizeof(SMS_TIME_ABS_S));
- memcpy(&(msg.originAddress), &(pTpdu->data.deliver.originAddress), sizeof(SMS_ADDRESS_S));
- memcpy(&(msg.dcs), &(pTpdu->data.deliver.dcs), sizeof(SMS_DCS_S));
+ memcpy(&(msg.timeStamp.time.absolute), &(pTpdu->data.deliver.timeStamp.time.absolute), sizeof(SMS_3GPP_TIME_ABS_S));
+ memcpy(&(msg.originAddress), &(pTpdu->data.deliver.originAddress), sizeof(SMS_3GPP_ADDRESS_S));
+ memcpy(&(msg.dcs), &(pTpdu->data.deliver.dcs), sizeof(SMS_3GPP_DCS_S));
#if 0
if (msg.totalSeg > MAX_SEGMENT_NUM) {
MSG_DEBUG("Total Segment Count is over Maximum [%d]", msg.totalSeg);
dataSize = makeConcatUserData(msg.msgRef, msg.simIndex, &pUserData, msg.originAddress.address);
if (dataSize > 0) {
- if (SmsPluginWapPushHandler::instance()->IsWapPushMsg(&(pTpdu->data.deliver.userData)) == true) {
- SmsPluginWapPushHandler::instance()->copyDeliverData(&(pTpdu->data.deliver));
+ if (Sms3gppWapPushHandler::instance()->IsWapPushMsg(&(pTpdu->data.deliver.userData)) == true) {
+ Sms3gppWapPushHandler::instance()->copyDeliverData(&(pTpdu->data.deliver));
msgInfo.msgType.mainType = MSG_SMS_TYPE;
if (err == MSG_SUCCESS) {
time_t sent_time = 0;
- if (pTpdu->data.deliver.timeStamp.format == SMS_TIME_ABSOLUTE) {
+ if (pTpdu->data.deliver.timeStamp.format == SMS_3GPP_TIME_ABSOLUTE) {
sent_time = time(NULL);
}
-
- SmsPluginWapPushHandler::instance()->handleWapPushMsg(pUserData, dataSize, msg.simIndex, sent_time);
+ Sms3gppWapPushHandler::instance()->handleWapPushMsg(pUserData, dataSize, msg.simIndex, sent_time);
}
} else {
convertConcatToMsginfo(&(pTpdu->data.deliver), pUserData, dataSize, &msgInfo);
if (msgInfo.msgType.classType == MSG_CLASS_2) {
msgInfo.storageId = MSG_STORAGE_SIM;
- SmsPluginSimMsg::instance()->setSmsTpduTotalSegCount(msg.totalSeg);
+ Sms3gppSimMsg::instance()->setSmsTpduTotalSegCount(msg.totalSeg);
}
if (msgInfo.msgPort.valid == true) {
/* check Class2 Normal SMS is longer than SIM slot full size and send DeliveryReport SUCCESS because that Class2 msg cannot be saved on SIM
* It MUST be done before calling addClass2Message(thread) beause 10+ page message body ipc file is deleted after SmsPluginTransport::instance()->msgInfoToSubmitData() */
if (msgInfo.msgType.subType == MSG_NORMAL_SMS && msgInfo.msgType.classType == MSG_CLASS_2 &&
- (SmsPluginSimMsg::instance()->checkSimMsgFull(msg.simIndex, segCnt) == true)) {
+ (Sms3gppSimMsg::instance()->checkSimMsgFull(msg.simIndex, segCnt) == true)) {
char keyName[MAX_VCONFKEY_NAME_LEN];
memset(keyName, 0x00, sizeof(keyName));
snprintf(keyName, sizeof(keyName), "%s/%d", SIM_TOTAL_COUNT, msg.simIndex);
- int totalCnt;
+ int totalCnt = 0;
if (MsgSettingGetInt(keyName, &totalCnt) != MSG_SUCCESS) {
MSG_INFO("MsgSettingGetInt() is failed");
}
/* send DeliveryResport as MSG_SUCCESS and return when total sim storage cnt is less than segment cnt. */
MSG_INFO("SIM slot total count [%d] is less than total sement count of Class2 message [%d], send delivery report as SUCCESS and save it only PHONE", totalCnt, segCnt);
- SmsPluginTransport::instance()->sendDeliverReport(handle, MSG_SUCCESS);
+ Sms3gppTransport::instance()->sendDeliverReport(handle, MSG_SUCCESS);
MsgInsertTicker("Message is too large to store as a single message to SIM card.", SMS_MESSAGE_SIZE_OVER_SIM_SLOT_SIZE, false, 0);
msgInfo.storageId = MSG_STORAGE_PHONE;
/** Callback */
- err = SmsPluginEventHandler::instance()->callbackMsgIncoming(&msgInfo);
-
+ err = Sms3gppEventHandler::instance()->callbackMsgIncoming(&msgInfo);
if (err != MSG_SUCCESS) {
MSG_WARN("callbackMsgIncoming() Error !! [%d]", err);
}
}
/** Send Deliver Report */
- SmsPluginTransport::instance()->sendDeliverReport(handle, err);
+ Sms3gppTransport::instance()->sendDeliverReport(handle, err);
MSG_END();
}
-void SmsPluginConcatHandler::handleSimConcatMsg(TapiHandle *handle, SMS_TPDU_S *pTpdu, int msgId, int bRead, int *simIdList)
+void Sms3gppConcatHandler::handleSimConcatMsg(TapiHandle *handle, SMS_3GPP_TPDU_S *pTpdu, int msgId, int bRead, int *simIdList)
{
MSG_BEGIN();
bool noneConcatTypeHeader = true;
if (pTpdu->tpduType == SMS_TPDU_DELIVER) {
- SMS_CONCAT_MSG_S msg = {0};
+ SMS_3GPP_CONCAT_MSG_S msg = {0};
msg.simIndex = SmsPluginDSHandler::instance()->getSimIndex(handle);
msg.totalSeg = pTpdu->data.deliver.userData.header[i].udh.concat8bit.totalSeg;
msg.seqNum = pTpdu->data.deliver.userData.header[i].udh.concat8bit.seqNum;
msg.simId = msgId;
- memcpy(&(msg.timeStamp.time.absolute), &(pTpdu->data.deliver.timeStamp.time.absolute), sizeof(SMS_TIME_ABS_S));
- memcpy(&(msg.originAddress), &(pTpdu->data.deliver.originAddress), sizeof(SMS_ADDRESS_S));
- memcpy(&(msg.dcs), &(pTpdu->data.deliver.dcs), sizeof(SMS_DCS_S));
+ memcpy(&(msg.timeStamp.time.absolute), &(pTpdu->data.deliver.timeStamp.time.absolute), sizeof(SMS_3GPP_TIME_ABS_S));
+ memcpy(&(msg.originAddress), &(pTpdu->data.deliver.originAddress), sizeof(SMS_3GPP_ADDRESS_S));
+ memcpy(&(msg.dcs), &(pTpdu->data.deliver.dcs), sizeof(SMS_3GPP_DCS_S));
/** check noneConcatTypeHeader */
msg.totalSeg = pTpdu->data.deliver.userData.header[i].udh.concat16bit.totalSeg;
msg.seqNum = pTpdu->data.deliver.userData.header[i].udh.concat16bit.seqNum;
msg.simId = msgId;
- memcpy(&(msg.timeStamp.time.absolute), &(pTpdu->data.deliver.timeStamp.time.absolute), sizeof(SMS_TIME_ABS_S));
- memcpy(&(msg.originAddress), &(pTpdu->data.deliver.originAddress), sizeof(SMS_ADDRESS_S));
- memcpy(&(msg.dcs), &(pTpdu->data.deliver.dcs), sizeof(SMS_DCS_S));
+ memcpy(&(msg.timeStamp.time.absolute), &(pTpdu->data.deliver.timeStamp.time.absolute), sizeof(SMS_3GPP_TIME_ABS_S));
+ memcpy(&(msg.originAddress), &(pTpdu->data.deliver.originAddress), sizeof(SMS_3GPP_ADDRESS_S));
+ memcpy(&(msg.dcs), &(pTpdu->data.deliver.dcs), sizeof(SMS_3GPP_DCS_S));
/** check noneConcatTypeHeader */
noneConcatTypeHeader = false;
}
removeFromConcatList(msg.msgRef, msg.simIndex, msg.originAddress.address);
/* Call Event Handler */
- SmsPluginSimMsg::instance()->setSimMsgEvent(handle, &msgInfo, true);
+ Sms3gppSimMsg::instance()->setSimMsgEvent(handle, &msgInfo, true);
return;
}
/* Call Event Handler */
- SmsPluginSimMsg::instance()->setSimMsgEvent(handle, NULL, false);
+ Sms3gppSimMsg::instance()->setSimMsgEvent(handle, NULL, false);
} else {
- SMS_CONCAT_MSG_S msg = {0};
+ SMS_3GPP_CONCAT_MSG_S msg = {0};
msg.simIndex = SmsPluginDSHandler::instance()->getSimIndex(handle);
msg.totalSeg = pTpdu->data.submit.userData.header[i].udh.concat8bit.totalSeg;
msg.seqNum = pTpdu->data.submit.userData.header[i].udh.concat8bit.seqNum;
msg.simId = msgId;
- memcpy(&(msg.originAddress), &(pTpdu->data.submit.destAddress), sizeof(SMS_ADDRESS_S));
- memcpy(&(msg.dcs), &(pTpdu->data.submit.dcs), sizeof(SMS_DCS_S));
-
+ memcpy(&(msg.originAddress), &(pTpdu->data.submit.destAddress), sizeof(SMS_3GPP_ADDRESS_S));
+ memcpy(&(msg.dcs), &(pTpdu->data.submit.dcs), sizeof(SMS_3GPP_DCS_S));
/** check noneConcatTypeHeader */
noneConcatTypeHeader = false;
msg.totalSeg = pTpdu->data.submit.userData.header[i].udh.concat16bit.totalSeg;
msg.seqNum = pTpdu->data.submit.userData.header[i].udh.concat16bit.seqNum;
msg.simId = msgId;
- memcpy(&(msg.originAddress), &(pTpdu->data.submit.destAddress), sizeof(SMS_ADDRESS_S));
- memcpy(&(msg.dcs), &(pTpdu->data.submit.dcs), sizeof(SMS_DCS_S));
+ memcpy(&(msg.originAddress), &(pTpdu->data.submit.destAddress), sizeof(SMS_3GPP_ADDRESS_S));
+ memcpy(&(msg.dcs), &(pTpdu->data.submit.dcs), sizeof(SMS_3GPP_DCS_S));
/** check noneConcatTypeHeader */
noneConcatTypeHeader = false;
}
}
/* Call Event Handler */
- SmsPluginSimMsg::instance()->setSimMsgEvent(handle, &msgInfo, true);
+ Sms3gppSimMsg::instance()->setSimMsgEvent(handle, &msgInfo, true);
removeFromConcatList(msg.msgRef, msg.simIndex, msg.originAddress.address);
return;
}
/* Call Event Handler */
- SmsPluginSimMsg::instance()->setSimMsgEvent(handle, NULL, false);
+ Sms3gppSimMsg::instance()->setSimMsgEvent(handle, NULL, false);
}
MSG_END();
}
#ifdef CONCAT_SIM_MSG_OPERATION
-void SmsPluginConcatHandler::handleConcatMsg(SMS_TPDU_S *pTpdu, msg_sim_id_t SimMsgId, bool bRead)
+void Sms3gppConcatHandler::handleConcatMsg(SMS_3GPP_TPDU_S *pTpdu, msg_sim_id_t SimMsgId, bool bRead)
{
MSG_BEGIN();
return;
}
- SMS_CONCAT_MSG_S msg;
- memset(&msg, 0x00, sizeof(SMS_CONCAT_MSG_S));
+ SMS_3GPP_CONCAT_MSG_S msg;
+ memset(&msg, 0x00, sizeof(SMS_3GPP_CONCAT_MSG_S));
for (int i = 0; i < pTpdu->data.deliver.userData.headerCnt; i++) {
if (pTpdu->data.deliver.userData.header[i].udhType == SMS_UDH_CONCAT_8BIT) {
msg.totalSeg = pTpdu->data.deliver.userData.header[i].udh.concat8bit.totalSeg;
msg.seqNum = pTpdu->data.deliver.userData.header[i].udh.concat8bit.seqNum;
- memcpy(&(msg.timeStamp.time.absolute), &(pTpdu->data.deliver.timeStamp.time.absolute), sizeof(SMS_TIME_ABS_S));
- memcpy(&(msg.originAddress), &(pTpdu->data.deliver.originAddress), sizeof(SMS_ADDRESS_S));
- memcpy(&(msg.dcs), &(pTpdu->data.deliver.dcs), sizeof(SMS_DCS_S));
+ memcpy(&(msg.timeStamp.time.absolute), &(pTpdu->data.deliver.timeStamp.time.absolute), sizeof(SMS_3GPP_TIME_ABS_S));
+ memcpy(&(msg.originAddress), &(pTpdu->data.deliver.originAddress), sizeof(SMS_3GPP_ADDRESS_S));
+ memcpy(&(msg.dcs), &(pTpdu->data.deliver.dcs), sizeof(SMS_3GPP_DCS_S));
msg.bRead = bRead;
msg.totalSeg = pTpdu->data.deliver.userData.header[i].udh.concat16bit.totalSeg;
msg.seqNum = pTpdu->data.deliver.userData.header[i].udh.concat16bit.seqNum;
- memcpy(&(msg.timeStamp.time.absolute), &(pTpdu->data.deliver.timeStamp.time.absolute), sizeof(SMS_TIME_ABS_S));
- memcpy(&(msg.originAddress), &(pTpdu->data.deliver.originAddress), sizeof(SMS_ADDRESS_S));
- memcpy(&(msg.dcs), &(pTpdu->data.deliver.dcs), sizeof(SMS_DCS_S));
+ memcpy(&(msg.timeStamp.time.absolute), &(pTpdu->data.deliver.timeStamp.time.absolute), sizeof(SMS_3GPP_TIME_ABS_S));
+ memcpy(&(msg.originAddress), &(pTpdu->data.deliver.originAddress), sizeof(SMS_3GPP_ADDRESS_S));
+ memcpy(&(msg.dcs), &(pTpdu->data.deliver.dcs), sizeof(SMS_3GPP_DCS_S));
msg.bRead = bRead;
removeFromSimIdList(msg.msgRef);
/* add msgInfo to msg list */
- SmsPluginStorage::instance()->addSimMsgToList(&msgInfo, true);
+ Sms3gppStorage::instance()->addSimMsgToList(&msgInfo, true);
/* Callback to MSG FW */
- SmsPluginEventHandler::instance()->callbackGetSimMsg();
+ Sms3gppEventHandler::instance()->callbackGetSimMsg();
}
} else {
/* add index count to msg list */
- SmsPluginStorage::instance()->addSimMsgToList(NULL, false);
+ Sms3gppStorage::instance()->addSimMsgToList(NULL, false);
/* Callback to MSG FW */
- SmsPluginEventHandler::instance()->callbackGetSimMsg();
+ Sms3gppEventHandler::instance()->callbackGetSimMsg();
}
MSG_END();
}
-void SmsPluginConcatHandler::handleBrokenMsg()
+void Sms3gppConcatHandler::handleBrokenMsg()
{
if (concatList.size() <= 0 || simIdList.size() <= 0) {
MSG_DEBUG("No Broken Concatenated Message");
if (dataSize > 0) {
MSG_DEBUG("TOTAL DATA : %s", pUserData);
- SMS_CONCAT_MSG_S msg;
- memset(&msg, 0x00, sizeof(SMS_CONCAT_MSG_S));
+ SMS_3GPP_CONCAT_MSG_S msg;
+ memset(&msg, 0x00, sizeof(SMS_3GPP_CONCAT_MSG_S));
msg.msgRef = concatList[index].msgRef;
msg.totalSeg = concatList[index].totalSeg;
- memcpy(&(msg.timeStamp.time.absolute), &(concatList[index].timeStamp.time.absolute), sizeof(SMS_TIME_ABS_S));
- memcpy(&(msg.originAddress), &(concatList[index].originAddress), sizeof(SMS_ADDRESS_S));
- memcpy(&(msg.dcs), &(concatList[index].dcs), sizeof(SMS_DCS_S));
+ memcpy(&(msg.timeStamp.time.absolute), &(concatList[index].timeStamp.time.absolute), sizeof(SMS_3GPP_TIME_ABS_S));
+ memcpy(&(msg.originAddress), &(concatList[index].originAddress), sizeof(SMS_3GPP_ADDRESS_S));
+ memcpy(&(msg.dcs), &(concatList[index].dcs), sizeof(SMS_3GPP_DCS_S));
convertSimMsgToMsginfo(&msg, pUserData, dataSize, &msgInfo);
MSG_DEBUG("###############################################################");
/* add msgInfo to msg list */
- SmsPluginStorage::instance()->addSimMsgToList(&msgInfo, true);
+ Sms3gppStorage::instance()->addSimMsgToList(&msgInfo, true);
}
removeFromConcatList(concatList[index].msgRef);
#endif
-unsigned char SmsPluginConcatHandler::checkConcatMsg(SMS_CONCAT_MSG_S *pConcatMsg, SMS_USERDATA_S *pUserData)
+unsigned char Sms3gppConcatHandler::checkConcatMsg(SMS_3GPP_CONCAT_MSG_S *pConcatMsg, SMS_3GPP_USERDATA_S *pUserData)
{
if (pConcatMsg == NULL || pUserData == NULL) {
MSG_DEBUG("In Parameter is NULL");
MSG_DEBUG("The Sequence Number already exists [%d]", pConcatMsg->seqNum);
return 0;
}
- CONCAT_DATA_S concatData = {0};
+ SMS_3GPP_CONCAT_DATA_S concatData = {0};
memcpy(concatData.data, pUserData->data, pUserData->length);
concatData.length = pUserData->length;
- pair<unsigned char, CONCAT_DATA_S> newData(pConcatMsg->seqNum, concatData);
+ pair<unsigned char, SMS_3GPP_CONCAT_DATA_S> newData(pConcatMsg->seqNum, concatData);
concatList[i].data.insert(newData);
concatList[i].simIdList[concatList[i].segCnt] = pConcatMsg->simId + 1;
/** New Concat Msg */
if (bFind == false) {
- SMS_CONCAT_INFO_S tmpInfo;
+ SMS_3GPP_CONCAT_INFO_S tmpInfo;
memset(tmpInfo.simIdList, 0x00, sizeof(int) * MAX_SIM_SMS_NUM);
tmpInfo.msgRef = pConcatMsg->msgRef;
tmpInfo.totalSeg = pConcatMsg->totalSeg;
tmpInfo.simIndex = pConcatMsg->simIndex;
tmpInfo.bRead = false;
- memcpy(&(tmpInfo.timeStamp.time.absolute), &(pConcatMsg->timeStamp.time.absolute), sizeof(SMS_TIME_ABS_S));
- memcpy(&(tmpInfo.originAddress), &(pConcatMsg->originAddress), sizeof(SMS_ADDRESS_S));
- memcpy(&(tmpInfo.dcs), &(pConcatMsg->dcs), sizeof(SMS_DCS_S));
+ memcpy(&(tmpInfo.timeStamp.time.absolute), &(pConcatMsg->timeStamp.time.absolute), sizeof(SMS_3GPP_TIME_ABS_S));
+ memcpy(&(tmpInfo.originAddress), &(pConcatMsg->originAddress), sizeof(SMS_3GPP_ADDRESS_S));
+ memcpy(&(tmpInfo.dcs), &(pConcatMsg->dcs), sizeof(SMS_3GPP_DCS_S));
tmpInfo.totalSize = pUserData->length;
tmpInfo.display_time = time(NULL);
- CONCAT_DATA_S concatData = {0};
+ SMS_3GPP_CONCAT_DATA_S concatData = {0};
memcpy(concatData.data, pUserData->data, pUserData->length);
concatData.length = pUserData->length;
- pair<unsigned char, CONCAT_DATA_S> newData(pConcatMsg->seqNum, concatData);
+ pair<unsigned char, SMS_3GPP_CONCAT_DATA_S> newData(pConcatMsg->seqNum, concatData);
tmpInfo.data.insert(newData);
MSG_DEBUG("MSG DATA : %s", pUserData->data);
}
-int SmsPluginConcatHandler::makeConcatUserData(unsigned short MsgRef, int simIndex, char **ppTotalData, char *originAddress)
+int Sms3gppConcatHandler::makeConcatUserData(unsigned short MsgRef, int simIndex, char **ppTotalData, char *originAddress)
{
- concatDataMap::iterator it;
+ Sms3gppConcatDataMap::iterator it;
int totalSize = 0, offset = 0;
}
-void SmsPluginConcatHandler::convertConcatToMsginfo(const SMS_DELIVER_S *pTpdu, const char *pUserData, int DataSize, MSG_MESSAGE_INFO_S *pMsgInfo)
+void Sms3gppConcatHandler::convertConcatToMsginfo(const SMS_3GPP_DELIVER_S *pTpdu, const char *pUserData, int DataSize, MSG_MESSAGE_INFO_S *pMsgInfo)
{
/** Convert Type values */
pMsgInfo->msgType.mainType = MSG_SMS_TYPE;
- pMsgInfo->msgType.subType = SmsPluginEventHandler::instance()->convertMsgSubType(pTpdu->pid);
+ pMsgInfo->msgType.subType = Sms3gppEventHandler::instance()->convertMsgSubType(pTpdu->pid);
/** set folder id */
pMsgInfo->folderId = MSG_INBOX_ID;
/*** Comment below lines to save local UTC time..... (it could be used later.)
- if (pTpdu->timeStamp.format == SMS_TIME_ABSOLUTE) {
+ if (pTpdu->timeStamp.format == SMS_3GPP_TIME_ABSOLUTE) {
MSG_DEBUG("year : %d", pTpdu->timeStamp.time.absolute.year);
MSG_DEBUG("month : %d", pTpdu->timeStamp.time.absolute.month);
}
-void SmsPluginConcatHandler::convertConcatToMsginfo(const SMS_SUBMIT_S *pTpdu, const char *pUserData, int DataSize, MSG_MESSAGE_INFO_S *pMsgInfo)
+void Sms3gppConcatHandler::convertConcatToMsginfo(const SMS_3GPP_SUBMIT_S *pTpdu, const char *pUserData, int DataSize, MSG_MESSAGE_INFO_S *pMsgInfo)
{
/** Convert Type values */
pMsgInfo->msgType.mainType = MSG_SMS_TYPE;
- pMsgInfo->msgType.subType = SmsPluginEventHandler::instance()->convertMsgSubType(pTpdu->pid);
+ pMsgInfo->msgType.subType = Sms3gppEventHandler::instance()->convertMsgSubType(pTpdu->pid);
/** set folder id */
pMsgInfo->folderId = MSG_INBOX_ID;
pMsgInfo->priority = MSG_MESSAGE_PRIORITY_NORMAL;
pMsgInfo->direction = MSG_DIRECTION_TYPE_MT;
-
time_t rawtime = time(NULL);
pMsgInfo->displayTime = rawtime;
}
#ifdef CONCAT_SIM_MSG_OPERATION
-void SmsPluginConcatHandler::convertSimMsgToMsginfo(const SMS_CONCAT_MSG_S *pConcatMsg, const char *pUserData, int DataSize, MSG_MESSAGE_INFO_S *pMsgInfo)
+void Sms3gppConcatHandler::convertSimMsgToMsginfo(const SMS_3GPP_CONCAT_MSG_S *pConcatMsg, const char *pUserData, int DataSize, MSG_MESSAGE_INFO_S *pMsgInfo)
{
/* Convert Type values */
pMsgInfo->msgType.mainType = MSG_SMS_TYPE;
/*** Comment below lines to save local UTC time..... (it could be used later.)
- if (pTpdu->timeStamp.format == SMS_TIME_ABSOLUTE) {
+ if (pTpdu->timeStamp.format == SMS_3GPP_TIME_ABSOLUTE) {
MSG_DEBUG("year : %d", pTpdu->timeStamp.time.absolute.year);
MSG_DEBUG("month : %d", pTpdu->timeStamp.time.absolute.month);
#endif
-void SmsPluginConcatHandler::removeFromConcatList(unsigned short MsgRef, int simIndex, char *originAddress)
+void Sms3gppConcatHandler::removeFromConcatList(unsigned short MsgRef, int simIndex, char *originAddress)
{
for (int index = concatList.size()-1; index >= 0 ; index--) {
if (concatList[index].msgRef == MsgRef && concatList[index].simIndex == simIndex
}
#ifdef CONCAT_SIM_MSG_OPERATION
-void SmsPluginConcatHandler::addToSimIdList(unsigned short MsgRef, msg_sim_id_t SimMsgId)
+void Sms3gppConcatHandler::addToSimIdList(unsigned short MsgRef, msg_sim_id_t SimMsgId)
{
SMS_SIM_ID_S simIdStruct;
}
-void SmsPluginConcatHandler::removeFromSimIdList(unsigned short MsgRef)
+void Sms3gppConcatHandler::removeFromSimIdList(unsigned short MsgRef)
{
for (int index = simIdList.size()-1; index >= 0 ; index--) {
if (simIdList[index].msgRef == MsgRef) {
#include "MsgGconfWrapper.h"
#include "MsgNotificationWrapper.h"
#include "MsgDevicedWrapper.h"
-#include "SmsPluginTransport.h"
-#include "SmsPluginSimMsg.h"
-#include "SmsPluginStorage.h"
-#include "SmsPluginSetting.h"
-#include "SmsPluginConcatHandler.h"
-#include "SmsPluginEventHandler.h"
+#include "Sms3gppTransport.h"
+#include "Sms3gppSimMsg.h"
+#include "Sms3gppStorage.h"
+#include "Sms3gppSetting.h"
+#include "Sms3gppConcatHandler.h"
+#include "Sms3gppEventHandler.h"
#include "SmsPluginDSHandler.h"
-#include "SmsPluginParamCodec.h"
+#include "SmsPluginStorage.h"
+#include "Sms3gppParamCodec.h"
/*==================================================================================================
- IMPLEMENTATION OF SmsPluginEventHandler - Member Functions
+ IMPLEMENTATION OF Sms3gppEventHandler - Member Functions
==================================================================================================*/
-SmsPluginEventHandler* SmsPluginEventHandler::pInstance = NULL;
+Sms3gppEventHandler* Sms3gppEventHandler::pInstance = NULL;
-SmsPluginEventHandler::SmsPluginEventHandler()
+Sms3gppEventHandler::Sms3gppEventHandler()
{
- /** Initialize global parameters */
+ /* Initialize global parameters */
memset(&listener, 0x00, sizeof(MSG_PLUGIN_LISTENER_S));
- memset(&sentInfo, 0x00, sizeof(SMS_SENT_INFO_S));
+ memset(&sentInfo, 0x00, sizeof(SMS_3GPP_SENT_INFO_S));
pSimCnt = NULL;
devStatus = false;
}
-SmsPluginEventHandler::~SmsPluginEventHandler()
+Sms3gppEventHandler::~Sms3gppEventHandler()
{
}
-SmsPluginEventHandler* SmsPluginEventHandler::instance()
+Sms3gppEventHandler* Sms3gppEventHandler::instance()
{
- if (!pInstance)
- pInstance = new SmsPluginEventHandler();
+ if (!pInstance) {
+ pInstance = new Sms3gppEventHandler();
+ }
return pInstance;
}
-void SmsPluginEventHandler::registerListener(MSG_PLUGIN_LISTENER_S *pListener)
+void Sms3gppEventHandler::registerListener(MSG_PLUGIN_LISTENER_S *pListener)
{
listener = *pListener;
}
-void SmsPluginEventHandler::handleSentStatus(msg_network_status_t NetStatus)
+void Sms3gppEventHandler::handleSentStatus(msg_network_status_t NetStatus)
{
MSG_DEBUG("NetStatus[%d]", NetStatus);
MSG_DEBUG("sentInfo.reqInfo.sendOptInfo.bSetting [%d]", sentInfo.reqInfo.sendOptInfo.bSetting);
MSG_DEBUG("sentInfo.reqInfo.sendOptInfo.bKeepCopy [%d]", sentInfo.reqInfo.sendOptInfo.bKeepCopy);
- /** Check sending options */
+ /* Check sending options */
if (sentInfo.reqInfo.sendOptInfo.bSetting && !sentInfo.reqInfo.sendOptInfo.bKeepCopy && NetStatus == MSG_NETWORK_SEND_SUCCESS) {
SmsPluginStorage::instance()->deleteSmsMessage(sentInfo.reqInfo.msgInfo.msgId);
callbackStorageChange(MSG_STORAGE_CHANGE_DELETE, &(sentInfo.reqInfo.msgInfo));
}
- /** Callback to MSG FW */
+ /* Callback to MSG FW */
MSG_SENT_STATUS_S msgStatus;
msgStatus.reqId = sentInfo.reqInfo.reqId;
}
-void SmsPluginEventHandler::handleMsgIncoming(TapiHandle *handle, SMS_TPDU_S *pTpdu)
+void Sms3gppEventHandler::handleMsgIncoming(TapiHandle *handle, SMS_3GPP_TPDU_S *pTpdu)
{
- /** Make MSG_MESSAGE_INFO_S */
+ /* Make MSG_MESSAGE_INFO_S */
MSG_MESSAGE_INFO_S msgInfo;
MSG_MESSAGE_INFO_S stored_msgInfo;
- /** initialize msgInfo */
+ /* initialize msgInfo */
memset(&msgInfo, 0x00, sizeof(MSG_MESSAGE_INFO_S));
msgInfo.addressList = NULL;
if (pTpdu->tpduType == SMS_TPDU_DELIVER) {
- /** check unsupported message */
+ /* check unsupported message */
if (pTpdu->data.deliver.dcs.codingScheme == SMS_CHARSET_8BIT && pTpdu->data.deliver.pid == 0x11) {
MSG_DEBUG("Unsupported message!!");
- SmsPluginTransport::instance()->sendDeliverReport(handle, MSG_SUCCESS);
+ Sms3gppTransport::instance()->sendDeliverReport(handle, MSG_SUCCESS);
return;
}
}
bool bStoreVoiceMsg = false;
if (bUdhMwiMethod == false) {
- /** check MWI and set info to SIM for DCS & Address method */
+ /* check MWI and set info to SIM for DCS & Address method */
if (pTpdu->tpduType == SMS_TPDU_DELIVER && pTpdu->data.deliver.dcs.bMWI == true) {
int MwiCnt = 0;
MSG_DEBUG("MWI message - DCS method");
if (pTpdu->data.deliver.dcs.bIndActive == false) {
- SmsPluginSetting::instance()->setMwiInfo(msgInfo.sim_idx, msgInfo.msgType.subType, 0);
+ Sms3gppSetting::instance()->setMwiInfo(msgInfo.sim_idx, msgInfo.msgType.subType, 0);
MwiCnt = 0;
} else {
- SmsPluginSetting::instance()->setMwiInfo(msgInfo.sim_idx, msgInfo.msgType.subType, 1);
+ Sms3gppSetting::instance()->setMwiInfo(msgInfo.sim_idx, msgInfo.msgType.subType, 1);
MwiCnt = 1;
/* For address method */
}
}
- /** Short Message Type 0 - Just Send Deliver Report */
+ /* Short Message Type 0 - Just Send Deliver Report */
if (msgInfo.msgType.subType == MSG_TYPE0_SMS) {
- SmsPluginTransport::instance()->sendDeliverReport(handle, MSG_SUCCESS);
+ Sms3gppTransport::instance()->sendDeliverReport(handle, MSG_SUCCESS);
return;
}
msg_error_t err = MSG_SUCCESS;
if (msgInfo.msgType.subType == MSG_STATUS_REPORT_SMS) {
- /** Status Report Message */
- err = SmsPluginStorage::instance()->updateMsgDeliverStatus(&msgInfo, pTpdu->data.statusRep.msgRef);
+ /* Status Report Message */
+ err = Sms3gppStorage::instance()->updateMsgDeliverStatus(&msgInfo, pTpdu->data.statusRep.msgRef);
if (err == MSG_SUCCESS)
err = listener.pfMsgIncomingCb(&msgInfo);
else
MSG_DEBUG("updateMsgDeliverStatus is failed [%d]", err);
- /** Handling of Fail Case ?? */
- SmsPluginTransport::instance()->sendDeliverReport(handle, MSG_SUCCESS);
- } else { /** SMS Deliver */
- /** Class 2 Msg */
+ /* Handling of Fail Case ?? */
+ Sms3gppTransport::instance()->sendDeliverReport(handle, MSG_SUCCESS);
+ } else { /* SMS Deliver */
+ /* Class 2 Msg */
if (msgInfo.msgType.classType == MSG_CLASS_2) {
- if (msgInfo.bTextSms == false) { /** Concat Msg cannot be saved in SIM */
+ if (msgInfo.bTextSms == false) { /* Concat Msg cannot be saved in SIM */
msgInfo.msgType.classType = MSG_CLASS_NONE;
msgInfo.storageId = MSG_STORAGE_PHONE;
} else {
/** set total segment of Class2 message as 1 */
- SmsPluginSimMsg::instance()->setSmsTpduTotalSegCount(1);
+ Sms3gppSimMsg::instance()->setSmsTpduTotalSegCount(1);
}
}
err = SmsPluginStorage::instance()->checkMessage(&msgInfo);
}
- /** Callback to MSG FW */
+ /* Callback to MSG FW */
if (msgInfo.msgType.classType == MSG_CLASS_2) {
if (((msgInfo.msgType.subType >= MSG_MWI_VOICE_SMS) && (msgInfo.msgType.subType <= MSG_MWI_OTHER_SMS)) &&
(msgInfo.bStore == false)) {
if (listener.pfMsgIncomingCb(&msgInfo) != MSG_SUCCESS)
MSG_DEBUG("listener.pfMsgIncomingCb is failed!");
- SmsPluginTransport::instance()->sendDeliverReport(handle, MSG_SUCCESS);
+ Sms3gppTransport::instance()->sendDeliverReport(handle, MSG_SUCCESS);
}
} else {
if (err == MSG_SUCCESS) {
}
}
- /** Send Deliver Report */
+ /* Send Deliver Report */
if (msgInfo.msgType.classType == MSG_CLASS_0)
- SmsPluginTransport::instance()->sendClass0DeliverReport(handle, err);
+ Sms3gppTransport::instance()->sendClass0DeliverReport(handle, err);
else
- SmsPluginTransport::instance()->sendDeliverReport(handle, err);
+ Sms3gppTransport::instance()->sendDeliverReport(handle, err);
}
/* Tizen Validation System */
}
}
-void SmsPluginEventHandler::handlePushMsgIncoming(char* pPushHeader, char* pPushBody, int pushBodyLen, char *application_id, char *content_type)
+void Sms3gppEventHandler::handlePushMsgIncoming(char* pPushHeader, char* pPushBody, int pushBodyLen, char *application_id, char *content_type)
{
MSG_PUSH_MESSAGE_DATA_S pushData;
memset(&pushData, 0x00, sizeof(MSG_PUSH_MESSAGE_DATA_S));
- /** set PUSH data */
+ /* set PUSH data */
memcpy(pushData.pushHeader, pPushHeader, strlen(pPushHeader));
+ pushData.pushHeader[strlen(pPushHeader)] = '\0';
pushData.pushBodyLen = pushBodyLen;
memcpy(pushData.pushBody, pPushBody, pushBodyLen);
+ pushData.pushBody[pushBodyLen] = '\0';
memcpy(pushData.pushAppId, application_id, MAX_WAPPUSH_ID_LEN);
memcpy(pushData.pushContentType, content_type, MAX_WAPPUSH_CONTENT_TYPE_LEN);
- /** Callback to MSG FW */
+ /* Callback to MSG FW */
listener.pfPushMsgIncomingCb(&pushData);
}
-void SmsPluginEventHandler::handleResendMessage(void)
+void Sms3gppEventHandler::handleResendMessage(void)
{
listener.pfResendMessageCb();
}
-void SmsPluginEventHandler::handleSyncMLMsgIncoming(msg_syncml_message_type_t msgType, char* pPushBody, int PushBodyLen, char* pWspHeader, int WspHeaderLen, int simIndex)
+void Sms3gppEventHandler::handleSyncMLMsgIncoming(msg_syncml_message_type_t msgType, char* pPushBody, int PushBodyLen, char* pWspHeader, int WspHeaderLen, int simIndex)
{
MSG_SYNCML_MESSAGE_DATA_S syncMLData;
memset(&syncMLData, 0x00, sizeof(MSG_SYNCML_MESSAGE_DATA_S));
- /** set syncML data */
+ /* set syncML data */
syncMLData.syncmlType = msgType;
syncMLData.simIndex = simIndex;
syncMLData.wspHeaderLen = WspHeaderLen;
memcpy(syncMLData.wspHeader, pWspHeader, WspHeaderLen);
- /** Callback to MSG FW */
+ /* Callback to MSG FW */
listener.pfSyncMLMsgIncomingCb(&syncMLData);
}
-void SmsPluginEventHandler::handleLBSMsgIncoming(char* pPushHeader, char* pPushBody, int pushBodyLen)
+void Sms3gppEventHandler::handleLBSMsgIncoming(char* pPushHeader, char* pPushBody, int pushBodyLen)
{
- MSG_LBS_MESSAGE_DATA_S lBSData;
+ MSG_LBS_MESSAGE_DATA_S lbsData;
- memset(&lBSData, 0x00, sizeof(MSG_LBS_MESSAGE_DATA_S));
+ memset(&lbsData, 0x00, sizeof(MSG_LBS_MESSAGE_DATA_S));
- /** set LBA data */
- memcpy(lBSData.pushHeader, pPushHeader, strlen(pPushHeader));
+ /* set LBA data */
+ memcpy(lbsData.pushHeader, pPushHeader, strlen(pPushHeader));
+ lbsData.pushHeader[strlen(pPushHeader)] = '\0';
- lBSData.pushBodyLen = pushBodyLen;
- memcpy(lBSData.pushBody, pPushBody, pushBodyLen);
+ lbsData.pushBodyLen = pushBodyLen;
+ memcpy(lbsData.pushBody, pPushBody, pushBodyLen);
+ lbsData.pushBody[pushBodyLen] = '\0';
- /** Callback to MSG FW */
- listener.pfLBSMsgIncomingCb(&lBSData);
+ /* Callback to MSG FW */
+ listener.pfLBSMsgIncomingCb(&lbsData);
}
-msg_error_t SmsPluginEventHandler::callbackMsgIncoming(MSG_MESSAGE_INFO_S *pMsgInfo)
+msg_error_t Sms3gppEventHandler::callbackMsgIncoming(MSG_MESSAGE_INFO_S *pMsgInfo)
{
MSG_BEGIN();
msg_error_t err = MSG_SUCCESS;
- /** Callback to MSG FW */
+ /* Callback to MSG FW */
err = listener.pfMsgIncomingCb(pMsgInfo);
MSG_END();
return err;
}
-msg_error_t SmsPluginEventHandler::callbackCBMsgIncoming(MSG_CB_MSG_S *pCbMsg, MSG_MESSAGE_INFO_S *pMsgInfo)
+msg_error_t Sms3gppEventHandler::callbackCBMsgIncoming(MSG_CB_MSG_S *pCbMsg, MSG_MESSAGE_INFO_S *pMsgInfo)
{
MSG_BEGIN();
msg_error_t err = MSG_SUCCESS;
- /** Callback to MSG FW */
+ /* Callback to MSG FW */
err = listener.pfCBMsgIncomingCb(pCbMsg, pMsgInfo);
MSG_END();
}
-msg_error_t SmsPluginEventHandler::callbackInitSimBySat()
+msg_error_t Sms3gppEventHandler::callbackInitSimBySat()
{
- /** Callback to MSG FW */
+ /* Callback to MSG FW */
return listener.pfInitSimBySatCb();
}
-msg_error_t SmsPluginEventHandler::callbackStorageChange(msg_storage_change_type_t storageChangeType, MSG_MESSAGE_INFO_S *pMsgInfo)
+msg_error_t Sms3gppEventHandler::callbackStorageChange(msg_storage_change_type_t storageChangeType, MSG_MESSAGE_INFO_S *pMsgInfo)
{
msg_id_list_s msgIdList;
msg_message_id_t msgIds[1];
}
-msg_error_t SmsPluginEventHandler::callbackThreadChange(msg_storage_change_type_t storageChangeType, msg_thread_id_t threadId)
+msg_error_t Sms3gppEventHandler::callbackThreadChange(msg_storage_change_type_t storageChangeType, msg_thread_id_t threadId)
{
/* Callback to MSG FW */
listener.pfThreadChangeCb(storageChangeType, threadId);
}
-void SmsPluginEventHandler::convertTpduToMsginfo(SMS_TPDU_S *pTpdu, MSG_MESSAGE_INFO_S *msgInfo)
+void Sms3gppEventHandler::convertTpduToMsginfo(SMS_3GPP_TPDU_S *pTpdu, MSG_MESSAGE_INFO_S *msgInfo)
{
switch (pTpdu->tpduType) {
case SMS_TPDU_SUBMIT :
}
-void SmsPluginEventHandler::convertSubmitTpduToMsginfo(const SMS_SUBMIT_S *pTpdu, MSG_MESSAGE_INFO_S *msgInfo)
+void Sms3gppEventHandler::convertSubmitTpduToMsginfo(const SMS_3GPP_SUBMIT_S *pTpdu, MSG_MESSAGE_INFO_S *msgInfo)
{
int addressListCnt = 0;
- /** Convert Type values */
+ /* Convert Type values */
msgInfo->msgType.mainType = MSG_SMS_TYPE;
msgInfo->msgType.subType = convertMsgSubType(pTpdu->pid);
- /** set folder id (temporary) */
+ /* set folder id (temporary) */
msgInfo->folderId = MSG_SENTBOX_ID;
switch (pTpdu->dcs.msgClass) {
memset(msgInfo->subject, 0x00, MAX_SUBJECT_LEN+1);
- /** What kind of time has to be saved?? (temporary store time) */
+ /* What kind of time has to be saved?? (temporary store time) */
msgInfo->displayTime = time(NULL);
- /** Convert Address values */
+ /* Convert Address values */
msgInfo->nAddressCnt = 1;
msgInfo->addressList = (MSG_ADDRESS_INFO_S *)new char[sizeof(MSG_ADDRESS_INFO_S)];
msgInfo->addressList[addressListCnt].addressType = MSG_ADDRESS_TYPE_PLMN;
strncpy(msgInfo->addressList[addressListCnt].addressVal, pTpdu->destAddress.address, MAX_ADDRESS_VAL_LEN);
- /**exception operation for none userdata */
+ /*exception operation for none userdata */
if (pTpdu->userData.length == 0) {
snprintf(msgInfo->msgText, sizeof(msgInfo->msgText), "[Broken Message]");
msgInfo->dataSize = strlen(msgInfo->msgText);
return;
}
- /** Convert Data values */
+ /* Convert Data values */
MsgTextConvert *textCvt = MsgTextConvert::instance();
if (pTpdu->dcs.codingScheme == SMS_CHARSET_7BIT) {
MSG_LANG_INFO_S langInfo = {0, };
}
-void SmsPluginEventHandler::convertDeliverTpduToMsginfo(const SMS_DELIVER_S *pTpdu, MSG_MESSAGE_INFO_S *msgInfo)
+void Sms3gppEventHandler::convertDeliverTpduToMsginfo(const SMS_3GPP_DELIVER_S *pTpdu, MSG_MESSAGE_INFO_S *msgInfo)
{
MSG_BEGIN();
- /** Convert Type values */
+ /* Convert Type values */
msgInfo->msgType.mainType = MSG_SMS_TYPE;
msgInfo->msgType.subType = convertMsgSubType(pTpdu->pid);
- /** set folder id (temporary) */
+ /* set folder id (temporary) */
msgInfo->folderId = MSG_INBOX_ID;
time_t rawtime = 0;
if (msgInfo->storageId == MSG_STORAGE_SIM) {
/*** Comment below lines to save local UTC time..... (it could be used later.)
***/
- if (pTpdu->timeStamp.format == SMS_TIME_ABSOLUTE) {
+ if (pTpdu->timeStamp.format == SMS_3GPP_TIME_ABSOLUTE) {
MSG_DEBUG("year : %d", pTpdu->timeStamp.time.absolute.year);
MSG_DEBUG("month : %d", pTpdu->timeStamp.time.absolute.month);
MSG_DEBUG("day : %d", pTpdu->timeStamp.time.absolute.day);
memset(msgInfo->subject, 0x00, MAX_SUBJECT_LEN+1);
- /** Convert Address values */
+ /* Convert Address values */
msgInfo->nAddressCnt = 1;
msgInfo->addressList = (MSG_ADDRESS_INFO_S *)new char[sizeof(MSG_ADDRESS_INFO_S)];
msgInfo->msgPort.srcPort = 0;
for (int i = 0; i < pTpdu->userData.headerCnt; i++) {
- /** Convert UDH values - Port Number */
+ /* Convert UDH values - Port Number */
if (pTpdu->userData.header[i].udhType == SMS_UDH_APP_PORT_8BIT) {
msgInfo->msgPort.valid = true;
msgInfo->msgPort.dstPort = pTpdu->userData.header[i].udh.appPort8bit.destPort;
}
MSG_DEBUG("Message waiting number : [%d]", udhMwiCnt);
-
- SmsPluginSetting::instance()->setMwiInfo(msgInfo->sim_idx, msgInfo->msgType.subType, udhMwiCnt);
+ Sms3gppSetting::instance()->setMwiInfo(msgInfo->sim_idx, msgInfo->msgType.subType, udhMwiCnt);
if (udhMwiCnt > 0 && (msgInfo->msgType.subType >= MSG_MWI_VOICE_SMS && msgInfo->msgType.subType <= MSG_MWI_OTHER_SMS)) {
switch (msgInfo->msgType.subType) {
}
}
- /**length 0 - no user data - msg should be received */
+ /*length 0 - no user data - msg should be received */
if (pTpdu->userData.length <= 0) {
memset(msgInfo->msgText, 0x00, sizeof(msgInfo->msgText));
msgInfo->dataSize = 0;
return;
}
- /** Convert Data values */
+ /* Convert Data values */
MsgTextConvert *textCvt = MsgTextConvert::instance();
if (pTpdu->dcs.codingScheme == SMS_CHARSET_7BIT) {
MSG_LANG_INFO_S langInfo = {0, };
}
-void SmsPluginEventHandler::convertStatusRepTpduToMsginfo(const SMS_STATUS_REPORT_S *pTpdu, MSG_MESSAGE_INFO_S *msgInfo)
+void Sms3gppEventHandler::convertStatusRepTpduToMsginfo(const SMS_3GPP_STATUS_REPORT_S *pTpdu, MSG_MESSAGE_INFO_S *msgInfo)
{
- /** Convert Type values */
+ /* Convert Type values */
msgInfo->msgType.mainType = MSG_SMS_TYPE;
msgInfo->msgType.subType = MSG_STATUS_REPORT_SMS;
- /** set folder id */
+ /* set folder id */
msgInfo->folderId = MSG_INBOX_ID;
- /** set storage id */
+ /* set storage id */
if (msgInfo->storageId == MSG_STORAGE_UNKNOWN) {
msgInfo->storageId = MSG_STORAGE_PHONE;
}
msgInfo->displayTime = time(NULL);
- /** Convert Address values */
+ /* Convert Address values */
msgInfo->nAddressCnt = 1;
msgInfo->addressList = (MSG_ADDRESS_INFO_S *)new char[sizeof(MSG_ADDRESS_INFO_S)];
msgInfo->msgPort.srcPort = 0;
for (int i = 0; i < pTpdu->userData.headerCnt; i++) {
- /** Convert UDH values - Port Number */
+ /* Convert UDH values - Port Number */
if (pTpdu->userData.header[i].udhType == SMS_UDH_APP_PORT_8BIT) {
msgInfo->msgPort.valid = true;
msgInfo->msgPort.dstPort = pTpdu->userData.header[i].udh.appPort8bit.destPort;
}
-MSG_SUB_TYPE_T SmsPluginEventHandler::convertMsgSubType(SMS_PID_T pid)
+MSG_SUB_TYPE_T Sms3gppEventHandler::convertMsgSubType(SMS_3GPP_PID_T pid)
{
switch (pid) {
case SMS_PID_TYPE0 :
}
-void SmsPluginEventHandler::SetSentInfo(SMS_SENT_INFO_S *pSentInfo)
+void Sms3gppEventHandler::SetSentInfo(SMS_3GPP_SENT_INFO_S *pSentInfo)
{
- memset(&sentInfo, 0x00, sizeof(SMS_SENT_INFO_S));
- memcpy(&sentInfo, pSentInfo, sizeof(SMS_SENT_INFO_S));
+ memset(&sentInfo, 0x00, sizeof(SMS_3GPP_SENT_INFO_S));
+ memcpy(&sentInfo, pSentInfo, sizeof(SMS_3GPP_SENT_INFO_S));
MSG_DEBUG("sentInfo.reqId : %d", sentInfo.reqInfo.reqId);
MSG_DEBUG("sentInfo.bLast : %d", sentInfo.bLast);
}
-void SmsPluginEventHandler::setDeviceStatus(TapiHandle *handle)
+void Sms3gppEventHandler::setDeviceStatus(TapiHandle *handle, bool status)
{
if (handle == devHandle) {
mx.lock();
}
-bool SmsPluginEventHandler::getDeviceStatus(TapiHandle *handle)
+bool Sms3gppEventHandler::getDeviceStatus(TapiHandle *handle)
{
int ret = 0;
}
-msg_error_t SmsPluginEventHandler::handleSimMsg(MSG_MESSAGE_INFO_S *pMsgInfo, int *simIdList, msg_message_id_t *retMsgId, int listSize)
+msg_error_t Sms3gppEventHandler::handleSimMsg(MSG_MESSAGE_INFO_S *pMsgInfo, int *simIdList, msg_message_id_t *retMsgId, int listSize)
{
MSG_BEGIN();
msg_error_t err = MSG_SUCCESS;
- /** Callback to MSG FW */
+ /* Callback to MSG FW */
err = listener.pfSimMsgIncomingCb(pMsgInfo, simIdList, retMsgId, listSize);
MSG_END();
return err;
}
-msg_error_t SmsPluginEventHandler::updateIMSI(int sim_idx)
+msg_error_t Sms3gppEventHandler::updateIMSI(int sim_idx)
{
MSG_BEGIN();
msg_error_t err = MSG_SUCCESS;
- /** Callback to MSG FW */
+ /* Callback to MSG FW */
err = listener.pfSimInitImsiCb(sim_idx);
MSG_END();
return err;
}
-void SmsPluginEventHandler::handleSimMemoryFull(int simIndex)
+void Sms3gppEventHandler::handleSimMemoryFull(int simIndex)
{
char keyName[MAX_VCONFKEY_NAME_LEN];
bool bSimSst = true;
#include "MsgDebug.h"
#include "MsgTextConvert.h"
-#include "SmsPluginUDCodec.h"
-#include "SmsPluginParamCodec.h"
+#include "Sms3gppUDCodec.h"
+#include "Sms3gppParamCodec.h"
/*==================================================================================================
- IMPLEMENTATION OF SmsPluginParamCodec - Member Functions
+ IMPLEMENTATION OF Sms3gppParamCodec - Member Functions
==================================================================================================*/
-SmsPluginParamCodec::SmsPluginParamCodec()
+Sms3gppParamCodec::Sms3gppParamCodec()
{
}
-SmsPluginParamCodec::~SmsPluginParamCodec()
+Sms3gppParamCodec::~Sms3gppParamCodec()
{
}
/*==================================================================================================
Encode Functions
==================================================================================================*/
-int SmsPluginParamCodec::encodeAddress(const SMS_ADDRESS_S *pAddress, char **ppParam)
+int Sms3gppParamCodec::encodeAddress(const SMS_3GPP_ADDRESS_S *pAddress, char **ppParam)
{
int offset = 0, length = 0;
char *temp = (char *)pAddress->address;
- SMS_TON_T ton;
+ SMS_3GPP_TON_T ton;
char *tempParam = new char[MAX_ADD_PARAM_LEN];
if (tempParam == NULL)
}
-int SmsPluginParamCodec::encodeTime(const SMS_TIMESTAMP_S *pTimeStamp, char **ppParam)
+int Sms3gppParamCodec::encodeTime(const SMS_3GPP_TIMESTAMP_S *pTimeStamp, char **ppParam)
{
int offset = 0;
- if (pTimeStamp->format == SMS_TIME_ABSOLUTE) {
+ if (pTimeStamp->format == SMS_3GPP_TIME_ABSOLUTE) {
int timeZone = pTimeStamp->time.absolute.timeZone;
*ppParam = new char[MAX_ABS_TIME_PARAM_LEN];
return offset;
- } else if (pTimeStamp->format == SMS_TIME_RELATIVE) {
+ } else if (pTimeStamp->format == SMS_3GPP_TIME_RELATIVE) {
*ppParam = new char[MAX_REL_TIME_PARAM_LEN+1];
memcpy(*ppParam, &(pTimeStamp->time.relative.time), MAX_REL_TIME_PARAM_LEN);
}
-int SmsPluginParamCodec::encodeDCS(const SMS_DCS_S *pDCS, char **ppParam)
+int Sms3gppParamCodec::encodeDCS(const SMS_3GPP_DCS_S *pDCS, char **ppParam)
{
*ppParam = new char[MAX_DCS_PARAM_LEN];
case SMS_GROUP_DELETION:
/* not supported */
break;
-
case SMS_GROUP_DISCARD:
/* not supported */
break;
-
case SMS_GROUP_STORE:
/* not supported */
break;
-
default:
return 0;
}
switch (pDCS->codingScheme) {
case SMS_CHARSET_7BIT:
-
break;
-
case SMS_CHARSET_8BIT:
**ppParam |= 0x04;
break;
-
case SMS_CHARSET_UCS2:
**ppParam |= 0x08;
break;
-
default:
return 0;
}
}
-int SmsPluginParamCodec::encodeSMSC(const char *pAddress, unsigned char *pEncodeAddr)
+int Sms3gppParamCodec::encodeSMSC(const char *pAddress, unsigned char *pEncodeAddr)
{
char newAddr[MAX_SMSC_LEN+1];
memset(newAddr, 0x00, sizeof(newAddr));
}
-int SmsPluginParamCodec::encodeSMSC(const SMS_ADDRESS_S *pAddress, unsigned char *pSMSC)
+int Sms3gppParamCodec::encodeSMSC(const SMS_3GPP_ADDRESS_S *pAddress, unsigned char *pSMSC)
{
- char newAddr[MAX_SMSC_LEN+1];
+ char newAddr[MAX_SMSC_LEN+2]; // the size of pAddress->address is greater than newAddr. So +2.
memset(newAddr, 0x00, sizeof(newAddr));
int dataSize = 0, addrLen = 0;
- if (pAddress->address[0] == '+')
+ if (pAddress->address[0] == '+') {
+ newAddr[strlen(pAddress->address)-1] = '\0';
memcpy(newAddr, pAddress->address+1, strlen(pAddress->address)-1);
- else
+ } else {
memcpy(newAddr, pAddress->address, strlen(pAddress->address));
+ newAddr[strlen(pAddress->address)] = '\0';
+ }
addrLen = strlen(newAddr);
- if (addrLen % 2 == 0)
+ if (addrLen % 2 == 0) {
dataSize = 2 + (addrLen/2);
- else
+ } else {
dataSize = 2 + (addrLen/2) + 1;
+ }
if (dataSize > MAX_SMSC_LEN) {
MSG_DEBUG("addrLen is too long [%d]", addrLen);
/*==================================================================================================
Decode Functions
==================================================================================================*/
-int SmsPluginParamCodec::decodeAddress(const unsigned char *pTpdu, SMS_ADDRESS_S *pAddress)
+int Sms3gppParamCodec::decodeAddress(const unsigned char *pTpdu, SMS_3GPP_ADDRESS_S *pAddress)
{
int offset = 0, addrLen = 0, bcdLen = 0;
MsgTextConvert *textCvt = MsgTextConvert::instance();
char* tmpAddress = new char[MAX_ADDRESS_LEN];
int tmplength = 0;
- tmplength = SmsPluginUDCodec::unpack7bitChar(&(pTpdu[offset]), (addrLen*4)/7, 0, tmpAddress);
+ tmplength = Sms3gppUDCodec::unpack7bitChar(&(pTpdu[offset]), (addrLen*4)/7, 0, tmpAddress);
MSG_LANG_INFO_S langInfo = {0, };
convertBcdToDigit(&(pTpdu[offset]), bcdLen, &((pAddress->address)[0]));
}
- offset += bcdLen;
+ offset += bcdLen;
/* MSG_DEBUG("address [%s]", pAddress->address);
*/
}
-int SmsPluginParamCodec::decodeTime(const unsigned char *pTpdu, SMS_TIMESTAMP_S *pTimeStamp)
+int Sms3gppParamCodec::decodeTime(const unsigned char *pTpdu, SMS_3GPP_TIMESTAMP_S *pTimeStamp)
{
int offset = 0;
/* decode in ABSOLUTE time type. */
- pTimeStamp->format = SMS_TIME_ABSOLUTE;
+ pTimeStamp->format = SMS_3GPP_TIME_ABSOLUTE;
pTimeStamp->time.absolute.year = (pTpdu[offset] & 0x0F)*10 + ((pTpdu[offset] & 0xF0) >> 4);
offset++;
}
-int SmsPluginParamCodec::decodeDCS(const unsigned char *pTpdu, SMS_DCS_S *pDCS)
+int Sms3gppParamCodec::decodeDCS(const unsigned char *pTpdu, SMS_3GPP_DCS_S *pDCS)
{
int offset = 0;
char dcs = pTpdu[offset++];
pDCS->msgClass = SMS_MSG_CLASS_NONE;
pDCS->bMWI = true;
- pDCS->bIndActive = (((dcs & 0x08) >> 3) == 1)? true:false;
- pDCS->indType = (SMS_INDICATOR_TYPE_T)(dcs & 0x03);
+ pDCS->bIndActive = (((dcs & 0x08) >> 3) == 1) ? true : false;
+ pDCS->indType = (SMS_3GPP_INDICATOR_TYPE_T)(dcs & 0x03);
} else if (((dcs & 0xF0) >> 4) == 0x0D) {
pDCS->codingGroup = SMS_GROUP_STORE;
pDCS->codingScheme = SMS_CHARSET_7BIT;
pDCS->msgClass = SMS_MSG_CLASS_NONE;
pDCS->bMWI = true;
- pDCS->bIndActive = (((dcs & 0x08) >> 3) == 1)? true:false;
- pDCS->indType = (SMS_INDICATOR_TYPE_T)(dcs & 0x03);
+ pDCS->bIndActive = (((dcs & 0x08) >> 3) == 1) ? true : false;
+ pDCS->indType = (SMS_3GPP_INDICATOR_TYPE_T)(dcs & 0x03);
} else if (((dcs & 0xF0) >> 4) == 0x0E) {
pDCS->codingGroup = SMS_GROUP_STORE;
pDCS->codingScheme = SMS_CHARSET_UCS2;
pDCS->msgClass = SMS_MSG_CLASS_NONE;
pDCS->bMWI = true;
- pDCS->bIndActive = (((dcs & 0x08) >> 3) == 1)? true:false;
- pDCS->indType = (SMS_INDICATOR_TYPE_T)(dcs & 0x03);
+ pDCS->bIndActive = (((dcs & 0x08) >> 3) == 1) ? true : false;
+ pDCS->indType = (SMS_3GPP_INDICATOR_TYPE_T)(dcs & 0x03);
} else {
pDCS->codingGroup = SMS_GROUP_UNKNOWN;
}
-void SmsPluginParamCodec::decodeSMSC(unsigned char* pAddress, int AddrLen, MSG_SMS_TON_T ton, char *pDecodeAddr)
+void Sms3gppParamCodec::decodeSMSC(unsigned char* pAddress, int AddrLen, MSG_SMS_TON_T ton, char *pDecodeAddr)
{
if (pAddress == NULL || AddrLen == 0)
return;
/*==================================================================================================
Util Functions
==================================================================================================*/
-int SmsPluginParamCodec::convertDigitToBcd(char *pDigit, int DigitLen, unsigned char *pBcd)
+int Sms3gppParamCodec::convertDigitToBcd(char *pDigit, int DigitLen, unsigned char *pBcd)
{
int offset = 0;
unsigned char temp;
}
-int SmsPluginParamCodec::convertBcdToDigit(const unsigned char *pBcd, int BcdLen, char *pDigit)
+int Sms3gppParamCodec::convertBcdToDigit(const unsigned char *pBcd, int BcdLen, char *pDigit)
{
int offset = 0;
unsigned char temp;
return offset;
}
-bool SmsPluginParamCodec::checkCphsVmiMsg(const unsigned char *pTpdu, int *setType, int *indType)
+bool Sms3gppParamCodec::checkCphsVmiMsg(const unsigned char *pTpdu, int *setType, int *indType)
{
bool ret = false;
if (pTpdu[offset] == 0x11 || pTpdu[offset] == 0x10) {
MSG_DEBUG("####### VMI msg ######");
*setType = (int)(pTpdu[offset] & 0x01); /* 0 : clear, 1 : set */
-
*indType = (int)(pTpdu[offset+1] & 0x01); /* 0 : indicator 1, 1 : indicator 2 */
ret = true;
return ret;
}
-time_t SmsPluginParamCodec::convertTime(const SMS_TIMESTAMP_S *time_stamp)
+time_t Sms3gppParamCodec::convertTime(const SMS_3GPP_TIMESTAMP_S *time_stamp)
{
time_t rawtime;
- if (time_stamp->format == SMS_TIME_ABSOLUTE) {
+ if (time_stamp->format == SMS_3GPP_TIME_ABSOLUTE) {
MSG_DEBUG("year : %d", time_stamp->time.absolute.year);
MSG_DEBUG("month : %d", time_stamp->time.absolute.month);
MSG_DEBUG("day : %d", time_stamp->time.absolute.day);
#include "MsgGconfWrapper.h"
#include "MsgNotificationWrapper.h"
#include "MsgUtilStorage.h"
-#include "SmsPluginParamCodec.h"
-#include "SmsPluginUDCodec.h"
-#include "SmsPluginTpduCodec.h"
-#include "SmsPluginSetting.h"
-#include "SmsPluginTransport.h"
-#include "SmsPluginCallback.h"
-#include "SmsPluginEventHandler.h"
-#include "SmsPluginSatHandler.h"
+#include "Sms3gppParamCodec.h"
+#include "Sms3gppUDCodec.h"
+#include "Sms3gppTpduCodec.h"
+#include "Sms3gppSetting.h"
+#include "Sms3gppTransport.h"
+#include "include/Sms3gppTapiEventHandler.h"
+#include "Sms3gppEventHandler.h"
+#include "Sms3gppSatHandler.h"
#include "SmsPluginDSHandler.h"
-extern "C" {
- #include <tapi_common.h>
- #include <TelSms.h>
- #include <TapiUtility.h>
- #include <ITapiNetText.h>
- #include <ITapiSat.h>
-}
+#include <tapi_common.h>
+#include <TelSms.h>
+#include <TapiUtility.h>
+#include <ITapiNetText.h>
+#include <ITapiSat.h>
/*==================================================================================================
- IMPLEMENTATION OF SmsPluginCbMsgHandler - Member Functions
+ IMPLEMENTATION OF Sms3gppCbMsgHandler - Member Functions
==================================================================================================*/
-SmsPluginSatHandler* SmsPluginSatHandler::pInstance = NULL;
+Sms3gppSatHandler* Sms3gppSatHandler::pInstance = NULL;
-SmsPluginSatHandler::SmsPluginSatHandler()
+Sms3gppSatHandler::Sms3gppSatHandler()
{
commandId = 0;
}
-SmsPluginSatHandler::~SmsPluginSatHandler()
+Sms3gppSatHandler::~Sms3gppSatHandler()
{
}
-SmsPluginSatHandler* SmsPluginSatHandler::instance()
+Sms3gppSatHandler* Sms3gppSatHandler::instance()
{
- if (!pInstance)
- pInstance = new SmsPluginSatHandler();
+ if (!pInstance) {
+ pInstance = new Sms3gppSatHandler();
+ }
return pInstance;
}
-void SmsPluginSatHandler::refreshSms(TapiHandle *handle, void *pData)
+void Sms3gppSatHandler::refreshSms(TapiHandle *handle, void *pData)
{
- /*
+/*
TelSatRefreshInd_t* pRefreshData = (TelSatRefreshInd_t*)pData;
if (pRefreshData->appType != TAPI_SAT_REFRESH_MSG)
}
-void SmsPluginSatHandler::sendSms(TapiHandle *handle, void *pData)
+void Sms3gppSatHandler::sendSms(TapiHandle *handle, void *pData)
{
TelSatSendSmsIndSmsData_t* pSmsData = (TelSatSendSmsIndSmsData_t*)pData;
pkgInfo.format = TAPI_NETTEXT_NETTYPE_3GPP;
/* Set SMSC Address */
- SMS_ADDRESS_S smsc = {0, };
+ SMS_3GPP_ADDRESS_S smsc = {0,};
int simIndex = SmsPluginDSHandler::instance()->getSimIndex(handle);
if (pSmsData->address.diallingNumberLen > 0) {
MSG_SEC_DEBUG("SCA TON[%d], NPI[%d], LEN[%zu], ADDR[%s]", smsc.ton, smsc.npi, strlen(smsc.address), smsc.address);
} else {
/* Set SMSC Options */
- SmsPluginTransport::instance()->setSmscOptions(simIndex, &smsc);
+ Sms3gppTransport::instance()->setSmscOptions(simIndex, &smsc);
}
unsigned char smscAddr[MAX_SMSC_LEN];
int smscLen = 0;
memset(smscAddr, 0x00, sizeof(smscAddr));
- smscLen = SmsPluginParamCodec::encodeSMSC(&smsc, smscAddr);
+ smscLen = Sms3gppParamCodec::encodeSMSC(&smsc, smscAddr);
if (smscLen <= 0)
return;
int tapiRet = TAPI_API_SUCCESS;
/* Send SMS */
- tapiRet = tel_send_sms(handle, &pkgInfo, 0, TapiEventSatSmsSentStatus, NULL);
+ tapiRet = tel_send_sms(handle, &pkgInfo, 0, Sms3gppTapiEventHandler::respSatSmsSentStatus, NULL);
if (tapiRet == TAPI_API_SUCCESS) {
MSG_DEBUG("######## TelTapiSmsSend Success !!! return : %d #######", tapiRet);
-
} else {
MSG_DEBUG("######## TelTapiSmsSend Fail !!! return : %d #######", tapiRet);
sendResult(handle, SMS_SAT_CMD_SEND_SMS, TAPI_SAT_R_BEYOND_ME_CAPABILITIES);
}
-void SmsPluginSatHandler::ctrlSms(TapiHandle *handle, void *pData)
+void Sms3gppSatHandler::ctrlSms(TapiHandle *handle, void *pData)
{
if (!pData) {
- MSG_DEBUG("pData is NULL");
+ MSG_ERR("pData is NULL");
return;
}
MSG_DEBUG("Event Noti for sending message by SAT : result = [%d]", pCtrlData->moSmsCtrlResult);
} else {
/* Send SMS By APP */
- SmsPluginTransport::instance()->setMoCtrlStatus(pCtrlData);
+ Sms3gppTransport::instance()->setMoCtrlStatus(pCtrlData);
}
#else
if (pCtrlData->moSmsCtrlResult == TAPI_SAT_CALL_CTRL_R_NOT_ALLOWED) {
}
/* Call Event Handler */
- SmsPluginEventHandler::instance()->handleSentStatus(netStatus);
+ Sms3gppEventHandler::instance()->handleSentStatus(netStatus);
}
#endif
}
-void SmsPluginSatHandler::ctrlSms(TapiHandle *handle, SMS_NETWORK_STATUS_T smsStatus)
+void Sms3gppSatHandler::ctrlSms(TapiHandle *handle, SMS_NETWORK_STATUS_T smsStatus)
{
MSG_DEBUG("SMS network status = [%d]", smsStatus);
}
#if 0
-void SmsPluginSatHandler::finishSimMsgInit(msg_error_t Err)
+void Sms3gppSatHandler::finishSimMsgInit(msg_error_t Err)
{
/* SAT Handler is initializing SIM now */
if (bInitSim == true) {
}
-void SmsPluginSatHandler::initSim()
+void Sms3gppSatHandler::initSim()
{
bInitSim = true;
/* Init SIM Message */
- if (SmsPluginEventHandler::instance()->callbackInitSimBySat() != MSG_SUCCESS) {
+ if (Sms3gppEventHandler::instance()->callbackInitSimBySat() != MSG_SUCCESS) {
MSG_DEBUG("Init Sim Error");
/* Send Result to TAPI */
}
-void SmsPluginSatHandler::initSMSCList()
+void Sms3gppSatHandler::initSMSCList()
{
MSG_SETTING_S settingData;
settingData.type = MSG_SMSC_LIST;
/* Get Data From SIM */
- SmsPluginSetting::instance()->getConfigData(&settingData);
+ Sms3gppSetting::instance()->getConfigData(&settingData);
MSG_DEBUG("total_count[%d]", settingData.option.smscList.totalCnt);
MSG_DEBUG("selected[%d]", settingData.option.smscList.selected);
}
-void SmsPluginSatHandler::initCBConfig()
+void Sms3gppSatHandler::initCBConfig()
{
MSG_SETTING_S settingData;
settingData.type = MSG_CBMSG_OPT;
/* Get Data From SIM */
- SmsPluginSetting::instance()->getConfigData(&settingData);
+ Sms3gppSetting::instance()->getConfigData(&settingData);
if (MsgSettingSetBool(CB_RECEIVE, settingData.option.cbMsgOpt.bReceive) != MSG_SUCCESS) {
THROW(MsgException::SMS_PLG_ERROR, "Error to set config data [%s]", CB_RECEIVE);
}
#endif
-int SmsPluginSatHandler::handleSatTpdu(unsigned char *pTpdu, unsigned char TpduLen, int bIsPackingRequired)
+int Sms3gppSatHandler::handleSatTpdu(unsigned char *pTpdu, unsigned char TpduLen, int bIsPackingRequired)
{
if (pTpdu == NULL)
THROW(MsgException::SMS_PLG_ERROR, "SAT TPDU is NULL");
/* TP-MTI, TP-RD, TP-VPF, TP-RP, TP-UDHI, TP-SRR */
/* TP-VPF */
- SMS_VPF_T vpf = (SMS_VPF_T)(pTpdu[pos++] & 0x18) >> 3;
+ SMS_3GPP_VPF_T vpf = (SMS_3GPP_VPF_T)(pTpdu[pos++] & 0x18) >> 3;
/* TP-MR */
unsigned char tmpRef = pTpdu[pos];
/* TP-DA */
- SMS_ADDRESS_S destAddr = {0};
- int addrLen = SmsPluginParamCodec::decodeAddress(&pTpdu[pos], &destAddr);
+ SMS_3GPP_ADDRESS_S destAddr = {0};
+ int addrLen = Sms3gppParamCodec::decodeAddress(&pTpdu[pos], &destAddr);
pos += addrLen;
pos++;
/* TP-DCS */
- SMS_DCS_S dcs = {0};
+ SMS_3GPP_DCS_S dcs = {0};
- int dcsLen = SmsPluginParamCodec::decodeDCS(&pTpdu[pos], &dcs);
+ int dcsLen = Sms3gppParamCodec::decodeDCS(&pTpdu[pos], &dcs);
if (bIsPackingRequired == true) {
dcs.codingScheme = SMS_CHARSET_7BIT;
char* pDcs = NULL;
unique_ptr<char*, void(*)(char**)> dcsBuf(&pDcs, unique_ptr_deleter);
- SmsPluginParamCodec::encodeDCS(&dcs, &pDcs);
+ Sms3gppParamCodec::encodeDCS(&dcs, &pDcs);
memcpy(&(pTpdu[pos]), pDcs, dcsLen);
}
int retLen = 0;
if (bIsPackingRequired == true) {
- SMS_USERDATA_S userData = {0};
+ SMS_3GPP_USERDATA_S userData = {0};
userData.headerCnt = 0;
userData.length = udl;
if (!is7bitPacked) {
MSG_DEBUG("packing 8-bit user data to 7-bit charset !!");
- int encodeSize = SmsPluginUDCodec::encodeUserData(&userData, dcs.codingScheme, (char*)&pTpdu[pos]);
+ int encodeSize = Sms3gppUDCodec::encodeUserData(&userData, dcs.codingScheme, (char*)&pTpdu[pos]);
retLen = pos + encodeSize;
} else {
retLen = TpduLen;
}
-void SmsPluginSatHandler::sendResult(TapiHandle *handle, SMS_SAT_CMD_TYPE_T CmdType, int ResultType)
+void Sms3gppSatHandler::sendResult(TapiHandle *handle, SMS_3GPP_SAT_CMD_TYPE_T CmdType, int ResultType)
{
TelSatAppsRetInfo_t satRetInfo;
memset(&satRetInfo, 0, sizeof(TelSatAppsRetInfo_t));
#include "MsgTextConvert.h"
#include "MsgDevicedWrapper.h"
-#include "SmsPluginParamCodec.h"
-#include "SmsPluginCallback.h"
-#include "SmsPluginEventHandler.h"
-#include "SmsPluginSimMsg.h"
-#include "SmsPluginMain.h"
-#include "SmsPluginSetting.h"
#include "SmsPluginDSHandler.h"
-
-extern "C" {
- #include <tapi_common.h>
- #include <TelSms.h>
- #include <TapiUtility.h>
- #include <ITapiNetText.h>
- #include <ITapiSim.h>
- #include <ITapiModem.h>
-}
+#include "SmsPluginMain.h"
+#include "Sms3gppParamCodec.h"
+#include "Sms3gppTapiEventHandler.h"
+#include "Sms3gppEventHandler.h"
+#include "Sms3gppSimMsg.h"
+#include "Sms3gppSetting.h"
+
+#include <tapi_common.h>
+#include <TelSms.h>
+#include <TapiUtility.h>
+#include <ITapiNetText.h>
+#include <ITapiSim.h>
+#include <ITapiModem.h>
/*==================================================================================================
INTERNAL FUNCTION
/*==================================================================================================
- IMPLEMENTATION OF SmsPluginSetting - Member Functions
+ IMPLEMENTATION OF Sms3gppSetting - Member Functions
==================================================================================================*/
-SmsPluginSetting* SmsPluginSetting::pInstance = NULL;
+Sms3gppSetting* Sms3gppSetting::pInstance = NULL;
-SmsPluginSetting::SmsPluginSetting()
+Sms3gppSetting::Sms3gppSetting()
{
/* Initialize member variables */
for (int i = 0; i <= MAX_TELEPHONY_HANDLE_CNT; i++) {
}
-SmsPluginSetting::~SmsPluginSetting()
+Sms3gppSetting::~Sms3gppSetting()
{
smscList.erase(smscList.begin(), smscList.end());
simMailboxList.erase(simMailboxList.begin(), simMailboxList.end());
}
-SmsPluginSetting* SmsPluginSetting::instance()
+Sms3gppSetting* Sms3gppSetting::instance()
{
- if (!pInstance)
- pInstance = new SmsPluginSetting();
+ if (!pInstance) {
+ pInstance = new Sms3gppSetting();
+ }
return pInstance;
}
-void* SmsPluginSetting::initSimInfo(void *data)
+void* Sms3gppSetting::initSimInfo(void *data)
{
static MsgMutex mm;
MsgMutexLocker lock(mm);
return NULL;
}
-void* SmsPluginSetting::processInitSimInfo(void *data)
+void* Sms3gppSetting::processInitSimInfo(void *data)
{
MSG_BEGIN();
}
-void SmsPluginSetting::updateSimStatus(TapiHandle *handle)
+void Sms3gppSetting::updateSimStatus(TapiHandle *handle)
{
MSG_BEGIN();
- if (!handle) {
- MSG_DEBUG("handle is NULL.");
- return;
- }
+ MSG_ERR_RET_M(!handle, "handle is NULL!");
int status = 0;
int tapiRet = TAPI_API_SUCCESS;
+ int simIndex = SmsPluginDSHandler::instance()->getSimIndex(handle);
char keyName[MAX_VCONFKEY_NAME_LEN];
memset(keyName, 0x00, sizeof(keyName));
- int simIndex = SmsPluginDSHandler::instance()->getSimIndex(handle);
-
/* Get IMSI */
TelSimImsiInfo_t imsiInfo;
memset(&imsiInfo, 0x00, sizeof(TelSimImsiInfo_t));
} else {
MSG_DEBUG("Device Is Not Ready.. Waiting For Ready Callback");
- if (SmsPluginEventHandler::instance()->getDeviceStatus(handle) == true) {
+ if (Sms3gppEventHandler::instance()->getDeviceStatus(handle) == true) {
MSG_DEBUG("Device Is Ready");
} else {
MSG_DEBUG("Device Is Not Ready.");
try {
/* init sim messages. */
- SmsPluginSimMsg::instance()->initSimMessage(handle);
+ Sms3gppSimMsg::instance()->initSimMessage(handle);
} catch (MsgException& e) {
MSG_FATAL("%s", e.what());
return;
}
-void SmsPluginSetting::initConfigData(TapiHandle *handle)
+void Sms3gppSetting::initConfigData(TapiHandle *handle)
{
MSG_BEGIN();
}
-void SmsPluginSetting::SimRefreshCb(TapiHandle *handle)
+void Sms3gppSetting::SimRefreshCb(TapiHandle *handle)
{
pthread_t thd;
}
-void* SmsPluginSetting::init_config_data(void *data)
+void* Sms3gppSetting::init_config_data(void *data)
{
TapiHandle *handle = (TapiHandle *)data;
instance()->initConfigData(handle);
}
-void SmsPluginSetting::setConfigData(const MSG_SETTING_S *pSetting)
+void Sms3gppSetting::setConfigData(const MSG_SETTING_S *pSetting)
{
MSG_DEBUG("Setting Type : [%d]", pSetting->type);
}
-void SmsPluginSetting::getConfigData(MSG_SETTING_S *pSetting)
+void Sms3gppSetting::getConfigData(MSG_SETTING_S *pSetting)
{
MSG_DEBUG("Setting Type : [%d]", pSetting->type);
}
-void SmsPluginSetting::addSMSCList(MSG_SMSC_LIST_S *pSmscList)
+void Sms3gppSetting::addSMSCList(MSG_SMSC_LIST_S *pSmscList)
{
MSG_BEGIN();
}
-void SmsPluginSetting::getSmscListInfo(int simIndex, MSG_SMSC_LIST_S *pSmscList)
+void Sms3gppSetting::getSmscListInfo(int simIndex, MSG_SMSC_LIST_S *pSmscList)
{
if (pSmscList == NULL) {
MSG_DEBUG("pSmscList is NULL!");
}
-msg_error_t SmsPluginSetting::addCbOpt(MSG_CBMSG_OPT_S *pCbOpt)
+msg_error_t Sms3gppSetting::addCbOpt(MSG_CBMSG_OPT_S *pCbOpt)
{
msg_error_t err = MSG_SUCCESS;
char keyName[MAX_VCONFKEY_NAME_LEN];
}
-void SmsPluginSetting::getCbOpt(MSG_SETTING_S *pSetting, int simIndex)
+void Sms3gppSetting::getCbOpt(MSG_SETTING_S *pSetting, int simIndex)
{
char keyName[MAX_VCONFKEY_NAME_LEN];
}
-void SmsPluginSetting::setParamList(const MSG_SMSC_LIST_S *pSMSCList)
+void Sms3gppSetting::setParamList(const MSG_SMSC_LIST_S *pSMSCList)
{
MSG_BEGIN();
MSG_SEC_DEBUG("address = %s", pSMSCList->smscData[index].smscAddr.address);
- smsParam.TpSvcCntrAddr.DialNumLen = SmsPluginParamCodec::encodeSMSC(pSMSCList->smscData[index].smscAddr.address, smsParam.TpSvcCntrAddr.szDiallingNum);
+ smsParam.TpSvcCntrAddr.DialNumLen = Sms3gppParamCodec::encodeSMSC(pSMSCList->smscData[index].smscAddr.address, smsParam.TpSvcCntrAddr.szDiallingNum);
} else {
MSG_DEBUG("SMSC Addr is not present");
}
/* Get TAPI handle */
TapiHandle *handle = SmsPluginDSHandler::instance()->getTelHandle(pSMSCList->simIndex);
- ret = tel_set_sms_parameters(handle, (const TelSmsParams_t*)&smsParam, TapiEventSetConfigData, NULL);
+ ret = tel_set_sms_parameters(handle, (const TelSmsParams_t*)&smsParam, Sms3gppTapiEventHandler::respSetConfigData, NULL);
if (ret != TAPI_API_SUCCESS)
THROW(MsgException::SMS_PLG_ERROR, "tel_set_sms_parameters() Error. [%d]", ret);
}
-void SmsPluginSetting::getParamList(MSG_SMSC_LIST_S *pSMSCList)
+void Sms3gppSetting::getParamList(MSG_SMSC_LIST_S *pSMSCList)
{
MSG_BEGIN();
MSG_SMSC_DATA_S tmpSmscData = {};
for (int index = 0; index < paramCnt; index++) {
- ret = tel_get_sms_parameters(handle, index, TapiEventGetParam, NULL);
+ ret = tel_get_sms_parameters(handle, index, Sms3gppTapiEventHandler::respGetParam, NULL);
if (ret == TAPI_API_SUCCESS) {
MSG_DEBUG("######## tel_get_sms_parameters() Success !!! #######");
if (getParamEvent(handle, &tmpSmscData) == true) {
MSG_DEBUG("######## Get Parameter was Successful !!! #######");
-
memcpy(&(pSMSCList->smscData[index]), &tmpSmscData, sizeof(MSG_SMSC_DATA_S));
MSG_DEBUG("pid[%d]", pSMSCList->smscData[index].pid);
}
-int SmsPluginSetting::getParamCount(TapiHandle *handle)
+int Sms3gppSetting::getParamCount(TapiHandle *handle)
{
int ret = TAPI_API_SUCCESS;
- ret = tel_get_sms_parameter_count(handle, TapiEventGetParamCnt, NULL);
+ ret = tel_get_sms_parameter_count(handle, Sms3gppTapiEventHandler::respGetParamCnt, NULL);
if (ret == TAPI_API_SUCCESS) {
MSG_DEBUG("######## tel_get_sms_parameter_count() Success !!! #######");
}
-bool SmsPluginSetting::getParam(TapiHandle *handle, int Index, MSG_SMSC_DATA_S *pSmscData)
+bool Sms3gppSetting::getParam(TapiHandle *handle, int Index, MSG_SMSC_DATA_S *pSmscData)
{
int ret = TAPI_API_SUCCESS;
- ret = tel_get_sms_parameters(handle, Index, TapiEventGetParam, NULL);
+ ret = tel_get_sms_parameters(handle, Index, Sms3gppTapiEventHandler::respGetParam, NULL);
if (ret == TAPI_API_SUCCESS) {
MSG_DEBUG("######## tel_get_sms_parameters() Success !!! #######");
}
-void SmsPluginSetting::setSmscInfo(const MSG_SMSC_LIST_S *pSmscList)
+void Sms3gppSetting::setSmscInfo(const MSG_SMSC_LIST_S *pSmscList)
{
MSG_BEGIN();
MSG_SEC_DEBUG("SMSC TON = [%d], NPI = [%d], Address = [%s]", sca.Ton, sca.Npi, pSmscData->smscAddr.address);
- sca.DialNumLen = SmsPluginParamCodec::encodeSMSC(pSmscData->smscAddr.address, sca.szDiallingNum);
+ sca.DialNumLen = Sms3gppParamCodec::encodeSMSC(pSmscData->smscAddr.address, sca.szDiallingNum);
} else {
MSG_DEBUG("SMSC Addr is not present");
}
- ret = tel_set_sms_sca(handle, (const TelSmsAddressInfo_t *)&sca, 0, TapiEventSetSmscInfo, NULL);
+ ret = tel_set_sms_sca(handle, (const TelSmsAddressInfo_t *)&sca, 0, Sms3gppTapiEventHandler::respSetSmscInfo, NULL);
if (ret != TAPI_API_SUCCESS)
THROW(MsgException::SMS_PLG_ERROR, "tel_set_sms_sca() Error. [%d]", ret);
}
-bool SmsPluginSetting::setCbConfig(const MSG_CBMSG_OPT_S *pCbOpt)
+bool Sms3gppSetting::setCbConfig(const MSG_CBMSG_OPT_S *pCbOpt)
{
TapiHandle *handle = NULL;
int simCnt = SmsPluginDSHandler::instance()->getTelHandleCount();
cbConfig.MsgIDs[i].Net3gpp.ToMsgId = (unsigned short)cbSetting.option.cbMsgOpt.channelData.channelInfo[i].to;
}*/
- ret = tel_set_sms_cb_config(handle, &cbConfig, TapiEventSetConfigData, NULL);
+ ret = tel_set_sms_cb_config(handle, &cbConfig, Sms3gppTapiEventHandler::respSetConfigData, NULL);
if (ret == TAPI_API_SUCCESS) {
MSG_DEBUG("######## tel_set_sms_cb_config() Success !!! #######");
}
MSG_DEBUG("CBEnabled: %d, range_count: %d", cbConfig.CBEnabled, cbConfig.MsgIdRangeCount);*/
- ret = tel_set_sms_cb_config(handle, &cbConfig, TapiEventSetConfigData, NULL);
+ ret = tel_set_sms_cb_config(handle, &cbConfig, Sms3gppTapiEventHandler::respSetConfigData, NULL);
if (ret == TAPI_API_SUCCESS) {
MSG_DEBUG("######## tel_set_sms_cb_config() Success !!! #######");
}
-bool SmsPluginSetting::getCbConfig(MSG_CBMSG_OPT_S *pCbOpt)
+bool Sms3gppSetting::getCbConfig(MSG_CBMSG_OPT_S *pCbOpt)
{
int ret = TAPI_API_SUCCESS;
handle = SmsPluginDSHandler::instance()->getTelHandle(pCbOpt->simIndex);
- ret = tel_get_sms_cb_config(handle, TapiEventGetCBConfig, NULL);
+ ret = tel_get_sms_cb_config(handle, Sms3gppTapiEventHandler::respGetCBConfig, NULL);
if (ret == TAPI_API_SUCCESS) {
MSG_DEBUG("######## tel_get_sms_cb_config() Success !!! #######");
}
-void SmsPluginSetting::setVoiceMailInfo(const MSG_VOICEMAIL_OPT_S *pVoiceOpt)
+void Sms3gppSetting::setVoiceMailInfo(const MSG_VOICEMAIL_OPT_S *pVoiceOpt)
{
MSG_BEGIN();
MsgMutexLocker lock(mx);
return;
}
- SMS_SIM_MAILBOX_LIST_S &pTmpSimMailboxList = it->second;
+ SMS_3GPP_SIM_MAILBOX_LIST_S &pTmpSimMailboxList = it->second;
if (pTmpSimMailboxList.count < 0) { /* Not available */
return;
}
TapiHandle *handle = SmsPluginDSHandler::instance()->getTelHandle(simIndex);
- ret = tel_set_sim_mailbox_info(handle, &mailboxInfo, TapiEventSetMailboxInfo, (void*)bShowError);
+ ret = tel_set_sim_mailbox_info(handle, &mailboxInfo, Sms3gppTapiEventHandler::respSetMailboxInfo, (void*)bShowError);
if (ret == TAPI_API_SUCCESS) {
MSG_DEBUG("######## tel_set_sim_mailbox_info() Success !!! #######");
}
-bool SmsPluginSetting::getVoiceMailInfo(TapiHandle *handle)
+bool Sms3gppSetting::getVoiceMailInfo(TapiHandle *handle)
{
MsgMutexLocker lock(mx);
int ret = TAPI_API_SUCCESS;
- ret = tel_get_sim_mailbox_info(handle, TapiEventGetMailboxInfo, NULL);
+ ret = tel_get_sim_mailbox_info(handle, Sms3gppTapiEventHandler::respGetMailboxInfo, NULL);
if (ret == TAPI_API_SUCCESS) {
MSG_DEBUG("######## tel_get_sim_mailbox_info() Success !!! #######");
}
-void SmsPluginSetting::getMeImei(char *pImei)
+void Sms3gppSetting::getMeImei(char *pImei)
{
int ret = TAPI_API_SUCCESS;
return;
}
- ret = tel_get_misc_me_imei(handle, TapiEventGetMeImei, NULL);
+ ret = tel_get_misc_me_imei(handle, Sms3gppTapiEventHandler::respGetMeImei, NULL);
if (ret == TAPI_API_SUCCESS) {
MSG_SEC_DEBUG("######## tel_get_misc_me_imei() Success !!! #######");
}
-void SmsPluginSetting::setMwiInfo(int simIndex, MSG_SUB_TYPE_T type, int count)
+void Sms3gppSetting::setMwiInfo(int simIndex, MSG_SUB_TYPE_T type, int count)
{
MSG_DEBUG("SET MWI INFO, type=[%d]", type);
MSG_DEBUG("SET MWI INFO, count=[%d]", count);
MSG_DEBUG("IT is present");
- SMS_SIM_MWI_INFO_S &pTmpsimMwiInfo = iter->second;
+ SMS_3GPP_SIM_MWI_INFO_S &pTmpsimMwiInfo = iter->second;
MSG_DEBUG("SET MWI INFO, CPHS? [%s]", pTmpsimMwiInfo.b_cphs?"Yes":"No");
TapiHandle *handle = SmsPluginDSHandler::instance()->getTelHandle(simIndex);
- ret = tel_set_sim_messagewaiting_info(handle, &mwReq, TapiEventSetMwiInfo, NULL);
+ ret = tel_set_sim_messagewaiting_info(handle, &mwReq, Sms3gppTapiEventHandler::respSetMwiInfo, NULL);
if (ret == TAPI_API_SUCCESS) {
MSG_DEBUG("######## tel_set_sim_messagewaiting_info() Success !!! #######");
}
-bool SmsPluginSetting::getMwiInfo(TapiHandle *handle)
+bool Sms3gppSetting::getMwiInfo(TapiHandle *handle)
{
MsgMutexLocker lock(mx);
int ret = TAPI_API_SUCCESS;
- ret = tel_get_sim_messagewaiting_info(handle, TapiEventGetMwiInfo, NULL);
+ ret = tel_get_sim_messagewaiting_info(handle, Sms3gppTapiEventHandler::respGetMwiInfo, NULL);
if (ret == TAPI_API_SUCCESS) {
MSG_DEBUG("######## tel_get_sim_messagewaiting_info() Success !!! #######");
}
-bool SmsPluginSetting::getMsisdnInfo(TapiHandle *handle)
+bool Sms3gppSetting::getMsisdnInfo(TapiHandle *handle)
{
MsgMutexLocker lock(mx);
int ret = TAPI_API_SUCCESS;
- ret = tel_get_sim_msisdn(handle, TapiEventGetMsisdnInfo, NULL);
+ ret = tel_get_sim_msisdn(handle, Sms3gppTapiEventHandler::respGetMsisdnInfo, NULL);
if (ret == TAPI_API_SUCCESS) {
MSG_DEBUG("######## tel_get_sim_msisdn() Success !!! #######");
}
-bool SmsPluginSetting::getSimServiceTable(TapiHandle *handle)
+bool Sms3gppSetting::getSimServiceTable(TapiHandle *handle)
{
MsgMutexLocker lock(mx);
int ret = TAPI_API_SUCCESS;
- ret = tel_get_sim_service_table(handle, TapiEventGetSimServiceTable, NULL);
+ ret = tel_get_sim_service_table(handle, Sms3gppTapiEventHandler::respGetSimServiceTable, NULL);
if (ret == TAPI_API_SUCCESS) {
MSG_DEBUG("######## tel_get_sim_service_table() Success !!! #######");
}
-void SmsPluginSetting::setParamCntEvent(int ParamCnt)
+void Sms3gppSetting::setParamCntEvent(int ParamCnt)
{
mx.lock();
}
-int SmsPluginSetting::getParamCntEvent()
+int Sms3gppSetting::getParamCntEvent()
{
int ret = 0;
}
-void SmsPluginSetting::setParamEvent(struct tapi_handle *handle, const MSG_SMSC_DATA_S *pSmscData, int RecordIdx, bool bSuccess)
+void Sms3gppSetting::setParamEvent(TapiHandle *handle, const MSG_SMSC_DATA_S *pSmscData, int RecordIdx, bool bSuccess)
{
mx.lock();
}
-bool SmsPluginSetting::getParamEvent(TapiHandle *handle, MSG_SMSC_DATA_S *pSmscData)
+bool Sms3gppSetting::getParamEvent(TapiHandle *handle, MSG_SMSC_DATA_S *pSmscData)
{
int ret = 0;
}
-void SmsPluginSetting::setCbConfigEvent(TapiHandle *handle, const MSG_CBMSG_OPT_S *pCbOpt, bool bSuccess)
+void Sms3gppSetting::setCbConfigEvent(TapiHandle *handle, const MSG_CBMSG_OPT_S *pCbOpt, bool bSuccess)
{
MSG_BEGIN();
}
-bool SmsPluginSetting::getCbConfigEvent(MSG_CBMSG_OPT_S *pCbOpt)
+bool Sms3gppSetting::getCbConfigEvent(MSG_CBMSG_OPT_S *pCbOpt)
{
MSG_BEGIN();
}
-void SmsPluginSetting::setMailboxInfoEvent(TapiHandle *handle, SMS_SIM_MAILBOX_LIST_S *pMailboxList, bool bSuccess, bool bMbdn)
+void Sms3gppSetting::setMailboxInfoEvent(TapiHandle *handle, SMS_3GPP_SIM_MAILBOX_LIST_S *pMailboxList, bool bSuccess, bool bMbdn)
{
MSG_BEGIN();
char keyName[MAX_VCONFKEY_NAME_LEN];
if (pMailboxList && pMailboxList->count > 0) {
- pair <int, SMS_SIM_MAILBOX_LIST_S> newList(simIndex, *pMailboxList);
+ pair <int, SMS_3GPP_SIM_MAILBOX_LIST_S> newList(simIndex, *pMailboxList);
smsSimMailboxListMap::iterator it = simMailboxList.find(simIndex);
if (it == simMailboxList.end()) {
}
smsSimMailboxListMap::iterator iter = simMailboxList.find(simIndex);
-
- SMS_SIM_MAILBOX_LIST_S &pTmpMailboxList = iter->second;
-
+ SMS_3GPP_SIM_MAILBOX_LIST_S &pTmpMailboxList = iter->second;
char mailNumber[MAX_PHONE_NUMBER_LEN+1];
memset(mailNumber, 0x00 , sizeof(mailNumber));
}
} else {
/* insert empty list with sim index */
- SMS_SIM_MAILBOX_LIST_S pDummySimMailboxList;
+ SMS_3GPP_SIM_MAILBOX_LIST_S pDummySimMailboxList;
- memset(&pDummySimMailboxList, 0x00, sizeof(SMS_SIM_MAILBOX_LIST_S));
- pair <int, SMS_SIM_MAILBOX_LIST_S> newTmpList(simIndex, pDummySimMailboxList);
+ memset(&pDummySimMailboxList, 0x00, sizeof(SMS_3GPP_SIM_MAILBOX_LIST_S));
+ pair <int, SMS_3GPP_SIM_MAILBOX_LIST_S> newTmpList(simIndex, pDummySimMailboxList);
simMailboxList.insert(newTmpList);
}
MSG_END();
}
-bool SmsPluginSetting::getMailboxInfoEvent()
+bool Sms3gppSetting::getMailboxInfoEvent()
{
int ret = 0;
return bTapiResult;
}
-void SmsPluginSetting::setMwiInfoEvent(struct tapi_handle *handle, SMS_SIM_MWI_INFO_S *pMwiInfo, bool bSuccess)
+void Sms3gppSetting::setMwiInfoEvent(TapiHandle *handle, SMS_3GPP_SIM_MWI_INFO_S *pMwiInfo, bool bSuccess)
{
MSG_BEGIN();
int mwiCnt = 0;
char keyName[MAX_VCONFKEY_NAME_LEN];
- pair <int, SMS_SIM_MWI_INFO_S> newList(index, *pMwiInfo);
+ pair <int, SMS_3GPP_SIM_MWI_INFO_S> newList(index, *pMwiInfo);
simMwiInfoMap::iterator it = simMwiInfo.find(index);
if (it == simMwiInfo.end()) {
simMwiInfoMap::iterator iter = simMwiInfo.find(index);
- SMS_SIM_MWI_INFO_S &pTmpsimMwiInfoList = iter->second;
+ SMS_3GPP_SIM_MWI_INFO_S &pTmpsimMwiInfoList = iter->second;
/* Save MW count with VOICE line1 number */
if (pTmpsimMwiInfoList.b_cphs == true) {
deliverVoiceMsgNoti(index, mwiCnt);
}
} else {
- SMS_SIM_MWI_INFO_S pTmpsimMwiInfo;
+ SMS_3GPP_SIM_MWI_INFO_S pTmpsimMwiInfo;
- memset(&pTmpsimMwiInfo, 0x00, sizeof(SMS_SIM_MWI_INFO_S));
+ memset(&pTmpsimMwiInfo, 0x00, sizeof(SMS_3GPP_SIM_MWI_INFO_S));
- pair <int, SMS_SIM_MWI_INFO_S> newList(index, pTmpsimMwiInfo);
+ pair <int, SMS_3GPP_SIM_MWI_INFO_S> newList(index, pTmpsimMwiInfo);
simMwiInfoMap::iterator it = simMwiInfo.find(index);
if (it == simMwiInfo.end()) {
}
-void SmsPluginSetting::setResultImei(bool bResult, char *pImei)
+void Sms3gppSetting::setResultImei(bool bResult, char *pImei)
{
mx.lock();
}
-bool SmsPluginSetting::getResultImei(char *pImei)
+bool Sms3gppSetting::getResultImei(char *pImei)
{
int ret = 0;
}
-void SmsPluginSetting::setResultFromSim(bool bResult)
+void Sms3gppSetting::setResultFromSim(bool bResult)
{
mx.lock();
}
-bool SmsPluginSetting::getResultFromSim()
+bool Sms3gppSetting::getResultFromSim()
{
int ret = 0;
}
-SMS_PID_T SmsPluginSetting::convertPid(MSG_SMS_PID_T pid)
+SMS_3GPP_PID_T Sms3gppSetting::convertPid(MSG_SMS_PID_T pid)
{
- SMS_PID_T retPid;
+ SMS_3GPP_PID_T retPid;
switch (pid) {
case MSG_PID_TEXT :
}
-void SmsPluginSetting::deliverVoiceMsgNoti(int simIndex, int mwiCnt)
+void Sms3gppSetting::deliverVoiceMsgNoti(int simIndex, int mwiCnt)
{
MSG_BEGIN();
#endif
#if 0
- if (SmsPluginEventHandler::instance()->callbackMsgIncoming(&msgInfo) != MSG_SUCCESS)
+ if (Sms3gppEventHandler::instance()->callbackMsgIncoming(&msgInfo) != MSG_SUCCESS)
MSG_DEBUG("callbackIncoming is failed.");
#else
MsgInsertNotification(&msgInfo);
}
-void SmsPluginSetting::setSimChangeStatus(TapiHandle *handle, bool bInitializing)
+void Sms3gppSetting::setSimChangeStatus(TapiHandle *handle)
{
MSG_BEGIN();
#include <errno.h>
+#include "SmsPluginDSHandler.h"
+#include "Sms3gppTapiEventHandler.h"
+#include "Sms3gppTpduCodec.h"
#include "MsgDebug.h"
#include "MsgCppTypes.h"
#include "MsgException.h"
#include "MsgGconfWrapper.h"
-#include "SmsPluginParamCodec.h"
-#include "SmsPluginTpduCodec.h"
-#include "SmsPluginTransport.h"
-#include "SmsPluginStorage.h"
-#include "SmsPluginEventHandler.h"
-#include "SmsPluginCallback.h"
+#include "Sms3gppParamCodec.h"
+#include "Sms3gppTransport.h"
+#include "Sms3gppStorage.h"
+#include "Sms3gppEventHandler.h"
#include "MsgUtilStorage.h"
#include "MsgNotificationWrapper.h"
-#include "SmsPluginSimMsg.h"
-#include "SmsPluginDSHandler.h"
+#include "Sms3gppSimMsg.h"
/*==================================================================================================
- IMPLEMENTATION OF SmsPluginSimMsg - Member Functions
+ IMPLEMENTATION OF Sms3gppSimMsg - Member Functions
==================================================================================================*/
-SmsPluginSimMsg* SmsPluginSimMsg::pInstance = NULL;
+Sms3gppSimMsg* Sms3gppSimMsg::pInstance = NULL;
-SmsPluginSimMsg::SmsPluginSimMsg()
+Sms3gppSimMsg::Sms3gppSimMsg()
{
/* Initialize member variables */
simMsgId = 0;
}
-SmsPluginSimMsg::~SmsPluginSimMsg()
+Sms3gppSimMsg::~Sms3gppSimMsg()
{
}
-SmsPluginSimMsg* SmsPluginSimMsg::instance()
+Sms3gppSimMsg* Sms3gppSimMsg::instance()
{
- if (!pInstance)
- pInstance = new SmsPluginSimMsg();
+ if (!pInstance) {
+ pInstance = new Sms3gppSimMsg();
+ }
return pInstance;
}
-void SmsPluginSimMsg::initSimMessage(TapiHandle *handle)
+void Sms3gppSimMsg::initSimMessage(TapiHandle *handle)
{
MSG_BEGIN();
MSG_DEBUG("Error to set config data [%s]", keyName);
}
- MSG_SIM_COUNT_S tmpMsgCnt;
- memset(&tmpMsgCnt, 0x00, sizeof(MSG_SIM_COUNT_S));
+ MSG_3GPP_SIM_COUNT_S tmpMsgCnt;
+ memset(&tmpMsgCnt, 0x00, sizeof(MSG_3GPP_SIM_COUNT_S));
getSimMsgCount(handle, &tmpMsgCnt);
MSG_MESSAGE_INFO_S tmpMsgInfo;
if (tmpMsgInfo.bRead == false)
unreadSimMsg++;
- if (SmsPluginEventHandler::instance()->handleSimMsg(&tmpMsgInfo, simIdList, NULL, MAX_SIM_SMS_NUM) < 0) {
+ if (Sms3gppEventHandler::instance()->handleSimMsg(&tmpMsgInfo, simIdList, NULL, MAX_SIM_SMS_NUM) < 0) {
MSG_DEBUG("Fail to handleSimMsg()");
}
}
#endif
- if (SmsPluginEventHandler::instance()->updateIMSI(sim_idx) != MSG_SUCCESS) {
+ if (Sms3gppEventHandler::instance()->updateIMSI(sim_idx) != MSG_SUCCESS) {
MSG_ERR("Fail to handleSimMsg()");
}
}
-msg_error_t SmsPluginSimMsg::saveSimMessage(const MSG_MESSAGE_INFO_S *pMsgInfo, SMS_SIM_ID_LIST_S *pSimIdList)
+msg_error_t Sms3gppSimMsg::saveSimMessage(const MSG_MESSAGE_INFO_S *pMsgInfo, SMS_SIM_ID_LIST_S *pSimIdList)
{
bool bSimSst = true;
/* Reset Out Parameter */
pSimIdList->count = 0;
- SMS_TPDU_S tpdu;
- memset(&tpdu, 0x00, sizeof(SMS_TPDU_S));
+ SMS_3GPP_TPDU_S tpdu;
+ memset(&tpdu, 0x00, sizeof(SMS_3GPP_TPDU_S));
if (pMsgInfo->direction == MSG_DIRECTION_TYPE_MO) {
tpdu.tpduType = SMS_TPDU_SUBMIT;
tpdu.data.submit.dcs.msgClass = SMS_MSG_CLASS_NONE;
}
for (int i = 0; i <pMsgInfo->nAddressCnt; ++i) {
- SMS_SUBMIT_DATA_S submitData;
- memset(&submitData, 0x00, sizeof(SMS_SUBMIT_DATA_S));
+ SMS_3GPP_SUBMIT_DATA_S submitData;
+ memset(&submitData, 0x00, sizeof(SMS_3GPP_SUBMIT_DATA_S));
int bufLen = 0;
char buf[MAX_TPDU_DATA_LEN];
if (pMsgInfo->direction == MSG_DIRECTION_TYPE_MO) { /* SUBMIT MSG */
- SmsPluginTransport::instance()->msgInfoToSubmitData(pMsgInfo, &submitData, &(tpdu.data.submit.dcs.codingScheme), i);
+ Sms3gppTransport::instance()->msgInfoToSubmitData(pMsgInfo, &submitData, &(tpdu.data.submit.dcs.codingScheme), i);
int addLen = strlen(submitData.destAddress.address);
memcpy(tpdu.data.submit.destAddress.address, submitData.destAddress.address, MAX_ADDRESS_LEN);
tpdu.data.submit.destAddress.address[MAX_ADDRESS_LEN] = '\0';
}
-
} else { /* DELIVER MSG */
- SmsPluginTransport::instance()->msgInfoToSubmitData(pMsgInfo, &submitData, &(tpdu.data.deliver.dcs.codingScheme), i);
+ Sms3gppTransport::instance()->msgInfoToSubmitData(pMsgInfo, &submitData, &(tpdu.data.deliver.dcs.codingScheme), i);
int addLen = strlen(submitData.destAddress.address);
for (unsigned int segCnt = 0; segCnt < submitData.segCount; segCnt++) {
if (pMsgInfo->direction == MSG_DIRECTION_TYPE_MO) {
- memcpy(&(tpdu.data.submit.userData), &(submitData.userData[segCnt]), sizeof(SMS_USERDATA_S));
+ memcpy(&(tpdu.data.submit.userData), &(submitData.userData[segCnt]), sizeof(SMS_3GPP_USERDATA_S));
} else {
- memcpy(&(tpdu.data.deliver.userData), &(submitData.userData[segCnt]), sizeof(SMS_USERDATA_S));
+ memcpy(&(tpdu.data.deliver.userData), &(submitData.userData[segCnt]), sizeof(SMS_3GPP_USERDATA_S));
}
memset(buf, 0x00, sizeof(buf));
/* Encode SMS-DELIVER TPDU */
- bufLen = SmsPluginTpduCodec::encodeTpdu(&tpdu, buf);
+ bufLen = Sms3gppTpduCodec::encodeTpdu(&tpdu, buf);
/* Make Telephony Structure */
TelSmsData_t simSmsData;
/* Save SMS in SIM */
int ret = 0;
- ret = tel_write_sms_in_sim(handle, &simSmsData, TapiEventSaveSimMsg, NULL);
+ ret = tel_write_sms_in_sim(handle, &simSmsData, Sms3gppTapiEventHandler::respSaveSimMsg, NULL);
if (ret == TAPI_API_SUCCESS) {
MSG_DEBUG("######## tel_write_sms_in_sim Success !!!#######");
} else {
MSG_DEBUG("######## tel_write_sms_in_sim Fail !!! return : [%d] #######", ret);
-
return MSG_ERR_PLUGIN_STORAGE;
}
}
-msg_error_t SmsPluginSimMsg::saveClass2Message(const MSG_MESSAGE_INFO_S *pMsgInfo)
+msg_error_t Sms3gppSimMsg::saveClass2Message(const MSG_MESSAGE_INFO_S *pMsgInfo)
{
msg_error_t err = MSG_SUCCESS;
bool bSimSst = true;
/* No return, default value is true. */
if (bSimSst == false) {
- SmsPluginTransport::instance()->sendDeliverReport(handle, MSG_SUCCESS);
+ Sms3gppTransport::instance()->sendDeliverReport(handle, MSG_SUCCESS);
return MSG_SUCCESS;
}
/* Reset Flag */
- SMS_TPDU_S tpdu;
+ SMS_3GPP_TPDU_S tpdu;
tpdu.tpduType = SMS_TPDU_DELIVER;
/* Set SMS TPDU Options */
setSmsOptions(pMsgInfo, &(tpdu.data.deliver));
- SMS_SUBMIT_DATA_S submitData;
+ SMS_3GPP_SUBMIT_DATA_S submitData;
int bufLen = 0;
char buf[MAX_TPDU_DATA_LEN];
- SmsPluginTransport::instance()->msgInfoToSubmitData(pMsgInfo, &submitData, &(tpdu.data.deliver.dcs.codingScheme), 0);
+ Sms3gppTransport::instance()->msgInfoToSubmitData(pMsgInfo, &submitData, &(tpdu.data.deliver.dcs.codingScheme), 0);
if (pMsgInfo->msgType.subType >= MSG_REPLACE_TYPE1_SMS && pMsgInfo->msgType.subType <= MSG_REPLACE_TYPE7_SMS) {
- err = SmsPluginStorage::instance()->getReplaceSimMsg(pMsgInfo, &replaceMsgId, &replaceSimId);
+ err = Sms3gppStorage::instance()->getReplaceSimMsg(pMsgInfo, &replaceMsgId, &replaceSimId);
MSG_DEBUG("getReplaceSimMsg(): err=[%d], Replace Sim Id = [%d], Replace message id = [%d]", err, replaceSimId, replaceMsgId);
if (replaceMsgId < 0)
replaceMsgId = 0;
/* Check sim message full. */
if (checkSimMsgFull(pMsgInfo->sim_idx, submitData.segCount) == true) {
MSG_ERR("SIM storage is full.");
-
- SmsPluginTransport::instance()->sendDeliverReport(handle, MSG_ERR_SIM_STORAGE_FULL);
-
+ Sms3gppTransport::instance()->sendDeliverReport(handle, MSG_ERR_SIM_STORAGE_FULL);
return MSG_ERR_SIM_STORAGE_FULL;
}
if (submitData.segCount > 1)
tpdu.data.deliver.bHeaderInd = true;
} else { /* Replace message type */
- tapiRet = tel_delete_sms_in_sim(handle, replaceSimId, TapiEventDeleteSimMsg, NULL);
-
+ tapiRet = tel_delete_sms_in_sim(handle, replaceSimId, Sms3gppTapiEventHandler::respDeleteSimMsg, NULL);
if (tapiRet == TAPI_API_SUCCESS) {
MSG_DEBUG("######## tel_delete_sms_in_sim Success !!! #######");
simId = -1;
if (getDelSimEvent(&simId) == true) {
- err = SmsPluginStorage::instance()->deleteSimMessage(pMsgInfo->sim_idx, replaceSimId);
+ err = Sms3gppStorage::instance()->deleteSimMessage(pMsgInfo->sim_idx, replaceSimId);
}
MSG_DEBUG("tel_delete_sms_in_sim() : Err=[%d], Replace Sim Id=[%d], Result Sim id=[%d]", err, replaceSimId, simId);
simSmsData.SmsData.MsgLength = simMsgDataInfo.msgLength;
} else {
- memcpy(&(tpdu.data.deliver.userData), &(submitData.userData[segCnt]), sizeof(SMS_USERDATA_S));
+ memcpy(&(tpdu.data.deliver.userData), &(submitData.userData[segCnt]), sizeof(SMS_3GPP_USERDATA_S));
memset(buf, 0x00, sizeof(buf));
/* Encode SMS-DELIVER TPDU */
- bufLen = SmsPluginTpduCodec::encodeTpdu(&tpdu, buf);
+ bufLen = Sms3gppTpduCodec::encodeTpdu(&tpdu, buf);
/* Set TPDU data */
int copyLen = (bufLen > TAPI_NETTEXT_SMDATA_SIZE_MAX) ? TAPI_NETTEXT_SMDATA_SIZE_MAX : bufLen;
tmpSimMsgInfo->addressList = (MSG_ADDRESS_INFO_S *)new char[sizeof(MSG_ADDRESS_INFO_S)];
memcpy(&tmpSimMsgInfo->addressList[0], &pMsgInfo->addressList[0], sizeof(MSG_ADDRESS_INFO_S));
- tapiRet = tel_write_sms_in_sim(handle, &simSmsData, TapiEventSaveClass2Msg, tmpSimMsgInfo);
+ tapiRet = tel_write_sms_in_sim(handle, &simSmsData, Sms3gppTapiEventHandler::respSaveClass2Msg, tmpSimMsgInfo);
if (tapiRet == TAPI_API_SUCCESS) {
MSG_DEBUG("######## tel_write_sms_in_sim Success !!!, segNum = [%d] #######", segCnt);
} else {
MSG_DEBUG("######## tel_write_sms_in_sim Fail !!! return : [%d] #######", tapiRet);
-
- SmsPluginTransport::instance()->sendDeliverReport(handle, MSG_ERR_STORAGE_ERROR);
+ Sms3gppTransport::instance()->sendDeliverReport(handle, MSG_ERR_STORAGE_ERROR);
if (tmpSimMsgInfo) {
if (tmpSimMsgInfo->addressList) {
}
-void SmsPluginSimMsg::deleteSimMessage(msg_sim_slot_id_t sim_idx, msg_sim_id_t SimMsgId)
+void Sms3gppSimMsg::deleteSimMessage(msg_sim_slot_id_t sim_idx, msg_sim_id_t SimMsgId)
{
int tapiRet = TAPI_API_SUCCESS;
TapiHandle *handle = SmsPluginDSHandler::instance()->getTelHandle(sim_idx);
- tapiRet = tel_delete_sms_in_sim(handle, (int)SimMsgId, TapiEventDeleteSimMsg, NULL);
+ tapiRet = tel_delete_sms_in_sim(handle, (int)SimMsgId, Sms3gppTapiEventHandler::respDeleteSimMsg, NULL);
if (tapiRet == TAPI_API_SUCCESS)
MSG_DEBUG("######## tel_delete_sms_in_sim Success !!! #######");
}
-bool SmsPluginSimMsg::checkSimMsgFull(msg_sim_slot_id_t sim_idx, unsigned int SegCnt)
+bool Sms3gppSimMsg::checkSimMsgFull(msg_sim_slot_id_t sim_idx, unsigned int SegCnt)
{
int usedCnt = 0, totalCnt = 0;
}
-void SmsPluginSimMsg::setReadStatus(msg_sim_slot_id_t sim_idx, msg_sim_id_t SimMsgId)
+void Sms3gppSimMsg::setReadStatus(msg_sim_slot_id_t sim_idx, msg_sim_id_t SimMsgId)
{
MSG_DEBUG("Sim Message ID [%d]", SimMsgId);
int ret = TAPI_API_SUCCESS;
TapiHandle *handle = SmsPluginDSHandler::instance()->getTelHandle(sim_idx);
- ret = tel_set_sms_message_status(handle, (int)SimMsgId, TAPI_NETTEXT_STATUS_READ, TapiEventSetMsgStatus, (void *)&SimMsgId);
+ ret = tel_set_sms_message_status(handle, (int)SimMsgId, TAPI_NETTEXT_STATUS_READ, Sms3gppTapiEventHandler::respSetMsgStatus, (void *)&SimMsgId);
if (ret == TAPI_API_SUCCESS)
MSG_DEBUG("######## tel_set_sms_message_status Success !!! return : %d #######", ret);
}
-void SmsPluginSimMsg::getSimMsgCount(TapiHandle *handle, MSG_SIM_COUNT_S *pSimMsgCnt)
+void Sms3gppSimMsg::getSimMsgCount(TapiHandle *handle, MSG_3GPP_SIM_COUNT_S *pSimMsgCnt)
{
int ret = TAPI_API_SUCCESS;
- ret = tel_get_sms_count(handle, TapiEventGetSimMsgCnt, NULL);
+ ret = tel_get_sms_count(handle, Sms3gppTapiEventHandler::respGetSimMsgCnt, NULL);
if (ret == TAPI_API_SUCCESS)
MSG_DEBUG("######## tel_get_sms_count() Success !!! #######");
}
-bool SmsPluginSimMsg::getSimMsg(TapiHandle *handle, msg_sim_id_t SimMsgId, MSG_MESSAGE_INFO_S *pMsgInfo, int *simIdList)
+bool Sms3gppSimMsg::getSimMsg(TapiHandle *handle, msg_sim_id_t SimMsgId, MSG_MESSAGE_INFO_S *pMsgInfo, int *simIdList)
{
int ret = TAPI_API_SUCCESS;
- ret = tel_read_sms_in_sim(handle, SimMsgId, TapiEventGetSimMsg, simIdList);
+ ret = tel_read_sms_in_sim(handle, SimMsgId, Sms3gppTapiEventHandler::respGetSimMsg, simIdList);
if (ret == TAPI_API_SUCCESS) {
MSG_DEBUG("######## tel_read_sms_in_sim() Success !!! Sim ID : [%d] #######", SimMsgId);
}
-void SmsPluginSimMsg::setSmsOptions(const MSG_MESSAGE_INFO_S* pMsgInfo, SMS_DELIVER_S *pDeliver)
+void Sms3gppSimMsg::setSmsOptions(const MSG_MESSAGE_INFO_S* pMsgInfo, SMS_3GPP_DELIVER_S *pDeliver)
{
pDeliver->bMoreMsg = false;
pDeliver->bStatusReport = false;
}
-void SmsPluginSimMsg::convertTimeStamp(const MSG_MESSAGE_INFO_S* pMsgInfo, SMS_DELIVER_S *pDeliver)
+void Sms3gppSimMsg::convertTimeStamp(const MSG_MESSAGE_INFO_S* pMsgInfo, SMS_3GPP_DELIVER_S *pDeliver)
{
MSG_BEGIN();
/* encode time stamp */
- pDeliver->timeStamp.format = SMS_TIME_ABSOLUTE;
+ pDeliver->timeStamp.format = SMS_3GPP_TIME_ABSOLUTE;
/* encode absolute time */
- struct tm timeinfo = {0, };
+ struct tm timeinfo = {0,};
tzset();
localtime_r(&pMsgInfo->displayTime, &timeinfo);
}
-void SmsPluginSimMsg::setSimMsgCntEvent(TapiHandle *handle, const MSG_SIM_COUNT_S *pSimMsgCnt)
+void Sms3gppSimMsg::setSimMsgCntEvent(TapiHandle *handle, const MSG_3GPP_SIM_COUNT_S *pSimMsgCnt)
{
mx.lock();
if (MsgSettingSetInt(keyName, (int)pSimMsgCnt->totalCount) != MSG_SUCCESS)
MSG_ERR("Error to set config data [%s]", SIM_TOTAL_COUNT);
- memset(&simMsgCnt, 0x00, sizeof(MSG_SIM_COUNT_S));
- memcpy(&simMsgCnt, pSimMsgCnt, sizeof(MSG_SIM_COUNT_S));
+ memset(&simMsgCnt, 0x00, sizeof(MSG_3GPP_SIM_COUNT_S));
+ memcpy(&simMsgCnt, pSimMsgCnt, sizeof(MSG_3GPP_SIM_COUNT_S));
cv.signal();
}
-bool SmsPluginSimMsg::getSimMsgCntEvent(TapiHandle *handle, MSG_SIM_COUNT_S *pSimMsgCnt)
+bool Sms3gppSimMsg::getSimMsgCntEvent(TapiHandle *handle, MSG_3GPP_SIM_COUNT_S *pSimMsgCnt)
{
int ret = 0;
mx.lock();
- ret = cv.timedwait(mx.pMsgMutex(), 10);
+ ret = cv.timedwait(mx.pMsgMutex(), MAX_TAPI_SIM_API_TIMEOUT);
mx.unlock();
return false;
}
- memcpy(pSimMsgCnt, &simMsgCnt, sizeof(MSG_SIM_COUNT_S));
+ memcpy(pSimMsgCnt, &simMsgCnt, sizeof(MSG_3GPP_SIM_COUNT_S));
return true;
}
-void SmsPluginSimMsg::setSimMsgEvent(TapiHandle *handle, const MSG_MESSAGE_INFO_S *pMsgInfo, bool bSuccess)
+void Sms3gppSimMsg::setSimMsgEvent(TapiHandle *handle, const MSG_MESSAGE_INFO_S *pMsgInfo, bool bSuccess)
{
mx.lock();
}
-bool SmsPluginSimMsg::getSimMsgEvent(TapiHandle *handle, MSG_MESSAGE_INFO_S *pMsgInfo)
+bool Sms3gppSimMsg::getSimMsgEvent(TapiHandle *handle, MSG_MESSAGE_INFO_S *pMsgInfo)
{
int ret = 0;
pMsgInfo->sim_idx = SmsPluginDSHandler::instance()->getSimIndex(handle);
}
-
return bTapiResult;
}
-void SmsPluginSimMsg::setSaveSimMsgEvent(TapiHandle *handle, int simId, int result)
+void Sms3gppSimMsg::setSaveSimMsgEvent(TapiHandle *handle, int simId, int result)
{
msg_error_t err = MSG_SUCCESS;
int tapiRet = TAPI_API_SUCCESS;
if (err == MSG_SUCCESS) {
- tapiRet = tel_set_sms_memory_status(handle, TAPI_NETTEXT_PDA_MEMORY_STATUS_AVAILABLE, TapiEventMemoryStatus, NULL);
+ tapiRet = tel_set_sms_memory_status(handle, TAPI_NETTEXT_PDA_MEMORY_STATUS_AVAILABLE, Sms3gppTapiEventHandler::respSetMemoryStatus, NULL);
} else if (err == MSG_ERR_SIM_STORAGE_FULL) {
- tapiRet = tel_set_sms_memory_status(handle, TAPI_NETTEXT_PDA_MEMORY_STATUS_FULL, TapiEventMemoryStatus, NULL);
+ tapiRet = tel_set_sms_memory_status(handle, TAPI_NETTEXT_PDA_MEMORY_STATUS_FULL, Sms3gppTapiEventHandler::respSetMemoryStatus, NULL);
} else {
return;
}
}
-void SmsPluginSimMsg::setSaveClass2MsgEvent(TapiHandle *handle, int simId, int result, MSG_MESSAGE_INFO_S *pMsgInfo)
+void Sms3gppSimMsg::setSaveClass2MsgEvent(TapiHandle *handle, int simId, int result, MSG_MESSAGE_INFO_S *pMsgInfo)
{
+ MSG_ERR_RET_M(!pMsgInfo, "pMsgInfo is NULL");
+
msg_error_t err = MSG_SUCCESS;
/*int sim_idx = SmsPluginDSHandler::instance()->getSimIndex(handle); */
if (simMsgDataInfo.totalSegment >= 1 && simIdList[simMsgDataInfo.totalSegment-1] != 0) {
msg_message_id_t saved_msg_id = 0;
- SmsPluginEventHandler::instance()->handleSimMsg(pMsgInfo, simIdList, &saved_msg_id, MAX_SIM_SMS_NUM);
+ Sms3gppEventHandler::instance()->handleSimMsg(pMsgInfo, simIdList, &saved_msg_id, MAX_SIM_SMS_NUM);
MSG_DEBUG("Saved message ID = [%d]", saved_msg_id);
if (saved_msg_id > 0)
pMsgInfo->msgId = saved_msg_id;
- err = SmsPluginEventHandler::instance()->callbackMsgIncoming(pMsgInfo);
+ err = Sms3gppEventHandler::instance()->callbackMsgIncoming(pMsgInfo);
if (err != MSG_SUCCESS)
MSG_DEBUG("callbackMsgIncoming() Error !! [%d]", err);
}
/* Send Deliver Report */
- SmsPluginTransport::instance()->sendDeliverReport(handle, err);
+ Sms3gppTransport::instance()->sendDeliverReport(handle, err);
}
-void SmsPluginSimMsg::setSimEvent(msg_sim_id_t SimId, bool bResult)
+void Sms3gppSimMsg::setSimEvent(msg_sim_id_t SimId, bool bResult)
{
mx.lock();
}
-bool SmsPluginSimMsg::getSimEvent(msg_sim_id_t *pSimId)
+bool Sms3gppSimMsg::getSimEvent(msg_sim_id_t *pSimId)
{
int ret = 0;
}
-void SmsPluginSimMsg::setDelSimEvent(int SimId, bool bResult)
+void Sms3gppSimMsg::setDelSimEvent(int SimId, bool bResult)
{
mx.lock();
}
-bool SmsPluginSimMsg::getDelSimEvent(int *pSimId)
+bool Sms3gppSimMsg::getDelSimEvent(int *pSimId)
{
int ret = 0;
}
-void SmsPluginSimMsg::setSmsData(const char *sca, const char *szData, int msgLength)
+void Sms3gppSimMsg::setSmsData(const char *sca, const char *szData, int msgLength)
{
MSG_DEBUG("Set SMS data(class2 message)");
simMsgDataInfo.msgLength = msgLength;
}
-void SmsPluginSimMsg::setSmsTpduTotalSegCount(int totalSeg)
+void Sms3gppSimMsg::setSmsTpduTotalSegCount(int totalSeg)
{
MSG_DEBUG("Set SMS Segements Info");
--- /dev/null
+/*
+ * Copyright (c) 2014 Samsung Electronics Co., Ltd. All rights reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+*/
+
+#include <errno.h>
+
+#include "MsgDebug.h"
+#include "MsgCppTypes.h"
+#include "MsgException.h"
+#include "MsgContact.h"
+#include "MsgUtilFile.h"
+#include "MsgUtilStorage.h"
+#include "MsgUtilFunction.h"
+#include "MsgGconfWrapper.h"
+#include "MsgNotificationWrapper.h"
+
+#include "SmsPluginMain.h"
+#include "Sms3gppSimMsg.h"
+#include "Sms3gppStorage.h"
+#include "Sms3gppSetting.h"
+
+/*==================================================================================================
+ Variables
+==================================================================================================*/
+Sms3gppStorage* Sms3gppStorage::pInstance = NULL;
+
+/*==================================================================================================
+ Methods of Sms3gppStorage
+==================================================================================================*/
+
+Sms3gppStorage::Sms3gppStorage()
+{
+ memset(&msgInfo, 0x00, sizeof(msgInfo));
+ memset(&addrInfo, 0x00, sizeof(addrInfo));
+}
+
+
+Sms3gppStorage* Sms3gppStorage::instance()
+{
+ if (!pInstance) {
+ MSG_DEBUG("pInstance is NULL. Now creating instance.");
+ pInstance = new Sms3gppStorage();
+ }
+
+ return pInstance;
+}
+
+
+msg_error_t Sms3gppStorage::insertMsgRef(MSG_MESSAGE_INFO_S *pMsg, unsigned char msgRef, int index)
+{
+ MSG_BEGIN();
+
+ time_t curTime = time(NULL);
+
+ MsgDbHandler *dbHandle = getDbHandle();
+ char sqlQuery[MAX_QUERY_LEN+1];
+ char *normalNum = NULL;
+
+ memset(sqlQuery, 0x00, sizeof(sqlQuery));
+
+ normalNum = msg_normalize_number(pMsg->addressList[index].addressVal);
+
+ MSG_SEC_DEBUG("Insert MsgID=[%d], Address=[%s], MsgRef=[%d], Time=[%d]", pMsg->msgId, normalNum, (int)msgRef, (int)curTime);
+
+ snprintf(sqlQuery, sizeof(sqlQuery), "INSERT INTO %s VALUES (%d, %s, %d, 0, -1, %d);",
+ MSGFW_SMS_REPORT_TABLE_NAME, pMsg->msgId, normalNum, (int)msgRef, (int)curTime);
+
+ if (dbHandle->execQuery(sqlQuery) != MSG_SUCCESS) {
+ MSG_DEBUG("MsgExecQuery() : [%s]", sqlQuery);
+ return MSG_ERR_DB_EXEC;
+ }
+
+ MSG_END();
+ return MSG_SUCCESS;
+}
+
+msg_error_t Sms3gppStorage::updateMsgDeliverStatus(MSG_MESSAGE_INFO_S *pMsgInfo, unsigned char msgRef)
+{
+ MSG_BEGIN();
+
+ MsgDbHandler *dbHandle = getDbHandle();
+ char sqlQuery[MAX_QUERY_LEN+1];
+
+ msg_message_id_t msgId = 0;
+ int rowCnt = 0;
+ char *normalNum = NULL;
+
+ normalNum = msg_normalize_number(pMsgInfo->addressList[0].addressVal);
+
+ memset(sqlQuery, 0x00, sizeof(sqlQuery));
+ snprintf(sqlQuery, sizeof(sqlQuery), "SELECT MSG_ID FROM %s WHERE ADDRESS_VAL = %s AND MSG_REF > 0 ORDER BY TIME ASC;",
+ MSGFW_SMS_REPORT_TABLE_NAME, normalNum);
+ MSG_DEBUG("[SQL Query] %s", sqlQuery);
+
+ if (dbHandle->prepareQuery(sqlQuery) != MSG_SUCCESS)
+ return MSG_ERR_DB_PREPARE;
+
+ if (dbHandle->stepQuery() == MSG_ERR_DB_ROW)
+ msgId = dbHandle->columnInt(0);
+
+ dbHandle->finalizeQuery();
+
+ pMsgInfo->msgId = msgId;
+
+ /** Update Status - MSG_MESSAGE_TABLE */
+ memset(sqlQuery, 0x00, sizeof(sqlQuery));
+ snprintf(sqlQuery, sizeof(sqlQuery), "SELECT * FROM %s WHERE MSG_ID = %d AND MSG_REF > 0;",
+ MSGFW_SMS_REPORT_TABLE_NAME, msgId);
+
+ if (dbHandle->getTable(sqlQuery, &rowCnt, NULL) != MSG_SUCCESS) {
+ dbHandle->freeTable();
+ return MSG_ERR_DB_GETTABLE;
+ }
+
+ dbHandle->freeTable();
+
+ MSG_DEBUG("Selected row count = [%d]", rowCnt);
+
+ if (rowCnt == 1 && pMsgInfo->networkStatus == MSG_NETWORK_DELIVER_SUCCESS) {
+ memset(sqlQuery, 0x00, sizeof(sqlQuery));
+ snprintf(sqlQuery, sizeof(sqlQuery), "UPDATE %s SET NETWORK_STATUS = %d WHERE MSG_ID = %d;",
+ MSGFW_MESSAGE_TABLE_NAME, (int)pMsgInfo->networkStatus, msgId);
+ MSG_DEBUG("[SQL Query] %s", sqlQuery);
+
+ if (dbHandle->execQuery(sqlQuery) != MSG_SUCCESS) {
+ MSG_DEBUG("Query Failed : [%s]", sqlQuery);
+ return MSG_ERR_DB_EXEC;
+ }
+ }
+
+ /** Update Status - MSG_REPORT_TABLE */
+ if (pMsgInfo->networkStatus == MSG_NETWORK_DELIVER_SUCCESS) {
+ memset(sqlQuery, 0x00, sizeof(sqlQuery));
+ snprintf(sqlQuery, sizeof(sqlQuery), "UPDATE %s SET MSG_REF = -1, STATUS = %d, TIME = %d WHERE MSG_ID = %d and ADDRESS_VAL = '%s';",
+ MSGFW_SMS_REPORT_TABLE_NAME, 1, (int)pMsgInfo->displayTime, msgId, normalNum);
+ MSG_DEBUG("[SQL Query] %s", sqlQuery);
+
+ if (dbHandle->execQuery(sqlQuery) != MSG_SUCCESS) {
+ MSG_DEBUG("Query Failed : [%s]", sqlQuery);
+ return MSG_ERR_DB_EXEC;
+ }
+ } else if (pMsgInfo->networkStatus == MSG_NETWORK_DELIVER_EXPIRED) {
+ memset(sqlQuery, 0x00, sizeof(sqlQuery));
+ snprintf(sqlQuery, sizeof(sqlQuery), "UPDATE %s SET MSG_REF = -1, STATUS = %d, TIME = %d WHERE MSG_ID = %d and ADDRESS_VAL = '%s';",
+ MSGFW_SMS_REPORT_TABLE_NAME, 0, (int)pMsgInfo->displayTime, msgId, normalNum);
+ MSG_DEBUG("[SQL Query] %s", sqlQuery);
+
+ if (dbHandle->execQuery(sqlQuery) != MSG_SUCCESS) {
+ MSG_DEBUG("Query Failed : [%s]", sqlQuery);
+ return MSG_ERR_DB_EXEC;
+ }
+ } else if (pMsgInfo->networkStatus == MSG_NETWORK_DELIVER_PENDING) {
+ memset(sqlQuery, 0x00, sizeof(sqlQuery));
+ snprintf(sqlQuery, sizeof(sqlQuery), "UPDATE %s SET MSG_REF = -1, STATUS = %d, TIME = %d WHERE MSG_ID = %d and ADDRESS_VAL = '%s';",
+ MSGFW_SMS_REPORT_TABLE_NAME, 3, (int)pMsgInfo->displayTime, msgId, normalNum);
+ MSG_DEBUG("[SQL Query] %s", sqlQuery);
+
+ if (dbHandle->execQuery(sqlQuery) != MSG_SUCCESS) {
+ MSG_DEBUG("Query Failed : [%s]", sqlQuery);
+ return MSG_ERR_DB_EXEC;
+ }
+ } else if (pMsgInfo->networkStatus == MSG_NETWORK_DELIVER_FAIL) {
+ memset(sqlQuery, 0x00, sizeof(sqlQuery));
+ snprintf(sqlQuery, sizeof(sqlQuery), "UPDATE %s SET MSG_REF = -1, STATUS = %d, TIME = %d WHERE MSG_ID = %d and ADDRESS_VAL = '%s';",
+ MSGFW_SMS_REPORT_TABLE_NAME, 8, (int)pMsgInfo->displayTime, msgId, normalNum);
+ MSG_DEBUG("[SQL Query] %s", sqlQuery);
+
+ if (dbHandle->execQuery(sqlQuery) != MSG_SUCCESS) {
+ MSG_DEBUG("Query Failed : [%s]", sqlQuery);
+ return MSG_ERR_DB_EXEC;
+ }
+ }
+
+ MSG_END();
+ return MSG_SUCCESS;
+}
+
+#ifdef SMS_REPORT_OPERATION
+msg_error_t Sms3gppStorage::updateMsgRef(msg_message_id_t MsgId, unsigned char MsgRef)
+{
+ MSG_BEGIN();
+
+ MsgDbHandler *dbHandle = getDbHandle();
+
+ char sqlQuery[MAX_QUERY_LEN+1];
+
+ memset(sqlQuery, 0x00, sizeof(sqlQuery));
+
+ snprintf(sqlQuery, sizeof(sqlQuery), "UPDATE %s SET MSG_REF = %d WHERE MSG_ID = %d;",
+ MSGFW_REPORT_TABLE_NAME, (int)MsgRef, MsgId);
+
+ if (dbHandle->execQuery(sqlQuery) != MSG_SUCCESS) {
+ MSG_DEBUG("Query Failed : [%s]", sqlQuery);
+ return MSG_ERR_DB_EXEC;
+ }
+
+ /** Set Message Reference for updating report table */
+ tmpMsgRef = MsgRef;
+
+ MSG_DEBUG("MsgRef : %d", MsgRef);
+
+ MSG_END();
+
+ return MSG_SUCCESS;
+}
+
+
+msg_error_t Sms3gppStorage::updateStatusReport(unsigned char MsgRef, msg_delivery_report_status_t Status, time_t DeliveryTime)
+{
+ MSG_BEGIN();
+
+ MSG_DEBUG("tmpMsgRef : %d", tmpMsgRef);
+
+ MsgDbHandler *dbHandle = getDbHandle();
+
+ char sqlQuery[MAX_QUERY_LEN+1];
+
+ /** Get Msg Id for Quickpanel Noti */
+ msg_message_id_t msgId = 0;
+
+ memset(sqlQuery, 0x00, sizeof(sqlQuery));
+ snprintf(sqlQuery, sizeof(sqlQuery), "SELECT MSG_ID FROM %s WHERE MSG_REF = %d;",
+ MSGFW_REPORT_TABLE_NAME, (int)tmpMsgRef);
+
+ if (dbHandle->prepareQuery(sqlQuery) != MSG_SUCCESS)
+ return MSG_ERR_DB_PREPARE;
+
+ if (dbHandle->stepQuery() == MSG_ERR_DB_ROW)
+ msgId = dbHandle->columnInt(0);
+
+ dbHandle->finalizeQuery();
+
+ /** Update Status */
+ memset(sqlQuery, 0x00, sizeof(sqlQuery));
+ snprintf(sqlQuery, sizeof(sqlQuery), "UPDATE %s SET MSG_REF = -1, DELIVERY_REPORT_STATUS = %d, DELIVERY_REPORT_TIME = %lu WHERE MSG_REF = %d;",
+ MSGFW_REPORT_TABLE_NAME, Status, DeliveryTime, (int)tmpMsgRef);
+
+ if (dbHandle->execQuery(sqlQuery) != MSG_SUCCESS) {
+ MSG_DEBUG("Query Failed : [%s]", sqlQuery);
+ return MSG_ERR_DB_EXEC;
+ }
+
+ /** Insert Quickpanel Noti */
+ msg_error_t ret = MSG_SUCCESS;
+
+ ret = MsgInsertSmsNotiToQuickpanel(dbHandle, msgId, Status);
+ if (ret != MSG_SUCCESS) {
+ MSG_DEBUG("MsgInsertSmsNotiToQuickpanel() Failed : [%d]", ret);
+ return ret;
+ }
+
+ MSG_END();
+
+ return MSG_SUCCESS;
+}
+#endif
+
+msg_error_t Sms3gppStorage::addSimMessage(MSG_MESSAGE_INFO_S *pSimMsgInfo, int *simIdList)
+{
+ msg_error_t err = MSG_SUCCESS;
+
+ unsigned int simId = 0;
+ MsgDbHandler *dbHandle = getDbHandle();
+
+ char sqlQuery[MAX_QUERY_LEN+1];
+
+ if (simIdList) {
+ MSG_DEBUG("simIdList exist.");
+ for (int i = 0; i < MAX_SIM_SMS_NUM; ++i) {
+ if (simIdList[i]) {
+ simId = simIdList[i] - 1;
+ memset(sqlQuery, 0x00, sizeof(sqlQuery));
+ snprintf(sqlQuery, sizeof(sqlQuery), "INSERT INTO %s VALUES (%d, %d);",
+ MSGFW_SIM_MSG_TABLE_NAME, simId, pSimMsgInfo->msgId);
+
+ MSG_DEBUG("QUERY : %s", sqlQuery);
+
+ if (dbHandle->execQuery(sqlQuery) != MSG_SUCCESS) {
+ return MSG_ERR_DB_EXEC;
+ }
+ } else {
+ break;
+ }
+ }
+ }
+
+ return err;
+}
+
+msg_error_t Sms3gppStorage::insertSimMessage(int simId, int msgId)
+{
+ MSG_BEGIN();
+
+ MsgDbHandler *dbHandle = getDbHandle();
+
+ char sqlQuery[MAX_QUERY_LEN+1];
+
+ dbHandle->beginTrans();
+
+ /* Insert Message into msg_sim table */
+ memset(sqlQuery, 0x00, sizeof(sqlQuery));
+ snprintf(sqlQuery, sizeof(sqlQuery), "INSERT INTO %s VALUES (%d, %d);", MSGFW_SIM_MSG_TABLE_NAME, simId, msgId);
+ if (dbHandle->execQuery(sqlQuery) != MSG_SUCCESS) {
+ dbHandle->endTrans(false);
+ return MSG_ERR_DB_EXEC;
+ }
+
+ dbHandle->endTrans(true);
+
+ return MSG_SUCCESS;
+}
+
+
+msg_error_t Sms3gppStorage::deleteSimMessage(int sim_idx, int simId)
+{
+ MSG_BEGIN();
+
+ MsgDbHandler *dbHandle = getDbHandle();
+
+ char sqlQuery[MAX_QUERY_LEN+1];
+
+ dbHandle->beginTrans();
+
+ /** Delete Message from msg_sim table */
+ memset(sqlQuery, 0x00, sizeof(sqlQuery));
+ snprintf(sqlQuery, sizeof(sqlQuery), "DELETE FROM %s WHERE SIM_ID = %d AND SIM_SLOT_ID = %d;", MSGFW_SIM_MSG_TABLE_NAME, simId, sim_idx);
+ if (dbHandle->execQuery(sqlQuery) != MSG_SUCCESS) {
+ dbHandle->endTrans(false);
+ return MSG_ERR_DB_EXEC;
+ }
+
+ dbHandle->endTrans(true);
+
+ return MSG_SUCCESS;
+}
+
+
+msg_error_t Sms3gppStorage::getReplaceSimMsg(const MSG_MESSAGE_INFO_S *pMsg, int *pMsgId, int *pSimId)
+{
+ MSG_BEGIN();
+
+ MsgDbHandler *dbHandle = getDbHandle();
+
+ char sqlQuery[MAX_QUERY_LEN+1];
+ msg_thread_id_t convId = 0;
+ msg_message_id_t msgId = 0;
+
+ dbHandle->beginTrans();
+
+ if (MsgExistAddress(dbHandle, pMsg, &convId) == true) {
+ MSG_DEBUG("Address Info. exists [%d]", convId);
+
+ /** Find Replace Type Msg : Same Replace Type, Same Origin Address, Same Storage ID */
+ memset(sqlQuery, 0x00, sizeof(sqlQuery));
+ snprintf(sqlQuery, sizeof(sqlQuery), "SELECT MSG_ID FROM %s \
+ WHERE CONV_ID = %d AND SUB_TYPE = %d AND STORAGE_ID = %d \
+ ORDER BY DISPLAY_TIME ASC;",
+ MSGFW_MESSAGE_TABLE_NAME, (int)convId, pMsg->msgType.subType, MSG_STORAGE_SIM);
+
+ MSG_DEBUG("Query=[%s]", sqlQuery);
+ if (dbHandle->prepareQuery(sqlQuery) != MSG_SUCCESS) {
+ dbHandle->endTrans(false);
+ return MSG_ERR_DB_PREPARE;
+ }
+
+ if (dbHandle->stepQuery() == MSG_ERR_DB_ROW) {
+ *pMsgId = dbHandle->columnInt(0);
+ } else {
+ dbHandle->finalizeQuery();
+ dbHandle->endTrans(false);
+ return MSG_ERR_DB_STEP;
+ }
+
+ dbHandle->finalizeQuery();
+
+ } else {
+ dbHandle->endTrans(false);
+ return MSG_ERR_DB_NORECORD;
+ }
+
+ memset(sqlQuery, 0x00, sizeof(sqlQuery));
+
+ snprintf(sqlQuery, sizeof(sqlQuery), "SELECT SIM_ID FROM %s \
+ WHERE MSG_ID = %d;",
+ MSGFW_SIM_MSG_TABLE_NAME, *pMsgId);
+
+ if (dbHandle->prepareQuery(sqlQuery) != MSG_SUCCESS) {
+ dbHandle->endTrans(false);
+ return MSG_ERR_DB_PREPARE;
+ }
+
+ if (dbHandle->stepQuery() == MSG_ERR_DB_ROW) {
+ *pSimId = dbHandle->columnInt(0);
+ } else {
+ dbHandle->finalizeQuery();
+ dbHandle->endTrans(false);
+ return MSG_ERR_DB_STEP;
+ }
+
+ MSG_DEBUG("Replace Msg Id=[%d], Sim Id=[%d]", *pMsgId, *pSimId);
+
+ dbHandle->finalizeQuery();
+
+ dbHandle->endTrans(true);
+
+ MSG_END();
+ return msgId;
+}
+
+
+msg_error_t Sms3gppStorage::addClass2Message(MSG_MESSAGE_INFO_S *pMsgInfo)
+{
+ MSG_BEGIN();
+
+ msg_error_t err = MSG_SUCCESS;
+ bool bSimSst = true;
+
+ char keyName[MAX_VCONFKEY_NAME_LEN] = {0, };
+ snprintf(keyName, sizeof(keyName), "%s/%d", MSG_SIM_SERVICE_TABLE, pMsgInfo->sim_idx);
+
+ if (MsgSettingGetBool(keyName, &bSimSst) != MSG_SUCCESS) {
+ MSG_ERR("MsgSettingGetBool [%s] failed", keyName);
+ }
+
+ if (bSimSst == false) {
+ return MSG_ERR_SIM_STORAGE_FULL;
+ }
+
+ pthread_t thd;
+ memset(&msgInfo, 0, sizeof(MSG_MESSAGE_INFO_S));
+ memset(&addrInfo, 0, sizeof(MSG_ADDRESS_INFO_S));
+ memcpy(&msgInfo, pMsgInfo, sizeof(MSG_MESSAGE_INFO_S));
+ memcpy(&addrInfo, pMsgInfo->addressList, sizeof(MSG_ADDRESS_INFO_S));
+ msgInfo.addressList = &addrInfo;
+
+ if (pthread_create(&thd, NULL, &class2_thread, (void *)&msgInfo) < 0) {
+ MSG_ERR("pthread_create() error");
+ } else {
+ pthread_detach(thd);
+ }
+
+ MSG_END();
+ return err;
+}
+
+void* Sms3gppStorage::class2_thread(void *data)
+{
+ MSG_BEGIN();
+
+ msg_error_t err = MSG_SUCCESS;
+ MSG_MESSAGE_INFO_S *pMsgInfo = (MSG_MESSAGE_INFO_S *)data;
+
+ err = Sms3gppSimMsg::instance()->saveClass2Message(pMsgInfo);
+ if (err == MSG_SUCCESS) {
+ MSG_DEBUG("Success to saveClass2Message.");
+ } else {
+ MSG_ERR("Fail to saveClass2Message : [%d]", err);
+ }
+
+ MSG_END();
+ return NULL;
+}
+
+#if 0
+msg_error_t Sms3gppStorage::isReceivedCBMessage(SMS_CBMSG_PAGE_S CbPage)
+{
+ msg_error_t err = MSG_SUCCESS;
+
+ int rowCnt = 0;
+
+ MsgDbHandler *dbHandle = getDbHandle();
+
+ char sqlQuery[MAX_QUERY_LEN+1] = {0, };
+
+ memset(sqlQuery, 0x00, sizeof(sqlQuery));
+
+ snprintf(sqlQuery, sizeof(sqlQuery), "SELECT * FROM %s WHERE GEO_SCOPE = %d AND MSG_CODE = %d AND MESSAGE_ID = %d AND UPDATE_NUM = %d",
+ MSGFW_RECEIVED_CB_MSG_TABLE_NAME, CbPage.pageHeader.serialNum.geoScope,
+ CbPage.pageHeader.serialNum.msgCode, CbPage.pageHeader.msgId, CbPage.pageHeader.serialNum.updateNum);
+
+ err = dbHandle->getTable(sqlQuery, &rowCnt, NULL);
+ MSG_DEBUG("rowCnt: %d", rowCnt);
+
+ dbHandle->freeTable();
+ return err;
+}
+
+msg_error_t Sms3gppStorage::insertReceivedCBMessage(SMS_CBMSG_PAGE_S CbPage)
+{
+ msg_error_t err = MSG_SUCCESS;
+
+ unsigned int rowId = 0;
+
+ MsgDbHandler *dbHandle = getDbHandle();
+
+ char sqlQuery[MAX_QUERY_LEN+1];
+
+ err = dbHandle->getRowId(MSGFW_RECEIVED_CB_MSG_TABLE_NAME, &rowId);
+
+ if (err != MSG_SUCCESS)
+ return err;
+
+ /* Add Folder */
+ memset(sqlQuery, 0x00, sizeof(sqlQuery));
+ snprintf(sqlQuery, sizeof(sqlQuery), "INSERT INTO %s VALUES (%d, %d, %d, %d, %d);",
+ MSGFW_RECEIVED_CB_MSG_TABLE_NAME, rowId, CbPage.pageHeader.serialNum.geoScope,
+ CbPage.pageHeader.serialNum.msgCode, CbPage.pageHeader.msgId, CbPage.pageHeader.serialNum.updateNum);
+
+ if (dbHandle->execQuery(sqlQuery) != MSG_SUCCESS)
+ return MSG_ERR_DB_EXEC;
+
+ return MSG_SUCCESS;
+}
+#endif
--- /dev/null
+/*
+ * Copyright (c) 2014 Samsung Electronics Co., Ltd. All rights reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+*/
+
+#include <glib.h>
+#include <pthread.h>
+#ifdef MSG_FEATURE_FDN
+#include <csc-feature.h>
+#endif
+
+#include "Sms3gppTapiEventHandler.h"
+#include "MsgDebug.h"
+#include "MsgCppTypes.h"
+#include "MsgException.h"
+#include "Sms3gppEventHandler.h"
+#include "Sms3gppWapPushHandler.h"
+#include "Sms3gppParamCodec.h"
+#include "Sms3gppTransport.h"
+#include "Sms3gppSetting.h"
+#include "MsgGconfWrapper.h"
+#include "SmsPluginDSHandler.h"
+#include "Sms3gppCbMsgHandler.h"
+#include "Sms3gppConcatHandler.h"
+#include "Sms3gppSatHandler.h"
+#include "Sms3gppSimMsg.h"
+#include "Sms3gppTpduCodec.h"
+#include "MsgUtilFunction.h"
+#include "MsgUtilStorage.h"
+#include "MsgDevicedWrapper.h"
+
+static SMS_NETWORK_STATUS_T convertTapiRespToSmsPlugin(int result);
+
+/*==================================================================================================
+ FUNCTION IMPLEMENTATION
+==================================================================================================*/
+SMS_NETWORK_STATUS_T convertTapiRespToSmsPlugin(int result)
+{
+ SMS_NETWORK_STATUS_T sentStatus;
+
+ /* Convert TAPI status -> SMS network status */
+ switch ((TelSmsResponse_t)result) {
+ case TAPI_NETTEXT_SENDSMS_SUCCESS :
+ sentStatus = SMS_NETWORK_SEND_SUCCESS;
+ break;
+ case TAPI_NETTEXT_INVALID_MANDATORY_INFO :
+ sentStatus = SMS_NETWORK_SEND_FAIL_MANDATORY_INFO_MISSING;
+ break;
+ case TAPI_NETTEXT_DESTINAITION_OUTOFSERVICE :
+ case TAPI_NETTEXT_TEMPORARY_FAILURE :
+ case TAPI_NETTEXT_CONGESTION :
+ case TAPI_NETTEXT_RESOURCES_UNAVAILABLE :
+ case TAPI_NETTEXT_MESSAGE_NOT_COMPAT_PROTOCOL :
+ case TAPI_NETTEXT_NETWORK_OUTOFORDER:
+ sentStatus = SMS_NETWORK_SEND_FAIL_TEMPORARY;
+ break;
+ case TAPI_NETTEXT_MESSAGE_TRANSFER_REJECTED :
+ sentStatus = SMS_NETWORK_SEND_FAIL_BY_MO_CONTROL_NOT_ALLOWED;
+ break;
+ case TAPI_NETTEXT_DEST_ADDRESS_FDN_RESTRICTED :
+ case TAPI_NETTEXT_SCADDRESS_FDN_RESTRICTED :
+ sentStatus = SMS_NETWORK_SEND_FAIL_FDN_RESTRICED;
+ break;
+ case TAPI_NETTEXT_ROUTING_NOT_AVAILABLE :
+ sentStatus = SMS_NETWORK_SEND_FAIL_NO_ROUTING;
+ break;
+ default :
+ sentStatus = SMS_NETWORK_SEND_FAIL;
+ break;
+ }
+
+ return sentStatus;
+}
+
+
+void Sms3gppTapiEventHandler::NotiSmsDeviceReady(TapiHandle *handle, const char *noti_id, void *data, void *user_data)
+{
+ try {
+ int deviceStatus = *(int*)data;
+ MSG_INFO("Device ready status: (%d)", deviceStatus);
+ Sms3gppEventHandler::instance()->setDeviceStatus(handle, deviceStatus != TAPI_NETTEXT_READY_STATUS_NONE);
+
+ } catch (MsgException& e) {
+ MSG_FATAL("%s", e.what());
+ }
+}
+
+void Sms3gppTapiEventHandler::NotiSmsIncomMsg(TapiHandle *handle, const char *noti_id, void *data, void *user_data)
+{
+ MSG_INFO("noti_id: (%s)", noti_id);
+
+ MSG_ERR_RET_M(data == NULL, "Invalid parameter: data is NULL!");
+
+ /* make a margin timeout(500ms) till suspending status */
+ MsgDisplayLock();
+
+ TelSmsDatapackageInfo_t* pDataPackage = (TelSmsDatapackageInfo_t*)data;
+
+ SMS_3GPP_TPDU_S tpdu;
+ memset(&tpdu, 0x00, sizeof(SMS_3GPP_TPDU_S));
+
+ /* Decode Incoming Message */
+ Sms3gppTpduCodec::decodeTpdu(handle, pDataPackage->szData, pDataPackage->MsgLength, &tpdu);
+
+ /* Print tpdu */
+ if (tpdu.tpduType == SMS_TPDU_DELIVER) {
+ MSG_DEBUG("############# SMS_TPDU_DELIVER Incoming decoded tpdu values ####################");
+ MSG_DEBUG("tpdu.data.deliver.bMoreMsg : %d", tpdu.data.deliver.bMoreMsg);
+ MSG_DEBUG("tpdu.data.deliver.bStatusReport : %d", tpdu.data.deliver.bStatusReport);
+ MSG_DEBUG("tpdu.data.deliver.bHeaderInd : %d", tpdu.data.deliver.bHeaderInd);
+ MSG_DEBUG("tpdu.data.deliver.bReplyPath : %d", tpdu.data.deliver.bReplyPath);
+ MSG_DEBUG("tpdu.data.deliver.pid : %d", tpdu.data.deliver.pid);
+ MSG_DEBUG("tpdu.data.deliver.dcs.bCompressed : %d", tpdu.data.deliver.dcs.bCompressed);
+ MSG_DEBUG("tpdu.data.deliver.dcs.msgClass : %d", tpdu.data.deliver.dcs.msgClass);
+ MSG_DEBUG("tpdu.data.deliver.dcs.codingScheme : %d", tpdu.data.deliver.dcs.codingScheme);
+ MSG_DEBUG("tpdu.data.deliver.dcs.codingGroup : %d", tpdu.data.deliver.dcs.codingGroup);
+ MSG_DEBUG("tpdu.data.deliver.dcs.bIndActive : %d", tpdu.data.deliver.dcs.bIndActive);
+ MSG_SEC_DEBUG("tpdu.data.deliver.originAddress.address : %s", tpdu.data.deliver.originAddress.address);
+ MSG_DEBUG("tpdu.data.deliver.timeStamp.time : %d/%d/%d %d:%d:%d ", tpdu.data.deliver.timeStamp.time.absolute.year, tpdu.data.deliver.timeStamp.time.absolute.month, tpdu.data.deliver.timeStamp.time.absolute.day,
+ tpdu.data.deliver.timeStamp.time.absolute.hour, tpdu.data.deliver.timeStamp.time.absolute.minute, tpdu.data.deliver.timeStamp.time.absolute.second);
+ MSG_DEBUG("tpdu.data.deliver.userData.headerCnt : %d", tpdu.data.deliver.userData.headerCnt);
+ MSG_DEBUG("tpdu.data.deliver.userData.length : %d", tpdu.data.deliver.userData.length);
+ MSG_DEBUG("tpdu.data.deliver.userData.data : %s", tpdu.data.deliver.userData.data);
+ MSG_DEBUG("#####################################################");
+ } else if (tpdu.tpduType == SMS_TPDU_STATUS_REP) {
+ MSG_DEBUG("############# SMS_TPDU_STATUS_REP Incoming decoded tpdu values ####################");
+ MSG_DEBUG("tpdu.data.statusRep.msgRef : %d", tpdu.data.statusRep.msgRef);
+ MSG_DEBUG("tpdu.data.statusRep.bMoreMsg : %d", tpdu.data.statusRep.bMoreMsg);
+ MSG_DEBUG("tpdu.data.statusRep.bStatusReport : %d", tpdu.data.statusRep.bStatusReport);
+ MSG_DEBUG("tpdu.data.statusRep.statusRep : %d", tpdu.data.statusRep.bHeaderInd);
+ MSG_DEBUG("tpdu.data.statusRep.status : %02x", tpdu.data.statusRep.status);
+ MSG_DEBUG("tpdu.data.statusRep.pid : %d", tpdu.data.statusRep.pid);
+ MSG_DEBUG("tpdu.data.statusRep.dcs.bCompressed : %d", tpdu.data.statusRep.dcs.bCompressed);
+ MSG_DEBUG("tpdu.data.statusRep.dcs.msgClass : %d", tpdu.data.statusRep.dcs.msgClass);
+ MSG_DEBUG("tpdu.data.statusRep.dcs.codingScheme : %d", tpdu.data.statusRep.dcs.codingScheme);
+ MSG_DEBUG("tpdu.data.statusRep.dcs.codingGroup : %d", tpdu.data.statusRep.dcs.codingGroup);
+ MSG_SEC_DEBUG("tpdu.data.statusRep.recipAddress.address : %s", tpdu.data.statusRep.recipAddress.address);
+ MSG_DEBUG("tpdu.data.statusRep.timeStamp.time : %d/%d/%d %d:%d:%d ", tpdu.data.statusRep.timeStamp.time.absolute.year, tpdu.data.statusRep.timeStamp.time.absolute.month, tpdu.data.statusRep.timeStamp.time.absolute.day,
+ tpdu.data.statusRep.timeStamp.time.absolute.hour, tpdu.data.statusRep.timeStamp.time.absolute.minute, tpdu.data.statusRep.timeStamp.time.absolute.second);
+ MSG_DEBUG("tpdu.data.statusRep.dischargeTime.time : %d/%d/%d %d:%d:%d ", tpdu.data.statusRep.dischargeTime.time.absolute.year, tpdu.data.statusRep.dischargeTime.time.absolute.month, tpdu.data.statusRep.dischargeTime.time.absolute.day,
+ tpdu.data.statusRep.dischargeTime.time.absolute.hour, tpdu.data.statusRep.dischargeTime.time.absolute.minute, tpdu.data.statusRep.dischargeTime.time.absolute.second);
+ MSG_DEBUG("tpdu.data.statusRep.userData.headerCnt : %d", tpdu.data.statusRep.userData.headerCnt);
+ MSG_DEBUG("tpdu.data.statusRep.userData.length : %d", tpdu.data.statusRep.userData.length);
+ MSG_DEBUG("tpdu.data.statusRep.userData.data : %s", tpdu.data.statusRep.userData.data);
+ MSG_DEBUG("#####################################################");
+ }
+
+ MsgDisplayUnlock();
+
+ try {
+ if (tpdu.tpduType == SMS_TPDU_DELIVER) {
+ if (tpdu.data.deliver.dcs.msgClass == SMS_MSG_CLASS_2) {
+ /* For GCF test, 34.2.5.3 */
+ Sms3gppSimMsg::instance()->setSmsData((const char*)pDataPackage->Sca, (const char *)pDataPackage->szData, pDataPackage->MsgLength);
+ }
+
+ if (Sms3gppConcatHandler::instance()->IsConcatMsg(&(tpdu.data.deliver.userData)) == true ||
+ Sms3gppWapPushHandler::instance()->IsWapPushMsg(&(tpdu.data.deliver.userData)) == true) {
+ Sms3gppConcatHandler::instance()->handleConcatMsg(handle, &tpdu);
+ } else {
+ Sms3gppEventHandler::instance()->handleMsgIncoming(handle, &tpdu);
+ }
+ } else if (tpdu.tpduType == SMS_TPDU_STATUS_REP) {
+ Sms3gppEventHandler::instance()->handleMsgIncoming(handle, &tpdu);
+ }
+ } catch (MsgException& e) {
+ MSG_FATAL("%s", e.what());
+ return;
+ }
+}
+
+
+void Sms3gppTapiEventHandler::NotiSmsCbIncomMsg(TapiHandle *handle, const char *noti_id, void *data, void *user_data)
+{
+ MSG_INFO("noti_id: (%s)", noti_id);
+
+ MSG_ERR_RET_M(data == NULL, "Invalid parameter: data is NULL!");
+
+ try {
+ Sms3gppCbMsgHandler::instance()->handleCbMsg(handle, (TelSmsCbMsg_t*)data);
+ } catch (MsgException& e) {
+ MSG_FATAL("%s", e.what());
+ return;
+ }
+}
+
+
+void Sms3gppTapiEventHandler::NotiSmsEtwsIncomMsg(TapiHandle *handle, const char *noti_id, void *data, void *user_data)
+{
+ MSG_INFO("noti_id: (%s)", noti_id);
+
+ MSG_ERR_RET_M(data == NULL, "Invalid parameter: data is NULL!");
+
+ try {
+ Sms3gppCbMsgHandler::instance()->handleEtwsMsg(handle, (TelSmsEtwsMsg_t*)data);
+ } catch (MsgException& e) {
+ MSG_FATAL("%s", e.what());
+ return;
+ }
+}
+
+
+void Sms3gppTapiEventHandler::NotiSimStatus(TapiHandle *handle, const char *noti_id, void *data, void *user_data)
+{
+ MSG_ERR_RET_M(data == NULL, "Invalid parameter: data is NULL!");
+
+ int status = *(int *)data;
+
+ MSG_INFO("SIM Status [%d]", status);
+
+ if (status == TAPI_SIM_STATUS_SIM_INIT_COMPLETED) {
+ MSG_INFO("SIM Initialize by sim status change callback");
+ Sms3gppSetting::instance()->setSimChangeStatus(handle);
+ } else if (status == TAPI_SIM_STATUS_UNKNOWN) {
+ MSG_INFO("SIM TAPI_SIM_STATUS_UNKNOWN");
+ Sms3gppSetting::instance()->setSimChangeStatus(handle);
+ }
+}
+
+
+void Sms3gppTapiEventHandler::NotiNetworkRegistrationType(TapiHandle *handle, const char *noti_id, void *data, void *user_data)
+{
+ MSG_ERR_RET_M(data == NULL, "Invalid parameter: data is NULL!");
+
+ TelNetworkServiceType_t *type = (TelNetworkServiceType_t *)data;
+
+ MSG_INFO("network status type [%d]", *type);
+
+ if (*type > TAPI_NETWORK_SERVICE_TYPE_SEARCH) {
+ /* Call Event Handler */
+ Sms3gppEventHandler::instance()->handleResendMessage();
+ }
+}
+
+
+void Sms3gppTapiEventHandler::NotiSimRefreshed(TapiHandle *handle, const char *noti_id, void *data, void *user_data)
+{
+ MSG_INFO("noti_id: (%s)", noti_id);
+
+ Sms3gppSetting::instance()->SimRefreshCb(handle);
+}
+
+
+void Sms3gppTapiEventHandler::NotiSatSendSms(TapiHandle *handle, const char *noti_id, void *data, void *user_data)
+{
+ MSG_INFO("noti_id: (%s)", noti_id);
+
+ MSG_ERR_RET_M(data == NULL, "Invalid parameter: data is NULL!");
+
+ try {
+ Sms3gppSatHandler::instance()->sendSms(handle, data);
+ } catch (MsgException& e) {
+ MSG_FATAL("%s", e.what());
+ return;
+ }
+}
+
+
+void Sms3gppTapiEventHandler::NotiSatMoSmControlResult(TapiHandle *handle, const char *noti_id, void *data, void *user_data)
+{
+ MSG_INFO("noti_id: (%s)", noti_id);
+
+ MSG_ERR_RET_M(data == NULL, "Invalid parameter: data is NULL!");
+
+ try {
+ Sms3gppSatHandler::instance()->ctrlSms(handle, data);
+ } catch (MsgException& e) {
+ MSG_FATAL("%s", e.what());
+ return;
+ }
+}
+
+
+void Sms3gppTapiEventHandler::NotiSmsMemoryStatus(TapiHandle *handle, const char *noti_id, void *data, void *user_data)
+{
+ MSG_INFO("noti_id: (%s)", noti_id);
+
+ MSG_ERR_RET_M(data == NULL, "Invalid parameter: data is NULL!");
+
+ TelSmsMemStatusType *type = (TelSmsMemStatusType *)data;
+ if (*type == TAPI_NETTEXT_PDA_MEMORY_STATUS_FULL) {
+ int simIndex = SmsPluginDSHandler::instance()->getSimIndex(handle);
+ Sms3gppEventHandler::instance()->handleSimMemoryFull(simIndex);
+ }
+}
+
+
+void Sms3gppTapiEventHandler::respSentStatus(TapiHandle *handle, int result, void *data, void *user_data)
+{
+ MSG_INFO("result = [0x%x]", result);
+
+ SMS_NETWORK_STATUS_T sentStatus;
+
+ TelSatMoSmCtrlIndData_t *moCtrlStatus = (TelSatMoSmCtrlIndData_t *)user_data;
+
+ sentStatus = convertTapiRespToSmsPlugin(result);
+
+ if (moCtrlStatus && sentStatus == SMS_NETWORK_SEND_FAIL_BY_MO_CONTROL_NOT_ALLOWED) {
+ if (moCtrlStatus->moSmsCtrlResult == TAPI_SAT_CALL_CTRL_R_ALLOWED_WITH_MOD) {
+ sentStatus = SMS_NETWORK_SEND_FAIL_BY_MO_CONTROL_WITH_MOD;
+ }
+ }
+
+ if (result != TAPI_NETTEXT_SENDSMS_SUCCESS) {
+ MSG_INFO("sentStatus:[%d], tapi_result:[0x%x]", sentStatus, result);
+ }
+
+ MSG_DEBUG("SMS Network Status = [%d]", sentStatus);
+
+ /* only temporary errors should be returned without calling handleSentStatus() in order to resend sms */
+ if (sentStatus == SMS_NETWORK_SEND_FAIL_TEMPORARY ||
+ sentStatus == SMS_NETWORK_SEND_FAIL_BY_MO_CONTROL_WITH_MOD ||
+ sentStatus == SMS_NETWORK_SEND_FAIL_FDN_RESTRICED) {
+ Sms3gppTransport::instance()->setNetStatus(sentStatus);
+ return;
+ }
+
+ if (sentStatus == SMS_NETWORK_SEND_FAIL) {
+ int svc_type;
+ tel_get_property_int(handle, TAPI_PROP_NETWORK_SERVICE_TYPE, &svc_type);
+ if (svc_type < TAPI_NETWORK_SERVICE_TYPE_2G)
+ sentStatus = SMS_NETWORK_SEND_PENDING;
+ }
+
+ /* Convert SMS status -> Messaging network status */
+ msg_network_status_t netStatus;
+
+ if (sentStatus == SMS_NETWORK_SEND_SUCCESS) {
+ netStatus = MSG_NETWORK_SEND_SUCCESS;
+ } else if (sentStatus == SMS_NETWORK_SENDING) {
+ netStatus = MSG_NETWORK_SENDING;
+ } else if (sentStatus == SMS_NETWORK_SEND_PENDING) {
+ netStatus = MSG_NETWORK_SEND_PENDING;
+ } else {
+ netStatus = MSG_NETWORK_SEND_FAIL;
+ }
+
+ try {
+ Sms3gppEventHandler::instance()->handleSentStatus(netStatus);
+
+ Sms3gppTransport::instance()->setNetStatus(sentStatus);
+ } catch (MsgException& e) {
+ MSG_FATAL("%s", e.what());
+ return;
+ }
+}
+
+
+void Sms3gppTapiEventHandler::respSatSmsSentStatus(TapiHandle *handle, int result, void *data, void *user_data)
+{
+ MSG_INFO("result = [%d]", result);
+
+ SMS_NETWORK_STATUS_T sentStatus = convertTapiRespToSmsPlugin(result);
+
+ MSG_DEBUG("SMS Network Status = [%d]", sentStatus);
+
+ if (sentStatus == SMS_NETWORK_SEND_FAIL && result != TAPI_NETTEXT_DEVICE_FAILURE) {
+ int svc_type;
+ tel_get_property_int(handle, TAPI_PROP_NETWORK_SERVICE_TYPE, &svc_type);
+ if (svc_type < TAPI_NETWORK_SERVICE_TYPE_2G)
+ sentStatus = SMS_NETWORK_SEND_PENDING;
+ }
+
+ try {
+ Sms3gppSatHandler::instance()->ctrlSms(handle, sentStatus);
+ } catch (MsgException& e) {
+ MSG_FATAL("%s", e.what());
+ return;
+ }
+}
+
+
+void Sms3gppTapiEventHandler::respDeliveryReportCNF(TapiHandle *handle, int result, void *data, void *user_data)
+{
+ MSG_INFO("result = [%d]", result);
+}
+
+
+void Sms3gppTapiEventHandler::respGetSimMsgCnt(TapiHandle *handle, int result, void *data, void *user_data)
+{
+ MSG_INFO("result = [%d]", result);
+
+ if (result != TAPI_API_SUCCESS || data == NULL) {
+ MSG_ERR("Error. data is NULL. result:[0x%x]", result);
+ MSG_3GPP_SIM_COUNT_S simCnt;
+ memset(&simCnt, 0x00, sizeof(MSG_3GPP_SIM_COUNT_S));
+ Sms3gppSimMsg::instance()->setSimMsgCntEvent(handle, &simCnt);
+ return;
+ }
+
+ Sms3gppSimMsg::instance()->setSimMsgCntEvent(handle, (MSG_3GPP_SIM_COUNT_S *)data);
+}
+
+
+void Sms3gppTapiEventHandler::respGetSimMsg(TapiHandle *handle, int result, void *data, void *user_data)
+{
+ MSG_INFO("result = [%d]", result);
+
+ if (result != TAPI_API_SUCCESS || data == NULL) {
+ MSG_WARN("Error! Result:(%d)", result);
+ Sms3gppSimMsg::instance()->setSimMsgEvent(handle, NULL, false);
+ return;
+ }
+
+ TelSmsData_t* pSmsTpdu = (TelSmsData_t*)data;
+
+ int *simIdList = (int *)user_data;
+
+ /* Reading TelSmsData_t */
+ MSG_DEBUG("sim index %d", pSmsTpdu->SimIndex);
+ MSG_DEBUG("status %d", pSmsTpdu->MsgStatus);
+ MSG_DEBUG("sim msg [%s]", pSmsTpdu->SmsData.szData);
+
+ /* Reading TelSmsDatapackageInfo_t */
+ if (pSmsTpdu->SmsData.MsgLength > MAX_TPDU_DATA_LEN) {
+ MSG_DEBUG("WARNING: tpdu_len > MAX_SMS_TPDU_SIZE [%d] bytes. setting to 0.", pSmsTpdu->SmsData.MsgLength);
+ Sms3gppSimMsg::instance()->setSimMsgEvent(handle, NULL, false);
+ return;
+ }
+
+ SMS_3GPP_TPDU_S tpdu;
+
+ /* decode Tpdu */
+ Sms3gppTpduCodec::decodeTpdu(handle, pSmsTpdu->SmsData.szData, pSmsTpdu->SmsData.MsgLength, &tpdu);
+
+ MSG_DEBUG("Sim Message Type [%d]", tpdu.tpduType);
+
+ bool bRead = false;
+
+ /* set read status */
+ if (pSmsTpdu->MsgStatus == TAPI_NETTEXT_STATUS_READ) {
+ bRead = true;
+ } else if (pSmsTpdu->MsgStatus == TAPI_NETTEXT_STATUS_UNREAD) {
+ bRead = false;
+ }
+
+ if (tpdu.tpduType == SMS_TPDU_DELIVER) {
+ if (tpdu.data.deliver.dcs.codingScheme == SMS_CHARSET_8BIT && tpdu.data.deliver.pid == 0x11) {
+ MSG_DEBUG("Unsupported message!!");
+ Sms3gppSimMsg::instance()->setSimMsgEvent(handle, NULL, false);
+ return;
+ }
+
+ MSG_DEBUG("headerCnt [%d]", tpdu.data.deliver.userData.headerCnt);
+ for (int i = 0; i < tpdu.data.deliver.userData.headerCnt; i++) {
+ /* Handler Concatenated Message */
+ if (tpdu.data.deliver.userData.header[i].udhType == SMS_UDH_CONCAT_8BIT ||
+ tpdu.data.deliver.userData.header[i].udhType == SMS_UDH_CONCAT_16BIT) {
+ Sms3gppConcatHandler::instance()->handleSimConcatMsg(handle, &tpdu, pSmsTpdu->SimIndex, bRead, simIdList);
+ return;
+ }
+
+ if (tpdu.data.deliver.userData.header[i].udhType == SMS_UDH_SPECIAL_SMS) {
+ MSG_DEBUG("Unsupported Special SMS!!");
+ Sms3gppSimMsg::instance()->setSimMsgEvent(handle, NULL, false);
+ return;
+ }
+ }
+ } else if (tpdu.tpduType == SMS_TPDU_SUBMIT) {
+ if (tpdu.data.submit.dcs.codingScheme == SMS_CHARSET_8BIT && tpdu.data.submit.pid == 0x11) {
+ MSG_DEBUG("Unsupported message!!");
+ Sms3gppSimMsg::instance()->setSimMsgEvent(handle, NULL, false);
+ return;
+ }
+ MSG_DEBUG("headerCnt [%d]", tpdu.data.submit.userData.headerCnt);
+
+ for (int i = 0; i < tpdu.data.submit.userData.headerCnt; i++) {
+ /* Handler Concatenated Message */
+ if (tpdu.data.submit.userData.header[i].udhType == SMS_UDH_CONCAT_8BIT ||
+ tpdu.data.submit.userData.header[i].udhType == SMS_UDH_CONCAT_16BIT) {
+ Sms3gppConcatHandler::instance()->handleSimConcatMsg(handle, &tpdu, pSmsTpdu->SimIndex, bRead, simIdList);
+ return;
+ }
+ }
+ }
+
+ /* Make MSG_MESSAGE_INFO_S */
+ MSG_MESSAGE_INFO_S msgInfo;
+ memset(&msgInfo, 0x00, sizeof(MSG_MESSAGE_INFO_S));
+
+ /* set storage id */
+ msgInfo.storageId = MSG_STORAGE_SIM;
+
+ msgInfo.addressList = NULL;
+ unique_ptr<MSG_ADDRESS_INFO_S*, void(*)(MSG_ADDRESS_INFO_S**)> addressListBuf(&msgInfo.addressList, unique_ptr_deleter);
+
+ Sms3gppEventHandler::instance()->convertTpduToMsginfo(&tpdu, &msgInfo);
+
+ msgInfo.sim_idx = SmsPluginDSHandler::instance()->getSimIndex(handle);
+
+ if (tpdu.tpduType == SMS_TPDU_DELIVER && tpdu.data.deliver.dcs.bMWI == true) {
+ if (tpdu.data.deliver.pid == 0x20 && tpdu.data.deliver.originAddress.ton == SMS_TON_ALPHANUMERIC) {
+ char keyName[MAX_VCONFKEY_NAME_LEN];
+ char *voiceNumber = NULL;
+ char *voiceAlphaId = NULL;
+
+ memset(keyName, 0x00, sizeof(keyName));
+ snprintf(keyName, sizeof(keyName), "%s/%d", VOICEMAIL_NUMBER, msgInfo.sim_idx);
+ if (MsgSettingGetString(keyName, &voiceNumber) != MSG_SUCCESS) {
+ MSG_INFO("MsgSettingGetString() is failed");
+ }
+
+ memset(keyName, 0x00, sizeof(keyName));
+ snprintf(keyName, sizeof(keyName), "%s/%d", VOICEMAIL_ALPHA_ID, msgInfo.sim_idx);
+ if (MsgSettingGetString(keyName, &voiceAlphaId) != MSG_SUCCESS) {
+ MSG_INFO("MsgSettingGetString() is failed");
+ }
+
+ memset(msgInfo.addressList[0].addressVal, 0x00, sizeof(msgInfo.addressList[0].addressVal));
+ memset(msgInfo.addressList[0].displayName, 0x00, sizeof(msgInfo.addressList[0].displayName));
+
+ if (voiceNumber) {
+ snprintf(msgInfo.addressList[0].addressVal, sizeof(msgInfo.addressList[0].addressVal), "%s", voiceNumber);
+ free(voiceNumber);
+ voiceNumber = NULL;
+ }
+
+ if (voiceAlphaId) {
+ snprintf(msgInfo.addressList[0].displayName, sizeof(msgInfo.addressList[0].displayName), "%s", voiceAlphaId);
+ free(voiceAlphaId);
+ voiceAlphaId = NULL;
+ }
+
+ memset(msgInfo.msgText, 0x00, sizeof(msgInfo.msgText));
+ snprintf(msgInfo.msgText, sizeof(msgInfo.msgText), "Voice message");
+ }
+ } else if (tpdu.tpduType == SMS_TPDU_SUBMIT) {
+ msgInfo.displayTime = time(NULL);
+ }
+
+ /* set read status */
+ msgInfo.bRead = bRead;
+
+ simIdList[0] = pSmsTpdu->SimIndex + 1;
+ /* Print MSG_MESSAGE_INFO_S */
+ MSG_DEBUG("############# Convert tpdu values to Message Info values ####################");
+ MSG_DEBUG("msgInfo.msgId : %d", msgInfo.msgId);
+ MSG_DEBUG("msgInfo.nAddressCnt : %d", msgInfo.nAddressCnt);
+ MSG_DEBUG("msgInfo.addressList[0].addressType : %d", msgInfo.addressList[0].addressType);
+ MSG_SEC_DEBUG("msgInfo.addressList[0].addressVal : %s", msgInfo.addressList[0].addressVal);
+ MSG_SEC_DEBUG("msgInfo.addressList[0].displayName : %s", msgInfo.addressList[0].displayName);
+ MSG_DEBUG("msgInfo.priority : %d", msgInfo.priority);
+ MSG_DEBUG("msgInfo.bProtected : %d", msgInfo.bProtected);
+ MSG_DEBUG("msgInfo.bRead : %d", msgInfo.bRead);
+ MSG_DEBUG("msgInfo.bTextSms : %d", msgInfo.bTextSms);
+ MSG_DEBUG("msgInfo.direction : %d", msgInfo.direction);
+ MSG_DEBUG("msgInfo.msgType.mainType : %d", msgInfo.msgType.mainType);
+ MSG_DEBUG("msgInfo.msgType.subType : %d", msgInfo.msgType.subType);
+ MSG_DEBUG("msgInfo.msgType.classType : %d", msgInfo.msgType.classType);
+ MSG_DEBUG("msgInfo.displayTime : %ld", msgInfo.displayTime);
+ MSG_DEBUG("msgInfo.dataSize : %zu", msgInfo.dataSize);
+ if (msgInfo.bTextSms == true)
+ MSG_SEC_DEBUG("msgInfo.msgText : %s", msgInfo.msgText);
+ else
+ MSG_SEC_DEBUG("msgInfo.msgData : %s", msgInfo.msgData);
+ MSG_DEBUG("msgInfo.sim_idx : %d", msgInfo.sim_idx);
+ MSG_DEBUG("###############################################################");
+
+ Sms3gppSimMsg::instance()->setSimMsgEvent(handle, &msgInfo, true);
+}
+
+
+void Sms3gppTapiEventHandler::respSaveSimMsg(TapiHandle *handle, int result, void *data, void *user_data)
+{
+ MSG_DEBUG("result [%d]", result);
+
+ int simId = -1;
+
+ if (data != NULL) {
+ simId = *((int*)data);
+ } else {
+ MSG_ERR("Data(SIM Msg ID) is NULL");
+ }
+
+ Sms3gppSimMsg::instance()->setSaveSimMsgEvent(handle, simId, result);
+}
+
+
+void Sms3gppTapiEventHandler::respSaveClass2Msg(TapiHandle *handle, int result, void *data, void *user_data)
+{
+ MSG_DEBUG("result [%d]", result);
+
+ int simId = -1;
+
+ if (data != NULL) {
+ simId = *((int*)data);
+ MSG_DEBUG("SIM Msg ID : %d", simId);
+ } else {
+ MSG_ERR("Data(SIM Msg ID) is NULL");
+ }
+
+ MSG_MESSAGE_INFO_S *pMsgInfo = (MSG_MESSAGE_INFO_S *)user_data;
+
+ Sms3gppSimMsg::instance()->setSaveClass2MsgEvent(handle, simId, result, pMsgInfo);
+
+ if (result == TAPI_NETTEXT_SENDSMS_SUCCESS) {
+ Sms3gppSimMsg::instance()->setSimEvent((msg_sim_id_t)simId, true);
+ } else {
+ Sms3gppSimMsg::instance()->setSimEvent((msg_sim_id_t)0, false);
+ }
+
+ if (pMsgInfo) {
+ if (pMsgInfo->addressList) {
+ delete[] pMsgInfo->addressList;
+ pMsgInfo->addressList = NULL;
+ }
+ free(pMsgInfo);
+ pMsgInfo = NULL;
+ }
+}
+
+
+void Sms3gppTapiEventHandler::respDeleteSimMsg(TapiHandle *handle, int result, void *data, void *user_data)
+{
+ MSG_DEBUG("result [%d]", result);
+
+ if (result != TAPI_API_SUCCESS || data == NULL) {
+ MSG_ERR("Error! result:(0x%x)", result);
+ Sms3gppSimMsg::instance()->setDelSimEvent(-1, false);
+ return;
+ }
+
+ int sim_id = *((int*)data);
+ Sms3gppSimMsg::instance()->setDelSimEvent(sim_id, true);
+}
+
+
+void Sms3gppTapiEventHandler::respSetConfigData(TapiHandle *handle, int result, void *data, void *user_data)
+{
+ MSG_DEBUG("respSetConfigData is called.");
+
+ if (data == NULL) {
+ MSG_ERR("Error. data is NULL. result:%d", result);
+ Sms3gppSetting::instance()->setResultFromSim(false);
+ return;
+ }
+
+ TelSmsSetResponse* responseType = (TelSmsSetResponse*)data;
+
+ MSG_DEBUG("responseType : [%d]", *responseType);
+
+ switch (*responseType) {
+ case TAPI_NETTEXT_SETPREFERREDBEARER_RSP :
+ MSG_DEBUG("TAPI_NETTEXT_SETPREFERREDBEARER_RSP is called");
+ break;
+ case TAPI_NETTEXT_SETPARAMETERS_RSP :
+ MSG_DEBUG("TAPI_NETTEXT_SETPARAMETERS_RSP is called");
+ break;
+ case TAPI_NETTEXT_CBSETCONFIG_RSP :
+ MSG_DEBUG("TAPI_NETTEXT_CBSETCONFIG_RSP is called");
+ break;
+ case TAPI_NETTEXT_SETMEMORYSTATUS_RSP :
+ MSG_DEBUG("TAPI_NETTEXT_SETMEMORYSTATUS_RSP is called");
+ break;
+ case TAPI_NETTEXT_SETMESSAGESTATUS_RSP :
+ MSG_DEBUG("TAPI_NETTEXT_SETMESSAGESTATUS_RSP is called");
+ break;
+ default :
+ MSG_DEBUG("Unknown Response is called [%d]", *responseType);
+ break;
+ }
+
+ bool bRet = true;
+
+ MSG_DEBUG("status : [%d]", (TelSmsCause_t)result);
+
+ if ((TelSmsCause_t)result != TAPI_NETTEXT_SUCCESS) bRet = false;
+
+ if (*responseType == TAPI_NETTEXT_SETMESSAGESTATUS_RSP) {
+ Sms3gppSimMsg::instance()->setSimEvent(0, bRet);
+ } else {
+ Sms3gppSetting::instance()->setResultFromSim(bRet);
+ }
+}
+
+
+void Sms3gppTapiEventHandler::respGetCBConfig(TapiHandle *handle, int result, void *data, void *user_data)
+{
+ MSG_DEBUG("result = [%d]", result);
+
+ MSG_CBMSG_OPT_S cbOpt = {0};
+
+ int simIndex = SmsPluginDSHandler::instance()->getSimIndex(handle);
+
+ if (result != TAPI_API_SUCCESS || data == NULL || simIndex == 0) {
+ MSG_ERR("Error. data is NULL. result:(0x%x), simIndex:(%d)", result, simIndex);
+ Sms3gppSetting::instance()->setCbConfigEvent(handle, NULL, false);
+ return;
+ }
+
+ TelSmsCbConfig_t* pCBConfig = (TelSmsCbConfig_t*)data;
+
+ cbOpt.bReceive = (bool)pCBConfig->CBEnabled;
+ cbOpt.maxSimCnt = TAPI_NETTEXT_SMS_CBMI_LIST_SIZE_MAX;
+ cbOpt.simIndex = simIndex;
+
+ MSG_DEBUG("Sim Index [%d], Receive [%d], Max SIM Count [%d]", simIndex, cbOpt.bReceive, cbOpt.maxSimCnt);
+
+ cbOpt.channelData.channelCnt = pCBConfig->MsgIdRangeCount;
+ if (cbOpt.channelData.channelCnt > CB_CHANNEL_MAX) {
+ MSG_DEBUG("Channel Count [%d] from TAPI is over MAX", cbOpt.channelData.channelCnt);
+ cbOpt.channelData.channelCnt = CB_CHANNEL_MAX;
+ }
+
+ MSG_DEBUG("Channel Count [%d]", cbOpt.channelData.channelCnt);
+
+ for (int i = 0; i < cbOpt.channelData.channelCnt; 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 FROM [%d], Channel TO [%d] ", cbOpt.channelData.channelInfo[i].from, cbOpt.channelData.channelInfo[i].to);
+ }
+
+ Sms3gppSetting::instance()->setCbConfigEvent(handle, &cbOpt, true);
+}
+
+
+void Sms3gppTapiEventHandler::respSetSmscInfo(TapiHandle *handle, int result, void *data, void *user_data)
+{
+ MSG_DEBUG("result = [%d]", result);
+
+ if (result != TAPI_API_SUCCESS) {
+ Sms3gppSetting::instance()->setResultFromSim(false);
+ } else {
+ Sms3gppSetting::instance()->setResultFromSim(true);
+ }
+}
+
+
+void Sms3gppTapiEventHandler::respSetMemoryStatus(TapiHandle *handle, int result, void *data, void *user_data)
+{
+ MSG_DEBUG("result = [%d]", result);
+
+ if (result == TAPI_API_SUCCESS) {
+ Sms3gppTransport::instance()->setIsMemAvailable(true);
+ }
+}
+
+void Sms3gppTapiEventHandler::respSetMsgStatus(TapiHandle *handle, int result, void *data, void *user_data)
+{
+ MSG_INFO("result = [%d]", result);
+
+ if (result != TAPI_API_SUCCESS || data == NULL) {
+ MSG_ERR("Error. data is NULL. result:0x%x", result);
+ Sms3gppSimMsg::instance()->setSimEvent((msg_sim_id_t)0, false);
+ return;
+ }
+
+ msg_sim_id_t sim_id = *((msg_sim_id_t *)user_data);
+ Sms3gppSimMsg::instance()->setSimEvent(sim_id, true);
+}
+
+void Sms3gppTapiEventHandler::respGetParamCnt(TapiHandle *handle, int result, void *data, void *user_data)
+{
+ MSG_DEBUG("result = [%d]", result);
+
+ if (result != TAPI_API_SUCCESS || data == NULL) {
+ MSG_ERR("Error. data is NULL. result:0x%x", result);
+ Sms3gppSetting::instance()->setParamCntEvent(0);
+ return;
+ }
+
+ int paramCnt = *((int*)data);
+ Sms3gppSetting::instance()->setParamCntEvent(paramCnt);
+}
+
+void Sms3gppTapiEventHandler::respGetParam(TapiHandle *handle, int result, void *data, void *user_data)
+{
+ MSG_DEBUG("result = [%d]", result);
+
+ if (result != TAPI_API_SUCCESS || data == NULL) {
+ MSG_ERR("Error. data is NULL. result:0x%x", result);
+ Sms3gppSetting::instance()->setParamEvent(handle, NULL, -1, false);
+ return;
+ }
+
+ TelSmsParams_t* smsParam = (TelSmsParams_t*)data;
+
+ int alphaIdLen = 0;
+ int addrLen = 0;
+ MSG_SMSC_DATA_S smscData = {0, };
+
+ /*Check Alpha ID value*/
+ alphaIdLen = smsParam->AlphaIdLen;
+ MSG_DEBUG("alphaId_len[%d]", alphaIdLen);
+
+ if (alphaIdLen < 0 || alphaIdLen > SMSC_NAME_MAX) {
+ MSG_ERR("Wrong Alpha ID Length: [%d]", alphaIdLen);
+ Sms3gppSetting::instance()->setParamEvent(handle, NULL, -1, false);
+ return;
+ }
+
+ /*Check Address value*/
+ addrLen = smsParam->TpSvcCntrAddr.DialNumLen;
+ if (addrLen > SMSC_ADDR_MAX) {
+ MSG_ERR("addrLen is too long: %d", addrLen);
+ Sms3gppSetting::instance()->setParamEvent(handle, NULL, -1, false);
+ return;
+ } else if (addrLen < 2) {
+ MSG_ERR("addrLen is too short: %d", addrLen);
+ Sms3gppSetting::instance()->setParamEvent(handle, NULL, -1, false);
+ return;
+ }
+
+ MSG_DEBUG("addrLen : %d", addrLen);
+
+ /*SMSP Parameter Indicator value*/
+ MSG_DEBUG("ParamIndicator[%02x]", smsParam->ParamIndicator);
+
+ /*Get SMSC Address*/
+ if (0x00 == (0x02 & smsParam->ParamIndicator)) {
+ MSG_DEBUG("record index[%d]", (int)smsParam->RecordIndex);
+
+ MSG_DEBUG("TON : %d", smsParam->TpSvcCntrAddr.Ton);
+ MSG_DEBUG("NPI : %d", smsParam->TpSvcCntrAddr.Npi);
+
+ smscData.smscAddr.ton = smsParam->TpSvcCntrAddr.Ton;
+ smscData.smscAddr.npi = smsParam->TpSvcCntrAddr.Npi;
+
+ Sms3gppParamCodec paramCodec;
+
+ memset(smscData.smscAddr.address, 0x00, SMSC_ADDR_MAX+1);
+ paramCodec.decodeSMSC(smsParam->TpSvcCntrAddr.szDiallingNum, addrLen, smscData.smscAddr.ton, smscData.smscAddr.address);
+
+ MSG_SEC_DEBUG("SMSC Address : [%s]", smscData.smscAddr.address);
+
+ memset(smscData.name, 0x00, SMSC_NAME_MAX+1);
+ memcpy(smscData.name, smsParam->szAlphaId, alphaIdLen);
+ smscData.name[alphaIdLen] = '\0';
+
+ MSG_SEC_DEBUG("SMSC Name : [%s]", smscData.name);
+ } else {
+ MSG_ERR("SMSC Address is not present");
+ Sms3gppSetting::instance()->setParamEvent(handle, NULL, -1, false);
+
+ return;
+ }
+
+ /*Get the PID value*/
+ if (0x00 == (0x04 & smsParam->ParamIndicator)) {
+ SMS_3GPP_PID_T pid = (SMS_3GPP_PID_T)smsParam->TpProtocolId;
+
+ MSG_DEBUG("smsParam->TpProtocolId : %d", smsParam->TpProtocolId);
+
+ switch (pid) {
+ case SMS_PID_NORMAL:
+ smscData.pid = MSG_PID_TEXT;
+ break;
+ case SMS_PID_VOICE:
+ smscData.pid = MSG_PID_VOICE;
+ break;
+ case SMS_PID_TELEX:
+ smscData.pid = MSG_PID_FAX;
+ break;
+ case SMS_PID_x400:
+ smscData.pid = MSG_PID_X400;
+ break;
+ case SMS_PID_ERMES:
+ smscData.pid = MSG_PID_ERMES;
+ break;
+ case SMS_PID_EMAIL:
+ smscData.pid = MSG_PID_EMAIL;
+ break;
+ default:
+ smscData.pid = MSG_PID_TEXT;
+ break;
+ }
+
+ MSG_DEBUG("smscData.pid : %d", smscData.pid);
+ } else {
+ MSG_INFO("PID is not present");
+ smscData.pid = MSG_PID_TEXT;
+ MSG_DEBUG("MSG_PID_TEXT is inserted to PID");
+ }
+
+#if 0
+ /*Get the DCS value*/
+ if (0x00 == (0x08 & smsParam->ParamIndicator)) {
+ smscList.smscData[index].dcs = smsParam->TpDataCodingScheme;
+ MSG_DEBUG("dcs : %d", smscList.smscData[index].dcs);
+ } else {
+ smscList.smscData[index].dcs = MSG_ENCODE_GSM7BIT;
+ MSG_DEBUG("DCS is not present");
+ }
+#endif
+
+ /*Get the ValidityPeriod value*/
+ if (0x00 == (0x10 & smsParam->ParamIndicator)) {
+ smscData.valPeriod = smsParam->TpValidityPeriod;
+ MSG_DEBUG("valPeriod : %d", smscData.valPeriod);
+ } else {
+ smscData.valPeriod = 0;
+
+ MSG_DEBUG("Validity Period is not present");
+ }
+
+ Sms3gppSetting::instance()->setParamEvent(handle, &smscData, (int)smsParam->RecordIndex, true);
+}
+
+void Sms3gppTapiEventHandler::respSetMailboxInfo(TapiHandle *handle, int result, void *data, void *user_data)
+{
+ MSG_DEBUG("result = [%d]", result);
+
+ bool bRet = true;
+ bool *bShowError = (bool*)user_data;
+
+ if (result != TAPI_SIM_ACCESS_SUCCESS && *bShowError == true) {
+ bRet = false;
+ }
+
+ Sms3gppSetting::instance()->setResultFromSim(bRet);
+}
+
+void Sms3gppTapiEventHandler::respGetMailboxInfo(TapiHandle *handle, int result, void *data, void *user_data)
+{
+ MSG_DEBUG("result = [%d]", result);
+
+ if (result == TAPI_API_SIM_SERVICE_IS_DISABLED) {
+ MSG_INFO("result is TAPI_API_SIM_SERVICE_IS_DISABLED");
+ char keyName[MAX_VCONFKEY_NAME_LEN];
+ int sim_idx = SmsPluginDSHandler::instance()->getSimIndex(handle);
+ char *voiceNum = NULL;
+ memset(keyName, 0x00, sizeof(keyName));
+ snprintf(keyName, sizeof(keyName), "%s/%d", VOICEMAIL_NUMBER, sim_idx);
+ if (MsgSettingGetString(keyName, &voiceNum) != MSG_SUCCESS) {
+ MSG_INFO("MsgSettingGetString() is failed");
+ }
+
+ if (voiceNum && strlen(voiceNum)) {
+ MSG_DEBUG("Voice mailbox number exist in vconf");
+ Sms3gppSetting::instance()->setMailboxInfoEvent(handle, NULL, true, false);
+ free(voiceNum);
+ voiceNum = NULL;
+ return;
+ } else {
+ Sms3gppSetting::instance()->setMailboxInfoEvent(handle, NULL, false, false);
+ if (voiceNum) {
+ free(voiceNum);
+ voiceNum = NULL;
+ }
+ return;
+ }
+ } else if (result != TAPI_SIM_ACCESS_SUCCESS || data == NULL) {
+ MSG_ERR("Error. data is NULL.");
+ /*If result is not TAPI_SIM_ACCESS_SUCCESS, set bMbdnEnable to false*/
+ Sms3gppSetting::instance()->setMailboxInfoEvent(handle, NULL, false, false);
+ return;
+ }
+
+ TelSimMailboxList_t *list = (TelSimMailboxList_t *)data;
+ SMS_3GPP_SIM_MAILBOX_LIST_S mbList = {0,};
+
+ if (list->count <= 0) {
+ MSG_INFO("Mailbox list is empty");
+ Sms3gppSetting::instance()->setMailboxInfoEvent(handle, NULL, false, true);
+ return;
+ }
+
+ mbList.count = list->count;
+
+ for (int i = 0; i < mbList.count; i++) {
+ mbList.list[i].b_cphs = list->list[i].b_cphs;
+ mbList.list[i].alpha_id_max_len = list->list[i].alpha_id_max_len;
+ mbList.list[i].mb_type = list->list[i].mb_type;
+ mbList.list[i].profile_num = list->list[i].profile_num;
+ mbList.list[i].rec_index = list->list[i].rec_index;
+ mbList.list[i].ton = list->list[i].ton;
+ mbList.list[i].npi = list->list[i].npi;
+ snprintf(mbList.list[i].alpha_id, sizeof(mbList.list[i].alpha_id), "%s", list->list[i].alpha_id);
+ snprintf(mbList.list[i].num, sizeof(mbList.list[i].num), "%s", list->list[i].num);
+ mbList.list[i].cc_id = list->list[i].cc_id;
+ mbList.list[i].ext1_id = list->list[i].ext1_id;
+ mbList.list[i].num_len = strlen(mbList.list[i].num);
+ }
+
+ Sms3gppSetting::instance()->setMailboxInfoEvent(handle, &mbList, true, true);
+}
+
+void Sms3gppTapiEventHandler::respSetMwiInfo(TapiHandle *handle, int result, void *data, void *user_data)
+{
+ MSG_DEBUG("TapiEventSetMwiInfo is called. result = [%d]", result);
+}
+
+void Sms3gppTapiEventHandler::respGetMwiInfo(TapiHandle *handle, int result, void *data, void *user_data)
+{
+ MSG_DEBUG("TapiEventGetMwiInfo is called.");
+
+ if (result != TAPI_SIM_ACCESS_SUCCESS || data == NULL) {
+ MSG_ERR("Error. data is NULL. result:0x%x", result);
+ Sms3gppSetting::instance()->setMwiInfoEvent(handle, NULL, false);
+ return;
+ }
+
+ TelSimMessageWaitingResp_t *MwiInfo = (TelSimMessageWaitingResp_t *)data;
+ SMS_3GPP_SIM_MWI_INFO_S simMwiInfo = {0,};
+ memcpy(&simMwiInfo, MwiInfo, sizeof(SMS_3GPP_SIM_MWI_INFO_S));
+
+ Sms3gppSetting::instance()->setMwiInfoEvent(handle, &simMwiInfo, true);
+}
+
+void Sms3gppTapiEventHandler::respGetMsisdnInfo(TapiHandle *handle, int result, void *data, void *user_data)
+{
+ MSG_DEBUG("respGetMsisdnInfo is called");
+
+ bool bRet = false;
+ bool bDisableGroupMessage = false;
+
+ if (result != TAPI_SIM_ACCESS_SUCCESS || data == NULL) {
+ MSG_ERR("Error. data is NULL. result:0x%x", result);
+ Sms3gppSetting::instance()->setResultFromSim(bRet);
+ return;
+ }
+
+ TelSimMsisdnList_t *list = (TelSimMsisdnList_t *)data;
+
+ for (int i = 0; i < list->count; i++) {
+ if (list->list[i].num[0] != '\0') {
+ char keyName[MAX_VCONFKEY_NAME_LEN];
+ int simIndex = SmsPluginDSHandler::instance()->getSimIndex(handle);
+
+ memset(keyName, 0x00, sizeof(keyName));
+ snprintf(keyName, sizeof(keyName), "%s/%d", MSG_SIM_MSISDN, simIndex);
+
+ if (MsgSettingSetString(keyName, list->list[i].num) == MSG_SUCCESS) {
+ MSG_SEC_INFO("Get MSISDN from SIM : [%s]", list->list[i].num);
+ bRet = true;
+ } else {
+ MSG_DEBUG("Getting MSISDN is failed!");
+ }
+ break;
+ } else {
+ MSG_WARN("Msisdn is empty");
+ bDisableGroupMessage = true;
+ }
+ }
+
+ int tmpVal = 0;
+ if (MsgSettingGetInt(MMS_RECV_GROUP_MESSAGE, &tmpVal) != MSG_SUCCESS)
+ MSG_INFO("MsgSettingGetInt() is failed");
+
+ /* If the value from MMS_RECV_GROUP_MESSAGE is less than 0, it means group message mode is disabled. */
+ if ((tmpVal < 0 && bDisableGroupMessage == false) || (tmpVal > 0 && bDisableGroupMessage == true)) {
+ if (MsgSettingSetInt(MMS_RECV_GROUP_MESSAGE, -tmpVal))
+ MSG_ERR("Error to set config data [%s]", MMS_RECV_GROUP_MESSAGE);
+ }
+
+ Sms3gppSetting::instance()->setResultFromSim(bRet);
+}
+
+void Sms3gppTapiEventHandler::respGetSimServiceTable(TapiHandle *handle, int result, void *data, void *user_data)
+{
+ MSG_DEBUG("TapiEventGetSimServiceTable is called.");
+
+ TelSimAccessResult_t access_rt = (TelSimAccessResult_t)result;
+ TelSimServiceTable_t *svct = (TelSimServiceTable_t *)data;
+
+ bool bRet = true;
+
+ if (access_rt != TAPI_SIM_ACCESS_SUCCESS || svct == NULL) {
+ MSG_ERR("Error. data is NULL and access_rt [%d] failed", access_rt);
+ Sms3gppSetting::instance()->setResultFromSim(false);
+ return;
+ }
+
+ msg_error_t err = MSG_SUCCESS;
+
+ char sstKey[128];
+ char moCtrlKey[128];
+
+ int simIndex = SmsPluginDSHandler::instance()->getSimIndex(handle);
+
+ memset(sstKey, 0x00, sizeof(sstKey));
+ snprintf(sstKey, sizeof(sstKey), "%s/%d", MSG_SIM_SERVICE_TABLE, simIndex);
+
+ memset(moCtrlKey, 0x00, sizeof(moCtrlKey));
+ snprintf(moCtrlKey, sizeof(moCtrlKey), "%s/%d", MSG_SIM_MO_CONTROL, simIndex);
+
+ if (svct->sim_type == TAPI_SIM_CARD_TYPE_GSM) {
+ if (svct->table.sst.service[TAPI_SIM_SST_SMS] == 1) {
+ err = MsgSettingSetBool(sstKey, true);
+ } else {
+ err = MsgSettingSetBool(sstKey, false);
+ }
+ MSG_DEBUG("Setting result = [%d]", err);
+
+ if (svct->table.sst.service[TAPI_SIM_SST_MO_SMS_CTRL_BY_SIM] == 1) {
+ err = MsgSettingSetBool(moCtrlKey, true);
+ } else {
+ err = MsgSettingSetBool(moCtrlKey, false);
+ }
+ MSG_DEBUG("Setting result = [%d]", err);
+
+ } else if (svct->sim_type == TAPI_SIM_CARD_TYPE_USIM) {
+ if (svct->table.ust.service[TAPI_SIM_UST_SMS] == 1) {
+ err = MsgSettingSetBool(sstKey, true);
+ } else {
+ err = MsgSettingSetBool(sstKey, false);
+ }
+ MSG_DEBUG("Setting result = [%d]", err);
+
+ if (svct->table.ust.service[TAPI_SIM_UST_MO_SMS_CTRL] == 1) {
+ err = MsgSettingSetBool(moCtrlKey, true);
+ } else {
+ err = MsgSettingSetBool(moCtrlKey, false);
+ }
+ MSG_DEBUG("Setting result = [%d]", err);
+
+ } else {
+ MSG_DEBUG("Unknown SIM type value");
+
+ }
+
+ Sms3gppSetting::instance()->setResultFromSim(bRet);
+}
+
+
+void Sms3gppTapiEventHandler::respGetMeImei(TapiHandle *handle, int result, void *data, void *user_data)
+{
+ MSG_SEC_DEBUG("TapiEventGetMeImei is called. result [%d]", result);
+
+ if (result != TAPI_API_SUCCESS || data == NULL) {
+ MSG_ERR("Error. data is NULL. result:0x%x", result);
+ Sms3gppSetting::instance()->setResultImei(false, NULL);
+ return;
+ }
+
+ char *tmpImei = (char *)data;
+
+ Sms3gppSetting::instance()->setResultImei(true, tmpImei);
+}
+
* limitations under the License.
*/
+#include "Sms3gppTpduCodec.h"
+
#include <stdio.h>
#include <string.h>
+#include "Sms3gppUDCodec.h"
#include "MsgDebug.h"
#include "MsgCppTypes.h"
#include "MsgException.h"
#include "MsgGconfWrapper.h"
-#include "SmsPluginTpduCodec.h"
-#include "SmsPluginParamCodec.h"
-#include "SmsPluginUDCodec.h"
+#include "Sms3gppParamCodec.h"
/*==================================================================================================
- IMPLEMENTATION OF SmsPluginTpduCodec - Member Functions
+ IMPLEMENTATION OF Sms3gppTpduCodec - Member Functions
==================================================================================================*/
-SmsPluginTpduCodec::SmsPluginTpduCodec()
+Sms3gppTpduCodec::Sms3gppTpduCodec()
{
}
-SmsPluginTpduCodec::~SmsPluginTpduCodec()
+Sms3gppTpduCodec::~Sms3gppTpduCodec()
{
}
-int SmsPluginTpduCodec::encodeTpdu(const SMS_TPDU_S *pSmsTpdu, char *pTpdu)
+int Sms3gppTpduCodec::encodeTpdu(const SMS_3GPP_TPDU_S *pSmsTpdu, char *pTpdu)
{
int tpduLen = 0;
case SMS_TPDU_SUBMIT:
tpduLen = encodeSubmit(&(pSmsTpdu->data.submit), pTpdu);
break;
-
case SMS_TPDU_DELIVER:
tpduLen = encodeDeliver(&(pSmsTpdu->data.deliver), pTpdu);
break;
-
case SMS_TPDU_DELIVER_REP:
tpduLen = encodeDeliverReport(&(pSmsTpdu->data.deliverRep), pTpdu);
break;
-
case SMS_TPDU_STATUS_REP:
tpduLen = encodeStatusReport(&(pSmsTpdu->data.statusRep), pTpdu);
break;
}
-int SmsPluginTpduCodec::decodeTpdu(const unsigned char *pTpdu, int TpduLen, SMS_TPDU_S *pSmsTpdu)
+int Sms3gppTpduCodec::decodeTpdu(TapiHandle *handle, const unsigned char *pTpdu, int TpduLen, SMS_3GPP_TPDU_S *pSmsTpdu)
{
int decodeLen = 0;
switch (mti) {
case 0x00:
pSmsTpdu->tpduType = SMS_TPDU_DELIVER;
- decodeLen = decodeDeliver(pTpdu, TpduLen, &(pSmsTpdu->data.deliver));
+ decodeLen = decodeDeliver(handle, pTpdu, TpduLen, &(pSmsTpdu->data.deliver));
break;
-
case 0x01:
pSmsTpdu->tpduType = SMS_TPDU_SUBMIT;
decodeLen = decodeSubmit(pTpdu, TpduLen, &(pSmsTpdu->data.submit));
break;
-
case 0x02:
pSmsTpdu->tpduType = SMS_TPDU_STATUS_REP;
decodeLen = decodeStatusReport(pTpdu, TpduLen, &(pSmsTpdu->data.statusRep));
}
-int SmsPluginTpduCodec::encodeSubmit(const SMS_SUBMIT_S *pSubmit, char *pTpdu)
+int Sms3gppTpduCodec::encodeSubmit(const SMS_3GPP_SUBMIT_S *pSubmit, char *pTpdu)
{
int offset = 0, length = 0, encodeSize = 0;
MSG_DEBUG("TP-MR pSubmit->msgRef : %d.", pSubmit->msgRef);
/* TP-DA */
- length = SmsPluginParamCodec::encodeAddress(&pSubmit->destAddress, &address);
+ length = Sms3gppParamCodec::encodeAddress(&pSubmit->destAddress, &address);
memcpy(&(pTpdu[offset]), address, length);
offset += length;
MSG_DEBUG("TP-PID pSubmit->pid : %d.", pSubmit->pid);
/* TP-DCS */
- length = SmsPluginParamCodec::encodeDCS(&pSubmit->dcs, &dcs);
+ length = Sms3gppParamCodec::encodeDCS(&pSubmit->dcs, &dcs);
memcpy(&(pTpdu[offset]), dcs, length);
offset += length;
/* TP-VP */
if (pSubmit->vpf != SMS_VPF_NOT_PRESENT) {
- length = SmsPluginParamCodec::encodeTime(&pSubmit->validityPeriod, &vpTime);
+ length = Sms3gppParamCodec::encodeTime(&pSubmit->validityPeriod, &vpTime);
if (length > 0) {
memcpy(&(pTpdu[offset]), vpTime, length);
}
}
- encodeSize = SmsPluginUDCodec::encodeUserData(&(pSubmit->userData), pSubmit->dcs.codingScheme, &(pTpdu[offset]));
+ encodeSize = Sms3gppUDCodec::encodeUserData(&(pSubmit->userData), pSubmit->dcs.codingScheme, &(pTpdu[offset]));
MSG_DEBUG("encodeSize : %d", encodeSize);
}
-int SmsPluginTpduCodec::encodeDeliver(const SMS_DELIVER_S *pDeliver, char *pTpdu)
+int Sms3gppTpduCodec::encodeDeliver(const SMS_3GPP_DELIVER_S *pDeliver, char *pTpdu)
{
int offset = 0, length = 0, encodeSize = 0;
offset++;
/* TP-OA */
- length = SmsPluginParamCodec::encodeAddress(&pDeliver->originAddress, &address);
+ length = Sms3gppParamCodec::encodeAddress(&pDeliver->originAddress, &address);
memcpy(&(pTpdu[offset]), address, length);
offset += length;
pTpdu[offset++] = pDeliver->pid;
/* TP-DCS */
- length = SmsPluginParamCodec::encodeDCS(&pDeliver->dcs, &dcs);
+ length = Sms3gppParamCodec::encodeDCS(&pDeliver->dcs, &dcs);
memcpy(&(pTpdu[offset]), dcs, length);
offset += length;
/* TP-SCTS */
- length = SmsPluginParamCodec::encodeTime(&pDeliver->timeStamp, &scts);
+ length = Sms3gppParamCodec::encodeTime(&pDeliver->timeStamp, &scts);
memcpy(&(pTpdu[offset]), scts, length);
offset += length;
/* TP-UDL & TP-UD */
- encodeSize = SmsPluginUDCodec::encodeUserData(&(pDeliver->userData), pDeliver->dcs.codingScheme, &(pTpdu[offset]));
+ encodeSize = Sms3gppUDCodec::encodeUserData(&(pDeliver->userData), pDeliver->dcs.codingScheme, &(pTpdu[offset]));
MSG_DEBUG("encodeSize : %d", encodeSize);
}
-int SmsPluginTpduCodec::encodeDeliverReport(const SMS_DELIVER_REPORT_S *pDeliverRep, char *pTpdu)
+int Sms3gppTpduCodec::encodeDeliverReport(const SMS_3GPP_DELIVER_REPORT_S *pDeliverRep, char *pTpdu)
{
int offset = 0;
char* dcs = NULL;
unique_ptr<char*, void(*)(char**)> dcsBuf(&dcs, unique_ptr_deleter);
- length = SmsPluginParamCodec::encodeDCS(&pDeliverRep->dcs, &dcs);
+ length = Sms3gppParamCodec::encodeDCS(&pDeliverRep->dcs, &dcs);
memcpy(&(pTpdu[offset]), dcs, length);
offset += length;
if (pDeliverRep->paramInd & 0x04) {
int encodeSize = 0;
- encodeSize = SmsPluginUDCodec::encodeUserData(&(pDeliverRep->userData), pDeliverRep->dcs.codingScheme, &(pTpdu[offset]));
+ encodeSize = Sms3gppUDCodec::encodeUserData(&(pDeliverRep->userData), pDeliverRep->dcs.codingScheme, &(pTpdu[offset]));
MSG_DEBUG("encodeSize : %d", encodeSize);
}
-int SmsPluginTpduCodec::encodeStatusReport(const SMS_STATUS_REPORT_S *pStatusRep, char *pTpdu)
+int Sms3gppTpduCodec::encodeStatusReport(const SMS_3GPP_STATUS_REPORT_S *pStatusRep, char *pTpdu)
{
int offset = 0, length = 0;
pTpdu[offset++] = pStatusRep->msgRef;
/* TP-RA */
- length = SmsPluginParamCodec::encodeAddress(&pStatusRep->recipAddress, &address);
+ length = Sms3gppParamCodec::encodeAddress(&pStatusRep->recipAddress, &address);
memcpy(&(pTpdu[offset]), address, length);
offset += length;
/* TP-SCTS */
- length = SmsPluginParamCodec::encodeTime(&pStatusRep->timeStamp, &scts);
+ length = Sms3gppParamCodec::encodeTime(&pStatusRep->timeStamp, &scts);
memcpy(&(pTpdu[offset]), scts, length);
offset += length;
/* TP-DT */
- length = SmsPluginParamCodec::encodeTime(&pStatusRep->dischargeTime, &dt);
+ length = Sms3gppParamCodec::encodeTime(&pStatusRep->dischargeTime, &dt);
memcpy(&(pTpdu[offset]), dt, length);
offset += length;
char* dcs = NULL;
unique_ptr<char*, void(*)(char**)> dcsBuf(&dcs, unique_ptr_deleter);
- length = SmsPluginParamCodec::encodeDCS(&pStatusRep->dcs, &dcs);
+ length = Sms3gppParamCodec::encodeDCS(&pStatusRep->dcs, &dcs);
memcpy(&(pTpdu[offset]), dcs, length);
offset += length;
if (pStatusRep->paramInd & 0x04) {
int encodeSize = 0;
- encodeSize = SmsPluginUDCodec::encodeUserData(&(pStatusRep->userData), pStatusRep->dcs.codingScheme, &(pTpdu[offset]));
+ encodeSize = Sms3gppUDCodec::encodeUserData(&(pStatusRep->userData), pStatusRep->dcs.codingScheme, &(pTpdu[offset]));
MSG_DEBUG("encodeSize : %d", encodeSize);
}
-int SmsPluginTpduCodec::decodeSubmit(const unsigned char *pTpdu, int TpduLen, SMS_SUBMIT_S *pSubmit)
+int Sms3gppTpduCodec::decodeSubmit(const unsigned char *pTpdu, int TpduLen, SMS_3GPP_SUBMIT_S *pSubmit)
{
int offset = 0, udLen = 0;
pSubmit->bRejectDup = true;
/* TP-VPF */
- pSubmit->vpf = (SMS_VPF_T)(pTpdu[offset] & 0x18);
+ pSubmit->vpf = (SMS_3GPP_VPF_T)(pTpdu[offset] & 0x18);
/* TP-SRR */
if (pTpdu[offset] & 0x20)
pSubmit->msgRef = pTpdu[offset++];
/* TP-DA */
- offset += SmsPluginParamCodec::decodeAddress(pTpdu+offset, &(pSubmit->destAddress));
+ offset += Sms3gppParamCodec::decodeAddress(pTpdu+offset, &(pSubmit->destAddress));
/* TP-PID */
pSubmit->pid = pTpdu[offset++];
/* TP-DCS */
- offset += SmsPluginParamCodec::decodeDCS(pTpdu+offset, &(pSubmit->dcs));
+ offset += Sms3gppParamCodec::decodeDCS(pTpdu+offset, &(pSubmit->dcs));
/* TP-VP */
if (pSubmit->vpf != SMS_VPF_NOT_PRESENT) {
}
/* TP-UDL & TP-UD */
- udLen = SmsPluginUDCodec::decodeUserData(pTpdu+offset, TpduLen, pSubmit->bHeaderInd, pSubmit->dcs.codingScheme, &(pSubmit->userData));
+ udLen = Sms3gppUDCodec::decodeUserData(pTpdu+offset, TpduLen, pSubmit->bHeaderInd, pSubmit->dcs.codingScheme, &(pSubmit->userData));
return udLen;
}
-int SmsPluginTpduCodec::decodeDeliver(const unsigned char *pTpdu, int TpduLen, SMS_DELIVER_S *pDeliver)
+int Sms3gppTpduCodec::decodeDeliver(TapiHandle *handle, const unsigned char *pTpdu, int TpduLen, SMS_3GPP_DELIVER_S *pDeliver)
{
int offset = 0, udLen = 0, tmpOffset = 0;
-
char tpduTmp[(TpduLen*2)+1];
memset(tpduTmp, 0x00, sizeof(tpduTmp));
for (int i = 0; i < TpduLen; i++) {
MSG_DEBUG("Deliver TPDU.");
MSG_INFO("[%s]", tpduTmp);
-
/* TP-MMS */
if (pTpdu[offset] & 0x04)
pDeliver->bMoreMsg = false;
tmpOffset = offset;
#if 1
/* TP-OA */
- offset += SmsPluginParamCodec::decodeAddress(&pTpdu[offset], &(pDeliver->originAddress));
+ offset += Sms3gppParamCodec::decodeAddress(&pTpdu[offset], &(pDeliver->originAddress));
/* TP-PID */
pDeliver->pid = pTpdu[offset++];
/* TP-DCS */
- offset += SmsPluginParamCodec::decodeDCS(&pTpdu[offset], &(pDeliver->dcs));
+ offset += Sms3gppParamCodec::decodeDCS(&pTpdu[offset], &(pDeliver->dcs));
/* Support KSC5601 :: Coding group bits == 0x84 */
if (pTpdu[offset-1] == 0x84) {
pDeliver->dcs.codingScheme = SMS_CHARSET_EUCKR;
}
-
#else
/* For alphanumeric address test */
- offset += SmsPluginParamCodec::decodeAddress(&pTpdu[offset], &(pDeliver->originAddress));
+ offset += Sms3gppParamCodec::decodeAddress(&pTpdu[offset], &(pDeliver->originAddress));
char* address = new char[15];
address[0] = 0x04;
address[13] = 0x01;
address[14] = 0x20;
- SmsPluginParamCodec::decodeAddress((unsigned char*)address, &(pDeliver->originAddress));
+ Sms3gppParamCodec::decodeAddress((unsigned char*)address, &(pDeliver->originAddress));
pDeliver->pid = 0x20;
offset++;
- offset += SmsPluginParamCodec::decodeDCS((unsigned char*)address, &(pDeliver->dcs));
- /* end test */
-#endif
+ offset += Sms3gppParamCodec::decodeDCS((unsigned char*)address, &(pDeliver->dcs));
+#endif /* end test */
if (pDeliver->pid == 0x20 && pDeliver->originAddress.ton == SMS_TON_ALPHANUMERIC) {
int setType = -1;
int indType = -1;
- bool bVmi = SmsPluginParamCodec::checkCphsVmiMsg(&pTpdu[tmpOffset], &setType, &indType);
+ bool bVmi = Sms3gppParamCodec::checkCphsVmiMsg(&pTpdu[tmpOffset], &setType, &indType);
MSG_DEBUG("bVmi = [%d], setType=[%d], indType=[%d]", bVmi, setType, indType);
}
/* TP-SCTS */
- offset += SmsPluginParamCodec::decodeTime(&pTpdu[offset], &(pDeliver->timeStamp));
+ offset += Sms3gppParamCodec::decodeTime(&pTpdu[offset], &(pDeliver->timeStamp));
/* TP-UD */
- udLen = SmsPluginUDCodec::decodeUserData(&pTpdu[offset], TpduLen, pDeliver->bHeaderInd, pDeliver->dcs.codingScheme, &(pDeliver->userData), &(pDeliver->udData));
+ udLen = Sms3gppUDCodec::decodeUserData(&pTpdu[offset], TpduLen, pDeliver->bHeaderInd, pDeliver->dcs.codingScheme, &(pDeliver->userData), &(pDeliver->udData));
return udLen;
}
-int SmsPluginTpduCodec::decodeStatusReport(const unsigned char *pTpdu, int TpduLen, SMS_STATUS_REPORT_S *pStatusRep)
+int Sms3gppTpduCodec::decodeStatusReport(const unsigned char *pTpdu, int TpduLen, SMS_3GPP_STATUS_REPORT_S *pStatusRep)
{
#ifdef LOG_ENABLE
printf("\n\n[decodeStatusReport] pTpdu data - Length [%d]\n", TpduLen);
pStatusRep->msgRef = pTpdu[offset++];
/* TP-RA */
- offset += SmsPluginParamCodec::decodeAddress(&pTpdu[offset], &(pStatusRep->recipAddress));
+ offset += Sms3gppParamCodec::decodeAddress(&pTpdu[offset], &(pStatusRep->recipAddress));
/* TP-SCTS */
/* Decode timestamp */
- offset += SmsPluginParamCodec::decodeTime(&pTpdu[offset], &(pStatusRep->timeStamp));
+ offset += Sms3gppParamCodec::decodeTime(&pTpdu[offset], &(pStatusRep->timeStamp));
/* TP-DT */
/* Decode timestamp */
- offset += SmsPluginParamCodec::decodeTime(&pTpdu[offset], &(pStatusRep->dischargeTime));
+ offset += Sms3gppParamCodec::decodeTime(&pTpdu[offset], &(pStatusRep->dischargeTime));
/* TP-Status */
pStatusRep->status = pTpdu[offset++];
/* TP-DCS */
if (pStatusRep->paramInd & 0x02)
- offset += SmsPluginParamCodec::decodeDCS(&pTpdu[offset], &(pStatusRep->dcs));
+ offset += Sms3gppParamCodec::decodeDCS(&pTpdu[offset], &(pStatusRep->dcs));
/* TP-UDL & TP-UD */
if (pStatusRep->paramInd & 0x04)
/* Decode User Data */
- udLen = SmsPluginUDCodec::decodeUserData(&pTpdu[offset], TpduLen, pStatusRep->bHeaderInd, pStatusRep->dcs.codingScheme, &(pStatusRep->userData));
+ udLen = Sms3gppUDCodec::decodeUserData(&pTpdu[offset], TpduLen, pStatusRep->bHeaderInd, pStatusRep->dcs.codingScheme, &(pStatusRep->userData));
return udLen;
}
#include "MsgException.h"
#include "MsgGconfWrapper.h"
#include "MsgUtilFile.h"
+#include "MsgUtilFunction.h"
#include "MsgNotificationWrapper.h"
#include "MsgUtilStorage.h"
-#include "SmsPluginParamCodec.h"
-#include "SmsPluginTpduCodec.h"
-#include "SmsPluginEventHandler.h"
-#include "SmsPluginStorage.h"
-#include "SmsPluginCallback.h"
-#include "SmsPluginTransport.h"
#include "SmsPluginDSHandler.h"
-#include "SmsPluginSetting.h"
+#include "SmsPluginStorage.h"
+#include "Sms3gppParamCodec.h"
+#include "Sms3gppTpduCodec.h"
+#include "Sms3gppEventHandler.h"
+#include "Sms3gppStorage.h"
+#include "Sms3gppTapiEventHandler.h"
+#include "Sms3gppTransport.h"
+#include "Sms3gppSetting.h"
+#include "Sms3gppUAManager.h"
-extern "C" {
- #include <ITapiNetText.h>
- #include <TelNetwork.h>
-}
+#include <ITapiNetText.h>
+#include <TelNetwork.h>
+
+
+
+Sms3gppTransport* Sms3gppTransport::pInstance = NULL;
+
+msg_error_t Sms3gppSubmitRequest(MSG_REQUEST_INFO_S *pReqInfo)
+{
+ msg_error_t err = MSG_SUCCESS;
+
+#ifdef MSG_FEATURE_MDM
+#ifdef MSG_FEATURE_MDM_PHASE_2
+ /* Check MDM policy for Normal SMS */
+ if (pReqInfo->msgInfo.msgType.subType == MSG_NORMAL_SMS) {
+ if (MsgMdmGetStatus(MSG_MDM_OUTGOING_COUNT_LIMIT, pReqInfo->msgInfo.sim_idx, NULL) == MDM_RESTRICTED) {
+ MSG_INFO("SmsPlgSubmitRequest is restricted by MDM count limit.");
+ if (pReqInfo->msgInfo.msgId > 0) {
+ err = SmsPluginStorage::instance()->updateSentMsg(&(pReqInfo->msgInfo), MSG_NETWORK_SEND_FAIL);
+ if (err == MSG_SUCCESS) {
+ return MSG_ERR_MDM_RESTRICT;
+ } else {
+ return err;
+ }
+ } else {
+ return MSG_ERR_MDM_RESTRICT;
+ }
+ }
+
+ for (int i = 0; i < pReqInfo->msgInfo.nAddressCnt; i++) {
+ if (MsgMdmGetStatus(MSG_MDM_OUTGOING_RESTRICTION, pReqInfo->msgInfo.sim_idx, pReqInfo->msgInfo.addressList[i].addressVal) == MDM_RESTRICTED) {
+ MSG_INFO("SmsPlgSubmitRequest is restricted by MDM pattern matching.");
+ if (pReqInfo->msgInfo.msgId > 0) {
+ err = SmsPluginStorage::instance()->updateSentMsg(&(pReqInfo->msgInfo), MSG_NETWORK_SEND_FAIL);
+ if (err == MSG_SUCCESS) {
+ return MSG_ERR_MDM_RESTRICT;
+ } else {
+ return err;
+ }
+ } else {
+ return MSG_ERR_MDM_RESTRICT;
+ }
+ }
+ }
+ }
+#endif
+#endif
+
+ /* Add Submit SMS into DB */
+ if (pReqInfo->msgInfo.msgId == 0) {
+ if (pReqInfo->msgInfo.msgPort.valid == false) {
+ err = SmsPluginStorage::instance()->checkMessage(&(pReqInfo->msgInfo));
+
+ if (err != MSG_SUCCESS) {
+ MSG_ERR("######## checkMessage Fail !! [err=%d]", err);
+ return MSG_ERR_PLUGIN_STORAGE;
+ }
+
+ err = SmsPluginStorage::instance()->addSmsMessage(&(pReqInfo->msgInfo));
+ if (err != MSG_SUCCESS) {
+ MSG_ERR("######## addSmsMessage Fail !! [err=%d]", err);
+ return MSG_ERR_PLUGIN_STORAGE;
+ }
+
+ if (SmsPluginStorage::instance()->addSmsSendOption(&(pReqInfo->msgInfo), &(pReqInfo->sendOptInfo)) != MSG_SUCCESS) {
+ MSG_ERR("######## addSmsSendOption Fail !!");
+ return MSG_ERR_PLUGIN_STORAGE;
+ }
+ }
+ }
+
+#ifdef MSG_FEATURE_MDM
+#ifdef MSG_FEATURE_MDM_PHASE_2
+ /* MDM :: SMS capture for outgoing SMS */
+ if (pReqInfo->msgInfo.msgType.subType == MSG_NORMAL_SMS) {
+ if (MsgMdmGetStatus(MSG_MDM_MESSAGE_COPY, pReqInfo->msgInfo.sim_idx, NULL) == MDM_ENABLED) {
+ mdm_result_t mdmResult = MsgMdmMessageCopy(&pReqInfo->msgInfo);
+ if (mdmResult != MDM_RESULT_SUCCESS) {
+ MSG_ERR("MsgMdmMessageCopy() failed: (%d)", mdmResult);
+ }
+ }
+ }
+#endif
+#endif
+
+ /* Check SIM is present or not */
+ char keyName[MAX_VCONFKEY_NAME_LEN] = {0,};
+ snprintf(keyName, sizeof(keyName), "%s/%d", MSG_SIM_CHANGED, pReqInfo->msgInfo.sim_idx);
+ MSG_SIM_STATUS_T simStatus = 0;
+ if (MsgSettingGetInt(keyName, (int*)&simStatus) != MSG_SUCCESS) {
+ MSG_INFO("MsgSettingGetInt() failed!");
+ }
+
+ if (simStatus == MSG_SIM_STATUS_NOT_FOUND) {
+ MSG_DEBUG("SIM is not present..");
+
+ /* Update Msg Status */
+ if (pReqInfo->msgInfo.msgPort.valid == false) {
+ SmsPluginStorage::instance()->updateSentMsg(&(pReqInfo->msgInfo), MSG_NETWORK_SEND_FAIL);
+ }
+
+ return MSG_ERR_NO_SIM;
+ }
+
+ SMS_3GPP_REQUEST_INFO_S *request = NULL;
+
+ request = (SMS_3GPP_REQUEST_INFO_S *)calloc(1, sizeof(SMS_3GPP_REQUEST_INFO_S));
+
+ if (request != NULL) {
+ request->reqId = pReqInfo->reqId;
+
+ memcpy(&(request->msgInfo), &(pReqInfo->msgInfo), sizeof(MSG_MESSAGE_INFO_S));
+ memcpy(&(request->sendOptInfo), &(pReqInfo->sendOptInfo), sizeof(MSG_SENDINGOPT_INFO_S));
+
+ /* Add Request into Queue and Start UA Manger */
+ Sms3gppUAManager::instance()->addReqEntity(request);
+
+ free(request);
+ }
+
+ return MSG_SUCCESS;
+}
-extern bool isMemAvailable;
/*==================================================================================================
- IMPLEMENTATION OF SmsPluginTransport - Member Functions
+ IMPLEMENTATION OF Sms3gppTransport - Member Functions
==================================================================================================*/
-SmsPluginTransport* SmsPluginTransport::pInstance = NULL;
-
-SmsPluginTransport::SmsPluginTransport()
+Sms3gppTransport::Sms3gppTransport()
{
+ isMemAvailable = true;
msgRef = 0x00;
msgRef8bit = 0x00;
msgRef16bit = 0x0000;
- curStatus = 0x00;
+ curStatus = SMS_NETWORK_SEND_SUCCESS;
memset(&curMoCtrlData, 0x00, sizeof(curMoCtrlData));
}
-SmsPluginTransport::~SmsPluginTransport()
+Sms3gppTransport::~Sms3gppTransport()
{
}
-SmsPluginTransport* SmsPluginTransport::instance()
+Sms3gppTransport* Sms3gppTransport::instance()
{
- if (!pInstance)
- pInstance = new SmsPluginTransport();
+ if (!pInstance) {
+ pInstance = new Sms3gppTransport();
+ }
return pInstance;
}
-void SmsPluginTransport::submitRequest(SMS_REQUEST_INFO_S *pReqInfo)
+void Sms3gppTransport::submitRequest(SMS_3GPP_REQUEST_INFO_S *pReqInfo)
{
MSG_BEGIN();
- SMS_TPDU_S tpdu = {0, };
-
+ SMS_3GPP_TPDU_S tpdu = {0, };
tpdu.tpduType = SMS_TPDU_SUBMIT;
+ /* Get TAPI handle */
+ TapiHandle *handle = SmsPluginDSHandler::instance()->getTelHandle(pReqInfo->msgInfo.sim_idx);
/* Get SMS Send Options - Setting */
getSmsSendOption(pReqInfo->msgInfo.sim_idx, &(tpdu.data.submit));
setSmsReportOption(pReqInfo, &tpdu);
/* Set SMSC Options */
- SMS_ADDRESS_S smsc = {0, };
+ SMS_3GPP_ADDRESS_S smsc = {0, };
setSmscOptions(pReqInfo->msgInfo.sim_idx, &smsc);
- /* Get TAPI handle */
- TapiHandle *handle = SmsPluginDSHandler::instance()->getTelHandle(pReqInfo->msgInfo.sim_idx);
-
/* Get address informations. */
MsgDbHandler *dbHandle = getDbHandle();
MsgStoGetAddressByMsgId(dbHandle, pReqInfo->msgInfo.msgId, &pReqInfo->msgInfo.nAddressCnt, &pReqInfo->msgInfo.addressList);
for (int i = failedIndex; i < pReqInfo->msgInfo.nAddressCnt; i++) {
/* Make SMS_SUBMIT_DATA_S from MSG_REQUEST_INFO_S */
- SMS_SUBMIT_DATA_S submitData = {{0}, };
+ SMS_3GPP_SUBMIT_DATA_S submitData = {{0}, };
msgInfoToSubmitData(&(pReqInfo->msgInfo), &submitData, &(tpdu.data.submit.dcs.codingScheme), i);
/* Insert message reference into db */
if (tpdu.data.submit.bStatusReport == true) {
- SmsPluginStorage::instance()->insertMsgRef(&(pReqInfo->msgInfo), tpdu.data.submit.msgRef, i);
+ Sms3gppStorage::instance()->insertMsgRef(&(pReqInfo->msgInfo), tpdu.data.submit.msgRef, i);
}
/* Encode SMSC Address */
unsigned char smscAddr[MAX_SMSC_LEN];
memset(smscAddr, 0x00, sizeof(smscAddr));
- int smscLen = SmsPluginParamCodec::encodeSMSC(&smsc, smscAddr);
-
+ int smscLen = Sms3gppParamCodec::encodeSMSC(&smsc, smscAddr);
if (smscLen <= 0) {
MSG_DEBUG("smscLen <= 0");
goto _RETURN_FUNC;
MSG_DEBUG("pSCAInfo [%s]", smscAddrTmp);
int bufLen = 0;
-
char buf[MAX_TPDU_DATA_LEN];
-
int addLen = strlen(submitData.destAddress.address);
tpdu.data.submit.destAddress.ton = submitData.destAddress.ton;
tpdu.data.submit.bStatusReport = bStatusReport;
}
- memset(&(tpdu.data.submit.userData), 0x00, sizeof(SMS_USERDATA_S));
- memcpy(&(tpdu.data.submit.userData), &(submitData.userData[segCnt]), sizeof(SMS_USERDATA_S));
+ memset(&(tpdu.data.submit.userData), 0x00, sizeof(SMS_3GPP_USERDATA_S));
+ memcpy(&(tpdu.data.submit.userData), &(submitData.userData[segCnt]), sizeof(SMS_3GPP_USERDATA_S));
SMS_NETWORK_STATUS_T retStatus = SMS_NETWORK_SENDING;
-
bool bMoreMsg = false;
-
int retMoCtrlStatus = TAPI_SAT_CALL_CTRL_R_ALLOWED_NO_MOD;
bool bRetryByMoCtrl = false;
bool bSatMoCtrl = false;
if (cnt > 0)
tpdu.data.submit.bRejectDup = true;
- bufLen = SmsPluginTpduCodec::encodeTpdu(&tpdu, buf);
+ bufLen = Sms3gppTpduCodec::encodeTpdu(&tpdu, buf);
/* Make Telephony Structure */
TelSmsDatapackageInfo_t pkgInfo;
memcpy((void*)pkgInfo.Sca, smscAddr, smscLen);
pkgInfo.Sca[smscLen] = '\0';
-
char pkgInfoTmp[(pkgInfo.MsgLength*2)+1];
memset(pkgInfoTmp, 0x00, sizeof(pkgInfoTmp));
for (int j = 0; j < pkgInfo.MsgLength; j++) {
MSG_INFO("Submit Request TPDU. try cnt : %d", cnt+1);
MSG_INFO("[%s]", pkgInfoTmp);
- SMS_SENT_INFO_S sentInfo;
- memset(&sentInfo, 0x00, sizeof(SMS_SENT_INFO_S));
+ SMS_3GPP_SENT_INFO_S sentInfo;
+ memset(&sentInfo, 0x00, sizeof(SMS_3GPP_SENT_INFO_S));
bMoreMsg = FALSE;
- memcpy(&(sentInfo.reqInfo), pReqInfo, sizeof(SMS_REQUEST_INFO_S));
+ memcpy(&(sentInfo.reqInfo), pReqInfo, sizeof(SMS_3GPP_REQUEST_INFO_S));
if ((segCnt + 1) == submitData.segCount && (i + 1) == pReqInfo->msgInfo.nAddressCnt) {
sentInfo.bLast = true;
bMoreMsg = TRUE;
}
- SmsPluginEventHandler::instance()->SetSentInfo(&sentInfo);
+ Sms3gppEventHandler::instance()->SetSentInfo(&sentInfo);
int svc_type;
tel_get_property_int(handle, TAPI_PROP_NETWORK_SERVICE_TYPE, &svc_type);
if (svc_type < TAPI_NETWORK_SERVICE_TYPE_2G) {
MSG_DEBUG("Network service is not available : [%d]", svc_type);
- SmsPluginEventHandler::instance()->handleSentStatus(MSG_NETWORK_SEND_PENDING);
+ Sms3gppEventHandler::instance()->handleSentStatus(MSG_NETWORK_SEND_PENDING);
MsgInsertTicker("Network not available. Message will be sent when connected to network.", SMS_MESSAGE_SENDING_PENDING, false, 0);
goto _RETURN_FUNC;
}
/* Send SMS */
int tapiRet = TAPI_API_SUCCESS;
-
- tapiRet = tel_send_sms(handle, &pkgInfo, bMoreMsg, TapiEventSentStatus, (void *)&curMoCtrlData);
+ tapiRet = tel_send_sms(handle, &pkgInfo, bMoreMsg, Sms3gppTapiEventHandler::respSentStatus, (void *)&curMoCtrlData);
if (tapiRet == TAPI_API_SUCCESS) {
MSG_DEBUG("######## tel_send_sms Success !!! return : [%d] #######", tapiRet);
memcpy(smsc.address, curMoCtrlData.rpDestAddr.string, sizeof(smsc.address)-1);
memset(smscAddr, 0x00, sizeof(smscAddr));
- smscLen = SmsPluginParamCodec::encodeSMSC(&smsc, smscAddr);
+ smscLen = Sms3gppParamCodec::encodeSMSC(&smsc, smscAddr);
MSG_SEC_DEBUG("SMSC address=[%s], Encoded length=[%d]", smsc.address, smscLen);
}
}
} else {
- SmsPluginEventHandler::instance()->handleSentStatus(MSG_NETWORK_SEND_FAIL);
+ Sms3gppEventHandler::instance()->handleSentStatus(MSG_NETWORK_SEND_FAIL);
SmsPluginStorage::instance()->setFailedIndex(dbHandle, pReqInfo->msgInfo.msgId, i);
if (msisdn) {
}
} else {
if (retStatus == SMS_NETWORK_SEND_FAIL_TIMEOUT || retStatus == SMS_NETWORK_SEND_FAIL_TEMPORARY || retStatus == SMS_NETWORK_SEND_FAIL_BY_MO_CONTROL_WITH_MOD)
- SmsPluginEventHandler::instance()->handleSentStatus(MSG_NETWORK_SEND_FAIL);
+ Sms3gppEventHandler::instance()->handleSentStatus(MSG_NETWORK_SEND_FAIL);
else if (retStatus == SMS_NETWORK_SEND_FAIL_FDN_RESTRICED)
- /* SmsPluginEventHandler::instance()->handleSentStatus(MSG_NETWORK_SEND_FAIL_FDN_ENABLED); */
- SmsPluginEventHandler::instance()->handleSentStatus(MSG_NETWORK_SEND_FAIL);
+ /* Sms3gppEventHandler::instance()->handleSentStatus(MSG_NETWORK_SEND_FAIL_FDN_ENABLED); */
+ Sms3gppEventHandler::instance()->handleSentStatus(MSG_NETWORK_SEND_FAIL);
if (retStatus == SMS_NETWORK_SEND_FAIL_FDN_RESTRICED) {
MsgInsertTicker("Unable to send the message while Fixed dialling mode is enabled", SMS_FDN_RESTRICTED, true, 0);
}
-void SmsPluginTransport::sendDeliverReport(TapiHandle *handle, msg_error_t err)
+void Sms3gppTransport::sendDeliverReport(TapiHandle *handle, msg_error_t err)
{
MSG_BEGIN();
- SMS_TPDU_S tpdu;
+ SMS_3GPP_TPDU_S tpdu;
tpdu.tpduType = SMS_TPDU_DELIVER_REP;
response = TAPI_NETTEXT_SENDSMS_SUCCESS;
if (isMemAvailable == false) {
- tapiRet = tel_set_sms_memory_status(handle, TAPI_NETTEXT_PDA_MEMORY_STATUS_AVAILABLE, TapiEventMemoryStatus, NULL);
+ tapiRet = tel_set_sms_memory_status(handle, TAPI_NETTEXT_PDA_MEMORY_STATUS_AVAILABLE, Sms3gppTapiEventHandler::respSetMemoryStatus, NULL);
if (tapiRet == TAPI_API_SUCCESS)
MSG_DEBUG("######## tel_set_sms_memory_status() Success !!! #######");
tpdu.data.deliverRep.failCause = SMS_FC_MSG_CAPA_EXCEEDED;
response = TAPI_NETTEXT_ME_FULL;
MsgInsertTicker("Not enough memory. Delete some items.", SMS_MESSAGE_MEMORY_FULL, true, 0);
- tapiRet = tel_set_sms_memory_status(handle, TAPI_NETTEXT_PDA_MEMORY_STATUS_FULL, TapiEventMemoryStatus, NULL);
+
+ tapiRet = tel_set_sms_memory_status(handle, TAPI_NETTEXT_PDA_MEMORY_STATUS_FULL, Sms3gppTapiEventHandler::respSetMemoryStatus, NULL);
if (tapiRet == TAPI_API_SUCCESS)
MSG_DEBUG("######## tel_set_sms_memory_status() Success !!! #######");
char buf[MAX_TPDU_DATA_LEN];
memset(buf, 0x00, sizeof(buf));
- bufLen = SmsPluginTpduCodec::encodeTpdu(&tpdu, buf);
+ bufLen = Sms3gppTpduCodec::encodeTpdu(&tpdu, buf);
#ifdef MSG_FOR_DEBUG
/* print DeliverReport tpdu */
pkgInfo.format = TAPI_NETTEXT_NETTYPE_3GPP;
/* Set SMSC Address */
- SMS_ADDRESS_S smsc;
+ SMS_3GPP_ADDRESS_S smsc;
/* Set SMSC Options */
setSmscOptions(simIndex, &smsc);
unsigned char smscAddr[MAX_SMSC_LEN];
memset(smscAddr, 0x00, sizeof(smscAddr));
- int smscLen = SmsPluginParamCodec::encodeSMSC(&smsc, smscAddr);
+ int smscLen = Sms3gppParamCodec::encodeSMSC(&smsc, smscAddr);
if (smscLen <= 0) return;
pkgInfo.Sca[smscLen] = '\0';
/* Send Deliver Report */
- tapiRet = tel_send_sms_deliver_report(handle, &pkgInfo, response, TapiEventDeliveryReportCNF, NULL);
+ tapiRet = tel_send_sms_deliver_report(handle, &pkgInfo, response, Sms3gppTapiEventHandler::respDeliveryReportCNF, NULL);
if (tapiRet == TAPI_API_SUCCESS)
MSG_DEBUG("######## tel_send_sms_deliver_report() Success !!! #######");
MSG_END();
}
-void SmsPluginTransport::sendClass0DeliverReport(TapiHandle *handle, msg_error_t err)
+void Sms3gppTransport::sendClass0DeliverReport(TapiHandle *handle, msg_error_t err)
{
MSG_BEGIN();
- SMS_TPDU_S tpdu;
+ SMS_3GPP_TPDU_S tpdu;
tpdu.tpduType = SMS_TPDU_DELIVER_REP;
tpdu.data.deliverRep.reportType = SMS_REPORT_POSITIVE;
response = TAPI_NETTEXT_SENDSMS_SUCCESS;
- tapiRet = tel_set_sms_memory_status(handle, TAPI_NETTEXT_PDA_MEMORY_STATUS_AVAILABLE, TapiEventMemoryStatus, NULL);
+ tapiRet = tel_set_sms_memory_status(handle, TAPI_NETTEXT_PDA_MEMORY_STATUS_AVAILABLE, Sms3gppTapiEventHandler::respSetMemoryStatus, NULL);
if (tapiRet == TAPI_API_SUCCESS)
MSG_DEBUG("######## tel_set_sms_memory_status() Success !!! #######");
tpdu.data.deliverRep.reportType = SMS_REPORT_POSITIVE;
response = TAPI_NETTEXT_SENDSMS_SUCCESS;
- tapiRet = tel_set_sms_memory_status(handle, TAPI_NETTEXT_PDA_MEMORY_STATUS_FULL, TapiEventMemoryStatus, NULL);
+ tapiRet = tel_set_sms_memory_status(handle, TAPI_NETTEXT_PDA_MEMORY_STATUS_FULL, Sms3gppTapiEventHandler::respSetMemoryStatus, NULL);
if (tapiRet == TAPI_API_SUCCESS)
MSG_DEBUG("######## tel_set_sms_memory_status() Success !!! #######");
tpdu.data.deliverRep.reportType = SMS_REPORT_POSITIVE;
response = TAPI_NETTEXT_SENDSMS_SUCCESS;
- tapiRet = tel_set_sms_memory_status(handle, TAPI_NETTEXT_PDA_MEMORY_STATUS_FULL, TapiEventMemoryStatus, NULL);
+ tapiRet = tel_set_sms_memory_status(handle, TAPI_NETTEXT_PDA_MEMORY_STATUS_FULL, Sms3gppTapiEventHandler::respSetMemoryStatus, NULL);
if (tapiRet == TAPI_API_SUCCESS)
MSG_DEBUG("######## tel_set_sms_memory_status() Success !!! #######");
char buf[MAX_TPDU_DATA_LEN];
memset(buf, 0x00, sizeof(buf));
- bufLen = SmsPluginTpduCodec::encodeTpdu(&tpdu, buf);
+ bufLen = Sms3gppTpduCodec::encodeTpdu(&tpdu, buf);
/* Make Telephony Structure */
TelSmsDatapackageInfo_t pkgInfo;
pkgInfo.format = TAPI_NETTEXT_NETTYPE_3GPP;
/* Set SMSC Address */
- SMS_ADDRESS_S smsc;
+ SMS_3GPP_ADDRESS_S smsc;
/* Set SMSC Options */
setSmscOptions(simIndex, &smsc);
unsigned char smscAddr[MAX_SMSC_LEN];
memset(smscAddr, 0x00, sizeof(smscAddr));
- int smscLen = SmsPluginParamCodec::encodeSMSC(&smsc, smscAddr);
+ int smscLen = Sms3gppParamCodec::encodeSMSC(&smsc, smscAddr);
if (smscLen <= 0) return;
pkgInfo.Sca[smscLen] = '\0';
/* Send Deliver Report */
- tapiRet = tel_send_sms_deliver_report(handle, &pkgInfo, response, TapiEventDeliveryReportCNF, NULL);
+ tapiRet = tel_send_sms_deliver_report(handle, &pkgInfo, response, Sms3gppTapiEventHandler::respDeliveryReportCNF, NULL);
if (tapiRet == TAPI_API_SUCCESS)
MSG_DEBUG("######## tel_send_sms_deliver_report() Success !!! #######");
}
-void SmsPluginTransport::getSmsSendOption(int simIndex, SMS_SUBMIT_S *pSubmit)
+void Sms3gppTransport::getSmsSendOption(int simIndex, SMS_3GPP_SUBMIT_S *pSubmit)
{
/* Set SMS Send Options */
pSubmit->bRejectDup = false;
if (MsgSettingGetInt(SMS_SEND_DCS, &codingScheme) != MSG_SUCCESS) {
MSG_INFO("MsgSettingGetInt() is failed");
}
- pSubmit->dcs.codingScheme = (SMS_CODING_SCHEME_T)codingScheme;
+ pSubmit->dcs.codingScheme = (SMS_3GPP_CODING_SCHEME_T)codingScheme;
MSG_DEBUG("DCS : %d", pSubmit->dcs.codingScheme);
MSG_SMSC_LIST_S smscList = {0, };
- SmsPluginSetting::instance()->getSmscListInfo(simIndex, &smscList);
+ Sms3gppSetting::instance()->getSmscListInfo(simIndex, &smscList);
int selectIdx = smscList.selected;
int valPeriod = 0;
}
-void SmsPluginTransport::setSmsSendOption(SMS_REQUEST_INFO_S *pReqInfo, SMS_TPDU_S* pSmsTpdu)
+void Sms3gppTransport::setSmsSendOption(SMS_3GPP_REQUEST_INFO_S *pReqInfo, SMS_3GPP_TPDU_S* pSmsTpdu)
{
if (!pReqInfo || !pSmsTpdu) {
MSG_DEBUG("Input param is NULL");
}
-void SmsPluginTransport::setSmsDcsOption(SMS_REQUEST_INFO_S *pReqInfo, SMS_TPDU_S* pSmsTpdu)
+void Sms3gppTransport::setSmsDcsOption(SMS_3GPP_REQUEST_INFO_S *pReqInfo, SMS_3GPP_TPDU_S* pSmsTpdu)
{
if (!pReqInfo || !pSmsTpdu) {
MSG_DEBUG("Input param is NULL");
if (pReqInfo->msgInfo.msgPort.valid == true) {
/* Set Coding Scheme for apps that use port number */
- pSmsTpdu->data.submit.dcs.codingScheme = (SMS_CODING_SCHEME_T)pReqInfo->msgInfo.encodeType;
+ pSmsTpdu->data.submit.dcs.codingScheme = (SMS_3GPP_CODING_SCHEME_T)pReqInfo->msgInfo.encodeType;
MSG_DEBUG("DCS is changed by application : [%d]", pSmsTpdu->data.submit.dcs.codingScheme);
} else {
/* Change coding scheme if it is set coding scheme by apps */
if (pSmsTpdu->data.submit.dcs.codingScheme == SMS_CHARSET_7BIT && pReqInfo->msgInfo.encodeType != MSG_ENCODE_GSM7BIT) {
- pSmsTpdu->data.submit.dcs.codingScheme = (SMS_CODING_SCHEME_T)pReqInfo->msgInfo.encodeType;
+ pSmsTpdu->data.submit.dcs.codingScheme = (SMS_3GPP_CODING_SCHEME_T)pReqInfo->msgInfo.encodeType;
MSG_DEBUG("DCS is changed by application : [%d]", pSmsTpdu->data.submit.dcs.codingScheme);
}
}
}
-void SmsPluginTransport::setSmsReportOption(SMS_REQUEST_INFO_S *pReqInfo, SMS_TPDU_S* pSmsTpdu)
+void Sms3gppTransport::setSmsReportOption(SMS_3GPP_REQUEST_INFO_S *pReqInfo, SMS_3GPP_TPDU_S* pSmsTpdu)
{
if (!pReqInfo || !pSmsTpdu) {
MSG_DEBUG("Input param is NULL");
if (pSmsTpdu->data.submit.bStatusReport == true) {
MSG_DEBUG("Update Msg Ref [%d] in Report Table", pSmsTpdu->data.submit.msgRef);
- SmsPluginStorage::instance()->updateMsgRef(pReqInfo->msgInfo.msgId, pSmsTpdu->data.submit.msgRef);
+ Sms3gppStorage::instance()->updateMsgRef(pReqInfo->msgInfo.msgId, pSmsTpdu->data.submit.msgRef);
}
#endif
}
-void SmsPluginTransport::setSmscOptions(int simIndex, SMS_ADDRESS_S *pSmsc)
+void Sms3gppTransport::setSmscOptions(int simIndex, SMS_3GPP_ADDRESS_S *pSmsc)
{
/* Set SMSC Options */
MSG_SMSC_LIST_S smscList = {0, };
- SmsPluginSetting::instance()->getSmscListInfo(simIndex, &smscList);
+ Sms3gppSetting::instance()->getSmscListInfo(simIndex, &smscList);
int selectIdx = smscList.selected;
memset(pSmsc->address, 0x00, MAX_ADDRESS_LEN);
}
- pSmsc->ton = (SMS_TON_T)smscList.smscData[selectIdx].smscAddr.ton;
+ pSmsc->ton = (SMS_3GPP_TON_T)smscList.smscData[selectIdx].smscAddr.ton;
MSG_DEBUG("ton : %d", pSmsc->ton);
- pSmsc->npi = (SMS_NPI_T)smscList.smscData[selectIdx].smscAddr.npi;
+ pSmsc->npi = (SMS_3GPP_NPI_T)smscList.smscData[selectIdx].smscAddr.npi;
MSG_DEBUG("npi : %d", pSmsc->npi);
}
}
-void SmsPluginTransport::msgInfoToSubmitData(const MSG_MESSAGE_INFO_S *pMsgInfo, SMS_SUBMIT_DATA_S *pData, SMS_CODING_SCHEME_T *pCharType, int addrIndex)
+void Sms3gppTransport::msgInfoToSubmitData(const MSG_MESSAGE_INFO_S *pMsgInfo, SMS_3GPP_SUBMIT_DATA_S *pData, SMS_3GPP_CODING_SCHEME_T *pCharType, int addrIndex)
{
/* Destination Address */
pData->destAddress.ton = SMS_TON_UNKNOWN;
- pData->destAddress.npi = SMS_NPI_ISDN;
+ pData->destAddress.npi = SMS_3GPP_NPI_ISDN;
memset(pData->destAddress.address, 0x00, MAX_ADDRESS_LEN+1);
memcpy(pData->destAddress.address, pMsgInfo->addressList[addrIndex].addressVal, MAX_ADDRESS_LEN);
} else if (*pCharType == SMS_CHARSET_UCS2) {
decodeLen = textCvt->convertUTF8ToUCS2(decodeData, bufSize, (unsigned char*)pMsgInfo->msgText, (int)pMsgInfo->dataSize);
} else if (*pCharType == SMS_CHARSET_AUTO) {
- decodeLen = textCvt->convertUTF8ToAuto(decodeData, bufSize, (unsigned char*)pMsgInfo->msgText, (int)pMsgInfo->dataSize, &encodeType);
+ decodeLen = textCvt->convertUTF8ToAuto(decodeData, bufSize, (unsigned char*)pMsgInfo->msgText, (int)pMsgInfo->dataSize, MSG_ENCODE_GSM7BIT, &encodeType);
*pCharType = encodeType;
}
} else {
} else if (*pCharType == SMS_CHARSET_UCS2) {
decodeLen = textCvt->convertUTF8ToUCS2(decodeData, bufSize, (unsigned char*)pFileData, fileSize);
} else if (*pCharType == SMS_CHARSET_AUTO) {
- decodeLen = textCvt->convertUTF8ToAuto(decodeData, bufSize, (unsigned char*)pFileData, fileSize, &encodeType);
+ decodeLen = textCvt->convertUTF8ToAuto(decodeData, bufSize, (unsigned char*)pFileData, fileSize, MSG_ENCODE_GSM7BIT, &encodeType);
*pCharType = encodeType;
}
unique_ptr<char*, void(*)(char**)> addressBuf(&encodedAddr, unique_ptr_deleter);
if (strlen(pMsgInfo->replyAddress) > 0) {
- SMS_ADDRESS_S replyAddr = {};
+ SMS_3GPP_ADDRESS_S replyAddr = {};
replyAddr.ton = SMS_TON_NATIONAL;
- replyAddr.npi = SMS_NPI_ISDN;
+ replyAddr.npi = SMS_3GPP_NPI_ISDN;
memset(replyAddr.address, 0x00, MAX_ADDRESS_LEN+1);
memcpy(replyAddr.address, pMsgInfo->replyAddress, MAX_ADDRESS_LEN);
- addrLen = SmsPluginParamCodec::encodeAddress(&replyAddr, &encodedAddr);
+ addrLen = Sms3gppParamCodec::encodeAddress(&replyAddr, &encodedAddr);
MSG_DEBUG("reply addr length : [%d]", addrLen);
}
pData->userData[i].header[headerCnt].udhType = SMS_UDH_ALTERNATE_REPLY_ADDRESS;
pData->userData[i].header[headerCnt].udh.alternateAddress.ton = SMS_TON_NATIONAL;
- pData->userData[i].header[headerCnt].udh.alternateAddress.npi = SMS_NPI_ISDN;
+ pData->userData[i].header[headerCnt].udh.alternateAddress.npi = SMS_3GPP_NPI_ISDN;
memset(pData->userData[i].header[headerCnt].udh.alternateAddress.address, 0x00, MAX_ADDRESS_LEN+1);
memcpy(pData->userData[i].header[headerCnt].udh.alternateAddress.address, pMsgInfo->replyAddress, MAX_ADDRESS_LEN);
}
-int SmsPluginTransport::getSegmentSize(SMS_CODING_SCHEME_T CodingScheme, int DataLen, bool bPortNum, MSG_LANGUAGE_ID_T LangId, int ReplyAddrLen)
+int Sms3gppTransport::getSegmentSize(SMS_3GPP_CODING_SCHEME_T CodingScheme, int DataLen, bool bPortNum, MSG_LANGUAGE_ID_T LangId, int ReplyAddrLen)
{
int headerLen = 1, concat = 5, port = 6, lang = 3, reply = 2;
int headerSize = 0, segSize = 0, maxSize = 0;
}
-void SmsPluginTransport::setConcatHeader(SMS_UDH_S *pSrcHeader, SMS_UDH_S *pDstHeader)
+void Sms3gppTransport::setConcatHeader(SMS_3GPP_UDH_S *pSrcHeader, SMS_3GPP_UDH_S *pDstHeader)
{
pDstHeader->udhType = pSrcHeader->udhType;
}
-void SmsPluginTransport::setNetStatus(SMS_NETWORK_STATUS_T sentStatus)
+void Sms3gppTransport::setNetStatus(SMS_NETWORK_STATUS_T sentStatus)
{
mx.lock();
curStatus = sentStatus;
}
-SMS_NETWORK_STATUS_T SmsPluginTransport::getNetStatus()
+SMS_NETWORK_STATUS_T Sms3gppTransport::getNetStatus()
{
mx.lock();
}
-void SmsPluginTransport::setMoCtrlStatus(TelSatMoSmCtrlIndData_t *moCtrlData)
+void Sms3gppTransport::setMoCtrlStatus(TelSatMoSmCtrlIndData_t *moCtrlData)
{
mx.lock();
}
-int SmsPluginTransport::getMoCtrlStatus()
+int Sms3gppTransport::getMoCtrlStatus()
{
mx.lock();
}
-unsigned char SmsPluginTransport::getMsgRef()
+unsigned char Sms3gppTransport::getMsgRef()
{
return msgRef++;
}
-SMS_PID_T SmsPluginTransport::convertPid(MSG_SMS_PID_T pid)
+void Sms3gppTransport::setIsMemAvailable(bool isAvailable)
+{
+ isMemAvailable = isAvailable;
+}
+
+
+SMS_3GPP_PID_T Sms3gppTransport::convertPid(MSG_SMS_PID_T pid)
{
- SMS_PID_T retPid;
+ SMS_3GPP_PID_T retPid;
switch (pid) {
case MSG_PID_TEXT :
#include "MsgDebug.h"
#include "MsgCppTypes.h"
#include "MsgException.h"
-#include "SmsPluginEventHandler.h"
-#include "SmsPluginWapPushHandler.h"
-#include "SmsPluginConcatHandler.h"
-#include "SmsPluginTransport.h"
-#include "SmsPluginUAManager.h"
+#include "Sms3gppEventHandler.h"
+#include "Sms3gppWapPushHandler.h"
+#include "Sms3gppTransport.h"
+#include "Sms3gppUAManager.h"
+#include "Sms3gppConcatHandler.h"
/*==================================================================================================
- IMPLEMENTATION OF SmsPluginUAManager - Member Functions
+ IMPLEMENTATION OF Sms3gppUAManager - Member Functions
==================================================================================================*/
-SmsPluginUAManager* SmsPluginUAManager::pInstance = NULL;
+Sms3gppUAManager* Sms3gppUAManager::pInstance = NULL;
-SmsPluginUAManager::SmsPluginUAManager() : mx(), cv()
+Sms3gppUAManager::Sms3gppUAManager() : mx(), cv()
{
start();
}
-SmsPluginUAManager::~SmsPluginUAManager()
+Sms3gppUAManager::~Sms3gppUAManager()
{
}
-SmsPluginUAManager* SmsPluginUAManager::instance()
+Sms3gppUAManager* Sms3gppUAManager::instance()
{
- if (!pInstance)
- pInstance = new SmsPluginUAManager();
+ if (!pInstance) {
+ pInstance = new Sms3gppUAManager();
+ }
return pInstance;
}
-void SmsPluginUAManager::run()
+void Sms3gppUAManager::run()
{
while (1) {
lock();
while (smsTranQ.empty()) {
wait();
}
- SMS_REQUEST_INFO_S request;
+ SMS_3GPP_REQUEST_INFO_S request;
smsTranQ.front(&request);
unlock();
unique_ptr<MSG_ADDRESS_INFO_S*, void(*)(MSG_ADDRESS_INFO_S**)> addressListBuf(&request.msgInfo.addressList, unique_ptr_deleter);
try {
- SmsPluginTransport::instance()->submitRequest(&request);
+ Sms3gppTransport::instance()->submitRequest(&request);
} catch (MsgException& e) {
MSG_FATAL("%s", e.what());
}
-void SmsPluginUAManager::addReqEntity(SMS_REQUEST_INFO_S *request)
+void Sms3gppUAManager::addReqEntity(SMS_3GPP_REQUEST_INFO_S *request)
{
- SMS_REQUEST_INFO_S reqTmp = {0, };
+ SMS_3GPP_REQUEST_INFO_S reqTmp = {0, };
- memcpy(&reqTmp, request, sizeof(SMS_REQUEST_INFO_S));
+ memcpy(&reqTmp, request, sizeof(SMS_3GPP_REQUEST_INFO_S));
lock();
unlock();
}
-
#include "MsgDebug.h"
#include "MsgCppTypes.h"
-#include "SmsPluginParamCodec.h"
-#include "SmsPluginUDCodec.h"
+#include "Sms3gppParamCodec.h"
+#include "Sms3gppUDCodec.h"
using namespace std;
/*==================================================================================================
- IMPLEMENTATION OF SmsPluginUDCodec - Member Functions
+ IMPLEMENTATION OF Sms3gppUDCodec - Member Functions
==================================================================================================*/
-SmsPluginUDCodec::SmsPluginUDCodec()
+Sms3gppUDCodec::Sms3gppUDCodec()
{
}
-SmsPluginUDCodec::~SmsPluginUDCodec()
+Sms3gppUDCodec::~Sms3gppUDCodec()
{
}
-int SmsPluginUDCodec::encodeUserData(const SMS_USERDATA_S *pUserData, SMS_CODING_SCHEME_T CodingScheme, char *pEncodeData)
+int Sms3gppUDCodec::encodeUserData(const SMS_3GPP_USERDATA_S *pUserData, SMS_3GPP_CODING_SCHEME_T CodingScheme, char *pEncodeData)
{
int encodeSize = 0;
}
-int SmsPluginUDCodec::decodeUserData(const unsigned char *pTpdu, const int tpduLen, bool bHeaderInd, SMS_CODING_SCHEME_T CodingScheme, SMS_USERDATA_S *pUserData)
+int Sms3gppUDCodec::decodeUserData(const unsigned char *pTpdu, const int tpduLen, bool bHeaderInd, SMS_3GPP_CODING_SCHEME_T CodingScheme, SMS_3GPP_USERDATA_S *pUserData)
{
int decodeSize = 0;
- memset(pUserData, 0x00, sizeof(SMS_USERDATA_S));
+ memset(pUserData, 0x00, sizeof(SMS_3GPP_USERDATA_S));
switch (CodingScheme) {
case SMS_CHARSET_7BIT:
}
-int SmsPluginUDCodec::decodeUserData(const unsigned char *pTpdu, const int tpduLen, bool bHeaderInd, SMS_CODING_SCHEME_T CodingScheme, SMS_USERDATA_S *pUserData, SMS_TPUD_S *pTPUD)
+int Sms3gppUDCodec::decodeUserData(const unsigned char *pTpdu, const int tpduLen, bool bHeaderInd, SMS_3GPP_CODING_SCHEME_T CodingScheme, SMS_3GPP_USERDATA_S *pUserData, SMS_3GPP_TPUD_S *pTPUD)
{
int decodeSize = 0;
- memset(pUserData, 0x00, sizeof(SMS_USERDATA_S));
+ memset(pUserData, 0x00, sizeof(SMS_3GPP_USERDATA_S));
switch (CodingScheme) {
case SMS_CHARSET_7BIT:
}
-int SmsPluginUDCodec::encodeGSMData(const SMS_USERDATA_S *pUserData, char *pEncodeData)
+int Sms3gppUDCodec::encodeGSMData(const SMS_3GPP_USERDATA_S *pUserData, char *pEncodeData)
{
int headerLen = 0, offset = 0, fillBits = 0, packSize = 0, encodeLen = 0;
unsigned char udhl = 0x00;
}
-int SmsPluginUDCodec::encode8bitData(const SMS_USERDATA_S *pUserData, char *pEncodeData)
+int Sms3gppUDCodec::encode8bitData(const SMS_3GPP_USERDATA_S *pUserData, char *pEncodeData)
{
int headerLen = 0, offset = 2, fillBits = 0, encodeLen = 0;
unsigned char udhl = 0x00;
}
-int SmsPluginUDCodec::encodeUCS2Data(const SMS_USERDATA_S *pUserData, char *pEncodeData)
+int Sms3gppUDCodec::encodeUCS2Data(const SMS_3GPP_USERDATA_S *pUserData, char *pEncodeData)
{
int headerLen = 0, offset = 2, fillBits = 0, encodeLen = 0;
unsigned char udhl = 0x00;
}
-int SmsPluginUDCodec::decodeGSMData(const unsigned char *pTpdu, const int tpduLen, bool bHeaderInd, SMS_USERDATA_S *pUserData, SMS_TPUD_S *pTPUD)
+int Sms3gppUDCodec::decodeGSMData(const unsigned char *pTpdu, const int tpduLen, bool bHeaderInd, SMS_3GPP_USERDATA_S *pUserData, SMS_3GPP_TPUD_S *pTPUD)
{
int offset = 0, udl = 0, udhl = 0, headerLen = 0, fillBits = 0, octetUdl = 0;
}
-int SmsPluginUDCodec::decode8bitData(const unsigned char *pTpdu, bool bHeaderInd, SMS_USERDATA_S *pUserData, SMS_TPUD_S *pTPUD)
+int Sms3gppUDCodec::decode8bitData(const unsigned char *pTpdu, bool bHeaderInd, SMS_3GPP_USERDATA_S *pUserData, SMS_3GPP_TPUD_S *pTPUD)
{
int offset = 0, udl = 0, udhl = 0, headerLen = 0;
}
-int SmsPluginUDCodec::decodeUCS2Data(const unsigned char *pTpdu, const int tpduLen, bool bHeaderInd, SMS_USERDATA_S *pUserData, SMS_TPUD_S *pTPUD)
+int Sms3gppUDCodec::decodeUCS2Data(const unsigned char *pTpdu, const int tpduLen, bool bHeaderInd, SMS_3GPP_USERDATA_S *pUserData, SMS_3GPP_TPUD_S *pTPUD)
{
int offset = 0, udl = 0, udhl = 0, headerLen = 0;
}
-int SmsPluginUDCodec::encodeHeader(const SMS_UDH_S header, char *pEncodeHeader)
+int Sms3gppUDCodec::encodeHeader(const SMS_3GPP_UDH_S header, char *pEncodeHeader)
{
int offset = 0, addrLen = 0;
/* IEI */
pEncodeHeader[offset++] = SMS_UDH_ALTERNATE_REPLY_ADDRESS;
- addrLen = SmsPluginParamCodec::encodeAddress(&(header.udh.alternateAddress), &encodedAddr);
+ addrLen = Sms3gppParamCodec::encodeAddress(&(header.udh.alternateAddress), &encodedAddr);
/* IEDL */
pEncodeHeader[offset++] = addrLen;
}
-int SmsPluginUDCodec::decodeHeader(const unsigned char *pTpdu, SMS_UDH_S *pHeader)
+int Sms3gppUDCodec::decodeHeader(const unsigned char *pTpdu, SMS_3GPP_UDH_S *pHeader)
{
int offset = 0;
unsigned char IEDL = 0;
if (IEDL == 0)
return 0;
- offset += SmsPluginParamCodec::decodeAddress(&pTpdu[offset], &(pHeader->udh.alternateAddress));
+ offset += Sms3gppParamCodec::decodeAddress(&pTpdu[offset], &(pHeader->udh.alternateAddress));
MSG_SEC_DEBUG("alternate reply address [%s]", pHeader->udh.alternateAddress.address);
}
}
-int SmsPluginUDCodec::pack7bitChar(const unsigned char *pUserData, int dataLen, int fillBits, char *pPackData)
+int Sms3gppUDCodec::pack7bitChar(const unsigned char *pUserData, int dataLen, int fillBits, char *pPackData)
{
int srcIdx = 0, dstIdx = 0, shift = fillBits;
}
-int SmsPluginUDCodec::unpack7bitChar(const unsigned char *pTpdu, unsigned char dataLen, int fillBits, char *pUnpackData)
+int Sms3gppUDCodec::unpack7bitChar(const unsigned char *pTpdu, unsigned char dataLen, int fillBits, char *pUnpackData)
{
int srcIdx = 0, dstIdx = 0, shift = fillBits;
return dstIdx;
}
-
* limitations under the License.
*/
+#include <glib.h>
+#include <gio/gio.h>
+#if MSG_DRM_SUPPORT
+#include <drm_client.h>
+#endif
+
#include "MsgDebug.h"
#include "MsgCppTypes.h"
#include "MsgGconfWrapper.h"
#include "MsgException.h"
#include "MsgUtilFile.h"
+#include "Sms3gppTransport.h"
+#include "Sms3gppEventHandler.h"
+#include "Sms3gppWapPushHandler.h"
#include "SmsPluginStorage.h"
-#include "SmsPluginTransport.h"
-#include "SmsPluginEventHandler.h"
-#include "SmsPluginWapPushHandler.h"
-
-#include <glib.h>
-#include <gio/gio.h>
-#if MSG_DRM_SUPPORT
-#include <drm_client.h>
-#endif
-static unsigned short wapPushPortList[] = {0x0b84, 0x0b85, 0x23F0, 0x23F1, 0x23F2, 0x23F3, 0xC34F};
-#if 0
-const SMS_PUSH_APP_INFO_S pushDefaultApplication[] =
-{
- {(char*)"text/vnd.wap.si", (char*)"X-Wap-Application-Id: x-wap-application:wml.ua\r\n", SMS_WAP_APPLICATION_PUSH_SI},
- {(char*)"application/vnd.wap.sic", (char*)"X-Wap-Application-Id: x-wap-application:wml.ua\r\n", SMS_WAP_APPLICATION_PUSH_SIC},
- {(char*)"text/vnd.wap.sl", (char*)"X-Wap-Application-Id: x-wap-application:wml.ua\r\n", SMS_WAP_APPLICATION_PUSH_SL},
- {(char*)"application/vnd.wap.slc", (char*)"X-Wap-Application-Id: x-wap-application:wml.ua\r\n", SMS_WAP_APPLICATION_PUSH_SLC},
- {(char*)"text/vnd.wap.co", (char*)"X-Wap-Application-Id: x-wap-application:wml.ua\r\n", SMS_WAP_APPLICATION_PUSH_CO},
- {(char*)"application/vnd.wap.coc", (char*)"X-Wap-Application-Id: x-wap-application:wml.ua\r\n", SMS_WAP_APPLICATION_PUSH_COC},
-
- {(char*)"application/vnd.wap.mms-message", (char*)"X-Wap-Application-Id: x-wap-application:mms.ua\r\n", SMS_WAP_APPLICATION_MMS_UA},
-
- {(char*)"application/vnd.wap.sia", (char*)"X-Wap-Application-Id: x-wap-application:push.sia\r\n", SMS_WAP_APPLICATION_PUSH_SIA},
-
- {(char*)"application/vnd.syncml.dm+wbxml", (char*)"X-Wap-Application-Id: x-wap-application:push.syncml.dm\r\n", SMS_WAP_APPLICATION_SYNCML_DM_BOOTSTRAP},
- {(char*)"application/vnd.syncml.dm+xml", (char*)"X-Wap-Application-Id: x-wap-application:push.syncml.dm\r\n", SMS_WAP_APPLICATION_SYNCML_DM_BOOTSTRAP_XML},
- {(char*)"application/vnd.syncml.notification", (char*)"X-Wap-Application-Id: x-wap-application:push.syncml.dm\r\n", SMS_WAP_APPLICATION_SYNCML_DM_NOTIFICATION},
- {(char*)"application/vnd.syncml.ds.notification", (char*)"X-Wap-Application-Id: x-wap-application:push.syncml.ds\r\n", SMS_WAP_APPLICATION_SYNCML_DS_NOTIFICATION},
- {(char*)"application/vnd.syncml+wbxml", (char*)"X-Wap-Application-Id:x-wap-application:push.syncml", SMS_WAP_APPLICATION_SYNCML_DS_NOTIFICATION_WBXML},
-
- {(char*)"application/vnd.wap.locc+wbxml", (char*)"X-Wap-Application-Id: x-wap-application:loc.ua\r\n", SMS_WAP_APPLICATION_LOC_UA_WBXML},
- {(char*)"application/vnd.wap.loc+xml", (char*)"X-Wap-Application-Id: x-wap-application:loc.ua\r\n", SMS_WAP_APPLICATION_LOC_UA_XML},
-
- {(char*)"application/vnd.oma.dd+xml", (char*)"X-Wap-Application-Id: x-wap-application:drm.ua\r\n", SMS_WAP_APPLICATION_DRM_UA_XML},
- {(char*)"application/vnd.oma.drm.message", (char*)"X-Wap-Application-Id: x-wap-application:drm.ua\r\n", SMS_WAP_APPLICATION_DRM_UA_MESSAGE},
- {(char*)"application/vnd.oma.drm.content", (char*)"X-Wap-Application-Id: x-wap-application:drm.ua\r\n", SMS_WAP_APPLICATION_DRM_UA_CONETENT},
- {(char*)"application/vnd.oma.drm.rights+xml", (char*)"X-Wap-Application-Id: x-wap-application:drm.ua\r\n", SMS_WAP_APPLICATION_DRM_UA_RIGHTS_XML},
- {(char*)"application/vnd.oma.drm.rights+wbxml", (char*)"X-Wap-Application-Id: x-wap-application:drm.ua\r\n", SMS_WAP_APPLICATION_DRM_UA_RIGHTS_WBXML},
- {(char*)"application/vnd.oma.drm.ro+xml", (char*)"X-Wap-Application-Id: x-wap-application:drm.ua\r\n", SMS_WAP_APPLICATION_DRM_V2_RO_XML},
- {(char*)"application/vnd.oma.drm.roap-pdu+xml", (char*)"X-Wap-Application-Id: x-wap-application:drm.ua\r\n", SMS_WAP_APPLICATION_DRM_V2_ROAP_PDU_XML},
- {(char*)"application/vnd.oma.drm.roap-trigger+xml", (char*)"X-Wap-Application-Id: x-wap-application:drm.ua\r\n", SMS_WAP_APPLICATION_DRM_V2_ROAP_TRIGGER_XML},
- {(char*)"application/vnd.oma.drm.roap-trigger+wbxml", (char*)"X-Wap-Application-Id: x-wap-application:drm.ua\r\n", SMS_WAP_APPLICATION_DRM_V2_ROAP_TRIGGER_WBXML},
-
- {(char*)"text/vnd.wap.connectivity-xml", (char*)"X-Wap-Application-Id: x-wap-samsung:provisioning.ua\r\n", SMS_WAP_APPLICATION_PUSH_PROVISIONING_XML},
- {(char*)"application/vnd.wap.connectivity-wbxml", (char*)"X-Wap-Application-Id: x-wap-samsung:provisioning.ua\r\n", SMS_WAP_APPLICATION_PUSH_PROVISIONING_WBXML},
-
- {(char*)"application/x-wap-prov.browser-settings", (char*)"X-Wap-Application-Id: x-wap-samsung:provisioning.ua\r\n", SMS_WAP_APPLICATION_PUSH_BROWSER_SETTINGS},
- {(char*)"application/x-wap-prov.browser-bookmarks", (char*)"X-Wap-Application-Id: x-wap-samsung:provisioning.ua\r\n", SMS_WAP_APPLICATION_PUSH_BROWSER_BOOKMARKS},
- {(char*)"application/x-wap-prov.syncset+xml", (char*)"X-Wap-Application-Id: x-wap-samsung:provisioning.ua\r\n", SMS_WAP_APPLICATION_PUSH_SYNCSET_WBXML},
- {(char*)"application/x-wap-prov.syncset+wbxml", (char*)"X-Wap-Application-Id: x-wap-samsung:provisioning.ua\r\n", SMS_WAP_APPLICATION_PUSH_SYNCSET_XML},
- {(char*)"text/vnd.wap.emn+xml", (char*)"X-Wap-Application-Id: x-wap-application:emn.ua\r\n", SMS_WAP_APPLICATION_PUSH_EMAIL_XML},
- {(char*)"application/vnd.wap.emn+wbxml", (char*)"X-Wap-Application-Id: x-wap-application:emn.ua\r\n", SMS_WAP_APPLICATION_PUSH_EMAIL_WBXML},
- {(char*)"application/vnd.wv.csp.cir", (char*)"X-Wap-Application-Id: x-wap-application:wv.ua\r\n", SMS_WAP_APPLICATION_PUSH_IMPS_CIR},
- {(char*)"application/vnd.omaloc-supl-init", (char*)"X-Wap-Application-Id: x-oma-application:ulp.ua\r\n", SMS_WAP_APPLICATION_LBS},
- {NULL, NULL}
-};
-#endif
+static unsigned short wapPushPortList[] = { 0x0b84, 0x0b85, 0x23F0, 0x23F1, 0x23F2, 0x23F3, 0xC34F };
-char gWapCodeBufferLeft[WSP_CODE_BUFFER_LEFT_LEN_MAX];
-char gWapCodeBufferRight[WSP_CODE_BUFFER_RIGHT_LEN_MAX];
+static char gWapCodeBufferLeft[WSP_CODE_BUFFER_LEFT_LEN_MAX];
+static char gWapCodeBufferRight[WSP_CODE_BUFFER_RIGHT_LEN_MAX];
-const unsigned long wspUintvarDecodeTable[] = { 0x00000001, 0x00000080, 0x00004000, 0x00200000, 0x10000000 };
+static const unsigned long wspUintvarDecodeTable[] = { 0x00000001, 0x00000080, 0x00004000, 0x00200000, 0x10000000};
-const unsigned char wspHeaderFieldCount = 0x43;
-const unsigned char wspContentsTypeCount = 0x34;
-const unsigned long wspLanguageCount = 0x11a;
-const unsigned char wspSecurityTypeCount = 0x04;
+static const unsigned char wspHeaderFieldCount = 0x43;
+static const unsigned char wspContentsTypeCount = 0x34;
+static const unsigned long wspLanguageCount = 0x11a;
+static const unsigned char wspSecurityTypeCount = 0x04;
-static const SMS_WSP_CONTENTS_TYPE_S wspExtendedContentsType[] = {
+static const SMS_3GPP_WSP_CONTENTS_TYPE_S wspExtendedContentsType[] = {
{ (char*)"text/vnd/wap/connectivity-xml", 0x35 },
{ (char*)"application/vnd.wap.connectivity-wbxml", 0x36 },
{ (char*)"application/pkcs7-mime", 0x37 },
};
-const char* wspHeaderFieldName[] = {
- (char*)"Accept", /* 0x00 */
- (char*)"Accept-Charset",
- (char*)"Accept-Encoding",
- (char*)"Accept-Language",
- (char*)"Accept-Ranges",
- (char*)"Age", /* 0x05 */
- (char*)"Allow",
- (char*)"Authorization",
- (char*)"Cache-Control",
- (char*)"Connection",
- (char*)"Content-Base", /* 0x0a */
- (char*)"Content-Encoding",
- (char*)"Content-Language",
- (char*)"Content-Length",
- (char*)"Content-Location",
- (char*)"Content-MD5",
- (char*)"Content-Range", /* 0x10 */
- (char*)"Content-Type",
- (char*)"Date",
- (char*)"ETag",
- (char*)"Expires",
- (char*)"From", /* 0x15 */
- (char*)"Host",
- (char*)"If-Modified-Since",
- (char*)"If-Match",
- (char*)"If-None-Match",
- (char*)"If-Range", /* 0x1a */
- (char*)"If-Unmodified-Since",
- (char*)"Location",
- (char*)"Last-Modified",
- (char*)"Max-Forwards",
- (char*)"Pragma",
- (char*)"Proxy-Authenticate", /* 0x20 */
- (char*)"Proxy-Authorization",
- (char*)"Public",
- (char*)"Range",
- (char*)"Referer",
- (char*)"Retry-After", /* 0x25 */
- (char*)"Server",
- (char*)"Transfer-Encodig",
- (char*)"Upgrade",
- (char*)"User-Agent",
- (char*)"Vary", /* 0x2a */
- (char*)"Via",
- (char*)"Warning",
- (char*)"Www-Authenticate",
- (char*)"Content-Disposition",
- (char*)"X-Wap-Application-Id",
- (char*)"X-Wap-Content-URI", /* 0x30 */
- (char*)"X-Wap-Iinitiator-URI",
- (char*)"Accept-Application", /* Back */
- (char*)"Bearer-Indication",
- (char*)"Push-Flag",
- (char*)"Profile", /* 0x35 */
- (char*)"Profile-Diff",
- (char*)"Profile-Warning", /* end of WAP 1.2 */
- (char*)"Expect",
- (char*)"Te",
- (char*)"Trailer", /* 0x3a */
- (char*)"Accept-Charset", /* Back */
- (char*)"Accept-Encoding", /* Back */
- (char*)"Cache-Control", /* back */
- (char*)"Content-Range",
- (char*)"X-Wap-Tod",
- (char*)"Content-ID", /* 0x40 */
- (char*)"Set-Cookie",
- (char*)"Cookie",
- (char*)"Encoding-Version"
+static const char* wspHeaderFieldName[] = {
+ (char*)"Accept", /* 0x00 */
+ (char*)"Accept-Charset",
+ (char*)"Accept-Encoding",
+ (char*)"Accept-Language",
+ (char*)"Accept-Ranges",
+ (char*)"Age", /* 0x05 */
+ (char*)"Allow",
+ (char*)"Authorization",
+ (char*)"Cache-Control",
+ (char*)"Connection",
+ (char*)"Content-Base", /* 0x0a */
+ (char*)"Content-Encoding",
+ (char*)"Content-Language",
+ (char*)"Content-Length",
+ (char*)"Content-Location",
+ (char*)"Content-MD5",
+ (char*)"Content-Range", /* 0x10 */
+ (char*)"Content-Type",
+ (char*)"Date",
+ (char*)"ETag",
+ (char*)"Expires",
+ (char*)"From", /* 0x15 */
+ (char*)"Host",
+ (char*)"If-Modified-Since",
+ (char*)"If-Match",
+ (char*)"If-None-Match",
+ (char*)"If-Range", /* 0x1a */
+ (char*)"If-Unmodified-Since",
+ (char*)"Location",
+ (char*)"Last-Modified",
+ (char*)"Max-Forwards",
+ (char*)"Pragma",
+ (char*)"Proxy-Authenticate", /* 0x20 */
+ (char*)"Proxy-Authorization",
+ (char*)"Public",
+ (char*)"Range",
+ (char*)"Referer",
+ (char*)"Retry-After", /* 0x25 */
+ (char*)"Server",
+ (char*)"Transfer-Encodig",
+ (char*)"Upgrade",
+ (char*)"User-Agent",
+ (char*)"Vary", /* 0x2a */
+ (char*)"Via",
+ (char*)"Warning",
+ (char*)"Www-Authenticate",
+ (char*)"Content-Disposition",
+ (char*)"X-Wap-Application-Id",
+ (char*)"X-Wap-Content-URI", /* 0x30 */
+ (char*)"X-Wap-Iinitiator-URI",
+ (char*)"Accept-Application", /* Back */
+ (char*)"Bearer-Indication",
+ (char*)"Push-Flag",
+ (char*)"Profile", /* 0x35 */
+ (char*)"Profile-Diff",
+ (char*)"Profile-Warning", /* end of WAP 1.2 */
+ (char*)"Expect",
+ (char*)"Te",
+ (char*)"Trailer", /* 0x3a */
+ (char*)"Accept-Charset", /* Back */
+ (char*)"Accept-Encoding", /* Back */
+ (char*)"Cache-Control", /* back */
+ (char*)"Content-Range",
+ (char*)"X-Wap-Tod",
+ (char*)"Content-ID", /* 0x40 */
+ (char*)"Set-Cookie",
+ (char*)"Cookie",
+ (char*)"Encoding-Version"
};
-const SMS_WSP_CHARSET_S wspCharset[] = {
- { (char*)"big5", 0x07ea },
- { (char*)"iso-10646-ucs-2", 0x03e8 },
- { (char*)"iso-8859-1", 0x04 },
- { (char*)"iso-8859-2", 0x05 },
- { (char*)"iso-8859-3", 0x06 },
- { (char*)"iso-8859-4", 0x07 },
- { (char*)"iso-8859-5", 0x08 },
- { (char*)"iso-8859-6", 0x09 },
- { (char*)"iso-8859-7", 0x0a },
- { (char*)"iso-8859-8", 0x0b },
- { (char*)"iso-8859-9", 0x0c },
- { (char*)"shift-JIS", 0x11 },
- { (char*)"us-ascii", 0x03 },
- { (char*)"utf-8", 0x6a },
- { (char*)"none", 0x26 },
- { (char*)"", 0xffff }
+static const SMS_3GPP_WSP_CHARSET_S wspCharset[] = {
+ { (char*)"big5", 0x07ea },
+ { (char*)"iso-10646-ucs-2", 0x03e8 },
+ { (char*)"iso-8859-1", 0x04 },
+ { (char*)"iso-8859-2", 0x05 },
+ { (char*)"iso-8859-3", 0x06 },
+ { (char*)"iso-8859-4", 0x07 },
+ { (char*)"iso-8859-5", 0x08 },
+ { (char*)"iso-8859-6", 0x09 },
+ { (char*)"iso-8859-7", 0x0a },
+ { (char*)"iso-8859-8", 0x0b },
+ { (char*)"iso-8859-9", 0x0c },
+ { (char*)"shift-JIS", 0x11 },
+ { (char*)"us-ascii", 0x03 },
+ { (char*)"utf-8", 0x6a },
+ { (char*)"none", 0x26 },
+ { (char*)"", 0xffff }
};
-
-const char* wspEncodeMethod[] = {
- (char*)"Gzip",
- (char*)"Compress",
- (char*)"Deflate"
+static const char* wspEncodeMethod[] = {
+ (char*)"Gzip",
+ (char*)"Compress",
+ (char*)"Deflate"
};
-const SMS_WSP_CONTENTS_TYPE_S wspContentsType[] = {
- { (char*)"*/*", 0x00 },
- { (char*)"text/*", 0x01 },
- { (char*)"text/html", 0x02 },
- { (char*)"text/plain", 0x03 },
- { (char*)"text/x-hdml", 0x04 },
- { (char*)"text/x-ttml", 0x05 },
- { (char*)"text/x-vCalendar", 0x06 },
- { (char*)"text/x-vCard", 0x07 },
- { (char*)"text/vnd.wap.wml", 0x08 },
- { (char*)"text/vnd.wap.wmlscript", 0x09 },
- { (char*)"text/vnd.wap.wta-event", 0x0a },
- { (char*)"multipart/*", 0x0b },
- { (char*)"multipart/mixed", 0x0c },
- { (char*)"multipart/form-data", 0x0d },
- { (char*)"multipart/byteranges", 0x0e },
- { (char*)"multipart/alternative", 0x0f },
- { (char*)"application/*", 0x10 },
- { (char*)"application/java-vm", 0x11 },
- { (char*)"application/x-www-form-urlencoded", 0x12 },
- { (char*)"application/x-hdmlc", 0x13 },
- { (char*)"application/vnd.wap.wmlc", 0x14 },
- { (char*)"application/vnd.wap.wmlscriptc", 0x15 },
- { (char*)"application/vnd.wap.wta-eventc", 0x16 },
- { (char*)"application/vnd.wap.uaprof", 0x17 },
- { (char*)"application/vnd.wap.wtls-ca-certificate", 0x18 },
- { (char*)"application/vnd.wap.wtls-user-certificate", 0x19 },
- { (char*)"application/x-x509-ca-cert", 0x1a },
- { (char*)"application/x-x509-user-cert", 0x1b },
- { (char*)"image/*", 0x1c },
- { (char*)"image/gif", 0x1d },
- { (char*)"image/jpeg", 0x1e },
- { (char*)"image/tiff", 0x1f },
- { (char*)"image/png", 0x20 },
- { (char*)"image/vnd.wap.wbmp", 0x21 },
- { (char*)"application/vnd.wap.multipart.*", 0x22 },
- { (char*)"application/vnd.wap.multipart.mixed", 0x23 },
- { (char*)"application/vnd.wap.multipart.form-data", 0x24 },
- { (char*)"application/vnd.wap.multipart.byteranges", 0x25 },
- { (char*)"application/vnd.wap.multipart.alternative", 0x26 },
- { (char*)"application/xml", 0x27 },
- { (char*)"text/xml", 0x28 },
- { (char*)"application/vnd.wap.wbxml", 0x29 },
- { (char*)"application/x-x968-cross-cert", 0x2a },
- { (char*)"application/x-x968-ca-cert", 0x2b },
- { (char*)"application/x-x968-user-cert", 0x2c },
- { (char*)"text/vnd.wap.si", 0x2d },
- { (char*)"application/vnd.wap.sic", 0x2e },
- { (char*)"text/vnd.wap.sl", 0x2f },
- { (char*)"application/vnd.wap.slc", 0x30 },
- { (char*)"text/vnd.wap.co", 0x31 },
- { (char*)"application/vnd.wap.coc", 0x32 },
- { (char*)"application/vnd.wap.multipart.related", 0x33 },
- { (char*)"application/vnd.wap.sia", 0x34 },
-
- { (char*)"text/vnd/wap/connectivity-xml", 0x35 },
- { (char*)"application/vnd.connectivity-wbxml", 0x36 },
- { (char*)"application/pkcs7-mime", 0x37 },
- { (char*)"application/vnd.wap.hashed-certificate", 0x38 },
- { (char*)"application/vnd.wap.signed-certificate", 0x39 },
- { (char*)"application/vnd.wap.cert-response", 0x3A },
- { (char*)"application/xhtml+xml", 0x3B },
- { (char*)"application/wml+xml", 0x3C },
- { (char*)"text/css", 0x3D },
+static const SMS_3GPP_WSP_CONTENTS_TYPE_S wspContentsType[] = {
+ { (char*)"*/*", 0x00 },
+ { (char*)"text/*", 0x01 },
+ { (char*)"text/html", 0x02 },
+ { (char*)"text/plain", 0x03 },
+ { (char*)"text/x-hdml", 0x04 },
+ { (char*)"text/x-ttml", 0x05 },
+ { (char*)"text/x-vCalendar", 0x06 },
+ { (char*)"text/x-vCard", 0x07 },
+ { (char*)"text/vnd.wap.wml", 0x08 },
+ { (char*)"text/vnd.wap.wmlscript", 0x09 },
+ { (char*)"text/vnd.wap.wta-event", 0x0a },
+ { (char*)"multipart/*", 0x0b },
+ { (char*)"multipart/mixed", 0x0c },
+ { (char*)"multipart/form-data", 0x0d },
+ { (char*)"multipart/byteranges", 0x0e },
+ { (char*)"multipart/alternative", 0x0f },
+ { (char*)"application/*", 0x10 },
+ { (char*)"application/java-vm", 0x11 },
+ { (char*)"application/x-www-form-urlencoded", 0x12 },
+ { (char*)"application/x-hdmlc", 0x13 },
+ { (char*)"application/vnd.wap.wmlc", 0x14 },
+ { (char*)"application/vnd.wap.wmlscriptc", 0x15 },
+ { (char*)"application/vnd.wap.wta-eventc", 0x16 },
+ { (char*)"application/vnd.wap.uaprof", 0x17 },
+ { (char*)"application/vnd.wap.wtls-ca-certificate", 0x18 },
+ { (char*)"application/vnd.wap.wtls-user-certificate", 0x19 },
+ { (char*)"application/x-x509-ca-cert", 0x1a },
+ { (char*)"application/x-x509-user-cert", 0x1b },
+ { (char*)"image/*", 0x1c },
+ { (char*)"image/gif", 0x1d },
+ { (char*)"image/jpeg", 0x1e },
+ { (char*)"image/tiff", 0x1f },
+ { (char*)"image/png", 0x20 },
+ { (char*)"image/vnd.wap.wbmp", 0x21 },
+ { (char*)"application/vnd.wap.multipart.*", 0x22 },
+ { (char*)"application/vnd.wap.multipart.mixed", 0x23 },
+ { (char*)"application/vnd.wap.multipart.form-data", 0x24 },
+ { (char*)"application/vnd.wap.multipart.byteranges", 0x25 },
+ { (char*)"application/vnd.wap.multipart.alternative", 0x26 },
+ { (char*)"application/xml", 0x27 },
+ { (char*)"text/xml", 0x28 },
+ { (char*)"application/vnd.wap.wbxml", 0x29 },
+ { (char*)"application/x-x968-cross-cert", 0x2a },
+ { (char*)"application/x-x968-ca-cert", 0x2b },
+ { (char*)"application/x-x968-user-cert", 0x2c },
+ { (char*)"text/vnd.wap.si", 0x2d },
+ { (char*)"application/vnd.wap.sic", 0x2e },
+ { (char*)"text/vnd.wap.sl", 0x2f },
+ { (char*)"application/vnd.wap.slc", 0x30 },
+ { (char*)"text/vnd.wap.co", 0x31 },
+ { (char*)"application/vnd.wap.coc", 0x32 },
+ { (char*)"application/vnd.wap.multipart.related", 0x33 },
+ { (char*)"application/vnd.wap.sia", 0x34 },
+
+ { (char*)"text/vnd/wap/connectivity-xml", 0x35 },
+ { (char*)"application/vnd.connectivity-wbxml", 0x36 },
+ { (char*)"application/pkcs7-mime", 0x37 },
+ { (char*)"application/vnd.wap.hashed-certificate", 0x38 },
+ { (char*)"application/vnd.wap.signed-certificate", 0x39 },
+ { (char*)"application/vnd.wap.cert-response", 0x3A },
+ { (char*)"application/xhtml+xml", 0x3B },
+ { (char*)"application/wml+xml", 0x3C },
+ { (char*)"text/css", 0x3D },
+
+ { (char*)"application/vnd.wap.mms-message", 0x3E },
+
+ { (char*)"application/vnd.wap.rollover-certificate", 0x3F },
+ { (char*)"application/vnd.wap.locc+wbxml", 0x40 },
+ { (char*)"application/vnd.wap.loc+xml", 0x41 },
+ { (char*)"application/vnd.syncml.dm+wbxml", 0x42 },
+ { (char*)"application/vnd.syncml.dm+xml", 0x43 },
+ { (char*)"application/vnd.syncml.notification", 0x44 },
+ { (char*)"application/vnd.wap.xhtml+xml", 0x45 },
+ { (char*)"application/vnd.wv.csp.cir", 0x46 }
+};
- { (char*)"application/vnd.wap.mms-message", 0x3E },
- { (char*)"application/vnd.wap.rollover-certificate", 0x3F },
- { (char*)"application/vnd.wap.locc+wbxml", 0x40 },
- { (char*)"application/vnd.wap.loc+xml", 0x41 },
- { (char*)"application/vnd.syncml.dm+wbxml", 0x42 },
- { (char*)"application/vnd.syncml.dm+xml", 0x43 },
- { (char*)"application/vnd.syncml.notification", 0x44 },
- { (char*)"application/vnd.wap.xhtml+xml", 0x45 },
- { (char*)"application/vnd.wv.csp.cir", 0x46 }
+static const SMS_3GPP_WAP_UNREGISTER_CONTENTS_TYPE_S wspUnregisterContentsType[]= {
+ { (char*)"application/vnd.wap.emn+wbxml", 0x30A},
+ { (char*)"application/vnd.omaloc-supl-init", 0x312},
+ { (char*)"application/vnd.oma.drm.roap-trigger+wbxml", 0x316}
};
-static const SMS_WAP_UNREGISTER_CONTENTS_TYPE_S wspUnregisterContentsType[]= {
- { (char*)"application/vnd.wap.emn+wbxml", 0x30A},
- { (char*)"application/vnd.omaloc-supl-init", 0x312},
- { (char*)"application/vnd.oma.drm.roap-trigger+wbxml", 0x316}
-};
-const unsigned long wspUnregisteredContentsTypeCount = sizeof(wspUnregisterContentsType)/sizeof(SMS_WAP_UNREGISTER_CONTENTS_TYPE_S);
-
-const SMS_WSP_LANGUAGE_S wspLanguage[] = {
- { (char*)"English", 0x19 },
- { (char*)"en", 0x19 },
- { (char*)"Korean", 0x3d },
- { (char*)"*", 0x00 },
- { (char*)"Afar", 0x01 },
- { (char*)"aa", 0x01 },
- { (char*)"Abkhazian", 0x02 },
- { (char*)"ab", 0x02 },
- { (char*)"Afrikaans", 0x03 },
- { (char*)"af", 0x03 },
- { (char*)"Amharic", 0x04 },
- { (char*)"am", 0x04 },
- { (char*)"Arabic", 0x05 },
- { (char*)"ar", 0x05 },
- { (char*)"Assamese", 0x06 },
- { (char*)"as", 0x06 },
- { (char*)"Aymara", 0x07 },
- { (char*)"ay", 0x07 },
- { (char*)"Azerbaijani", 0x08 },
- { (char*)"az", 0x08 },
- { (char*)"Bashkir", 0x09 },
- { (char*)"ba", 0x09 },
- { (char*)"Byelorussian", 0x0a },
- { (char*)"be", 0x0a },
- { (char*)"Bulgarian", 0x0b },
- { (char*)"bg", 0x0b },
- { (char*)"Bihari", 0x0c },
- { (char*)"bh", 0x0c },
- { (char*)"Bislama", 0x0d },
- { (char*)"bi", 0x0f },
- { (char*)"Bengali", 0x0e },
- { (char*)"Bangla", 0x0e },
- { (char*)"bn", 0x0e },
- { (char*)"Tibetan", 0x0f },
- { (char*)"bo", 0x0f },
- { (char*)"Breton", 0x10 },
- { (char*)"br", 0x10 },
- { (char*)"Catalan", 0x11 },
- { (char*)"ca", 0x11 },
- { (char*)"Corsican", 0x12 },
- { (char*)"co", 0x12 },
- { (char*)"Czech", 0x13 },
- { (char*)"cs", 0x13 },
- { (char*)"Welsh", 0x14 },
- { (char*)"cy", 0x14 },
- { (char*)"Denish", 0x15 },
- { (char*)"da", 0x15 },
- { (char*)"German", 0x16 },
- { (char*)"de", 0x16 },
- { (char*)"Bhutani", 0x17 },
- { (char*)"dz", 0x17 },
- { (char*)"Greek", 0x18 },
- { (char*)"el", 0x18 },
- { (char*)"Esperanto", 0x81 },
- { (char*)"eo", 0x1a },
- { (char*)"Spanish", 0x1b },
- { (char*)"es", 0x1b },
- { (char*)"Estonian", 0x1c },
- { (char*)"et", 0x1c },
- { (char*)"Basque", 0x1d },
- { (char*)"eu", 0x1d },
- { (char*)"Persian", 0x1e },
- { (char*)"fa", 0x1e },
- { (char*)"Finnish", 0x1f },
- { (char*)"fi", 0x1f },
- { (char*)"Fiji", 0x20 },
- { (char*)"fj", 0x20 },
- { (char*)"Faeroese", 0x82 },
- { (char*)"fo", 0x82 },
- { (char*)"French", 0x22 },
- { (char*)"fr", 0x22 },
- { (char*)"Frisian", 0x83 },
- { (char*)"fy", 0x83 },
- { (char*)"Irish", 0x24 },
- { (char*)"ga", 0x24 },
- { (char*)"Scots Gaelic", 0x25 },
- { (char*)"gd", 0x25 },
- { (char*)"Galician", 0x26 },
- { (char*)"gl", 0x26 },
- { (char*)"Guarani", 0x27 },
- { (char*)"gn", 0x27 },
- { (char*)"Gujarati", 0x28 },
- { (char*)"gu", 0x28 },
- { (char*)"Hausa", 0x29 },
- { (char*)"ha", 0x29 },
- { (char*)"Hebrew", 0x2a },
- { (char*)"he", 0x2a },
- { (char*)"Hindi", 0x2b },
- { (char*)"hi", 0x2b },
- { (char*)"Croatian", 0x2c },
- { (char*)"hr", 0x2c },
- { (char*)"Hungarian", 0x2d },
- { (char*)"hu", 0x2d },
- { (char*)"Armenian", 0x2e },
- { (char*)"hy", 0x2e },
- { (char*)"Interlingua", 0x84 },
- { (char*)"ia", 0x84 },
- { (char*)"Indonesian", 0x30 },
- { (char*)"id", 0x30 },
- { (char*)"Interlingue", 0x86 },
- { (char*)"ie", 0x86 },
- { (char*)"Maori", 0x47 },
- { (char*)"mi", 0x47 },
- { (char*)"Macedonian", 0x48 },
- { (char*)"mk", 0x48 },
- { (char*)"Malayalam", 0x49 },
- { (char*)"ml", 0x49 },
- { (char*)"Mongolian", 0x4a },
- { (char*)"mn", 0x4a },
- { (char*)"Moldavian", 0x4b },
- { (char*)"mo", 0x4d },
- { (char*)"Marathi", 0x4c },
- { (char*)"mr", 0x4c },
- { (char*)"Malay", 0x4d },
- { (char*)"ms", 0x4d },
- { (char*)"Maltese", 0x4e },
- { (char*)"mt", 0x4e },
- { (char*)"Burmese", 0x4f },
- { (char*)"my", 0x4f },
- { (char*)"Nauru", 0x50 },
- { (char*)"na", 0x50 },
- { (char*)"Nepali", 0x51 },
- { (char*)"ne", 0x51 },
- { (char*)"Dutch", 0x52 },
- { (char*)"nl", 0x52 },
- { (char*)"Norwegian", 0x53 },
- { (char*)"no", 0x53 },
- { (char*)"Occitan", 0x54 },
- { (char*)"oc", 0x54 },
- { (char*)"(Afan) Oromo", 0x55 },
- { (char*)"(Afan)Oromo", 0x55 },
- { (char*)"om", 0x55 },
- { (char*)"Oriya", 0x56 },
- { (char*)"or", 0x56 },
- { (char*)"Punjabi", 0x57 },
- { (char*)"pa", 0x57 },
- { (char*)"Polish", 0x58 },
- { (char*)"po", 0x58 },
- { (char*)"Pashto", 0x59 },
- { (char*)"Pushto", 0x59 },
- { (char*)"ps", 0x59 },
- { (char*)"Portugurse", 0x5a },
- { (char*)"pt", 0x5a },
- { (char*)"Quechua", 0x5b },
- { (char*)"qu", 0x5b },
- { (char*)"Rhaeto-Romance", 0x8c },
- { (char*)"rm", 0x8c },
- { (char*)"Kirundi", 0x5d },
- { (char*)"rn", 0x5d },
- { (char*)"Romanian", 0x5e },
- { (char*)"ro", 0x5e },
- { (char*)"Russian", 0x5f },
- { (char*)"ru", 0x5f },
- { (char*)"Kinyarwanda", 0x60 },
- { (char*)"rw", 0x60 },
- { (char*)"Sanskrit", 0x61 },
- { (char*)"sa", 0x61 },
- { (char*)"Sindhi", 0x62 },
- { (char*)"sd", 0x62 },
- { (char*)"Sangho", 0x63 },
- { (char*)"sg", 0x63 },
- { (char*)"Serbo-Croatian", 0x64 },
- { (char*)"sh", 0x64 },
- { (char*)"Sinhalese", 0x65 },
- { (char*)"si", 0x65 },
- { (char*)"Slovak", 0x66 },
- { (char*)"sk", 0x66 },
- { (char*)"Slovenian", 0x67 },
- { (char*)"sl", 0x67 },
- { (char*)"Samoan", 0x68 },
- { (char*)"sm", 0x68 },
- { (char*)"Shona", 0x69 },
- { (char*)"sn", 0x69 },
- { (char*)"Somali", 0x6a },
- { (char*)"so", 0x6a },
- { (char*)"Albanian", 0x6b },
- { (char*)"sq", 0x6b },
- { (char*)"Serbian", 0x6c },
- { (char*)"sr", 0x6c },
- { (char*)"Siswati", 0x6d },
- { (char*)"ss", 0x6d },
- { (char*)"Sesotho", 0x6e },
- { (char*)"st", 0x6e },
- { (char*)"Sundanese", 0x6f },
- { (char*)"su", 0x6f },
- { (char*)"Swedish", 0x70 },
- { (char*)"sv", 0x70 },
- { (char*)"Swahili", 0x71 },
- { (char*)"sw", 0x71 },
- { (char*)"Tamil", 0x72 },
- { (char*)"ta", 0x72 },
- { (char*)"Telugu", 0x73 },
- { (char*)"te", 0x73 },
- { (char*)"Tajik", 0x74 },
- { (char*)"tg", 0x74 },
- { (char*)"Thai", 0x75 },
- { (char*)"th", 0x75 },
- { (char*)"Tigrinya", 0x76 },
- { (char*)"ti", 0x76 },
- { (char*)"Turkmen", 0x77 },
- { (char*)"tk", 0x77 },
- { (char*)"Inupiak", 0x87 },
- { (char*)"ik", 0x87 },
- { (char*)"Icelandic", 0x33 },
- { (char*)"is", 0x33 },
- { (char*)"Italian", 0x34 },
- { (char*)"it", 0x34 },
- { (char*)"Inuktitut", 0x89 },
- { (char*)"iu", 0x89 },
- { (char*)"Japanese", 0x36 },
- { (char*)"ja", 0x36 },
- { (char*)"Javanese", 0x37 },
- { (char*)"jw", 0x37 },
- { (char*)"Georgian", 0x38 },
- { (char*)"ka", 0x38 },
- { (char*)"Kazakh", 0x39 },
- { (char*)"kk", 0x39 },
- { (char*)"Gerrnlandic", 0x8a },
- { (char*)"kl", 0x8a },
- { (char*)"Cambodian", 0x3b },
- { (char*)"km", 0x3b },
- { (char*)"Kannada", 0x3c },
- { (char*)"kn", 0x3c },
- { (char*)"Kashmiri", 0x3e },
- { (char*)"ks", 0x3e },
- { (char*)"Kurdish", 0x3f },
- { (char*)"ku", 0x3f },
- { (char*)"Kirghiz", 0x40 },
- { (char*)"ky", 0x40 },
- { (char*)"Latin", 0x8b },
- { (char*)"la", 0x8b },
- { (char*)"Lingala", 0x42 },
- { (char*)"ln", 0x42 },
- { (char*)"Laothian", 0x43 },
- { (char*)"lo", 0x43 },
- { (char*)"Lithuanian", 0x44 },
- { (char*)"lt", 0x44 },
- { (char*)"Lavian", 0x45 },
- { (char*)"Lettish", 0x45 },
- { (char*)"lv", 0x45 },
- { (char*)"Malagasy", 0x46 },
- { (char*)"mg", 0x46 },
- { (char*)"Tagalog", 0x78 },
- { (char*)"tl", 0x78 },
- { (char*)"Setswana", 0x79 },
- { (char*)"tn", 0x79 },
- { (char*)"Tonga", 0x7a },
- { (char*)"to", 0x7a },
- { (char*)"Turkish", 0x7b },
- { (char*)"tr", 0x7b },
- { (char*)"Tsonga", 0x7c },
- { (char*)"ts", 0x7c },
- { (char*)"Tatar", 0x7d },
- { (char*)"tt", 0x7d },
- { (char*)"Twi", 0x7e },
- { (char*)"tw", 0x7e },
- { (char*)"Uighur", 0x7f },
- { (char*)"ug", 0x7f },
- { (char*)"Ukrainian", 0x1a },
- { (char*)"uk", 0x1a },
- { (char*)"Urdu", 0x21 },
- { (char*)"ur", 0x21 },
- { (char*)"Uzbek", 0x23 },
- { (char*)"uz", 0x23 },
- { (char*)"Vietnamese", 0x2f },
- { (char*)"vi", 0x2f },
- { (char*)"Volapuk", 0x85 },
- { (char*)"vo", 0x85 },
- { (char*)"Wolof", 0x31 },
- { (char*)"wo" , 0x31 },
- { (char*)"Xhosa", 0x32 },
- { (char*)"xh", 0x32 },
- { (char*)"Yiddish", 0x88 },
- { (char*)"yi", 0x88 },
- { (char*)"Yoruba", 0x35 },
- { (char*)"yo", 0x35 },
- { (char*)"Zhuang", 0x3a },
- { (char*)"z", 0x3a },
- { (char*)"Chinese", 0x41 },
- { (char*)"ch", 0x41 },
- { (char*)"Zulu", 0x5c },
- { (char*)"zu", 0x5c },
- { (char*)"Ko", 0x3d }
+static const unsigned long wspUnregisteredContentsTypeCount = sizeof(wspUnregisterContentsType)/sizeof(SMS_3GPP_WAP_UNREGISTER_CONTENTS_TYPE_S);
+
+
+static const SMS_3GPP_WSP_LANGUAGE_S wspLanguage[] = {
+ { (char*)"English", 0x19 },
+ { (char*)"en", 0x19 },
+ { (char*)"Korean", 0x3d },
+ { (char*)"*", 0x00 },
+ { (char*)"Afar", 0x01 },
+ { (char*)"aa", 0x01 },
+ { (char*)"Abkhazian", 0x02 },
+ { (char*)"ab", 0x02 },
+ { (char*)"Afrikaans", 0x03 },
+ { (char*)"af", 0x03 },
+ { (char*)"Amharic", 0x04 },
+ { (char*)"am", 0x04 },
+ { (char*)"Arabic", 0x05 },
+ { (char*)"ar", 0x05 },
+ { (char*)"Assamese", 0x06 },
+ { (char*)"as", 0x06 },
+ { (char*)"Aymara", 0x07 },
+ { (char*)"ay", 0x07 },
+ { (char*)"Azerbaijani", 0x08 },
+ { (char*)"az", 0x08 },
+ { (char*)"Bashkir", 0x09 },
+ { (char*)"ba", 0x09 },
+ { (char*)"Byelorussian", 0x0a },
+ { (char*)"be", 0x0a },
+ { (char*)"Bulgarian", 0x0b },
+ { (char*)"bg", 0x0b },
+ { (char*)"Bihari", 0x0c },
+ { (char*)"bh", 0x0c },
+ { (char*)"Bislama", 0x0d },
+ { (char*)"bi", 0x0f },
+ { (char*)"Bengali", 0x0e },
+ { (char*)"Bangla", 0x0e },
+ { (char*)"bn", 0x0e },
+ { (char*)"Tibetan", 0x0f },
+ { (char*)"bo", 0x0f },
+ { (char*)"Breton", 0x10 },
+ { (char*)"br", 0x10 },
+ { (char*)"Catalan", 0x11 },
+ { (char*)"ca", 0x11 },
+ { (char*)"Corsican", 0x12 },
+ { (char*)"co", 0x12 },
+ { (char*)"Czech", 0x13 },
+ { (char*)"cs", 0x13 },
+ { (char*)"Welsh", 0x14 },
+ { (char*)"cy", 0x14 },
+ { (char*)"Denish", 0x15 },
+ { (char*)"da", 0x15 },
+ { (char*)"German", 0x16 },
+ { (char*)"de", 0x16 },
+ { (char*)"Bhutani", 0x17 },
+ { (char*)"dz", 0x17 },
+ { (char*)"Greek", 0x18 },
+ { (char*)"el", 0x18 },
+ { (char*)"Esperanto", 0x81 },
+ { (char*)"eo", 0x1a },
+ { (char*)"Spanish", 0x1b },
+ { (char*)"es", 0x1b },
+ { (char*)"Estonian", 0x1c },
+ { (char*)"et", 0x1c },
+ { (char*)"Basque", 0x1d },
+ { (char*)"eu", 0x1d },
+ { (char*)"Persian", 0x1e },
+ { (char*)"fa", 0x1e },
+ { (char*)"Finnish", 0x1f },
+ { (char*)"fi", 0x1f },
+ { (char*)"Fiji", 0x20 },
+ { (char*)"fj", 0x20 },
+ { (char*)"Faeroese", 0x82 },
+ { (char*)"fo", 0x82 },
+ { (char*)"French", 0x22 },
+ { (char*)"fr", 0x22 },
+ { (char*)"Frisian", 0x83 },
+ { (char*)"fy", 0x83 },
+ { (char*)"Irish", 0x24 },
+ { (char*)"ga", 0x24 },
+ { (char*)"Scots Gaelic", 0x25 },
+ { (char*)"gd", 0x25 },
+ { (char*)"Galician", 0x26 },
+ { (char*)"gl", 0x26 },
+ { (char*)"Guarani", 0x27 },
+ { (char*)"gn", 0x27 },
+ { (char*)"Gujarati", 0x28 },
+ { (char*)"gu", 0x28 },
+ { (char*)"Hausa", 0x29 },
+ { (char*)"ha", 0x29 },
+ { (char*)"Hebrew", 0x2a },
+ { (char*)"he", 0x2a },
+ { (char*)"Hindi", 0x2b },
+ { (char*)"hi", 0x2b },
+ { (char*)"Croatian", 0x2c },
+ { (char*)"hr", 0x2c },
+ { (char*)"Hungarian", 0x2d },
+ { (char*)"hu", 0x2d },
+ { (char*)"Armenian", 0x2e },
+ { (char*)"hy", 0x2e },
+ { (char*)"Interlingua", 0x84 },
+ { (char*)"ia", 0x84 },
+ { (char*)"Indonesian", 0x30 },
+ { (char*)"id", 0x30 },
+ { (char*)"Interlingue", 0x86 },
+ { (char*)"ie", 0x86 },
+ { (char*)"Maori", 0x47 },
+ { (char*)"mi", 0x47 },
+ { (char*)"Macedonian", 0x48 },
+ { (char*)"mk", 0x48 },
+ { (char*)"Malayalam", 0x49 },
+ { (char*)"ml", 0x49 },
+ { (char*)"Mongolian", 0x4a },
+ { (char*)"mn", 0x4a },
+ { (char*)"Moldavian", 0x4b },
+ { (char*)"mo", 0x4d },
+ { (char*)"Marathi", 0x4c },
+ { (char*)"mr", 0x4c },
+ { (char*)"Malay", 0x4d },
+ { (char*)"ms", 0x4d },
+ { (char*)"Maltese", 0x4e },
+ { (char*)"mt", 0x4e },
+ { (char*)"Burmese", 0x4f },
+ { (char*)"my", 0x4f },
+ { (char*)"Nauru", 0x50 },
+ { (char*)"na", 0x50 },
+ { (char*)"Nepali", 0x51 },
+ { (char*)"ne", 0x51 },
+ { (char*)"Dutch", 0x52 },
+ { (char*)"nl", 0x52 },
+ { (char*)"Norwegian", 0x53 },
+ { (char*)"no", 0x53 },
+ { (char*)"Occitan", 0x54 },
+ { (char*)"oc", 0x54 },
+ { (char*)"(Afan) Oromo", 0x55 },
+ { (char*)"(Afan)Oromo", 0x55 },
+ { (char*)"om", 0x55 },
+ { (char*)"Oriya", 0x56 },
+ { (char*)"or", 0x56 },
+ { (char*)"Punjabi", 0x57 },
+ { (char*)"pa", 0x57 },
+ { (char*)"Polish", 0x58 },
+ { (char*)"po", 0x58 },
+ { (char*)"Pashto", 0x59 },
+ { (char*)"Pushto", 0x59 },
+ { (char*)"ps", 0x59 },
+ { (char*)"Portugurse", 0x5a },
+ { (char*)"pt", 0x5a },
+ { (char*)"Quechua", 0x5b },
+ { (char*)"qu", 0x5b },
+ { (char*)"Rhaeto-Romance", 0x8c },
+ { (char*)"rm", 0x8c },
+ { (char*)"Kirundi", 0x5d },
+ { (char*)"rn", 0x5d },
+ { (char*)"Romanian", 0x5e },
+ { (char*)"ro", 0x5e },
+ { (char*)"Russian", 0x5f },
+ { (char*)"ru", 0x5f },
+ { (char*)"Kinyarwanda", 0x60 },
+ { (char*)"rw", 0x60 },
+ { (char*)"Sanskrit", 0x61 },
+ { (char*)"sa", 0x61 },
+ { (char*)"Sindhi", 0x62 },
+ { (char*)"sd", 0x62 },
+ { (char*)"Sangho", 0x63 },
+ { (char*)"sg", 0x63 },
+ { (char*)"Serbo-Croatian", 0x64 },
+ { (char*)"sh", 0x64 },
+ { (char*)"Sinhalese", 0x65 },
+ { (char*)"si", 0x65 },
+ { (char*)"Slovak", 0x66 },
+ { (char*)"sk", 0x66 },
+ { (char*)"Slovenian", 0x67 },
+ { (char*)"sl", 0x67 },
+ { (char*)"Samoan", 0x68 },
+ { (char*)"sm", 0x68 },
+ { (char*)"Shona", 0x69 },
+ { (char*)"sn", 0x69 },
+ { (char*)"Somali", 0x6a },
+ { (char*)"so", 0x6a },
+ { (char*)"Albanian", 0x6b },
+ { (char*)"sq", 0x6b },
+ { (char*)"Serbian", 0x6c },
+ { (char*)"sr", 0x6c },
+ { (char*)"Siswati", 0x6d },
+ { (char*)"ss", 0x6d },
+ { (char*)"Sesotho", 0x6e },
+ { (char*)"st", 0x6e },
+ { (char*)"Sundanese", 0x6f },
+ { (char*)"su", 0x6f },
+ { (char*)"Swedish", 0x70 },
+ { (char*)"sv", 0x70 },
+ { (char*)"Swahili", 0x71 },
+ { (char*)"sw", 0x71 },
+ { (char*)"Tamil", 0x72 },
+ { (char*)"ta", 0x72 },
+ { (char*)"Telugu", 0x73 },
+ { (char*)"te", 0x73 },
+ { (char*)"Tajik", 0x74 },
+ { (char*)"tg", 0x74 },
+ { (char*)"Thai", 0x75 },
+ { (char*)"th", 0x75 },
+ { (char*)"Tigrinya", 0x76 },
+ { (char*)"ti", 0x76 },
+ { (char*)"Turkmen", 0x77 },
+ { (char*)"tk", 0x77 },
+ { (char*)"Inupiak", 0x87 },
+ { (char*)"ik", 0x87 },
+ { (char*)"Icelandic", 0x33 },
+ { (char*)"is", 0x33 },
+ { (char*)"Italian", 0x34 },
+ { (char*)"it", 0x34 },
+ { (char*)"Inuktitut", 0x89 },
+ { (char*)"iu", 0x89 },
+ { (char*)"Japanese", 0x36 },
+ { (char*)"ja", 0x36 },
+ { (char*)"Javanese", 0x37 },
+ { (char*)"jw", 0x37 },
+ { (char*)"Georgian", 0x38 },
+ { (char*)"ka", 0x38 },
+ { (char*)"Kazakh", 0x39 },
+ { (char*)"kk", 0x39 },
+ { (char*)"Gerrnlandic", 0x8a },
+ { (char*)"kl", 0x8a },
+ { (char*)"Cambodian", 0x3b },
+ { (char*)"km", 0x3b },
+ { (char*)"Kannada", 0x3c },
+ { (char*)"kn", 0x3c },
+ { (char*)"Kashmiri", 0x3e },
+ { (char*)"ks", 0x3e },
+ { (char*)"Kurdish", 0x3f },
+ { (char*)"ku", 0x3f },
+ { (char*)"Kirghiz", 0x40 },
+ { (char*)"ky", 0x40 },
+ { (char*)"Latin", 0x8b },
+ { (char*)"la", 0x8b },
+ { (char*)"Lingala", 0x42 },
+ { (char*)"ln", 0x42 },
+ { (char*)"Laothian", 0x43 },
+ { (char*)"lo", 0x43 },
+ { (char*)"Lithuanian", 0x44 },
+ { (char*)"lt", 0x44 },
+ { (char*)"Lavian", 0x45 },
+ { (char*)"Lettish", 0x45 },
+ { (char*)"lv", 0x45 },
+ { (char*)"Malagasy", 0x46 },
+ { (char*)"mg", 0x46 },
+ { (char*)"Tagalog", 0x78 },
+ { (char*)"tl", 0x78 },
+ { (char*)"Setswana", 0x79 },
+ { (char*)"tn", 0x79 },
+ { (char*)"Tonga", 0x7a },
+ { (char*)"to", 0x7a },
+ { (char*)"Turkish", 0x7b },
+ { (char*)"tr", 0x7b },
+ { (char*)"Tsonga", 0x7c },
+ { (char*)"ts", 0x7c },
+ { (char*)"Tatar", 0x7d },
+ { (char*)"tt", 0x7d },
+ { (char*)"Twi", 0x7e },
+ { (char*)"tw", 0x7e },
+ { (char*)"Uighur", 0x7f },
+ { (char*)"ug", 0x7f },
+ { (char*)"Ukrainian", 0x1a },
+ { (char*)"uk", 0x1a },
+ { (char*)"Urdu", 0x21 },
+ { (char*)"ur", 0x21 },
+ { (char*)"Uzbek", 0x23 },
+ { (char*)"uz", 0x23 },
+ { (char*)"Vietnamese", 0x2f },
+ { (char*)"vi", 0x2f },
+ { (char*)"Volapuk", 0x85 },
+ { (char*)"vo", 0x85 },
+ { (char*)"Wolof", 0x31 },
+ { (char*)"wo" , 0x31 },
+ { (char*)"Xhosa", 0x32 },
+ { (char*)"xh", 0x32 },
+ { (char*)"Yiddish", 0x88 },
+ { (char*)"yi", 0x88 },
+ { (char*)"Yoruba", 0x35 },
+ { (char*)"yo", 0x35 },
+ { (char*)"Zhuang", 0x3a },
+ { (char*)"z", 0x3a },
+ { (char*)"Chinese", 0x41 },
+ { (char*)"ch", 0x41 },
+ { (char*)"Zulu", 0x5c },
+ { (char*)"zu", 0x5c },
+ { (char*)"Ko", 0x3d }
};
-const SMS_WSP_HEADER_PARAMETER_S wspHeaderApplId[] = {
+static const SMS_3GPP_WSP_HEADER_PARAMETER_S wspHeaderApplId[] = {
{ (char*)"x-wap-application:*", 0x00 },
{ (char*)"x-wap-application:push.sia", 0x01},
{ (char*)"x-wap-application:wml.ua", 0x02 },
};
-const char* wspCacheControl[] = {
- (char*)"No-cache",
- (char*)"No-store",
- (char*)"Max-age",
- (char*)"Max-stale",
- (char*)"Min-fresh",
- (char*)"Only-if-cached",
- (char*)"Public",
- (char*)"Private",
- (char*)"No-transform",
- (char*)"Must-revalidate",
- (char*)"Proxy-revalidate"
+static const char* wspCacheControl[] = {
+ (char*)"No-cache",
+ (char*)"No-store",
+ (char*)"Max-age",
+ (char*)"Max-stale",
+ (char*)"Min-fresh",
+ (char*)"Only-if-cached",
+ (char*)"Public",
+ (char*)"Private",
+ (char*)"No-transform",
+ (char*)"Must-revalidate",
+ (char*)"Proxy-revalidate"
};
-const SMS_WSP_METHOD_TYPE_S wspMethodType[] = {
- { (char*)"GET", 0x40 },
- { (char*)"OPTIONS", 0x41 },
- { (char*)"HEAD", 0x42 },
- { (char*)"DELETE", 0x43 },
- { (char*)"TRACE", 0x44 },
- { (char*)"POST", 0x60 },
- { (char*)"PUT", 0x61 }
+
+static const SMS_3GPP_WSP_METHOD_TYPE_S wspMethodType[] = {
+ { (char*)"GET", 0x40 },
+ { (char*)"OPTIONS", 0x41 },
+ { (char*)"HEAD", 0x42 },
+ { (char*)"DELETE", 0x43 },
+ { (char*)"TRACE", 0x44 },
+ { (char*)"POST", 0x60 },
+ { (char*)"PUT", 0x61 }
};
-const SMS_WSP_SECURITY_TYPE_S wspSecurityType[] = {
- {(char*)"NETWPIN", 0x00},
- {(char*)"USERPIN", 0x01},
- {(char*)"USERNETWPIN", 0x02},
- {(char*)"USERPINMAC", 0x03}
+static const SMS_3GPP_WSP_SECURITY_TYPE_S wspSecurityType[] = {
+ {(char*)"NETWPIN", 0x00},
+ {(char*)"USERPIN", 0x01},
+ {(char*)"USERNETWPIN", 0x02},
+ {(char*)"USERPINMAC", 0x03}
};
-
-const char* wspWeek[] = {
+static const char* wspWeek[] = {
(char*)"Sun",
(char*)"Mon",
(char*)"Tue",
};
-const char* wspWeekDay[] = {
+#ifdef MSG_FW_FOR_DEBUG
+static const char* wspWeekDay[] = {
(char*)"Sunday",
(char*)"Monday",
(char*)"Tuesday",
(char*)"Friday",
(char*)"Saturday"
};
-
-const char* wspMonth[] = {
- (char*)"Jan",
- (char*)"Feb",
- (char*)"Mar",
- (char*)"Apr",
- (char*)"May",
- (char*)"Jun",
- (char*)"Jul",
- (char*)"Aug",
- (char*)"Sep",
- (char*)"Oct",
- (char*)"Nov",
- (char*)"Dec"
-};
+#endif
+static const char* wspMonth[] = {
+ (char*)"Jan",
+ (char*)"Feb",
+ (char*)"Mar",
+ (char*)"Apr",
+ (char*)"May",
+ (char*)"Jun",
+ (char*)"Jul",
+ (char*)"Aug",
+ (char*)"Sep",
+ (char*)"Oct",
+ (char*)"Nov",
+ (char*)"Dec"
+};
/*==================================================================================================
- IMPLEMENTATION OF SmsPluginWapPushHandler - Member Functions
+ IMPLEMENTATION OF Sms3gppWapPushHandler - Member Functions
==================================================================================================*/
-SmsPluginWapPushHandler* SmsPluginWapPushHandler::pInstance = NULL;
+Sms3gppWapPushHandler* Sms3gppWapPushHandler::pInstance = NULL;
-SmsPluginWapPushHandler::SmsPluginWapPushHandler()
+Sms3gppWapPushHandler::Sms3gppWapPushHandler()
{
memset(&tmpAddress, 0x00, sizeof(tmpAddress));
memset(&tmpTimeStamp, 0x00, sizeof(tmpTimeStamp));
}
-SmsPluginWapPushHandler::~SmsPluginWapPushHandler()
+Sms3gppWapPushHandler::~Sms3gppWapPushHandler()
{
}
-SmsPluginWapPushHandler* SmsPluginWapPushHandler::instance()
+Sms3gppWapPushHandler* Sms3gppWapPushHandler::instance()
{
if (!pInstance)
- pInstance = new SmsPluginWapPushHandler();
+ pInstance = new Sms3gppWapPushHandler();
return pInstance;
}
-bool SmsPluginWapPushHandler::IsWapPushMsg(SMS_USERDATA_S *pUserData)
+bool Sms3gppWapPushHandler::IsWapPushMsg(SMS_3GPP_USERDATA_S *pUserData)
{
MSG_BEGIN();
}
#if 0
-SMS_WAP_APP_CODE_T SmsPluginWapPushHandler::getAppCode(const char *pPushHeader)
+SMS_WAP_APP_CODE_T Sms3gppWapPushHandler::getAppCode(const char *pPushHeader)
{
int appCount = sizeof(pushDefaultApplication)/sizeof(pushDefaultApplication[0]) - 1;
#endif
-void SmsPluginWapPushHandler::copyDeliverData(SMS_DELIVER_S *pDeliver)
+void Sms3gppWapPushHandler::copyDeliverData(SMS_3GPP_DELIVER_S *pDeliver)
{
tmpAddress.ton = pDeliver->originAddress.ton;
tmpAddress.npi = pDeliver->originAddress.npi;
tmpTimeStamp.format = pDeliver->timeStamp.format;
- if (tmpTimeStamp.format == SMS_TIME_ABSOLUTE) {
+ if (tmpTimeStamp.format == SMS_3GPP_TIME_ABSOLUTE) {
tmpTimeStamp.time.absolute.year = pDeliver->timeStamp.time.absolute.year;
tmpTimeStamp.time.absolute.month = pDeliver->timeStamp.time.absolute.month;
tmpTimeStamp.time.absolute.day = pDeliver->timeStamp.time.absolute.day;
}
-void SmsPluginWapPushHandler::handleWapPushMsg(const char *pUserData, int DataSize, int simIndex, time_t sent_time)
+void Sms3gppWapPushHandler::handleWapPushMsg(const char *pUserData, int DataSize, int simIndex, time_t sent_time)
{
MSG_BEGIN();
unique_ptr<char*, void(*)(char**)> WspBodyBuf(&pWspBody, unique_ptr_deleter);
unsigned long wspBodyLen = 0;
- /** pass PDU type */
+ /* pass PDU type */
iPDU++;
pushHeaderLen = wspRetriveUintvarDecode(pPDUTypeData, &iPDU);
printf("\n\n");
#endif
- /** return if it is below case error */
+ /* return if it is below case error */
if (PDUTypeDataLen < wspHeaderLen) {
MSG_DEBUG("PDUTypeDataLen < wspHeaderLen !!!");
return;
}
- /** Finding wspBody Information */
+ /* Finding wspBody Information */
wspBodyLen = PDUTypeDataLen - wspHeaderLen;
if (wspBodyLen > 0) {
mx.lock();
cv.timedwait(mx.pMsgMutex(), 2);
mx.unlock();
-
MSG_END();
}
break;
}
-void SmsPluginWapPushHandler::handleWapPushCallback(char* pPushHeader, char* pPushBody, int PushBodyLen, char* pWspHeader, int WspHeaderLen, char* pWspBody, int WspBodyLen, int simIndex, time_t sent_time)
+void Sms3gppWapPushHandler::handleWapPushCallback(char* pPushHeader, char* pPushBody, int PushBodyLen, char* pWspHeader, int WspHeaderLen, char* pWspBody, int WspBodyLen, int simIndex, time_t sent_time)
{
MSG_BEGIN();
- if (pPushBody == NULL) {
- MSG_DEBUG("pPushBody is NULL");
- return;
- }
+ MSG_ERR_RET_M(pPushHeader == NULL, "pPushHeader is NULL!");
+ MSG_ERR_RET_M(pPushBody == NULL, "pPushBody is NULL!");
msg_error_t err = MSG_SUCCESS;
int pushEvt_cnt = 0;
MSG_DEBUG("Received MMS Notification");
handleMMSNotification(pPushBody, PushBodyLen, simIndex, sent_time);
break;
-
case SMS_WAP_APPLICATION_PUSH_SI:
MSG_DEBUG("Received WAP Push (Service Indication Textual form)");
handleSIMessage(pPushBody, PushBodyLen, true, simIndex);
break;
-
case SMS_WAP_APPLICATION_PUSH_SIC:
MSG_DEBUG("Received WAP Push (Service Indication Tokenised form)");
handleSIMessage(pPushBody, PushBodyLen, false, simIndex);
break;
-
case SMS_WAP_APPLICATION_PUSH_SL:
MSG_DEBUG("Received WAP Push (Service Loading Textual form)");
handleSLMessage(pPushBody, PushBodyLen, true, simIndex);
break;
-
case SMS_WAP_APPLICATION_PUSH_SLC:
MSG_DEBUG("Received WAP Push (Service Loading Tokenised form)");
handleSLMessage(pPushBody, PushBodyLen, false, simIndex);
break;
-
case SMS_WAP_APPLICATION_PUSH_CO:
MSG_DEBUG("Received WAP Push (Cache Operation Textual form)");
handleCOMessage(pPushBody, PushBodyLen, true, simIndex);
break;
-
case SMS_WAP_APPLICATION_PUSH_COC:
MSG_DEBUG("Received WAP Push (Cache Operation Tokenised form)");
handleCOMessage(pPushBody, PushBodyLen, false, simIndex);
break;
-
case SMS_WAP_APPLICATION_SYNCML_DM_BOOTSTRAP:
MSG_DEBUG("Received DM BOOTSTRAP");
- SmsPluginEventHandler::instance()->handleSyncMLMsgIncoming(DM_WBXML, pPushBody, PushBodyLen, pWspHeader, WspHeaderLen, simIndex);
+ Sms3gppEventHandler::instance()->handleSyncMLMsgIncoming(DM_WBXML, pPushBody, PushBodyLen, pWspHeader, WspHeaderLen, simIndex);
break;
-
case SMS_WAP_APPLICATION_SYNCML_DM_BOOTSTRAP_XML:
MSG_DEBUG("Received DM BOOTSTRAP");
- SmsPluginEventHandler::instance()->handleSyncMLMsgIncoming(DM_XML, pPushBody, PushBodyLen, pWspHeader, WspHeaderLen, simIndex);
+ Sms3gppEventHandler::instance()->handleSyncMLMsgIncoming(DM_XML, pPushBody, PushBodyLen, pWspHeader, WspHeaderLen, simIndex);
break;
-
case SMS_WAP_APPLICATION_PUSH_PROVISIONING_XML:
MSG_DEBUG("Received Provisioning");
- SmsPluginEventHandler::instance()->handleSyncMLMsgIncoming(CP_XML, pPushBody, PushBodyLen, pWspHeader, WspHeaderLen, simIndex);
+ Sms3gppEventHandler::instance()->handleSyncMLMsgIncoming(CP_XML, pPushBody, PushBodyLen, pWspHeader, WspHeaderLen, simIndex);
break;
-
case SMS_WAP_APPLICATION_PUSH_PROVISIONING_WBXML:
MSG_DEBUG("Received Provisioning");
- SmsPluginEventHandler::instance()->handleSyncMLMsgIncoming(CP_WBXML, pPushBody, PushBodyLen, pWspHeader, WspHeaderLen, simIndex);
+ Sms3gppEventHandler::instance()->handleSyncMLMsgIncoming(CP_WBXML, pPushBody, PushBodyLen, pWspHeader, WspHeaderLen, simIndex);
break;
-
case SMS_WAP_APPLICATION_PUSH_BROWSER_SETTINGS:
case SMS_WAP_APPLICATION_PUSH_BROWSER_BOOKMARKS:
MSG_DEBUG("Received Provisioning");
- SmsPluginEventHandler::instance()->handleSyncMLMsgIncoming(OTHERS, pPushBody, PushBodyLen, pWspHeader, WspHeaderLen, simIndex);
+ Sms3gppEventHandler::instance()->handleSyncMLMsgIncoming(OTHERS, pPushBody, PushBodyLen, pWspHeader, WspHeaderLen, simIndex);
break;
-
case SMS_WAP_APPLICATION_SYNCML_DM_NOTIFICATION:
MSG_DEBUG("Received DM Notification");
- SmsPluginEventHandler::instance()->handleSyncMLMsgIncoming(DM_NOTIFICATION, pPushBody, PushBodyLen, pWspHeader, WspHeaderLen, simIndex);
+ Sms3gppEventHandler::instance()->handleSyncMLMsgIncoming(DM_NOTIFICATION, pPushBody, PushBodyLen, pWspHeader, WspHeaderLen, simIndex);
break;
-
case SMS_WAP_APPLICATION_SYNCML_DS_NOTIFICATION:
MSG_DEBUG("Received DS Notification");
- SmsPluginEventHandler::instance()->handleSyncMLMsgIncoming(DS_NOTIFICATION, pPushBody, PushBodyLen, pWspHeader, WspHeaderLen, simIndex);
+ Sms3gppEventHandler::instance()->handleSyncMLMsgIncoming(DS_NOTIFICATION, pPushBody, PushBodyLen, pWspHeader, WspHeaderLen, simIndex);
break;
-
case SMS_WAP_APPLICATION_SYNCML_DS_NOTIFICATION_WBXML:
MSG_DEBUG("Received DS Notification");
- SmsPluginEventHandler::instance()->handleSyncMLMsgIncoming(DS_WBXML, pPushBody, PushBodyLen, pWspHeader, WspHeaderLen, simIndex);
+ Sms3gppEventHandler::instance()->handleSyncMLMsgIncoming(DS_WBXML, pPushBody, PushBodyLen, pWspHeader, WspHeaderLen, simIndex);
break;
-
case SMS_WAP_APPLICATION_DRM_UA_RIGHTS_XML:
case SMS_WAP_APPLICATION_DRM_UA_RIGHTS_WBXML:
MSG_DEBUG("Received DRM UA");
-
if (pPushBody != NULL)
handleDrmVer1(pPushBody, PushBodyLen);
break;
-
case SMS_WAP_APPLICATION_DRM_V2_RO_XML:
case SMS_WAP_APPLICATION_DRM_V2_ROAP_PDU_XML:
case SMS_WAP_APPLICATION_DRM_V2_ROAP_TRIGGER_XML:
MSG_DEBUG("Received DRM V2");
/* TODO: DRM V2 */
break;
-
case SMS_WAP_APPLICATION_PUSH_EMAIL:
case SMS_WAP_APPLICATION_PUSH_EMAIL_XML:
case SMS_WAP_APPLICATION_PUSH_EMAIL_WBXML:
MSG_DEBUG("Received Email");
/* TODO: Email */
break;
-
-
case SMS_WAP_APPLICATION_PUSH_IMPS_CIR:
MSG_DEBUG("Received IMPS CIR");
/* TODO: IMPS CIR */
break;
-
case SMS_WAP_APPLICATION_LBS:
MSG_DEBUG("Received LBS related message");
- SmsPluginEventHandler::instance()->handleLBSMsgIncoming(pPushHeader, pPushBody, PushBodyLen);
+ Sms3gppEventHandler::instance()->handleLBSMsgIncoming(pPushHeader, pPushBody, PushBodyLen);
/* TODO: LBS */
break;
-
case SMS_WAP_APPLICATION_PUSH_SIA:
MSG_DEBUG("Received SIA");
/* TODO: SIA */
break;
-
default:
- SmsPluginEventHandler::instance()->handlePushMsgIncoming(pPushHeader, pPushBody, PushBodyLen, app_id, content_type);
+ Sms3gppEventHandler::instance()->handlePushMsgIncoming(pPushHeader, pPushBody, PushBodyLen, app_id, content_type);
break;
}
}
}
#endif
-bool SmsPluginWapPushHandler::IsWapPushMsgInWhiteList(int appCode)
+bool Sms3gppWapPushHandler::IsWapPushMsgInWhiteList(int appCode)
{
MSG_BEGIN();
return isAllowed;
}
-void SmsPluginWapPushHandler::handleMMSNotification(const char *pPushBody, int PushBodyLen, int simIndex, time_t sent_time)
+
+void Sms3gppWapPushHandler::handleMMSNotification(const char *pPushBody, int PushBodyLen, int simIndex, time_t sent_time)
{
MSG_BEGIN();
printf("\n\n");
#endif
- /** Make MSG_MESSAGE_INFO_S */
+ /* Make MSG_MESSAGE_INFO_S */
MSG_MESSAGE_INFO_S msgInfo;
memset(&msgInfo, 0x00, sizeof(MSG_MESSAGE_INFO_S));
createMsgInfo(&msgInfo);
- /** Convert Type values */
+ /* Convert Type values */
msgInfo.msgType.mainType = MSG_MMS_TYPE;
msgInfo.msgType.subType = MSG_NOTIFICATIONIND_MMS;
msgInfo.msgType.classType = MSG_CLASS_NONE;
if (msgInfo.dataSize > MAX_MSG_TEXT_LEN) {
msgInfo.bTextSms = false;
- /** Save Message Data into File */
+ /* Save Message Data into File */
char fileName[MSG_FILENAME_LEN_MAX+1];
memset(fileName, 0x00, sizeof(fileName));
msg_error_t err = MSG_SUCCESS;
- /** Add MMS Noti Msg into DB */
+ /* Add MMS Noti Msg into DB */
err = SmsPluginStorage::instance()->checkMessage(&msgInfo);
if (err == MSG_SUCCESS) {
- /** Callback */
- err = SmsPluginEventHandler::instance()->callbackMsgIncoming(&msgInfo);
-
+ /* Callback */
+ err = Sms3gppEventHandler::instance()->callbackMsgIncoming(&msgInfo);
if (err != MSG_SUCCESS) {
MSG_DEBUG("callbackMsgIncoming() Error !! [%d]", err);
}
MSG_END();
}
-void SmsPluginWapPushHandler::handleSIMessage(char* pPushBody, int PushBodyLen, bool isText, int simIndex)
+
+void Sms3gppWapPushHandler::handleSIMessage(char* pPushBody, int PushBodyLen, bool isText, int simIndex)
{
MSG_BEGIN();
THROW(MsgException::FILE_ERROR, "MsgWriteIpcFile error");
}
- /** Pack Message Info Structure */
+ /* Pack Message Info Structure */
MSG_MESSAGE_INFO_S msgInfo;
memset(&msgInfo, 0, sizeof(MSG_MESSAGE_INFO_S));
strncpy(msgInfo.msgData, fileName, MAX_MSG_DATA_LEN);
- /** Convert Type values */
+ /* Convert Type values */
msgInfo.msgType.mainType = MSG_SMS_TYPE;
msgInfo.msgType.subType = MSG_WAP_SI_SMS;
+ msgInfo.sim_idx = simIndex;
msgInfo.dataSize = sizeof(pushMsg);
- msgInfo.sim_idx = simIndex;
getDisplayName(msgInfo.msgType.subType, msgInfo.addressList[0].addressVal);
-
xmlFree(xmlDoc);
xmlFree(tmpXmlChar);
msg_error_t err = MSG_SUCCESS;
- /** Add WAP Push Msg into DB */
+ /* Add WAP Push Msg into DB */
err = SmsPluginStorage::instance()->checkMessage(&msgInfo);
-
if (err == MSG_SUCCESS) {
- /** Callback */
- err = SmsPluginEventHandler::instance()->callbackMsgIncoming(&msgInfo);
-
+ /* Callback */
+ err = Sms3gppEventHandler::instance()->callbackMsgIncoming(&msgInfo);
if (err != MSG_SUCCESS)
MSG_DEBUG("callbackMsgIncoming() Error !! [%d]", err);
} else {
}
-void SmsPluginWapPushHandler::handleSLMessage(char* pPushBody, int PushBodyLen, bool isText, int simIndex)
+void Sms3gppWapPushHandler::handleSLMessage(char* pPushBody, int PushBodyLen, bool isText, int simIndex)
{
MSG_BEGIN();
indNode = indNode->next;
}
- /** setting received time setting */
+ /* setting received time setting */
time_t t = time(NULL);
time_t utfTime = time(&t);
tmpXmlChar = xmlGetProp(indNode, (xmlChar*)SMS_PUSH_XML_ACTION_TAG);
pushMsg.action = convertSLActionStrToEnum((char*)tmpXmlChar);
- /** Setting other parameters in default values */
+ /* Setting other parameters in default values */
pushMsg.created = pushMsg.received;
- /** temporary set to MAX value. */
+ /* temporary set to MAX value. */
pushMsg.expires = 0xFFFFFFFF;
MSG_DEBUG("check pushMsg data");
MSG_DEBUG("pushMsg.href : [%s]", pushMsg.href);
MSG_DEBUG("pushMsg.contents : [%s]", pushMsg.contents);
- /** Write push Msg to file */
+ /* Write push Msg to file */
char fileName[MSG_FILENAME_LEN_MAX+1];
memset(fileName, 0x00, sizeof(fileName));
if (MsgWriteIpcFile(fileName, (char*)(&pushMsg), sizeof(pushMsg)) == false)
THROW(MsgException::FILE_ERROR, "MsgWriteIpcFile error");
- /** Pack Message Info Structure */
+ /* Pack Message Info Structure */
MSG_MESSAGE_INFO_S msgInfo;
memset(&msgInfo, 0, sizeof(MSG_MESSAGE_INFO_S));
strncpy(msgInfo.msgData, fileName, MAX_MSG_DATA_LEN);
- /** Convert Type values */
+ /* Convert Type values */
msgInfo.msgType.mainType = MSG_SMS_TYPE;
msgInfo.msgType.subType = MSG_WAP_SL_SMS;
+ msgInfo.sim_idx = simIndex;
- /** Update Msg Text */
+ /* Update Msg Text */
strncpy(msgInfo.msgText, pushMsg.href, MAX_MSG_TEXT_LEN);
msgInfo.dataSize = sizeof(pushMsg);
- msgInfo.sim_idx = simIndex;
getDisplayName(msgInfo.msgType.subType, msgInfo.addressList[0].addressVal);
-
MSG_DEBUG("dataSize : %zu", msgInfo.dataSize);
/** Add WAP Push Msg into DB */
err = SmsPluginStorage::instance()->checkMessage(&msgInfo);
-
if (err == MSG_SUCCESS) {
- /** Callback to MSG FW */
- err = SmsPluginEventHandler::instance()->callbackMsgIncoming(&msgInfo);
+ /* Callback to MSG FW */
+ err = Sms3gppEventHandler::instance()->callbackMsgIncoming(&msgInfo);
if (err != MSG_SUCCESS)
MSG_DEBUG("callbackMsgIncoming is failed, err=[%d]", err);
return;
}
-void SmsPluginWapPushHandler::handleCOMessage(char* pPushBody, int PushBodyLen, bool isText, int simIndex)
+void Sms3gppWapPushHandler::handleCOMessage(char* pPushBody, int PushBodyLen, bool isText, int simIndex)
{
MSG_PUSH_CACHEOP_S cacheOp;
indNode = topNode->xmlChildrenNode;
-
while (indNode != NULL) {
xmlChar* tmpUrl = NULL;
if (!xmlStrcmp(indNode->name, (const xmlChar*)SMS_PUSH_XML_INVAL_OBJ)) {
indNode = indNode->next;
}
- /** Write push Msg to file */
+ /* Write push Msg to file */
char fileName[MSG_FILENAME_LEN_MAX+1];
memset(fileName, 0x00, sizeof(fileName));
THROW(MsgException::FILE_ERROR, "MsgWriteIpcFile error");
}
- /** Pack Message Info Structure */
+ /* Pack Message Info Structure */
MSG_MESSAGE_INFO_S msgInfo;
memset(&msgInfo, 0, sizeof(MSG_MESSAGE_INFO_S));
strncpy(msgInfo.msgData, fileName, MAX_MSG_DATA_LEN);
- /** Convert Type values */
+ /* Convert Type values */
msgInfo.msgType.mainType = MSG_SMS_TYPE;
msgInfo.msgType.subType = MSG_WAP_CO_SMS;
+ msgInfo.sim_idx = simIndex;
msgInfo.dataSize = sizeof(cacheOp);
- msgInfo.sim_idx = simIndex;
msg_error_t err = MSG_SUCCESS;
- /** Add WAP Push Msg into DB */
+ /* Add WAP Push Msg into DB */
err = SmsPluginStorage::instance()->checkMessage(&msgInfo);
-
if (err == MSG_SUCCESS) {
- /** Callback */
- err = SmsPluginEventHandler::instance()->callbackMsgIncoming(&msgInfo);
-
+ /* Callback */
+ err = Sms3gppEventHandler::instance()->callbackMsgIncoming(&msgInfo);
if (err != MSG_SUCCESS)
MSG_DEBUG("callbackMsgIncoming() Error !! [%d]", err);
} else {
}
-void SmsPluginWapPushHandler::handleDrmVer1(char* pPushBody, int PushBodyLen)
+void Sms3gppWapPushHandler::handleDrmVer1(char* pPushBody, int PushBodyLen)
{
#if MSG_DRM_SUPPORT
int drmRt = DRM_RETURN_SUCCESS;
}
-void SmsPluginWapPushHandler::createMsgInfo(MSG_MESSAGE_INFO_S* pMsgInfo)
+void Sms3gppWapPushHandler::createMsgInfo(MSG_MESSAGE_INFO_S* pMsgInfo)
{
- /** Convert class Type values */
+ /* Convert class Type values */
pMsgInfo->msgType.classType = MSG_CLASS_NONE;
- /** set folder id (temporary) */
+ /* set folder id (temporary) */
pMsgInfo->folderId = MSG_INBOX_ID;
pMsgInfo->networkStatus = MSG_NETWORK_RECEIVED;
pMsgInfo->direction = MSG_DIRECTION_TYPE_MT;
time_t rawtime = time(NULL);
-
-/*** Comment below lines to save local UTC time..... (it could be used later.)
-
- if (tmpTimeStamp.format == SMS_TIME_ABSOLUTE) {
+ /* Comment below lines to save local UTC time..... (it could be used later.) */
+ /*
+ if (tmpTimeStamp.format == SMS_3GPP_TIME_ABSOLUTE) {
MSG_DEBUG("year : %d", tmpTimeStamp.time.absolute.year);
MSG_DEBUG("month : %d", tmpTimeStamp.time.absolute.month);
strftime(displayTime, 32, "%Y-%02m-%02d %T %z", timeTM);
MSG_DEBUG("displayTime [%s]", displayTime);
}
-
-***/
+ */
pMsgInfo->displayTime = rawtime;
- /** Convert Address values */
+ /* Convert Address values */
pMsgInfo->nAddressCnt = 1;
pMsgInfo->addressList = (MSG_ADDRESS_INFO_S *)new char[sizeof(MSG_ADDRESS_INFO_S)];
pMsgInfo->msgPort.srcPort = 0;
}
-void SmsPluginWapPushHandler::getXmlDoc(const char* pPushBody, const int PushBodyLen, xmlDocPtr *pXmlDoc, const bool isText)
+void Sms3gppWapPushHandler::getXmlDoc(const char* pPushBody, const int PushBodyLen, xmlDocPtr *pXmlDoc, const bool isText)
{
if (pPushBody == NULL) {
MSG_DEBUG("pPushBody is NULL");
return;
}
-
if (isText) {
*pXmlDoc = xmlParseMemory(pPushBody, AcStrlen(pPushBody));
} else {
}
}
-unsigned long SmsPluginWapPushHandler::convertXmlCharToSec(char* pDate)
+unsigned long Sms3gppWapPushHandler::convertXmlCharToSec(char* pDate)
{
- struct tm timeStruct;
- time_t nTimeInSec = 0;
- char tmpBuf[10];
- int i = 0, index = 0;
+ struct tm timeStruct;
+ time_t nTimeInSec = 0;
+ char tmpBuf[10];
+ int i = 0;
+ int index = 0;
memset(tmpBuf, 0x00, sizeof(tmpBuf));
memset(&timeStruct, 0x00, sizeof(struct tm));
- /** check pDate */
+ /* check pDate */
if (AcStrlen(pDate) < 20)
return 0;
MSG_DEBUG("pDate [%s]", pDate);
- /** Year */
+ /* Year */
for (i = 0; i < 4; i++) {
tmpBuf[i] = pDate[index++];
}
index++;
timeStruct.tm_year = (atoi(tmpBuf)-1900);
- /** Month */
+ /* Month */
for (i = 0; i < 2; i++) {
tmpBuf[i] = pDate[index++];
}
index++;
timeStruct.tm_mon = (atoi(tmpBuf) - 1);
- /** Date */
+ /* Date */
for (i = 0; i < 2; i++) {
tmpBuf[i] = pDate[index++];
}
index++;
timeStruct.tm_mday = atoi(tmpBuf);
- /** Hours */
+ /* Hours */
for (i = 0; i < 2; i++) {
tmpBuf[i] = pDate[index++];
}
index++;
timeStruct.tm_hour = atoi(tmpBuf);
- /** Minites */
+ /* Minites */
for (i = 0; i < 2; i++) {
tmpBuf[i] = pDate[index++];
}
index++;
timeStruct.tm_min = atoi(tmpBuf);
- /** Seconds */
+ /* Seconds */
for (i = 0; i < 2; i++) {
tmpBuf[i] = pDate[index++];
}
return nTimeInSec;
}
-msg_push_action_t SmsPluginWapPushHandler::convertSIActionStrToEnum(char* pAction)
+
+msg_push_action_t Sms3gppWapPushHandler::convertSIActionStrToEnum(char* pAction)
{
int comp = 0;
return MSG_PUSH_SI_ACTION_SIGNAL_MEDIUM;
}
- /** compare with signal-none. */
+ /* compare with signal-none. */
comp = g_strcmp0("signal-none", pAction);
if (comp == 0)
return MSG_PUSH_SI_ACTION_SIGNAL_NONE;
- /** compare with signal-low. */
+ /* compare with signal-low. */
comp = g_strcmp0("signal-low", pAction);
if (comp == 0)
return MSG_PUSH_SI_ACTION_SIGNAL_LOW;
- /** compare with signal-medium. */
+ /* compare with signal-medium. */
comp = g_strcmp0("signal-medium", pAction);
if (comp == 0)
return MSG_PUSH_SI_ACTION_SIGNAL_MEDIUM;
- /** compare with signal-high. */
+ /* compare with signal-high. */
comp = g_strcmp0("signal-high", pAction);
if (comp == 0)
return MSG_PUSH_SI_ACTION_SIGNAL_HIGH;
- /** compare with delete. */
+ /* compare with delete. */
comp = g_strcmp0("delete", pAction);
if (comp == 0)
return MSG_PUSH_SI_ACTION_DELETE;
- /** signal-medium is default action value. */
+ /* signal-medium is default action value. */
return MSG_PUSH_SI_ACTION_SIGNAL_MEDIUM;
}
-msg_push_action_t SmsPluginWapPushHandler::convertSLActionStrToEnum(char* pAction)
+
+msg_push_action_t Sms3gppWapPushHandler::convertSLActionStrToEnum(char* pAction)
{
int comp = 0;
return MSG_PUSH_SL_ACTION_EXECUTE_LOW;
}
- /** compare pSrcStr with execute-low. */
+ /* compare pSrcStr with execute-low. */
comp = g_strcmp0("execute-low", pAction);
if (comp == 0)
return MSG_PUSH_SL_ACTION_EXECUTE_LOW;
- /** compare pSrcStr with execute-high. */
+ /* compare pSrcStr with execute-high. */
comp = g_strcmp0("execute-high", pAction);
if (comp == 0)
return MSG_PUSH_SL_ACTION_EXECUTE_HIGH;
- /** compare pSrcStr with cache. */
+ /* compare pSrcStr with cache. */
comp = g_strcmp0("cache", pAction);
if (comp == 0)
return MSG_PUSH_SL_ACTION_CACHE;
- /** default SL action value is execute-low. */
+ /* default SL action value is execute-low. */
return MSG_PUSH_SL_ACTION_EXECUTE_LOW;
}
-unsigned long SmsPluginWapPushHandler::wspRetriveUintvarDecode(unsigned char* sourceData, unsigned long* currentPointer)
+unsigned long Sms3gppWapPushHandler::wspRetriveUintvarDecode(unsigned char* sourceData, unsigned long* currentPointer)
{
unsigned long i = 0;
unsigned long decodedValue;
}
-unsigned long SmsPluginWapPushHandler::wspDecodeUintvar(unsigned long length, unsigned char* userVar)
+unsigned long Sms3gppWapPushHandler::wspDecodeUintvar(unsigned long length, unsigned char* userVar)
{
unsigned long i;
unsigned long decodedUintvar = 0;
-
for (i = 0 ; i < length; i++) {
decodedUintvar = decodedUintvar + (wspUintvarDecodeTable[i] * (userVar[length-(i+1)] & 0x7f));
}
}
-void SmsPluginWapPushHandler::wspDecodeHeader(unsigned char* sEncodedHeader, unsigned long encodedHeaderLen, unsigned long contentsLength, bool fContentType, char** pHeader)
+void Sms3gppWapPushHandler::wspDecodeHeader(unsigned char* sEncodedHeader, unsigned long encodedHeaderLen, unsigned long contentsLength, bool fContentType, char** pHeader)
{
unsigned long iField = 0;
bool continueField = FALSE;
} else if (track > 0x7f) {
/* In case of first byte is field code, else case is error. */
-
/*if ((track & 0x7f) <= wspHeaderFieldCount) { */
unsigned long fieldValueLen = encodedHeader[iEncodedHeader + 1];
unsigned char fieldValue[1275];
fieldCode = track & 0x7f;
/*
- if ((fieldValueLen == 0) || (fieldValueLen == 0x80))
- {
+ if ((fieldValueLen == 0) || (fieldValueLen == 0x80)) {
dprint(DNET_WAP,DNET_DBG_HIGH, "%X %X %X %X %X %X\n" , fieldCode, encodedHeader[iEncodedHeader + 1], encodedHeader[iEncodedHeader + 2],encodedHeader[iEncodedHeader + 3],encodedHeader[iEncodedHeader + 4], encodedHeader[iEncodedHeader + 5]);
}
*/
memset(fieldValue, 0, 1275);
+
/* add field name */
/* This continueField flag show whether previous field code and current field code are same or not. If it's same, there are some sequential display effect by omitting field name addition process. The reason why it should be do that can be found in encoding example of spec. */
if (!continueField) {
iEncodedHeader = iEncodedHeader + AcStrlen((char*)encodedHeader + iEncodedHeader + 1) + 2;
fieldCode = 0xff;
}
+
/* first field value is length */
/* If first byte of field value is length value, allocate field value by the length.
In field value, data is
fieldValueLen = wspRetriveUintvarDecode((unsigned char*) encodedHeader + iEncodedHeader + 2, &uintvarLen);
memcpy(fieldValue, encodedHeader + iEncodedHeader + 2 + uintvarLen, (size_t)fieldValueLen);
iEncodedHeader = iEncodedHeader + fieldValueLen + uintvarLen + 2;
-
} else {
if (fieldValueLen == 1) {
/* field value is one byte integer over 0x80 */
}
}
}
+
/* field value is single encoded */
if (fieldValueLen > 0x7f) {
fieldValue[0] = encodedHeader[iEncodedHeader + 1];
fieldCode = 0xff;
}
-
switch (fieldCode) {
/* accept charset */
/* It's normal way of field process. */
MSG_DEBUG("integerValue = [%02x]", integerValue);
- int count = sizeof(wspHeaderApplId)/sizeof(SMS_WSP_HEADER_PARAMETER_S);
+ int count = sizeof(wspHeaderApplId)/sizeof(SMS_3GPP_WSP_HEADER_PARAMETER_S);
for (int i = 0; i < count ; ++i) {
if ((unsigned int)integerValue == wspHeaderApplId[i].parameterCode) {
snprintf((char*)temp, 64, "%s", wspHeaderApplId[i].parameterToken);
MSG_DEBUG("WspLDecodeHeader: Single Header : %s\r\n", temper);
}
-
MSG_DEBUG("WspLDecodeHeader: Header decoding ended.\n");
*pHeader = outTemper;
}
-unsigned long SmsPluginWapPushHandler::wspHeaderDecodeInteger(unsigned char* data)
+unsigned long Sms3gppWapPushHandler::wspHeaderDecodeInteger(unsigned char* data)
{
/* we only can handle max 32bit integer */
unsigned long i;
}
-void SmsPluginWapPushHandler::wspHeaderDecodeQValue(unsigned long length, unsigned char* data, char** pDecodedString)
+void Sms3gppWapPushHandler::wspHeaderDecodeQValue(unsigned long length, unsigned char* data, char** pDecodedString)
{
unsigned short qBase = 0;
float qValue;
}
-unsigned long SmsPluginWapPushHandler::wspHeaderDecodeIntegerByLength(unsigned char* data, unsigned long length)
+unsigned long Sms3gppWapPushHandler::wspHeaderDecodeIntegerByLength(unsigned char* data, unsigned long length)
{
unsigned long i;
}
-char* SmsPluginWapPushHandler::wspExtendedDecodeType(char contentType)
+char* Sms3gppWapPushHandler::wspExtendedDecodeType(char contentType)
{
int i = 0;
}
-void SmsPluginWapPushHandler::wspHeaderDecodeParameter(unsigned char* data, unsigned long length, char** pParam)
+void Sms3gppWapPushHandler::wspHeaderDecodeParameter(unsigned char* data, unsigned long length, char** pParam)
{
char* param = *pParam;
}
}
break;
-
default:
param = NULL;
break;
}
-void SmsPluginWapPushHandler::wspHeaderDecodeCharset(unsigned long length, unsigned char* data, char**pDecodedString)
+void Sms3gppWapPushHandler::wspHeaderDecodeCharset(unsigned long length, unsigned char* data, char**pDecodedString)
{
char* param = NULL;
param = new char[WSP_STANDARD_STR_LEN_MAX];
-
if (param == NULL) {
MSG_DEBUG("WspLHeaderDecodeCharset:MemAlloc failed\n");
*pDecodedString = NULL;
}
-
-void SmsPluginWapPushHandler::wspHeaderDecodeVersion(unsigned long length, unsigned char* data, char** pDecodedString)
+void Sms3gppWapPushHandler::wspHeaderDecodeVersion(unsigned long length, unsigned char* data, char** pDecodedString)
{
*pDecodedString = new char[WSP_STANDARD_STR_LEN_MAX];
}
-void SmsPluginWapPushHandler::wspHeaderDecodeDateValue(unsigned long length, unsigned char* data, char** pDecodedString)
+void Sms3gppWapPushHandler::wspHeaderDecodeDateValue(unsigned long length, unsigned char* data, char** pDecodedString)
{
time_t lTime;
struct tm pTMData;
return;
}
-void SmsPluginWapPushHandler::wspHeaderCopyDecodedString(unsigned char* szDecodedString, unsigned long* currentLen, char** pTemper)
+void Sms3gppWapPushHandler::wspHeaderCopyDecodedString(unsigned char* szDecodedString, unsigned long* currentLen, char** pTemper)
{
unsigned long elementLen = AcStrlen((char*)szDecodedString);
char* temper2 = NULL;
}
-void SmsPluginWapPushHandler::wspHeaderDecodeAuth(unsigned long fieldValueLen, unsigned char* fieldValue, char** pDecodedString)
+void Sms3gppWapPushHandler::wspHeaderDecodeAuth(unsigned long fieldValueLen, unsigned char* fieldValue, char** pDecodedString)
{
unsigned char userId[WSP_STANDARD_STR_LEN_MAX];
unsigned char passWd[WSP_STANDARD_STR_LEN_MAX];
}
-void SmsPluginWapPushHandler::wspHeaderDecodeChallenge(unsigned long fieldValueLen, unsigned char* fieldValue, char** pDecodedString)
+void Sms3gppWapPushHandler::wspHeaderDecodeChallenge(unsigned long fieldValueLen, unsigned char* fieldValue, char** pDecodedString)
{
unsigned char userId[WSP_STANDARD_STR_LEN_MAX];
unsigned long iField = 0;
}
-void SmsPluginWapPushHandler::wspHeaderDecodeCacheControl(unsigned char* fieldValue, unsigned long fieldValueLen, char** pCacheString)
+void Sms3gppWapPushHandler::wspHeaderDecodeCacheControl(unsigned char* fieldValue, unsigned long fieldValueLen, char** pCacheString)
{
unsigned char paramString[WSP_STANDARD_STR_LEN_MAX];
unsigned char cacheCode;
return;
}
-void SmsPluginWapPushHandler::getDisplayName(MSG_SUB_TYPE_T subType, char* displayName)
+void Sms3gppWapPushHandler::getDisplayName(MSG_SUB_TYPE_T subType, char* displayName)
{
if (subType == MSG_WAP_SL_SMS || subType == MSG_WAP_SI_SMS)
snprintf(displayName, MAX_ADDRESS_VAL_LEN + 1, "Push message");
* limitations under the License.
*/
-#ifndef SMS_PLUGIN_CBMSG_HANDLER_H
-#define SMS_PLUGIN_CBMSG_HANDLER_H
+#ifndef SMS_3GPP_CBMSG_HANDLER_H
+#define SMS_3GPP_CBMSG_HANDLER_H
/*==================================================================================================
#include <map>
#include <vector>
-using namespace std;
+#include <tapi_common.h>
+#include <TelSms.h>
+#include <ITapiNetText.h>
#include "MsgTextConvert.h"
-#include "SmsPluginTypes.h"
+#include "Sms3gppTypes.h"
-extern "C"
-{
- #include <tapi_common.h>
- #include <TelSms.h>
- #include <ITapiNetText.h>
-}
+using namespace std;
/*==================================================================================================
VARIABLES
==================================================================================================*/
-typedef map<unsigned char, SMS_CBMSG_PAGE_S> cbPageMap;
-
+typedef map<unsigned char, SMS_3GPP_CBMSG_PAGE_S> Sms3gppCbPageMap;
typedef struct _CB_PAGE_INFO_S {
unsigned char geoScope;
unsigned char pageCnt;
unsigned int totalSize;
- cbPageMap data;
-} CB_PAGE_INFO_S;
-
+ Sms3gppCbPageMap data;
+} SMS_3GPP_CB_PAGE_INFO_S;
/*==================================================================================================
CLASS DEFINITIONS
==================================================================================================*/
-class SmsPluginCbMsgHandler
+class Sms3gppCbMsgHandler
{
public:
- static SmsPluginCbMsgHandler* instance();
+ static Sms3gppCbMsgHandler* instance();
void handleCbMsg(TapiHandle *handle, TelSmsCbMsg_t *pCbMsg);
void handleEtwsMsg(TapiHandle *handle, TelSmsEtwsMsg_t *pEtwsMsg);
private:
- SmsPluginCbMsgHandler();
- virtual ~SmsPluginCbMsgHandler();
+ Sms3gppCbMsgHandler();
+ virtual ~Sms3gppCbMsgHandler();
- static SmsPluginCbMsgHandler* pInstance;
+ static Sms3gppCbMsgHandler* pInstance;
- void Decode2gCbMsg(TelSmsCbMsg_t *pCbMsg, SMS_CBMSG_PAGE_S *pCbPage);
- void Decode3gCbMsg(TelSmsCbMsg_t *pCbMsg, SMS_CBMSG_PAGE_S *pCbPage);
- void DecodeEtwsMsg(TelSmsEtwsMsg_t *pEtwsMsg, SMS_ETWS_PRIMARY_S *pEtwsPn);
- unsigned short encodeCbSerialNum(SMS_CBMSG_SERIAL_NUM_S snFields);
+ void Decode2gCbMsg(TelSmsCbMsg_t *pCbMsg, SMS_3GPP_CBMSG_PAGE_S *pCbPage);
+ void Decode3gCbMsg(TelSmsCbMsg_t *pCbMsg, SMS_3GPP_CBMSG_PAGE_S *pCbPage);
+ void DecodeEtwsMsg(TelSmsEtwsMsg_t *pEtwsMsg, SMS_3GPP_ETWS_PRIMARY_S *pEtwsPn);
+ unsigned short encodeCbSerialNum(SMS_3GPP_CBMSG_SERIAL_NUM_S snFields);
int getCMASType(unsigned short message_id);
- bool checkCbOpt(SMS_CBMSG_PAGE_S *CbPage, bool *pJavaMsg, msg_sim_slot_id_t simIndex);
- unsigned char checkCbPage(SMS_CBMSG_PAGE_S *CbPage);
- void MakeCbMsg(SMS_CBMSG_PAGE_S *CbPage, SMS_CBMSG_S *pCbMsg);
- void convertCbMsgToMsginfo(SMS_CBMSG_S *pCbMsg, MSG_MESSAGE_INFO_S *pMsgInfo, msg_sim_slot_id_t simIndex);
- void convertEtwsMsgToMsginfo(SMS_CBMSG_PAGE_S *EtwsMsg, MSG_MESSAGE_INFO_S *pMsgInfo, msg_sim_slot_id_t simIndex);
- int convertTextToUtf8(unsigned char* outBuf, int outBufSize, SMS_CBMSG_S* pCbMsg);
- void addToPageList(SMS_CBMSG_PAGE_S *CbPage);
- void removeFromPageList(SMS_CBMSG_PAGE_S *CbPage);
-
- void decodeCbMsgDCS(unsigned char dcsData, const unsigned char *pMsgData, SMS_CBMSG_DCS_S* pDcs);
- void convertLangType(SMS_CBMSG_LANG_TYPE_T InType , MSG_CB_LANGUAGE_TYPE_T *pOutType);
+ bool checkCbOpt(SMS_3GPP_CBMSG_PAGE_S *CbPage, bool *pJavaMsg, msg_sim_slot_id_t simIndex);
+ unsigned char checkCbPage(SMS_3GPP_CBMSG_PAGE_S *CbPage);
+ void MakeCbMsg(SMS_3GPP_CBMSG_PAGE_S *CbPage, SMS_3GPP_CBMSG_S *pCbMsg);
+ void convertCbMsgToMsginfo(SMS_3GPP_CBMSG_S *pCbMsg, MSG_MESSAGE_INFO_S *pMsgInfo, msg_sim_slot_id_t simIndex);
+ void convertEtwsMsgToMsginfo(SMS_3GPP_CBMSG_PAGE_S *EtwsMsg, MSG_MESSAGE_INFO_S *pMsgInfo, msg_sim_slot_id_t simIndex);
+ int convertTextToUtf8(unsigned char* outBuf, int outBufSize, SMS_3GPP_CBMSG_S* pCbMsg);
+ void addToPageList(SMS_3GPP_CBMSG_PAGE_S *CbPage);
+ void removeFromPageList(SMS_3GPP_CBMSG_PAGE_S *CbPage);
+
+ void decodeCbMsgDCS(unsigned char dcsData, const unsigned char *pMsgData, SMS_3GPP_CBMSG_DCS_S* pDcs);
+ void convertLangType(SMS_3GPP_CBMSG_LANG_TYPE_T InType , MSG_CB_LANGUAGE_TYPE_T *pOutType);
unsigned long getRecvTime();
- void getDisplayName(unsigned short MsgId, char *pDisplayName, msg_sim_slot_id_t simIndex);
+ void getDisplayName(unsigned short MsgId, char *pDisplayName, msg_sim_slot_id_t simIndex);
- vector<CB_PAGE_INFO_S> pageList;
+ vector<SMS_3GPP_CB_PAGE_INFO_S> pageList;
};
-#endif /* SMS_PLUGIN_CBMSG_HANDLER_H */
-
+#endif /* SMS_3GPP_CBMSG_HANDLER_H */
* limitations under the License.
*/
-#ifndef SMS_PLUGIN_CONCAT_HANDLER_H
-#define SMS_PLUGIN_CONCAT_HANDLER_H
+#ifndef SMS_3GPP_CONCAT_HANDLER_H
+#define SMS_3GPP_CONCAT_HANDLER_H
/*==================================================================================================
using namespace std;
#include "MsgTextConvert.h"
-#include "SmsPluginTypes.h"
+#include "Sms3gppTypes.h"
/*==================================================================================================
==================================================================================================*/
#define MAX_CONCAT_LIST 10
-struct CONCAT_DATA_S {
+struct SMS_3GPP_CONCAT_DATA_S {
int length;
char data[MAX_USER_DATA_LEN+1];
};
-typedef map<unsigned char, CONCAT_DATA_S> concatDataMap;
+typedef map<unsigned char, SMS_3GPP_CONCAT_DATA_S> Sms3gppConcatDataMap;
-typedef struct _SMS_CONCAT_MSG_S {
+typedef struct _SMS_3GPP_CONCAT_MSG_S {
unsigned short msgRef;
unsigned char totalSeg;
unsigned char seqNum;
- SMS_TIMESTAMP_S timeStamp;
- SMS_ADDRESS_S originAddress;
- SMS_DCS_S dcs;
+ SMS_3GPP_TIMESTAMP_S timeStamp;
+ SMS_3GPP_ADDRESS_S originAddress;
+ SMS_3GPP_DCS_S dcs;
bool bRead;
int simId;
int simIndex;
-} SMS_CONCAT_MSG_S;
+} SMS_3GPP_CONCAT_MSG_S;
-typedef struct _SMS_CONCAT_INFO_S {
+typedef struct _SMS_3GPP_CONCAT_INFO_S {
unsigned short msgRef;
unsigned char totalSeg;
unsigned char segCnt;
- SMS_TIMESTAMP_S timeStamp;
- SMS_ADDRESS_S originAddress;
- SMS_DCS_S dcs;
+ SMS_3GPP_TIMESTAMP_S timeStamp;
+ SMS_3GPP_ADDRESS_S originAddress;
+ SMS_3GPP_DCS_S dcs;
bool bRead;
unsigned int totalSize;
- concatDataMap data;
+ Sms3gppConcatDataMap data;
int simIdList[MAX_SIM_SMS_NUM];
unsigned int display_time;
int simIndex;
-} SMS_CONCAT_INFO_S;
+} SMS_3GPP_CONCAT_INFO_S;
typedef struct _SMS_SIM_ID_S {
unsigned short msgRef;
msg_sim_id_t simId;
-} SMS_SIM_ID_S;
+} SMS_3GPP_SIM_ID_S;
/*==================================================================================================
CLASS DEFINITIONS
==================================================================================================*/
-class SmsPluginConcatHandler
+class Sms3gppConcatHandler
{
public:
- static SmsPluginConcatHandler* instance();
+ static Sms3gppConcatHandler* instance();
- bool IsConcatMsg(SMS_USERDATA_S *pUserData);
- void handleConcatMsg(TapiHandle *handle, SMS_TPDU_S *pTpdu);
- void handleSimConcatMsg(TapiHandle *handle, SMS_TPDU_S *pTpdu, int msgId, int bRead, int *simIdList);
+ bool IsConcatMsg(SMS_3GPP_USERDATA_S *pUserData);
+ void handleConcatMsg(TapiHandle *handle, SMS_3GPP_TPDU_S *pTpdu);
+ void handleSimConcatMsg(TapiHandle *handle, SMS_3GPP_TPDU_S *pTpdu, int msgId, int bRead, int *simIdList);
/* void handleConcatMsg(SMS_TPDU_S *pTpdu, msg_sim_id_t SimMsgId, bool bRead); */
/* void handleBrokenMsg(); */
private:
- SmsPluginConcatHandler();
- virtual ~SmsPluginConcatHandler();
+ Sms3gppConcatHandler();
+ virtual ~Sms3gppConcatHandler();
- static SmsPluginConcatHandler* pInstance;
+ static Sms3gppConcatHandler* pInstance;
- unsigned char checkConcatMsg(SMS_CONCAT_MSG_S *pConcatMsg, SMS_USERDATA_S *pUserData);
+ unsigned char checkConcatMsg(SMS_3GPP_CONCAT_MSG_S *pConcatMsg, SMS_3GPP_USERDATA_S *pUserData);
int makeConcatUserData(unsigned short MsgRef, int simIndex, char **ppTotalData, char *originAddress);
- void convertConcatToMsginfo(const SMS_DELIVER_S *pTpdu, const char *pUserData, int DataSize, MSG_MESSAGE_INFO_S *pMsgInfo);
- void convertConcatToMsginfo(const SMS_SUBMIT_S *pTpdu, const char *pUserData, int DataSize, MSG_MESSAGE_INFO_S *pMsgInfo);
+ void convertConcatToMsginfo(const SMS_3GPP_DELIVER_S *pTpdu, const char *pUserData, int DataSize, MSG_MESSAGE_INFO_S *pMsgInfo);
+ void convertConcatToMsginfo(const SMS_3GPP_SUBMIT_S *pTpdu, const char *pUserData, int DataSize, MSG_MESSAGE_INFO_S *pMsgInfo);
/* void convertSimMsgToMsginfo(const SMS_CONCAT_MSG_S *pConcatMsg, const char *pUserData, int DataSize, MSG_MESSAGE_INFO_S *pMsgInfo); */
void removeFromConcatList(unsigned short MsgRef, int simIndex, char *originAddress);
/* void addToSimIdList(unsigned short MsgRef, msg_sim_id_t SimMsgId); */
-/* void removeFromSimIdList(unsigned short MsgRef); */
+/* void removeFromSimIdList(unsigned short MsgRef); */
- vector<SMS_CONCAT_INFO_S> concatList;
-/* vector<SMS_SIM_ID_S> simIdList; */
+ vector<SMS_3GPP_CONCAT_INFO_S> concatList;
+/* vector<SMS_3GPP_SIM_ID_S> simIdList; */
};
-#endif /* SMS_PLUGIN_CONCAT_HANDLER_H */
+#endif /* SMS_3GPP_CONCAT_HANDLER_H */
* limitations under the License.
*/
-#ifndef SMS_PLUGIN_EVENT_HANDLER_H
-#define SMS_PLUGIN_EVENT_HANDLER_H
+#ifndef SMS_3GPP_EVENT_HANDLER_H
+#define SMS_3GPP_EVENT_HANDLER_H
/*==================================================================================================
INCLUDE FILES
==================================================================================================*/
+#include <tapi_common.h>
+#include <TelSms.h>
#include "MsgMutex.h"
#include "MsgTextConvert.h"
#include "MsgPluginInterface.h"
-#include "SmsPluginTypes.h"
-
+#include "Sms3gppTypes.h"
/*==================================================================================================
CLASS DEFINITIONS
==================================================================================================*/
-class SmsPluginEventHandler
+class Sms3gppEventHandler
{
public:
- static SmsPluginEventHandler* instance();
+ static Sms3gppEventHandler* instance();
void registerListener(MSG_PLUGIN_LISTENER_S *pListener);
void handleSentStatus(msg_network_status_t NetStatus);
- void handleMsgIncoming(TapiHandle *handle, SMS_TPDU_S *pTpdu);
+ void handleMsgIncoming(TapiHandle *handle, SMS_3GPP_TPDU_S *pTpdu);
void handleSyncMLMsgIncoming(msg_syncml_message_type_t msgType, char* pPushBody, int PushBodyLen, char* pWspHeader, int WspHeaderLen, int simIndex);
void handleLBSMsgIncoming(char* pPushHeader, char* pPushBody, int pushBodyLen);
void handlePushMsgIncoming(char* pPushHeader, char* pPushBody, int pushBodyLen, char *app_id, char *content_type);
msg_error_t updateIMSI(int sim_idx);
void handleSimMemoryFull(int simIndex);
- void SetSentInfo(SMS_SENT_INFO_S *pSentInfo);
+ void SetSentInfo(SMS_3GPP_SENT_INFO_S *pSentInfo);
- void setDeviceStatus(TapiHandle *handle);
+ void setDeviceStatus(TapiHandle *handle, bool status);
bool getDeviceStatus(TapiHandle *handle);
/* temp */
- void convertTpduToMsginfo(SMS_TPDU_S *pTpdu, MSG_MESSAGE_INFO_S *msgInfo);
+ void convertTpduToMsginfo(SMS_3GPP_TPDU_S *pTpdu, MSG_MESSAGE_INFO_S *msgInfo);
- MSG_SUB_TYPE_T convertMsgSubType(SMS_PID_T pid);
+ MSG_SUB_TYPE_T convertMsgSubType(SMS_3GPP_PID_T pid);
private:
- SmsPluginEventHandler();
- virtual ~SmsPluginEventHandler();
+ Sms3gppEventHandler();
+ virtual ~Sms3gppEventHandler();
- void convertSubmitTpduToMsginfo(const SMS_SUBMIT_S *pTpdu, MSG_MESSAGE_INFO_S *msgInfo);
- void convertDeliverTpduToMsginfo(const SMS_DELIVER_S *pTpdu, MSG_MESSAGE_INFO_S *msgInfo);
- void convertStatusRepTpduToMsginfo(const SMS_STATUS_REPORT_S *pTpdu, MSG_MESSAGE_INFO_S *msgInfo);
+ void convertSubmitTpduToMsginfo(const SMS_3GPP_SUBMIT_S *pTpdu, MSG_MESSAGE_INFO_S *msgInfo);
+ void convertDeliverTpduToMsginfo(const SMS_3GPP_DELIVER_S *pTpdu, MSG_MESSAGE_INFO_S *msgInfo);
+ void convertStatusRepTpduToMsginfo(const SMS_3GPP_STATUS_REPORT_S *pTpdu, MSG_MESSAGE_INFO_S *msgInfo);
- static SmsPluginEventHandler* pInstance;
+ static Sms3gppEventHandler* pInstance;
MSG_PLUGIN_LISTENER_S listener;
- MSG_SIM_COUNT_S* pSimCnt;
- SMS_SENT_INFO_S sentInfo;
+ MSG_3GPP_SIM_COUNT_S* pSimCnt;
+ SMS_3GPP_SENT_INFO_S sentInfo;
bool devStatus;
bool bUdhMwiMethod;
TapiHandle *devHandle;
};
-#endif /* SMS_PLUGIN_EVENT_HANDLER_H */
-
+#endif /* SMS_3GPP_EVENT_HANDLER_H */
* limitations under the License.
*/
-#ifndef SMS_PLUGIN_PARAMCODEC_H
-#define SMS_PLUGIN_PARAMCODEC_H
+#ifndef SMS_3GPP_PARAM_CODEC_H
+#define SMS_3GPP_PARAM_CODEC_H
/*==================================================================================================
INCLUDE FILES
==================================================================================================*/
-#include "SmsPluginTypes.h"
+#include "Sms3gppTypes.h"
/*==================================================================================================
CLASS DEFINITIONS
==================================================================================================*/
-class SmsPluginParamCodec
+class Sms3gppParamCodec
{
public:
- SmsPluginParamCodec();
- virtual ~SmsPluginParamCodec();
+ Sms3gppParamCodec();
+ virtual ~Sms3gppParamCodec();
- static int encodeAddress(const SMS_ADDRESS_S *pAddress, char **ppParam);
- static int encodeTime(const SMS_TIMESTAMP_S *pTimeStamp, char **ppParam);
- static int encodeDCS(const SMS_DCS_S *pDCS, char **ppParam);
+ static int encodeAddress(const SMS_3GPP_ADDRESS_S *pAddress, char **ppParam);
+ static int encodeTime(const SMS_3GPP_TIMESTAMP_S *pTimeStamp, char **ppParam);
+ static int encodeDCS(const SMS_3GPP_DCS_S *pDCS, char **ppParam);
static int encodeSMSC(const char *pAddress, unsigned char *pEncodeAddr);
- static int encodeSMSC(const SMS_ADDRESS_S *pAddress, unsigned char *pSMSC);
+ static int encodeSMSC(const SMS_3GPP_ADDRESS_S *pAddress, unsigned char *pSMSC);
- static int decodeAddress(const unsigned char *pTpdu, SMS_ADDRESS_S *pAddress);
- static int decodeTime(const unsigned char *pTpdu, SMS_TIMESTAMP_S *pTimeStamp);
- static int decodeDCS(const unsigned char *pTpdu, SMS_DCS_S *pDCS);
+ static int decodeAddress(const unsigned char *pTpdu, SMS_3GPP_ADDRESS_S *pAddress);
+ static int decodeTime(const unsigned char *pTpdu, SMS_3GPP_TIMESTAMP_S *pTimeStamp);
+ static int decodeDCS(const unsigned char *pTpdu, SMS_3GPP_DCS_S *pDCS);
static void decodeSMSC(unsigned char* pAddress, int AddrLen, MSG_SMS_TON_T ton, char *pDecodeAddr);
static bool checkCphsVmiMsg(const unsigned char *pTpdu, int *setType, int *indType);
- static time_t convertTime(const SMS_TIMESTAMP_S *time_stamp);
+ static time_t convertTime(const SMS_3GPP_TIMESTAMP_S *time_stamp);
private:
static int convertDigitToBcd(char *pDigit, int DigitLen, unsigned char *pBcd);
static int convertBcdToDigit(const unsigned char *pBcd, int BcdLen, char *pDigit);
};
-#endif /* SMS_PLUGIN_PARAMCODEC_H */
+#endif /* SMS_3GPP_PARAM_CODEC_H */
* limitations under the License.
*/
-#ifndef SMS_PLUGIN_SAT_HANDLER_H
-#define SMS_PLUGIN_SAT_HANDLER_H
+#ifndef SMS_3GPP_SAT_HANDLER_H
+#define SMS_3GPP_SAT_HANDLER_H
/*==================================================================================================
INCLUDE FILES
==================================================================================================*/
-#include "SmsPluginTypes.h"
+#include "Sms3gppTypes.h"
#include "MsgMutex.h"
extern "C"
/*==================================================================================================
CLASS DEFINITIONS
==================================================================================================*/
-class SmsPluginSatHandler
+class Sms3gppSatHandler
{
public:
- static SmsPluginSatHandler* instance();
+ static Sms3gppSatHandler* instance();
void refreshSms(TapiHandle *handle, void *pData);
void sendSms(TapiHandle *handle, void *pData);
void finishSimMsgInit(msg_error_t Err);
private:
- SmsPluginSatHandler();
- virtual ~SmsPluginSatHandler();
+ Sms3gppSatHandler();
+ virtual ~Sms3gppSatHandler();
void initSim();
int handleSatTpdu(unsigned char *pTpdu, unsigned char TpduLen, int bIsPackingRequired);
- void sendResult(TapiHandle *handle, SMS_SAT_CMD_TYPE_T CmdType, int ResultType);
+ void sendResult(TapiHandle *handle, SMS_3GPP_SAT_CMD_TYPE_T CmdType, int ResultType);
- static SmsPluginSatHandler* pInstance;
+ static Sms3gppSatHandler* pInstance;
int commandId;
MsgCndVar cv;
};
-#endif /* SMS_PLUGIN_SAT_HANDLER_H */
-
+#endif /* SMS_3GPP_SAT_HANDLER_H */
* limitations under the License.
*/
-#ifndef SMS_PLUGIN_SETTING_H
-#define SMS_PLUGIN_SETTING_H
+#ifndef SMS_3GPP_SETTING_H
+#define SMS_3GPP_SETTING_H
/*==================================================================================================
}
typedef map <int, MSG_SMSC_LIST_S> smscListMap;
-typedef map <int, SMS_SIM_MAILBOX_LIST_S> smsSimMailboxListMap;
-typedef map <int, SMS_SIM_MWI_INFO_S> simMwiInfoMap;
+typedef map <int, SMS_3GPP_SIM_MAILBOX_LIST_S> smsSimMailboxListMap;
+typedef map <int, SMS_3GPP_SIM_MWI_INFO_S> simMwiInfoMap;
typedef map <int, MSG_CBMSG_OPT_S> cbOptMap;
/*==================================================================================================
CLASS DEFINITIONS
==================================================================================================*/
-class SmsPluginSetting
+class Sms3gppSetting
{
public:
- static SmsPluginSetting* instance();
+ static Sms3gppSetting* instance();
void setConfigData(const MSG_SETTING_S *pSetting);
void getConfigData(MSG_SETTING_S *pSetting);
void setParamCntEvent(int ParamCnt);
void setParamEvent(TapiHandle *handle, const MSG_SMSC_DATA_S *pSmscData, int RecordIdx, bool bSuccess);
void setCbConfigEvent(TapiHandle *handle, const MSG_CBMSG_OPT_S *pCbOpt, bool bSuccess);
- void setMailboxInfoEvent(TapiHandle *handle, SMS_SIM_MAILBOX_LIST_S *pVoiceOpt, bool bSuccess, bool bMbdn);
+ void setMailboxInfoEvent(TapiHandle *handle, SMS_3GPP_SIM_MAILBOX_LIST_S *pVoiceOpt, bool bSuccess, bool bMbdn);
void setMwiInfo(int simIndex, MSG_SUB_TYPE_T type, int count);
- void setMwiInfoEvent(TapiHandle *handle, SMS_SIM_MWI_INFO_S *pMwiInfo, bool bSuccess);
+ void setMwiInfoEvent(TapiHandle *handle, SMS_3GPP_SIM_MWI_INFO_S *pMwiInfo, bool bSuccess);
void setResultFromSim(bool bResult);
void setResultImei(bool bResult, char *pImei);
void setSmscInfo(const MSG_SMSC_LIST_S *pSmscList);
- void setSimChangeStatus(TapiHandle *handle, bool bInitializing);
+ void setSimChangeStatus(TapiHandle *handle);
void getSmscListInfo(int simIndex, MSG_SMSC_LIST_S *pSmscList);
+
+ void initializeSimInfo(TapiHandle *handle);
void SimRefreshCb(TapiHandle *handle);
private:
- SmsPluginSetting();
- ~SmsPluginSetting();
+ Sms3gppSetting();
+ ~Sms3gppSetting();
void updateSimStatus(TapiHandle *handle);
-
void initConfigData(TapiHandle *handle);
static void* init_config_data(void *data);
static void* initSimInfo(void *data);
bool getResultFromSim();
- SMS_PID_T convertPid(MSG_SMS_PID_T pid);
+ SMS_3GPP_PID_T convertPid(MSG_SMS_PID_T pid);
void deliverVoiceMsgNoti(int simIndex, int mwiCnt);
- static SmsPluginSetting* pInstance;
+ static Sms3gppSetting* pInstance;
std::list<TapiHandle *> tel_handle_list;
/* Setting values for keeping in setting instance */
MsgCndVar cv;
};
-#endif /* SMS_PLUGIN_SETTING_H */
-
+#endif /* SMS_3GPP_SETTING_H */
* limitations under the License.
*/
-#ifndef SMS_PLUGIN_SIMMSG_H
-#define SMS_PLUGIN_SIMMSG_H
+#ifndef SMS_3GPP_SIM_MSG_H
+#define SMS_3GPP_SIM_MSG_H
/*==================================================================================================
#include "MsgMutex.h"
#include "MsgStorageTypes.h"
-#include "SmsPluginTypes.h"
+#include "Sms3gppTypes.h"
#include "MsgInternalTypes.h"
extern "C"
/*==================================================================================================
CLASS DEFINITIONS
==================================================================================================*/
-class SmsPluginSimMsg
+class Sms3gppSimMsg
{
public:
- static SmsPluginSimMsg* instance();
+ static Sms3gppSimMsg* instance();
void initSimMessage(struct tapi_handle *handle);
msg_error_t saveSimMessage(const MSG_MESSAGE_INFO_S *pMsgInfo, SMS_SIM_ID_LIST_S *pSimIdList);
void setReadStatus(msg_sim_slot_id_t sim_idx, msg_sim_id_t SimMsgId);
bool checkSimMsgFull(msg_sim_slot_id_t sim_idx, unsigned int SegCnt);
- void setSimMsgCntEvent(struct tapi_handle *handle, const MSG_SIM_COUNT_S *pSimMsgCnt);
+ void setSimMsgCntEvent(struct tapi_handle *handle, const MSG_3GPP_SIM_COUNT_S *pSimMsgCnt);
void setSimMsgEvent(struct tapi_handle *handle, const MSG_MESSAGE_INFO_S *pMsgInfo, bool bSuccess);
void setSaveSimMsgEvent(struct tapi_handle *handle, int simId, int result);
void setSaveClass2MsgEvent(struct tapi_handle *handle, int simId, int result, MSG_MESSAGE_INFO_S *data);
void setSmsTpduTotalSegCount(int totalSeg);
private:
- SmsPluginSimMsg();
- ~SmsPluginSimMsg();
+ Sms3gppSimMsg();
+ ~Sms3gppSimMsg();
- void getSimMsgCount(struct tapi_handle *handle, MSG_SIM_COUNT_S *pSimMsgCnt);
+ void getSimMsgCount(struct tapi_handle *handle, MSG_3GPP_SIM_COUNT_S *pSimMsgCnt);
bool getSimMsg(struct tapi_handle *handle, msg_sim_id_t SimMsgId, MSG_MESSAGE_INFO_S* pMsgInfo, int *simIdList);
- void setSmsOptions(const MSG_MESSAGE_INFO_S* pMsgInfo, SMS_DELIVER_S *pDeliver);
- void convertTimeStamp(const MSG_MESSAGE_INFO_S* pMsgInfo, SMS_DELIVER_S *pDeliver);
+ void setSmsOptions(const MSG_MESSAGE_INFO_S* pMsgInfo, SMS_3GPP_DELIVER_S *pDeliver);
+ void convertTimeStamp(const MSG_MESSAGE_INFO_S* pMsgInfo, SMS_3GPP_DELIVER_S *pDeliver);
- bool getSimMsgCntEvent(struct tapi_handle *handle, MSG_SIM_COUNT_S *pSimMsgCnt);
+ bool getSimMsgCntEvent(struct tapi_handle *handle, MSG_3GPP_SIM_COUNT_S *pSimMsgCnt);
bool getSimMsgEvent(struct tapi_handle *handle, MSG_MESSAGE_INFO_S *pMsgInfo);
bool getSimEvent(msg_sim_id_t *pSimId);
bool getUpdateSimEvent();
bool getDelSimEvent(int *pSimId);
- static SmsPluginSimMsg* pInstance;
+ static Sms3gppSimMsg* pInstance;
- msg_sim_id_t simMsgId;
+ msg_sim_id_t simMsgId;
int delSimMsgId;
- int simIdList[MAX_SIM_SMS_NUM]; /** send total simIds to handleSimMsg **/
+ int simIdList[MAX_SIM_SMS_NUM]; /** send total simIds to handleSimMsg **/
- MSG_SIM_COUNT_S simMsgCnt;
+ MSG_3GPP_SIM_COUNT_S simMsgCnt;
MSG_MESSAGE_INFO_S simMsgInfo;
MSG_ADDRESS_INFO_S simAddrInfo;
- int usedCnt;
- int totalCnt;
+ int usedCnt;
+ int totalCnt;
- bool bTapiResult;
+ bool bTapiResult;
- SMS_DATA_INFO_S simMsgDataInfo;
+ SMS_3GPP_DATA_INFO_S simMsgDataInfo;
MsgMutex mx;
MsgCndVar cv;
};
-#endif /* SMS_PLUGIN_SIMMSG_H */
-
+#endif /* SMS_3GPP_SIM_MSG_H */
/*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd. All rights reserved
+ * Copyright (c) 2014 Samsung Electronics Co., Ltd. All rights reserved
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* limitations under the License.
*/
-#ifndef SMS_CDMA_PLUGIN_STORAGE_H
-#define SMS_CDMA_PLUGIN_STORAGE_H
-
+#ifndef SMS_3GPP_STORAGE_H
+#define SMS_3GPP_STORAGE_H
/*==================================================================================================
INCLUDE FILES
==================================================================================================*/
-#include "MsgMutex.h"
-
#include "MsgStorageTypes.h"
-#include "SmsCdmaPluginTypes.h"
#include "MsgInternalTypes.h"
-#include "MsgSqliteWrapper.h"
-#include <list>
-
-extern "C"
-{
- #include <tapi_common.h>
- #include <TelSms.h>
- #include <TapiUtility.h>
- #include <ITapiNetText.h>
-}
/*==================================================================================================
CLASS DEFINITIONS
==================================================================================================*/
-class SmsPluginStorage
+class Sms3gppStorage
{
public:
- static SmsPluginStorage* instance();
+ static Sms3gppStorage* instance();
msg_error_t insertMsgRef(MSG_MESSAGE_INFO_S *pMsg, unsigned char msgRef, int index);
msg_error_t updateMsgDeliverStatus(MSG_MESSAGE_INFO_S *pMsgInfo, unsigned char msgRef);
+ msg_error_t addSimMessage(MSG_MESSAGE_INFO_S *pSimMsgInfo, int *simIdList);
+ msg_error_t insertSimMessage(int simId, int msgId);
+ msg_error_t deleteSimMessage(int sim_idx, int simId);
+ msg_error_t getReplaceSimMsg(const MSG_MESSAGE_INFO_S *pMsg, int *pMsgId, int *pSimId);
- msg_error_t updateSentMsg(MSG_MESSAGE_INFO_S *pMsgInfo, msg_network_status_t Status);
-
- msg_error_t checkMessage(MSG_MESSAGE_INFO_S *pMsgInfo);
- msg_error_t addSmsMessage(MSG_MESSAGE_INFO_S *pMsgInfo);
- msg_error_t deleteSmsMessage(msg_message_id_t msgId);
- msg_error_t addSmsSendOption(MSG_MESSAGE_INFO_S *pMsg, MSG_SENDINGOPT_INFO_S *pSendOptInfo);
-
- msg_error_t checkStorageStatus(MSG_MESSAGE_INFO_S *pMsgInfo);
- msg_error_t getRegisteredPushEvent(char* pPushHeader, int *count, char *app_id, int app_id_len, char *content_type, int content_type_len);
- msg_error_t getnthPushEvent(int index, int *appcode);
- msg_error_t releasePushEvent();
+ msg_error_t addClass2Message(MSG_MESSAGE_INFO_S *pMsgInfo);
+ msg_error_t updateSmsMessage(MSG_MESSAGE_INFO_S *pMsgInfo);
private:
- SmsPluginStorage();
- ~SmsPluginStorage();
+ Sms3gppStorage();
+ ~Sms3gppStorage() = default;
- static SmsPluginStorage* pInstance;
+ static void* class2_thread(void *data);
+
+ static Sms3gppStorage* pInstance;
MSG_MESSAGE_INFO_S msgInfo;
MSG_ADDRESS_INFO_S addrInfo;
-
- std::list<PUSH_APPLICATION_INFO_S> pushAppInfoList;
};
-#endif /* SMS_CDMA_PLUGIN_STORAGE_H */
+#endif /* SMS_3GPP_STORAGE_H */
--- /dev/null
+/*
+ * Copyright (c) 2014 Samsung Electronics Co., Ltd. All rights reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+*/
+
+#ifndef SMS_3GPP_TAPI_EVENT_HANDLER_H
+#define SMS_3GPP_TAPI_EVENT_HANDLER_H
+
+
+/*==================================================================================================
+ INCLUDE FILES
+==================================================================================================*/
+#include <map>
+#include <vector>
+#include <tapi_common.h>
+#include <TelSms.h>
+#include <TelSim.h>
+#include <TapiUtility.h>
+#include <ITapiNetText.h>
+#include <ITapiNetwork.h>
+
+
+/*==================================================================================================
+ FUNCTION PROTOTYPES
+==================================================================================================*/
+class Sms3gppTapiEventHandler
+{
+public:
+ static void NotiSmsDeviceReady(TapiHandle *handle, const char *noti_id, void *data, void *user_data);
+ static void NotiSmsIncomMsg(TapiHandle *handle, const char *noti_id, void *data, void *user_data);
+ static void NotiSmsCbIncomMsg(TapiHandle *handle, const char *noti_id, void *data, void *user_data);
+ static void NotiSmsEtwsIncomMsg(TapiHandle *handle, const char *noti_id, void *data, void *user_data);
+ static void NotiSimStatus(TapiHandle *handle, const char *noti_id, void *data, void *user_data);
+ static void NotiNetworkRegistrationType(TapiHandle *handle, const char *noti_id, void *data, void *user_data);
+ static void NotiSimRefreshed(TapiHandle *handle, const char *noti_id, void *data, void *user_data);
+ static void NotiSatSendSms(TapiHandle *handle, const char *noti_id, void *data, void *user_data);
+ static void NotiSatMoSmControlResult(TapiHandle *handle, const char *noti_id, void *data, void *user_data);
+ static void NotiSmsMemoryStatus(TapiHandle *handle, const char *noti_id, void *data, void *user_data);
+
+ static void respSentStatus(TapiHandle *handle, int result, void *data, void *user_data);
+ static void respSatSmsSentStatus(TapiHandle *handle, int result, void *data, void *user_data);
+ static void respDeliveryReportCNF(TapiHandle *handle, int result, void *data, void *user_data);
+
+ static void respGetSimMsgCnt(TapiHandle *handle, int result, void *data, void *user_data);
+ static void respGetSimMsg(TapiHandle *handle, int result, void *data, void *user_data);
+ static void respSaveSimMsg(TapiHandle *handle, int result, void *data, void *user_data);
+ static void respSaveClass2Msg(TapiHandle *handle, int result, void *data, void *user_data);
+ static void respDeleteSimMsg(TapiHandle *handle, int result, void *data, void *user_data);
+
+ static void respSetConfigData(TapiHandle *handle, int result, void *data, void *user_data);
+ static void respGetCBConfig(TapiHandle *handle, int result, void *data, void *user_data);
+
+ static void respSetSmscInfo(TapiHandle *handle, int result, void *data, void *user_data);
+ static void respSetMemoryStatus(TapiHandle *handle, int result, void *data, void *user_data);
+ static void respSetMsgStatus(TapiHandle *handle, int result, void *data, void *user_data);
+
+ static void respGetParamCnt(TapiHandle *handle, int result, void *data, void *user_data);
+ static void respGetParam(TapiHandle *handle, int result, void *data, void *user_data);
+
+ static void respSetMailboxInfo(TapiHandle *handle, int result, void *data, void *user_data);
+ static void respGetMailboxInfo(TapiHandle *handle, int result, void *data, void *user_data);
+
+ static void respSetMwiInfo(TapiHandle *handle, int result, void *data, void *user_data);
+ static void respGetMwiInfo(TapiHandle *handle, int result, void *data, void *user_data);
+
+ static void respGetMsisdnInfo(TapiHandle *handle, int result, void *data, void *user_data);
+ static void respGetSimServiceTable(TapiHandle *handle, int result, void *data, void *user_data);
+ static void respGetMeImei(TapiHandle *handle, int result, void *data, void *user_data);
+
+};
+
+#endif /* SMS_3GPP_TAPI_EVENT_HANDLER_H */
* limitations under the License.
*/
-#ifndef SMS_PLUGIN_TPDU_CODEC_H
-#define SMS_PLUGIN_TPDU_CODEC_H
+#ifndef SMS_3GPP_TPDU_CODEC_H
+#define SMS_3GPP_TPDU_CODEC_H
/*==================================================================================================
INCLUDE FILES
==================================================================================================*/
-#include "SmsPluginTypes.h"
+#include <tapi_common.h>
+#include "Sms3gppTypes.h"
/*==================================================================================================
CLASS DEFINITIONS
==================================================================================================*/
-class SmsPluginTpduCodec
+class Sms3gppTpduCodec
{
public:
- SmsPluginTpduCodec();
- virtual ~SmsPluginTpduCodec();
+ Sms3gppTpduCodec();
+ virtual ~Sms3gppTpduCodec();
- static int encodeTpdu(const SMS_TPDU_S *pSmsTpdu, char *pTpdu);
- static int decodeTpdu(const unsigned char *pTpdu, int TpduLen, SMS_TPDU_S *pSmsTpdu);
+ static int encodeTpdu(const SMS_3GPP_TPDU_S *pSmsTpdu, char *pTpdu);
+ /* TODO: Need to remove TapiHandle on this function */
+ static int decodeTpdu(TapiHandle *handle, const unsigned char *pTpdu, int TpduLen, SMS_3GPP_TPDU_S *pSmsTpdu);
private:
- static int encodeSubmit(const SMS_SUBMIT_S *pSubmit, char *pTpdu);
- static int encodeDeliver(const SMS_DELIVER_S *pDeliver, char *pTpdu);
- static int encodeDeliverReport(const SMS_DELIVER_REPORT_S *pDeliverRep, char *pTpdu);
- static int encodeStatusReport(const SMS_STATUS_REPORT_S *pStatusRep, char *pTpdu);
-
- static int decodeSubmit(const unsigned char *pTpdu, int TpduLen, SMS_SUBMIT_S *pSubmit);
- static int decodeDeliver(const unsigned char *pTpdu, int TpduLen, SMS_DELIVER_S *pDeliver);
- static int decodeStatusReport(const unsigned char *pTpdu, int TpduLen, SMS_STATUS_REPORT_S *pStatusRep);
+ static int encodeSubmit(const SMS_3GPP_SUBMIT_S *pSubmit, char *pTpdu);
+ static int encodeDeliver(const SMS_3GPP_DELIVER_S *pDeliver, char *pTpdu);
+ static int encodeDeliverReport(const SMS_3GPP_DELIVER_REPORT_S *pDeliverRep, char *pTpdu);
+ static int encodeStatusReport(const SMS_3GPP_STATUS_REPORT_S *pStatusRep, char *pTpdu);
+
+ static int decodeSubmit(const unsigned char *pTpdu, int TpduLen, SMS_3GPP_SUBMIT_S *pSubmit);
+ static int decodeDeliver(TapiHandle *handle, const unsigned char *pTpdu, int TpduLen, SMS_3GPP_DELIVER_S *pDeliver);
+ static int decodeStatusReport(const unsigned char *pTpdu, int TpduLen, SMS_3GPP_STATUS_REPORT_S *pStatusRep);
};
-#endif /* SMS_PLUGIN_TPDU_CODEC_H */
-
+#endif /* SMS_3GPP_TPDU_CODEC_H */
* limitations under the License.
*/
-#ifndef SMS_PLUGIN_TRANSPORT_H
-#define SMS_PLUGIN_TRANSPORT_H
+#ifndef SMS_3GPP_TRANSPORT_H
+#define SMS_3GPP_TRANSPORT_H
/*==================================================================================================
#include "MsgTextConvert.h"
#include "MsgTransportTypes.h"
#include "MsgSettingTypes.h"
-#include "SmsPluginTypes.h"
+#include "Sms3gppTypes.h"
#include "MsgInternalTypes.h"
extern "C"
/*==================================================================================================
CLASS DEFINITIONS
==================================================================================================*/
-class SmsPluginTransport
+msg_error_t Sms3gppSubmitRequest(MSG_REQUEST_INFO_S *pReqInfo);
+
+class Sms3gppTransport
{
public:
- static SmsPluginTransport* instance();
+ static Sms3gppTransport* instance();
- void submitRequest(SMS_REQUEST_INFO_S *pReqInfo);
+ void submitRequest(SMS_3GPP_REQUEST_INFO_S *pReqInfo);
void sendDeliverReport(struct tapi_handle *handle, msg_error_t err);
void sendClass0DeliverReport(struct tapi_handle *handle, msg_error_t err);
- void setSmscOptions(int simIndex, SMS_ADDRESS_S *pSmsc);
+ void setSmscOptions(int simIndex, SMS_3GPP_ADDRESS_S *pSmsc);
- void msgInfoToSubmitData(const MSG_MESSAGE_INFO_S *pMsgInfo, SMS_SUBMIT_DATA_S *pData, SMS_CODING_SCHEME_T *pCharType, int addrIndex);
- void setConcatHeader(SMS_UDH_S *pSrcHeader, SMS_UDH_S *pDstHeader);
+ void msgInfoToSubmitData(const MSG_MESSAGE_INFO_S *pMsgInfo, SMS_3GPP_SUBMIT_DATA_S *pData, SMS_3GPP_CODING_SCHEME_T *pCharType, int addrIndex);
+ void setConcatHeader(SMS_3GPP_UDH_S *pSrcHeader, SMS_3GPP_UDH_S *pDstHeader);
void setNetStatus(SMS_NETWORK_STATUS_T sentStatus);
SMS_NETWORK_STATUS_T getNetStatus();
int getMoCtrlStatus();
unsigned char getMsgRef();
+ void setIsMemAvailable(bool isAvailable);
private:
- SmsPluginTransport();
- ~SmsPluginTransport();
+ Sms3gppTransport();
+ ~Sms3gppTransport();
- void getSmsSendOption(int simIndex, SMS_SUBMIT_S *pSubmit);
- void setSmsSendOption(SMS_REQUEST_INFO_S *pReqInfo, SMS_TPDU_S* pSmsTpdu);
- void setSmsDcsOption(SMS_REQUEST_INFO_S *pReqInfo, SMS_TPDU_S* pSmsTpdu);
- void setSmsReportOption(SMS_REQUEST_INFO_S *pReqInfo, SMS_TPDU_S* pSmsTpdu);
+ void getSmsSendOption(int simIndex, SMS_3GPP_SUBMIT_S *pSubmit);
+ void setSmsSendOption(SMS_3GPP_REQUEST_INFO_S *pReqInfo, SMS_3GPP_TPDU_S* pSmsTpdu);
+ void setSmsDcsOption(SMS_3GPP_REQUEST_INFO_S *pReqInfo, SMS_3GPP_TPDU_S* pSmsTpdu);
+ void setSmsReportOption(SMS_3GPP_REQUEST_INFO_S *pReqInfo, SMS_3GPP_TPDU_S* pSmsTpdu);
- int getSegmentSize(SMS_CODING_SCHEME_T CodingScheme, int DataLen, bool bPortNum, MSG_LANGUAGE_ID_T LangId, int ReplyAddrLen);
- SMS_PID_T convertPid(MSG_SMS_PID_T pid);
+ int getSegmentSize(SMS_3GPP_CODING_SCHEME_T CodingScheme, int DataLen, bool bPortNum, MSG_LANGUAGE_ID_T LangId, int ReplyAddrLen);
+ SMS_3GPP_PID_T convertPid(MSG_SMS_PID_T pid);
- static SmsPluginTransport* pInstance;
+ static Sms3gppTransport* pInstance;
+ bool isMemAvailable;
unsigned char msgRef;
-
unsigned char msgRef8bit;
unsigned short msgRef16bit;
MsgCndVar cv;
};
-#endif /* SMS_PLUGIN_TRANSPORT_H */
+#endif /* SMS_3GPP_TRANSPORT_H */
--- /dev/null
+/*
+ * Copyright (c) 2014 Samsung Electronics Co., Ltd. All rights reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+*/
+
+#ifndef SMS_3GPP_TYPES_H
+#define SMS_3GPP_TYPES_H
+
+
+/*==================================================================================================
+ INCLUDE FILES
+==================================================================================================*/
+#include "MsgTextConvert.h"
+#include "MsgInternalTypes.h"
+#include "MsgStorageTypes.h"
+#include "MsgSettingTypes.h"
+#include "SmsPluginTypes.h"
+
+
+/*==================================================================================================
+ DEFINES
+==================================================================================================*/
+#define MAX_ADDRESS_LEN 21 /* including '+' */
+#define MAX_USER_DATA_LEN 160
+#define MAX_GSM_7BIT_DATA_LEN 160
+#define MAX_UCS2_DATA_LEN 140
+/* #define MAX_TPDU_DATA_LEN 165 */
+#define MAX_TPDU_DATA_LEN 255
+#define MAX_SMS_SEND_RETRY 4
+#define MAX_SMSC_LEN 20
+#define MAX_ADD_PARAM_LEN 12
+#define MAX_DCS_PARAM_LEN 1
+#define MAX_ABS_TIME_PARAM_LEN 7
+#define MAX_REL_TIME_PARAM_LEN 1
+#define MAX_UD_HEADER_NUM 7
+#define MAX_SAT_TPDU_LEN 175
+#define MAX_CBMSG_PAGE_SIZE 82
+#define MAX_CBMSG_TOTAL_PAGE_SIZE 1252 /* 6 + 1 + (MAX_CBMSG_PAGE_SIZE + 1) * MAX_CBMSG_PAGE_NUM = 1252 */
+#define MAX_ETWS_SIZE 56
+#define MAX_CBMSG_PAGE_NUM 15
+#define MAX_SIM_SMS_NUM 255
+#define MAX_SIM_IMSI_NUM 20
+#define MAX_SIM_MSP_CNT 2
+
+#define SMS_PUSH_XML_HREF_TAG "href"
+#define SMS_PUSH_XML_SI_ID_TAG "si-id"
+#define SMS_PUSH_XML_CREATED_TAG "created"
+#define SMS_PUSH_XML_EXPIRES_TAG "si-expires"
+#define SMS_PUSH_XML_ACTION_TAG "action"
+
+#define SMS_PUSH_XML_INVAL_OBJ "invalidate-object"
+#define SMS_PUSH_XML_INVAL_SVC "invalidate-service"
+#define SMS_PUSH_XML_CO_URI "uri"
+
+
+/*==================================================================================================
+ TYPES
+==================================================================================================*/
+
+typedef unsigned char SMS_3GPP_TPDU_TYPE_T; /* _SMS_3GPP_TPDU_TYPE_E */
+
+typedef unsigned char SMS_3GPP_VPF_T; /* _SMS_3GPP_VPF_E */
+
+typedef unsigned char SMS_3GPP_TON_T; /* _SMS_3GPP_TON_E */
+
+typedef unsigned char SMS_3GPP_NPI_T; /* _SMS_3GPP_NPI_E */
+
+typedef unsigned char SMS_3GPP_PID_T; /* _SMS_3GPP_PID_E */
+
+typedef unsigned char SMS_3GPP_MSG_CLASS_T; /* _SMS_3GPP_MSG_CLASS_E */
+
+typedef unsigned char SMS_3GPP_CODING_SCHEME_T; /* _SMS_3GPP_CODING_SCHEME_E */
+
+typedef unsigned char SMS_3GPP_CODING_GROUP_T; /* _SMS_3GPP_CODING_GROUP_E */
+
+typedef unsigned char SMS_3GPP_INDICATOR_TYPE_T; /* _SMS_3GPP_INDICATOR_TYPE_E */
+
+typedef unsigned char SMS_3GPP_TIME_FORMAT_T; /* _SMS_3GPP_TIME_FORMAT_E */
+
+typedef unsigned char SMS_3GPP_FAIL_CAUSE_T; /* _SMS_3GPP_FAIL_CAUSE_E */
+
+typedef unsigned char SMS_3GPP_STATUS_T; /* _SMS_3GPP_STATUS_E */
+
+typedef unsigned char SMS_3GPP_REF_NUMBER_T; /* _SMS_3GPP_REF_NUMBER_E */
+
+typedef unsigned char SMS_3GPP_REPORT_TYPE_T; /* _SMS_3GPP_REPORT_TYPE_E */
+
+typedef unsigned char SMS_3GPP_UDH_TYPE_T; /* _SMS_3GPP_UDH_TYPE_E */
+
+typedef unsigned char SMS_3GPP_CB_NETWORK_TYPE_T; /* _SMS_3GPP_CB_NETWORK_TYPE_E */
+
+typedef unsigned char SMS_3GPP_CBMSG_TYPE_T; /* _SMS_3GPP_CBMSG_TYPE_E */
+
+typedef unsigned char SMS_3GPP_CBMSG_LANG_TYPE_T; /* _SMS_3GPP_CBMSG_LANG_TYPE_E */
+
+typedef unsigned char SMS_3GPP_CBMSG_CODING_GROUP_T; /* _SMS_3GPP_CBMSG_CODING_GROUP_E */
+
+typedef unsigned char SMS_3GPP_SAT_CMD_TYPE_T; /* _SMS_3GPP_SAT_CMD_TYPE_E */
+
+typedef unsigned short SMS_3GPP_SIM_EFILE_NAME_T; /* _SMS_3GPP_SIM_EFILE_NAME_E */
+
+typedef unsigned char SMS_3GPP_SIM_MAILBOX_TYPE_T; /* _SMS_3GPP_SIM_MAILBOX_TYPE_E */
+
+/*==================================================================================================
+ ENUMS
+==================================================================================================*/
+enum _SMS_3GPP_TPDU_TYPE_E {
+ SMS_TPDU_SUBMIT,
+ SMS_TPDU_DELIVER,
+ SMS_TPDU_DELIVER_REP,
+ SMS_TPDU_STATUS_REP,
+};
+
+
+enum _SMS_3GPP_VPF_E {
+ SMS_VPF_NOT_PRESENT = 0,
+ SMS_VPF_ENHANCED,
+ SMS_VPF_RELATIVE,
+ SMS_VPF_ABSOLUTE,
+};
+
+
+enum _SMS_3GPP_TON_E
+{
+ SMS_TON_UNKNOWN = 0, /* unknown */
+ SMS_TON_INTERNATIONAL, /* international */
+ SMS_TON_NATIONAL, /* national */
+ SMS_TON_NETWORK, /* network */
+ SMS_TON_SUBSCRIBER, /* subscriber */
+ SMS_TON_ALPHANUMERIC, /* alpha numberic */
+ SMS_TON_ABBREVIATED, /* abbreviated */
+ SMS_TON_RESERVE, /* reserve */
+};
+
+
+enum _SMS_3GPP_NPI_E {
+ SMS_3GPP_NPI_UNKNOWN = 0, /* unknown */
+ SMS_3GPP_NPI_ISDN = 1, /* idsn */
+ SMS_3GPP_NPI_DATA = 3, /* data */
+ SMS_3GPP_NPI_TELEX = 4, /* telex */
+ SMS_3GPP_NPI_SMSC = 5, /* smsc */
+ SMS_3GPP_NPI_NATIONAL = 8, /* national */
+ SMS_3GPP_NPI_PRIVATE = 9, /* private */
+ SMS_3GPP_NPI_ERMES = 10, /* ermes */
+};
+
+
+enum _SMS_3GPP_PID_E {
+ SMS_PID_NORMAL = 0x00,
+
+ SMS_PID_TELEX = 0x21,
+ SMS_PID_GROUP3_TELEX = 0x22,
+ SMS_PID_GROUP4_TELEX = 0x23,
+ SMS_PID_VOICE = 0x24,
+ SMS_PID_ERMES = 0x25,
+ SMS_PID_NPS = 0x26,
+ SMS_PID_VIDEO = 0x27,
+ SMS_PID_TELETEX_UNSPEC = 0x28,
+ SMS_PID_TELETEX_PSPDN = 0x29,
+ SMS_PID_TELETEX_CSPDN = 0x2A,
+ SMS_PID_TELETEX_PSTN = 0x2B,
+ SMS_PID_TELETEX_ISDN = 0x2C,
+ SMS_PID_UCI = 0x2D,
+ SMS_PID_x400 = 0x31,
+ SMS_PID_EMAIL = 0x32,
+
+ SMS_PID_TYPE0 = 0x40,
+ SMS_PID_REPLACE_TYPE1 = 0x41,
+ SMS_PID_REPLACE_TYPE2 = 0x42,
+ SMS_PID_REPLACE_TYPE3 = 0x43,
+ SMS_PID_REPLACE_TYPE4 = 0x44,
+ SMS_PID_REPLACE_TYPE5 = 0x45,
+ SMS_PID_REPLACE_TYPE6 = 0x46,
+ SMS_PID_REPLACE_TYPE7 = 0x47,
+
+ SMS_PID_RETURN_CALL = 0x5F,
+};
+
+
+enum _SMS_3GPP_MSG_CLASS_E {
+ SMS_MSG_CLASS_0 = 0,
+ SMS_MSG_CLASS_1,
+ SMS_MSG_CLASS_2,
+ SMS_MSG_CLASS_3,
+ SMS_MSG_CLASS_NONE,
+};
+
+
+enum _SMS_3GPP_CODING_SCHEME_E {
+ SMS_CHARSET_7BIT = 0,
+ SMS_CHARSET_8BIT,
+ SMS_CHARSET_UCS2,
+ SMS_CHARSET_AUTO,
+ SMS_CHARSET_EUCKR,
+};
+
+
+enum _SMS_3GPP_CODING_GROUP_E {
+ SMS_GROUP_GENERAL = 0,
+ SMS_GROUP_CODING_CLASS,
+ SMS_GROUP_DELETION,
+ SMS_GROUP_DISCARD,
+ SMS_GROUP_STORE,
+ SMS_GROUP_UNKNOWN,
+};
+
+
+enum _SMS_3GPP_INDICATOR_TYPE_E {
+ SMS_VOICE_INDICATOR = 0,
+ SMS_VOICE2_INDICATOR, /* Only for CPSH */
+ SMS_FAX_INDICATOR,
+ SMS_EMAIL_INDICATOR,
+ SMS_OTHER_INDICATOR,
+};
+
+
+enum _SMS_3GPP_TIME_FORMAT_E {
+ SMS_3GPP_TIME_RELATIVE = 0,
+ SMS_3GPP_TIME_ABSOLUTE
+};
+
+
+enum _SMS_3GPP_FAIL_CAUSE_E {
+ SMS_FC_MSG_TYPE0_NOT_SUPPORTED = 0x81,
+ SMS_FC_SM_CANNOT_BE_REPLACED = 0x82,
+ SMS_FC_UNSPEC_PID_ERROR = 0x8F,
+ SMS_FC_MSG_CLASS_NOT_SUPPORTED = 0x91,
+ SMS_FC_UNSPEC_DCS_ERROR = 0x9F,
+ SMS_FC_TPDU_NOT_SUPPORTED = 0xB0,
+ SMS_FC_SIM_STORAGE_FULL = 0xD0,
+ SMS_FC_NO_STORAGE_IN_SIM = 0xD1,
+ SMS_FC_ERROR_IN_MS = 0xD2,
+ SMS_FC_MSG_CAPA_EXCEEDED = 0xD3,
+ SMS_FC_SAT_BUSY = 0xD4,
+ SMS_FC_SIM_DOWNLOAD_ERROR = 0xD5,
+ SMS_FC_UNSPEC_ERROR = 0xFF,
+};
+
+
+enum _SMS_3GPP_STATUS_E {
+ SMS_STATUS_RECEIVE_SUCCESS = 0x00,
+ SMS_STATUS_UNABLE_TO_CONFIRM_DELIVER = 0x01,
+ SMS_STATUS_REPLACED = 0x02,
+ SMS_STATUS_SMSC_SPECIFIC_LAST = 0x1F,
+
+ SMS_STATUS_TRY_CONGESTION = 0x20,
+ SMS_STATUS_TRY_SME_BUSY = 0x21,
+ SMS_STATUS_TRY_NO_RESPONSE = 0x22,
+ SMS_STATUS_TRY_SERVICE_REJECTED = 0x23,
+ SMS_STATUS_TRY_QOS_NOT_AVAILABLE = 0x24,
+ SMS_STATUS_TRY_REQUEST_PENDING = 0x30,
+
+ SMS_STATUS_PERM_REMOTE_ERROR = 0x40,
+ SMS_STATUS_PERM_IMCOMPATIBLE_DEST = 0x41,
+ SMS_STATUS_PERM_CONNECTION_REJECTED = 0x42,
+ SMS_STATUS_PERM_NOT_OBTAINABLE = 0x43,
+ SMS_STATUS_PERM_QOS_NOT_AVAILABLE = 0x44,
+ SMS_STATUS_PERM_NO_INTERWORK_AVAILABLE = 0x45,
+ SMS_STATUS_PERM_MSG_VAL_PERIOD_EXPIRED = 0x46,
+ SMS_STATUS_PERM_MSG_DEL_BY_ORIGIN_SME = 0x47,
+ SMS_STATUS_PERM_MSG_DEL_BY_SMSC_ADMIN = 0x48,
+ SMS_STATUS_PERM_MSG_NOT_EXIST = 0x49,
+
+ SMS_STATUS_TEMP_CONGESTION = 0x60,
+ SMS_STATUS_TEMP_SME_BUSY = 0x61,
+ SMS_STATUS_TEMP_NO_RESPONSE = 0x62,
+ SMS_STATUS_TEMP_SERVICE_REJECTED = 0x63,
+ SMS_STATUS_TEMP_QOS_NOT_AVAILABLE = 0x64,
+ SMS_STATUS_TEMP_ERROR_IN_SME = 0x65,
+};
+
+
+enum _SMS_3GPP_REF_NUMBER_E {
+ SMS_REF_NUM_8BIT = 0,
+ SMS_REF_NUM_16BIT
+};
+
+
+enum _SMS_3GPP_REPORT_TYPE_E {
+ SMS_REPORT_POSITIVE = 0,
+ SMS_REPORT_NEGATIVE
+};
+
+
+enum _SMS_3GPP_UDH_TYPE_E {
+ SMS_UDH_CONCAT_8BIT = 0x00,
+ SMS_UDH_SPECIAL_SMS = 0x01,
+ /* 0x02, 0x03 - Reserved */
+ SMS_UDH_APP_PORT_8BIT = 0x04,
+ SMS_UDH_APP_PORT_16BIT = 0x05,
+ SMS_UDH_SC_CONTROL = 0x06,
+ SMS_UDH_SRC_IND = 0x07,
+ SMS_UDH_CONCAT_16BIT = 0x08,
+ SMS_UDH_WCMP = 0x09,
+ SMS_UDH_EMS_FIRST = 0x0a,
+ SMS_UDH_EMS_LAST = 0x1f,
+ SMS_UDH_ALTERNATE_REPLY_ADDRESS = 0x22,
+ SMS_UDH_SINGLE_SHIFT = 0x24,
+ SMS_UDH_LOCKING_SHIFT = 0x25,
+ SMS_UDH_NONE = 0xFF,
+};
+
+
+enum _SMS_3GPP_CB_NETWORK_TYPE_E {
+ SMS_CB_NETWORK_TYPE_2G_GSM = 1,
+ SMS_CB_NETWORK_TYPE_3G_UMTS,
+};
+
+
+enum _SMS_3GPP_CBMSG_TYPE_E {
+ SMS_CBMSG_TYPE_CBS = 1, /**< CBS */
+ SMS_CBMSG_TYPE_SCHEDULE, /**< Schedule */
+ SMS_CBMSG_TYPE_CBS41, /**< CBS41 */
+ SMS_CBMSG_TYPE_JAVACBS, /**< JAVA-CB Message*/
+ SMS_CBMSG_TYPE_ETWS,
+};
+
+
+enum _SMS_3GPP_CBMSG_LANG_TYPE_E {
+ SMS_CBMSG_LANG_GERMAN = 0x00,
+ SMS_CBMSG_LANG_ENGLISH = 0x01,
+ SMS_CBMSG_LANG_ITALIAN = 0x02,
+ SMS_CBMSG_LANG_FRENCH = 0x03,
+ SMS_CBMSG_LANG_SPANISH = 0x04,
+ SMS_CBMSG_LANG_DUTCH = 0x05,
+ SMS_CBMSG_LANG_SWEDISH = 0x06,
+ SMS_CBMSG_LANG_DANISH = 0x07,
+ SMS_CBMSG_LANG_PORTUGUESE = 0x08,
+ SMS_CBMSG_LANG_FINNISH = 0x09,
+ SMS_CBMSG_LANG_NORWEGIAN = 0x0a,
+ SMS_CBMSG_LANG_GREEK = 0x0b,
+ SMS_CBMSG_LANG_TURKISH = 0x0c,
+ SMS_CBMSG_LANG_HUNGARIAN = 0x0d,
+ SMS_CBMSG_LANG_POLISH = 0x0e,
+ SMS_CBMSG_LANG_UNSPECIFIED = 0x0f,
+
+ SMS_CBMSG_LANG_ISO639 = 0x10,
+
+ SMS_CBMSG_LANG_CZECH = 0x20,
+ SMS_CBMSG_LANG_HEBREW = 0x21,
+ SMS_CBMSG_LANG_ARABIC = 0x22,
+ SMS_CBMSG_LANG_RUSSIAN = 0x23,
+ SMS_CBMSG_LANG_ICELANDIC = 0x24,
+ SMS_CBMSG_LANG_RESERVED_25 = 0x25,
+ SMS_CBMSG_LANG_RESERVED_26 = 0x26,
+ SMS_CBMSG_LANG_RESERVED_27 = 0x27,
+ SMS_CBMSG_LANG_RESERVED_28 = 0x28,
+ SMS_CBMSG_LANG_RESERVED_29 = 0x29,
+ SMS_CBMSG_LANG_RESERVED_2A = 0x2a,
+ SMS_CBMSG_LANG_RESERVED_2B = 0x2b,
+ SMS_CBMSG_LANG_RESERVED_2C = 0x2c,
+ SMS_CBMSG_LANG_RESERVED_2D = 0x2d,
+ SMS_CBMSG_LANG_RESERVED_2E = 0x2e,
+ SMS_CBMSG_LANG_RESERVED_2F = 0x2f,
+
+ SMS_CBMSG_LANG_DUMMY = 0xFF
+};
+
+
+enum _SMS_3GPP_CBMSG_CODING_GROUP_E {
+ SMS_CBMSG_CODGRP_GENERAL_DCS, /**< Bits 7..4 00xx */
+ SMS_CBMSG_CODGRP_WAP, /**< 1110 Cell Broadcast */
+ SMS_CBMSG_CODGRP_CLASS_CODING, /**< 1111 Cell Broadcast */
+};
+
+
+enum _SMS_3GPP_SAT_CMD_TYPE_E {
+ SMS_SAT_CMD_REFRESH,
+ SMS_SAT_CMD_SEND_SMS,
+ SMS_SAT_CMD_SMS_CTRL,
+};
+
+
+enum _SMS_3GPP_SIM_EFILE_NAME_E {
+ SMS_SIM_EFILE_USIM_SMS = 0x6A3C, /** < USIM Short Messages file */
+ SMS_SIM_EFILE_USIM_SMSP = 0x6A42, /** < USIM SMS parameter */
+ SMS_SIM_EFILE_USIM_SMSS = 0x6A43, /** < USIM SMS status */
+ SMS_SIM_EFILE_USIM_CBMI = 0x6A45, /** < USIM Cell Broadcast Message Identifier */
+ SMS_SIM_EFILE_USIM_MBDN = 0x6FC7, /** < USIM Mail Box Dialing Number */
+ SMS_SIM_EFILE_SMS = 0x6F3C, /** < Short Messages file */
+ SMS_SIM_EFILE_SMSP = 0x6F42, /** < SMS Parameter */
+ SMS_SIM_EFILE_SMSS = 0x6F43, /** < SMS Status */
+ SMS_SIM_EFILE_CBMI = 0x6F45, /** < Cell Broadcast Message Identifier */
+ SMS_SIM_EFILE_MBDN = 0x6FC7, /** < Mail Box Dialing Number */
+};
+
+
+enum _SMS_3GPP_SIM_MAILBOX_TYPE_E {
+ SMS_SIM_MAILBOX_VOICE = 0x01,
+ SMS_SIM_MAILBOX_VOICE2 = 0x02,
+ SMS_SIM_MAILBOX_FAX = 0x03,
+ SMS_SIM_MAILBOX_DATA = 0x04,
+ SMS_SIM_MAILBOX_EMAIL = 0x05,
+ SMS_SIM_MAILBOX_OTHER = 0x06,
+};
+
+
+/*==================================================================================================
+ STRUCTURES
+==================================================================================================*/
+typedef struct _SMS_3GPP_ADDRESS_S {
+ SMS_3GPP_TON_T ton;
+ SMS_3GPP_NPI_T npi;
+ char address[MAX_ADDRESS_LEN+1]; /* < null terminated string */
+} SMS_3GPP_ADDRESS_S;
+
+
+typedef struct _SMS_3GPP_DCS_S {
+ bool bCompressed;
+ bool bMWI;
+ bool bIndActive;
+ SMS_3GPP_MSG_CLASS_T msgClass;
+ SMS_3GPP_CODING_SCHEME_T codingScheme;
+ SMS_3GPP_CODING_GROUP_T codingGroup;
+ SMS_3GPP_INDICATOR_TYPE_T indType;
+} SMS_3GPP_DCS_S;
+
+
+typedef struct _SMS_TIME_REL_S {
+ unsigned char time;
+} SMS_3GPP_TIME_REL_S;
+
+
+typedef struct _SMS_TIME_ABS_S {
+ unsigned char year;
+ unsigned char month;
+ unsigned char day;
+ unsigned char hour;
+ unsigned char minute;
+ unsigned char second;
+ int timeZone;
+} SMS_3GPP_TIME_ABS_S;
+
+
+typedef struct _SMS_TIMESTAMP_S {
+ SMS_3GPP_TIME_FORMAT_T format;
+
+ union {
+ SMS_3GPP_TIME_REL_S relative;
+ SMS_3GPP_TIME_ABS_S absolute;
+ } time;
+} SMS_3GPP_TIMESTAMP_S;
+
+
+typedef struct _SMS_CONCAT_8BIT_S {
+ unsigned char msgRef;
+ unsigned char totalSeg;
+ unsigned char seqNum;
+} SMS_3GPP_CONCAT_8BIT_S;
+
+
+typedef struct _SMS_CONCAT_16BIT_S {
+ unsigned short msgRef;
+ unsigned char totalSeg;
+ unsigned char seqNum;
+} SMS_3GPP_CONCAT_16BIT_S;
+
+
+typedef struct _SMS_APP_PORT_8BIT_S {
+ unsigned char destPort;
+ unsigned char originPort;
+} SMS_3GPP_APP_PORT_8BIT_S;
+
+
+typedef struct _SMS_APP_PORT_16BIT_S {
+ unsigned short destPort;
+ unsigned short originPort;
+} SMS_3GPP_APP_PORT_16BIT_S;
+
+
+typedef struct _SMS_SPECIAL_INDICATION_S {
+ bool bStore;
+ unsigned short msgInd;
+ unsigned short waitMsgNum;
+} SMS_3GPP_SPECIAL_INDICATION_S;
+
+
+typedef struct _SMS_UDH_S {
+ SMS_3GPP_UDH_TYPE_T udhType;
+
+ union {
+ SMS_3GPP_CONCAT_8BIT_S concat8bit;
+ SMS_3GPP_CONCAT_16BIT_S concat16bit;
+ SMS_3GPP_APP_PORT_8BIT_S appPort8bit;
+ SMS_3GPP_APP_PORT_16BIT_S appPort16bit;
+ SMS_3GPP_SPECIAL_INDICATION_S specialInd;
+ MSG_SINGLE_SHIFT_S singleShift;
+ MSG_LOCKING_SHIFT_S lockingShift;
+ SMS_3GPP_ADDRESS_S alternateAddress;
+ } udh;
+} SMS_3GPP_UDH_S;
+
+
+typedef struct _SMS_USERDATA_S {
+ int headerCnt;
+ SMS_3GPP_UDH_S header[MAX_UD_HEADER_NUM];
+ int length;
+ char data[MAX_USER_DATA_LEN+1];
+} SMS_3GPP_USERDATA_S;
+
+
+typedef struct _SMS_TPUD_S {
+ int udl;
+ char ud[MAX_USER_DATA_LEN+1];
+} SMS_3GPP_TPUD_S;
+
+
+typedef struct _SMS_SUBMIT_S {
+ bool bRejectDup;
+ bool bStatusReport;
+ bool bHeaderInd;
+ bool bReplyPath;
+ unsigned char msgRef;
+ SMS_3GPP_VPF_T vpf;
+ SMS_3GPP_ADDRESS_S destAddress;
+ SMS_3GPP_PID_T pid;
+ SMS_3GPP_DCS_S dcs;
+ SMS_3GPP_TIMESTAMP_S validityPeriod;
+ SMS_3GPP_USERDATA_S userData;
+} SMS_3GPP_SUBMIT_S;
+
+
+typedef struct _SMS_SUBMIT_DATA_S {
+ SMS_3GPP_ADDRESS_S destAddress;
+ unsigned int segCount;
+ SMS_3GPP_USERDATA_S userData[MAX_SEGMENT_NUM];
+} SMS_3GPP_SUBMIT_DATA_S;
+
+
+typedef struct _SMS_DELIVER_S {
+ bool bMoreMsg;
+ bool bStatusReport;
+ bool bHeaderInd;
+ bool bReplyPath;
+ SMS_3GPP_ADDRESS_S originAddress;
+ SMS_3GPP_PID_T pid;
+ SMS_3GPP_DCS_S dcs;
+ SMS_3GPP_TIMESTAMP_S timeStamp;
+ SMS_3GPP_USERDATA_S userData;
+ SMS_3GPP_TPUD_S udData;
+} SMS_3GPP_DELIVER_S;
+
+
+typedef struct _SMS_DELIVER_REPORT_S {
+ SMS_3GPP_REPORT_TYPE_T reportType;
+ bool bHeaderInd;
+ SMS_3GPP_FAIL_CAUSE_T failCause;
+ unsigned char paramInd;
+ SMS_3GPP_PID_T pid;
+ SMS_3GPP_DCS_S dcs;
+ SMS_3GPP_USERDATA_S userData;
+} SMS_3GPP_DELIVER_REPORT_S;
+
+
+typedef struct _SMS_STATUS_REPORT_S {
+ bool bMoreMsg;
+ bool bStatusReport;
+ bool bHeaderInd;
+ unsigned char msgRef;
+ SMS_3GPP_ADDRESS_S recipAddress;
+ SMS_3GPP_TIMESTAMP_S timeStamp;
+ SMS_3GPP_TIMESTAMP_S dischargeTime;
+ SMS_3GPP_STATUS_T status;
+ unsigned char paramInd;
+ SMS_3GPP_PID_T pid;
+ SMS_3GPP_DCS_S dcs;
+ SMS_3GPP_USERDATA_S userData;
+} SMS_3GPP_STATUS_REPORT_S;
+
+
+typedef struct _SMS_TPDU_S {
+ SMS_3GPP_TPDU_TYPE_T tpduType;
+
+ union {
+ SMS_3GPP_SUBMIT_S submit;
+ SMS_3GPP_DELIVER_S deliver;
+ SMS_3GPP_DELIVER_REPORT_S deliverRep;
+ SMS_3GPP_STATUS_REPORT_S statusRep;
+ } data;
+} SMS_3GPP_TPDU_S;
+
+
+typedef struct {
+ msg_request_id_t reqId; /**< Indicates the request ID, which is unique. When applications submit a request to the framework, this value will be set by the framework. */
+ MSG_MESSAGE_INFO_S msgInfo; /**< Indicates the message structure to be sent by applications. */
+ MSG_SENDINGOPT_INFO_S sendOptInfo;
+} SMS_3GPP_REQUEST_INFO_S;
+
+
+typedef struct _SMS_SENT_INFO_S {
+ SMS_3GPP_REQUEST_INFO_S reqInfo; /**< Indicates the corresponding request structure. */
+ bool bLast;
+} SMS_3GPP_SENT_INFO_S;
+
+
+typedef struct _SMS_PUSH_APP_INFO_S {
+ char* pContentType;
+ char* pAppId;
+ SMS_WAP_APP_CODE_T appCode;
+} SMS_3GPP_PUSH_APP_INFO_S;
+
+
+typedef struct _SMS_CBMSG_SERIAL_NUM_S {
+ unsigned char geoScope;
+ unsigned char updateNum;
+ unsigned short msgCode;
+} SMS_3GPP_CBMSG_SERIAL_NUM_S;
+
+
+typedef struct _SMS_CBMSG_DCS_S {
+ SMS_3GPP_CBMSG_CODING_GROUP_T codingGroup; /**< Coding group, GSM 03.38 */
+ SMS_3GPP_MSG_CLASS_T classType; /**< The message class */
+ bool bCompressed; /**< if text is compressed this is TRUE */
+ SMS_3GPP_CODING_SCHEME_T codingScheme; /**< How to encode a message. */
+ SMS_3GPP_CBMSG_LANG_TYPE_T langType;
+ unsigned char iso639Lang[3]; /* 2 GSM chars and a CR char */
+ bool bUDH;
+ unsigned char rawData;
+} SMS_3GPP_CBMSG_DCS_S;
+
+
+typedef struct _SMS_CBMSG_HEADER_S {
+ SMS_3GPP_CBMSG_SERIAL_NUM_S serialNum; /**< Cell Broadcast Serial number */
+ unsigned short msgId; /**< Message identifier code */
+ MSG_CB_LANGUAGE_TYPE_T langType; /**< Languages in CB Messages */
+ SMS_3GPP_CBMSG_DCS_S dcs; /**< Data coding scheme */
+ unsigned char page; /**< current page number */
+ unsigned char totalPages; /**< Total number of pages in this messages */
+ time_t recvTime; /**< Msg Recv Time */
+} SMS_3GPP_CBMSG_HEADER_S;
+
+
+typedef struct _SMS_CBMSG_PAGE_S {
+ SMS_3GPP_CBMSG_TYPE_T cbMsgType; /*CBS Msg or SCHEDULE Msg or CBS41 Msg */
+ SMS_3GPP_CBMSG_HEADER_S pageHeader; /**< CB Message Header */
+ int pageLength; /**< message string length */
+ char pageData[MAX_CBMSG_TOTAL_PAGE_SIZE * 8 / 7 + 1]; /**< user data */
+} SMS_3GPP_CBMSG_PAGE_S;
+
+
+typedef struct _SMS_CBMSG_S {
+ SMS_3GPP_CBMSG_TYPE_T cbMsgType; /*CBS Msg or SCHEDULE Msg or CBS41 Msg */
+ unsigned short msgId; /**< Message identifier code */
+ unsigned short serialNum; /* Serial number */
+ SMS_3GPP_MSG_CLASS_T classType; /**< The message class */
+ SMS_3GPP_CODING_SCHEME_T codingScheme; /**< How to encode a message. */
+ time_t recvTime; /**< Msg Recv Time */
+ int msgLength; /**< message string length */
+ char msgData[MAX_CBMSG_TOTAL_PAGE_SIZE * 8 / 7 + 1]; /**< user data */
+} SMS_3GPP_CBMSG_S;
+
+typedef struct _SMS_ETWS_PRIMARY_S {
+ time_t recvTime;
+ SMS_3GPP_CBMSG_SERIAL_NUM_S serialNum;
+ unsigned short msgId;
+ unsigned short warningType;
+ unsigned char warningSecurityInfo[MAX_ETWS_SIZE-6];
+} SMS_3GPP_ETWS_PRIMARY_S;
+
+
+typedef struct _SMS_WSP_CONTENTS_TYPE_S {
+ char* contentsTypeName;
+ unsigned char contentsTypeCode;
+} SMS_3GPP_WSP_CONTENTS_TYPE_S;
+
+
+typedef struct _SMS_WSP_CHARSET_S {
+ char* charsetName;
+ unsigned short charsetCode;
+} SMS_3GPP_WSP_CHARSET_S;
+
+
+typedef struct _SMS_WAP_UNREGISTER_CONTENTS_TYPE_S {
+ char* contentsTypeName;
+ unsigned short contentsTypeCode;
+} SMS_3GPP_WAP_UNREGISTER_CONTENTS_TYPE_S;
+
+
+typedef struct _SMS_WSP_LANGUAGE_S {
+ char* languageName;
+ unsigned char languageCode;
+} SMS_3GPP_WSP_LANGUAGE_S;
+
+
+typedef struct _SMS_WSP_HEADER_PARAMETER_S {
+ char* parameterToken;
+ unsigned int parameterCode;
+} SMS_3GPP_WSP_HEADER_PARAMETER_S;
+
+
+typedef struct _SMS_WSP_METHOD_TYPE_S {
+ char* methodName;
+ unsigned char methodCode;
+} SMS_3GPP_WSP_METHOD_TYPE_S;
+
+
+typedef struct _SMS_WSP_SECURITY_TYPE_S {
+ char* SecurityTypeName;
+ unsigned char SecurityTypeCode;
+} SMS_3GPP_WSP_SECURITY_TYPE_S;
+
+
+/**
+ * @brief Represents SIM count information.
+ */
+typedef struct {
+ unsigned int totalCount; /**< The total number of SIM */
+ int usedCount; /**< The used number of SIM */
+ int indexList[MAX_SIM_SMS_NUM]; /**< The SIM index list */
+} MSG_3GPP_SIM_COUNT_S;
+
+
+/**
+ * @brief Represents Concat SIM Msg information.
+ */
+typedef struct {
+ unsigned int simIdCnt; /**< The total number of SIM Msg ID*/
+ msg_sim_id_t simIdList[MAX_SEGMENT_NUM]; /**< The SIM Msg ID List */
+ char msgData[(MAX_MSG_DATA_LEN*MAX_SEGMENT_NUM)+1]; /**< user data */
+} SMS_3GPP_CONCAT_SIM_MSG_S;
+
+
+/**
+ * @brief Represents Sim Mailbox information
+ */
+typedef struct {
+ int b_cphs;
+ int rec_index; /**< index which stands for the location where record is saved in SIM*/
+ int profile_num; /**< SIM profile index*/
+ SMS_3GPP_SIM_MAILBOX_TYPE_T mb_type;
+ int alpha_id_max_len; /**< alpha max length in SIM - READ ONLY*/
+ char alpha_id[MAX_SIM_XDN_ALPHA_ID_LEN + 1]; /**< Alpha Identifier */
+ MSG_SMS_TON_T ton; /**< Type Of Number */
+ MSG_SMS_NPI_T npi; /**< Number Plan Identity */
+ char num[MAX_PHONE_NUMBER_LEN + 1]; /**< Dialing Number/SSC String */
+ unsigned char cc_id; /**< Capability/Configuration Identifier */
+ unsigned char ext1_id; /**< Extensiion1 Record Identifier */
+ int num_len; /**< Length of the original number read from SIM*/
+} SMS_3GPP_SIM_MAILBOX_INFO_S;
+
+
+/**
+ * @brief Represents Sim Mailbox list
+ */
+typedef struct {
+ int count;
+ SMS_3GPP_SIM_MAILBOX_INFO_S list[MAX_SIM_MSP_CNT*5]; /* max is 10 */
+} SMS_3GPP_SIM_MAILBOX_LIST_S;
+
+
+/**
+ * @brief Represents Message Waiting Indication
+ */
+typedef struct {
+ int rec_index;
+ unsigned char indicator_status; /**< Indicator Type*/
+ int voice_count; /**< VoiceMail Count*/
+ int fax_count; /**< FAX Count*/
+ int email_count; /**< Email Count*/
+ int other_count; /**< Other Count*/
+ int video_count; /**< VideoMail Count*/
+} SMS_3GPP_SIM_MWI_NORMAL_INFO_S;
+
+
+/**
+ * @brief Represents Message Waiting Indication list
+ */
+typedef struct {
+ int profile_count;
+ SMS_3GPP_SIM_MWI_NORMAL_INFO_S mw_info[MAX_SIM_MSP_CNT];
+} SMS_3GPP_SIM_MWI_LIST_S;
+
+
+/**
+ * @brief Represents Message Waiting Indication for CPHS
+ */
+typedef struct {
+ int b_voice1; /**< VoiceMsgLine1 message waiting flag */
+ int b_voice2; /**< VoiceMsgLine2 message waiting flag */
+ int b_fax; /**< FAX message waiting flag */
+ int b_data; /**< Data message waiting flag */
+} SMS_3GPP_SIM_MWI_CPHS_INFO_S;
+
+
+/**
+ * @brief Represents Message Waiting Indication Information
+ */
+typedef struct {
+ int b_cphs;
+ SMS_3GPP_SIM_MWI_LIST_S mwi_list;
+ SMS_3GPP_SIM_MWI_CPHS_INFO_S cphs_mwi;
+} SMS_3GPP_SIM_MWI_INFO_S;
+
+/**
+ * @brief Represents SIM MSISDN Information
+ */
+typedef struct {
+ char simMsisdn[MAX_SIM_MSISDN_LEN + 1];
+ int sim_index;
+} SMS_3GPP_SIM_MSISDN_INFO_S;
+
+
+/**
+ * @brief Represents Message Data Information from Telephony.
+ */
+typedef struct {
+ unsigned char sca[MAX_ADDRESS_LEN]; /**< Service Center address */
+ int msgLength; /**< Size of array szData (which is actual TPDU message) */
+ unsigned char szData[MAX_TPDU_DATA_LEN + 1]; /**< SMS TPDU message */
+ int totalSegment; /** total segment count of TPDU message */
+} SMS_3GPP_DATA_INFO_S;
+
+
+#endif /* SMS_3GPP_TYPES_H */
* limitations under the License.
*/
-#ifndef SMS_PLUGIN_UA_MANAGER_H
-#define SMS_PLUGIN_UA_MANAGER_H
+#ifndef SMS_3GPP_UA_MANAGER_H
+#define SMS_3GPP_UA_MANAGER_H
/*==================================================================================================
#include "MsgMutex.h"
#include "MsgQueue.h"
#include "MsgThread.h"
-#include "SmsPluginTypes.h"
+#include "Sms3gppTypes.h"
/*==================================================================================================
CLASS DEFINITIONS
==================================================================================================*/
-class SmsPluginUAManager : public MsgThread
+class Sms3gppUAManager : public MsgThread
{
public:
- static SmsPluginUAManager* instance();
+ static Sms3gppUAManager* instance();
/* virtual void start(); */
- void addReqEntity(SMS_REQUEST_INFO_S *request);
+ void addReqEntity(SMS_3GPP_REQUEST_INFO_S *request);
private:
- SmsPluginUAManager();
- ~SmsPluginUAManager();
- void lock() { mx.lock(); };
+ Sms3gppUAManager();
+ ~Sms3gppUAManager();
+ void lock() { mx.lock(); };
void unlock() { mx.unlock(); };
void wait() { cv.wait(mx.pMsgMutex()); };
void signal() { cv.signal(); };
virtual void run();
- static SmsPluginUAManager* pInstance;
+ static Sms3gppUAManager* pInstance;
- MsgSimpleQ <SMS_REQUEST_INFO_S> smsTranQ;
+ MsgSimpleQ <SMS_3GPP_REQUEST_INFO_S> smsTranQ;
MsgMutex mx;
MsgCndVar cv;
};
-#endif /* SMS_PLUGIN_UA_MANAGER_H */
-
+#endif /* SMS_3GPP_UA_MANAGER_H */
* limitations under the License.
*/
-#ifndef SMS_PLUGIN_UDCODEC_H
-#define SMS_PLUGIN_UDCODEC_H
+#ifndef SMS_3GPP_UD_CODEC_H
+#define SMS_3GPP_UD_CODEC_H
/*==================================================================================================
INCLUDE FILES
==================================================================================================*/
-#include "SmsPluginTypes.h"
+#include "Sms3gppTypes.h"
/*==================================================================================================
CLASS DEFINITIONS
==================================================================================================*/
-class SmsPluginUDCodec
+class Sms3gppUDCodec
{
public:
- SmsPluginUDCodec();
- virtual ~SmsPluginUDCodec();
+ Sms3gppUDCodec();
+ virtual ~Sms3gppUDCodec();
- static int encodeUserData(const SMS_USERDATA_S *pUserData, SMS_CODING_SCHEME_T CodingScheme, char *pEncodeData);
- static int decodeUserData(const unsigned char *pTpdu, const int tpduLen, bool bHeaderInd, SMS_CODING_SCHEME_T CodingScheme, SMS_USERDATA_S *pUserData);
- static int decodeUserData(const unsigned char *pTpdu, const int tpduLen, bool bHeaderInd, SMS_CODING_SCHEME_T CodingScheme, SMS_USERDATA_S *pUserData, SMS_TPUD_S *pTPUD);
+ static int encodeUserData(const SMS_3GPP_USERDATA_S *pUserData, SMS_3GPP_CODING_SCHEME_T CodingScheme, char *pEncodeData);
+ static int decodeUserData(const unsigned char *pTpdu, const int tpduLen, bool bHeaderInd, SMS_3GPP_CODING_SCHEME_T CodingScheme, SMS_3GPP_USERDATA_S *pUserData);
+ static int decodeUserData(const unsigned char *pTpdu, const int tpduLen, bool bHeaderInd, SMS_3GPP_CODING_SCHEME_T CodingScheme, SMS_3GPP_USERDATA_S *pUserData, SMS_3GPP_TPUD_S *pTPUD);
static int pack7bitChar(const unsigned char *pUserData, int dataLen, int fillBits, char *pPackData);
static int unpack7bitChar(const unsigned char *pTpdu, unsigned char dataLen, int fillBits, char *pUnpackData);
private:
- static int encodeGSMData(const SMS_USERDATA_S *pUserData, char *pEncodeData);
- static int encode8bitData(const SMS_USERDATA_S *pUserData, char *pEncodeData);
- static int encodeUCS2Data(const SMS_USERDATA_S *pUserData, char *pEncodeData);
+ static int encodeGSMData(const SMS_3GPP_USERDATA_S *pUserData, char *pEncodeData);
+ static int encode8bitData(const SMS_3GPP_USERDATA_S *pUserData, char *pEncodeData);
+ static int encodeUCS2Data(const SMS_3GPP_USERDATA_S *pUserData, char *pEncodeData);
- static int decodeGSMData(const unsigned char *pTpdu, const int tpduLen, bool bHeaderInd, SMS_USERDATA_S *pUserData, SMS_TPUD_S *pTPUD);
- static int decode8bitData(const unsigned char *pTpdu, bool bHeaderInd, SMS_USERDATA_S *pUserData, SMS_TPUD_S *pTPUD);
- static int decodeUCS2Data(const unsigned char *pTpdu, const int tpduLen, bool bHeaderInd, SMS_USERDATA_S *pUserData, SMS_TPUD_S *pTPUD);
+ static int decodeGSMData(const unsigned char *pTpdu, const int tpduLen, bool bHeaderInd, SMS_3GPP_USERDATA_S *pUserData, SMS_3GPP_TPUD_S *pTPUD);
+ static int decode8bitData(const unsigned char *pTpdu, bool bHeaderInd, SMS_3GPP_USERDATA_S *pUserData, SMS_3GPP_TPUD_S *pTPUD);
+ static int decodeUCS2Data(const unsigned char *pTpdu, const int tpduLen, bool bHeaderInd, SMS_3GPP_USERDATA_S *pUserData, SMS_3GPP_TPUD_S *pTPUD);
- static int encodeHeader(const SMS_UDH_S header, char *pEncodeHeader);
- static int decodeHeader(const unsigned char *pTpdu, SMS_UDH_S *pHeader);
+ static int encodeHeader(const SMS_3GPP_UDH_S header, char *pEncodeHeader);
+ static int decodeHeader(const unsigned char *pTpdu, SMS_3GPP_UDH_S *pHeader);
};
-#endif /* SMS_PLUGIN_UDCODEC_H */
-
+#endif /* SMS_3GPP_UD_CODEC_H */
* limitations under the License.
*/
-#ifndef SMS_PLUGIN_WAPPUSH_HANDLER_H
-#define SMS_PLUGIN_WAPPUSH_HANDLER_H
+#ifndef SMS_3GPP_WAP_PUSH_HANDLER_H
+#define SMS_3GPP_WAP_PUSH_HANDLER_H
/*==================================================================================================
#include <libxml/parser.h>
-#include "SmsPluginTypes.h"
+#include "Sms3gppTypes.h"
/*==================================================================================================
DEFINES
==================================================================================================*/
#define WSP_STANDARD_STR_LEN_MAX 255
-#define LENGTH_QUOTE 0x1F
+#define LENGTH_QUOTE 0x1F
#define NO_VALUE 0x00
#define WSP_CODE_BUFFER_LEFT_LEN_MAX 1024
/*==================================================================================================
CLASS DEFINITIONS
==================================================================================================*/
-class SmsPluginWapPushHandler
+class Sms3gppWapPushHandler
{
public:
- static SmsPluginWapPushHandler* instance();
+ static Sms3gppWapPushHandler* instance();
- bool IsWapPushMsg(SMS_USERDATA_S *pUserData);
+ bool IsWapPushMsg(SMS_3GPP_USERDATA_S *pUserData);
- void copyDeliverData(SMS_DELIVER_S *pDeliver);
+ void copyDeliverData(SMS_3GPP_DELIVER_S *pDeliver);
void handleWapPushMsg(const char *pUserData, int DataSize, int simIndex, time_t sent_time);
void handleWapPushCallback(char* pPushHeader, char* pPushBody, int PushBodyLen, char* pWspHeader, int WspHeaderLen, char* pWspBody, int WspBodyLen, int simIndex, time_t sent_time);
private:
- SmsPluginWapPushHandler();
- virtual ~SmsPluginWapPushHandler();
+ Sms3gppWapPushHandler();
+ virtual ~Sms3gppWapPushHandler();
- static SmsPluginWapPushHandler* pInstance;
+ static Sms3gppWapPushHandler* pInstance;
SMS_WAP_APP_CODE_T getAppCode(const char *pPushHeader);
bool IsWapPushMsgInWhiteList(int appCode);
void wspHeaderDecodeChallenge(unsigned long fieldValueLen, unsigned char* fieldValue, char** pDecodedString);
void wspHeaderDecodeCacheControl(unsigned char* fieldValue, unsigned long fieldValueLen, char** pCacheString);
- SMS_ADDRESS_S tmpAddress;
- SMS_TIMESTAMP_S tmpTimeStamp;
+ SMS_3GPP_ADDRESS_S tmpAddress;
+ SMS_3GPP_TIMESTAMP_S tmpTimeStamp;
};
-#endif /* SmsPluginWapPushHandler */
-
+#endif /* SMS_3GPP_WAP_PUSH_HANDLER_H */
#include "MsgDebug.h"
#include "MsgTextConvert.h"
-#include "SmsCdmaPluginParamCodec.h"
-#include "SmsCdmaPluginCodec.h"
+#include "Sms3gpp2Types.h"
+#include "Sms3gpp2ParamCodec.h"
+#include "Sms3gpp2Codec.h"
-SmsPluginMsgCodec* SmsPluginMsgCodec::pInstance = NULL;
+Sms3gpp2MsgCodec* Sms3gpp2MsgCodec::pInstance = NULL;
-
-SmsPluginMsgCodec::SmsPluginMsgCodec()
+Sms3gpp2MsgCodec::Sms3gpp2MsgCodec()
{
}
-SmsPluginMsgCodec::~SmsPluginMsgCodec()
+Sms3gpp2MsgCodec::~Sms3gpp2MsgCodec()
{
}
-SmsPluginMsgCodec* SmsPluginMsgCodec::instance()
+Sms3gpp2MsgCodec* Sms3gpp2MsgCodec::instance()
{
- if (!pInstance)
- pInstance = new SmsPluginMsgCodec();
+ if (!pInstance) {
+ pInstance = new Sms3gpp2MsgCodec();
+ }
return pInstance;
}
{
int srcIdx = 0, dstIdx = 0, shift = 0;
- if (shift > 0)
- dstIdx = 1;
-
while (srcIdx < dataLen) {
if (shift == 0) {
pPackData[dstIdx] = pUserData[srcIdx];
}
-bool SmsPluginMsgCodec::checkInvalidPDU(const unsigned char *p_pkg_str, const int p_pkg_len)
+bool Sms3gpp2MsgCodec::checkInvalidPDU(const unsigned char *p_pkg_str, const int p_pkg_len)
{
MSG_BEGIN();
int offset = 0;
}
-int SmsPluginMsgCodec::encodeMsg(const sms_trans_msg_s *p_msg, unsigned char *p_pkg_str)
+int Sms3gpp2MsgCodec::encodeMsg(const sms_3gpp2_trans_msg_s *p_msg, unsigned char *p_pkg_str)
{
MSG_BEGIN();
break;
}
-
MSG_END();
return encode_size;
}
-int SmsPluginMsgCodec::encodeP2PMsg(const sms_trans_p2p_msg_s *p_msg, unsigned char *p_pkg_str)
+int Sms3gpp2MsgCodec::encodeP2PMsg(const sms_3gpp2_trans_p2p_msg_s *p_msg, unsigned char *p_pkg_str)
{
MSG_BEGIN();
/* fixed */
/* memcpy(p_pkg_str+offset, &(p_msg->telesvc_id), sizeof(sms_trans_telesvc_id_t)); */
_copy_short_to_char(p_pkg_str+offset, &(p_msg->telesvc_id));
- offset += sizeof(sms_trans_telesvc_id_t);
+ offset += sizeof(sms_3gpp2_trans_telesvc_id_t);
/* 2. Service category */
if (p_msg->svc_ctg < SMS_TRANS_SVC_CTG_UNDEFINED) {
index = offset++;
p_pkg_str[offset++] = p_msg->address.addr_len;
- addr_len = SmsPluginParamCodec::instance()->convertDigitToDTMF(p_msg->address.szData, p_msg->address.addr_len, 0, p_pkg_str+offset);
+ addr_len = Sms3gpp2ParamCodec::instance()->convertDigitToDTMF(p_msg->address.szData, p_msg->address.addr_len, 0, p_pkg_str+offset);
for (int j=0; j < addr_len; j++) {
MSG_DEBUG("ADDRESS 4BIT DTMF [%d] = [%02x]", j, p_pkg_str[offset+j]);
}
-int SmsPluginMsgCodec::encodeCBMsg(const sms_trans_broadcast_msg_s *p_msg, unsigned char *p_pkg_str)
+int Sms3gpp2MsgCodec::encodeCBMsg(const sms_3gpp2_trans_broadcast_msg_s *p_msg, unsigned char *p_pkg_str)
{
MSG_BEGIN();
}
-int SmsPluginMsgCodec::encodeAckMsg(const sms_trans_ack_msg_s *p_msg, unsigned char *p_pkg_str)
+int Sms3gpp2MsgCodec::encodeAckMsg(const sms_3gpp2_trans_ack_msg_s *p_msg, unsigned char *p_pkg_str)
{
MSG_BEGIN();
if (p_msg->address.digit_mode == false) {
p_pkg_str[offset++] = p_msg->address.addr_len;
- addr_len = SmsPluginParamCodec::instance()->convertDigitToDTMF(p_msg->address.szData, p_msg->address.addr_len, 0, p_pkg_str+offset);
+ addr_len = Sms3gpp2ParamCodec::instance()->convertDigitToDTMF(p_msg->address.szData, p_msg->address.addr_len, 0, p_pkg_str+offset);
for (int j=0; j < addr_len; j++) {
MSG_DEBUG("ADDRESS 4BIT DTMF [%d] = [%02x]", j, p_pkg_str[offset+j]);
}
-int SmsPluginMsgCodec::encodeTelesvcMsg(const sms_telesvc_msg_s *p_msg, unsigned char *p_pkg_str)
+int Sms3gpp2MsgCodec::encodeTelesvcMsg(const sms_3gpp2_telesvc_msg_s *p_msg, unsigned char *p_pkg_str)
{
MSG_BEGIN();
int encode_size = 0;
/*
-int SmsPluginMsgCodec::encodeTelesvcDeliverMsg(const sms_telesvc_deliver_s *p_msg, char *p_pkg_str)
+int Sms3gpp2MsgCodec::encodeTelesvcDeliverMsg(const sms_3gpp2_telesvc_read_ack_s *p_msg, char *p_pkg_str)
{
}
*/
-int SmsPluginMsgCodec::encodeTelesvcReadAckMsg(const sms_telesvc_read_ack_s *p_msg, unsigned char *p_pkg_str)
+int Sms3gpp2MsgCodec::encodeTelesvcReadAckMsg(const sms_3gpp2_telesvc_read_ack_s *p_msg, unsigned char *p_pkg_str)
{
MSG_BEGIN();
}
-int SmsPluginMsgCodec::encodeTelesvcUserAckMsg(const sms_telesvc_user_ack_s *p_msg, unsigned char *p_pkg_str)
+int Sms3gpp2MsgCodec::encodeTelesvcUserAckMsg(const sms_3gpp2_telesvc_user_ack_s *p_msg, unsigned char *p_pkg_str)
{
MSG_BEGIN();
}
-int SmsPluginMsgCodec::encodeTelesvcDeliverReportMsg(const sms_telesvc_report_s *p_msg, unsigned char *p_pkg_str)
+int Sms3gpp2MsgCodec::encodeTelesvcDeliverReportMsg(const sms_3gpp2_telesvc_report_s *p_msg, unsigned char *p_pkg_str)
{
MSG_BEGIN();
offset += 2;
p_pkg_str[offset++] |= (p_msg->msg_id.header_ind ? 0x08 : 0x00);
-
/* 2. TP-Failure Cause (Conditional) */
- if (p_msg->tp_fail_cause >= 0x8000) {
+ if (p_msg->tp_fail_cause >= 0x80) {
p_pkg_str[offset++] = SMS_BEARER_TP_FAILURE_CAUSE;
p_pkg_str[offset++] = 1;
p_pkg_str[offset++] = p_msg->tp_fail_cause;
}
-int SmsPluginMsgCodec::encodeTelesvcCancelMsg(const sms_telesvc_cancel_s *p_msg, unsigned char *p_pkg_str)
+int Sms3gpp2MsgCodec::encodeTelesvcCancelMsg(const sms_3gpp2_telesvc_cancel_s *p_msg, unsigned char *p_pkg_str)
{
MSG_BEGIN();
}
-int SmsPluginMsgCodec::encodeTelesvcSubmitMsg(const sms_telesvc_submit_s *p_msg, unsigned char *p_pkg_str)
+int Sms3gpp2MsgCodec::encodeTelesvcSubmitMsg(const sms_3gpp2_telesvc_submit_s *p_msg, unsigned char *p_pkg_str)
{
MSG_BEGIN();
/* Sprint and Verizon issue */
/* 3. Validity Period */
/*
- if (p_msg->val_period.format == SMS_TIME_RELATIVE) {
+ if (p_msg->val_period.format == SMS_3GPP2_TIME_RELATIVE) {
p_pkg_str[offset++] = SMS_BEARER_VALIDITY_PERIOD_RELATIVE;
p_pkg_str[offset++] = 1;
p_pkg_str[offset++] = p_msg->val_period.time.rel_time.rel_time;
- } else if (p_msg->val_period.format == SMS_TIME_ABSOLUTE){
+ } else if (p_msg->val_period.format == SMS_3GPP2_TIME_ABSOLUTE){
p_pkg_str[offset++] = SMS_BEARER_VALIDITY_PERIOD_ABSOLUTE;
p_pkg_str[offset++] = 6;
p_pkg_str[offset++] = _convert_to_BCD(p_msg->val_period.time.abs_time.year);
*/
/* 4. Deferred Delivery Time */
- if (p_msg->defer_val_period.format == SMS_TIME_RELATIVE) {
+ if (p_msg->defer_val_period.format == SMS_3GPP2_TIME_RELATIVE) {
p_pkg_str[offset++] = SMS_BEARER_DEFERRED_DELIVERY_TIME_RELATIVE;
p_pkg_str[offset++] = 1;
p_pkg_str[offset++] = p_msg->defer_val_period.time.rel_time.rel_time;
- } else if (p_msg->defer_val_period.format == SMS_TIME_ABSOLUTE) {
+ } else if (p_msg->defer_val_period.format == SMS_3GPP2_TIME_ABSOLUTE) {
p_pkg_str[offset++] = SMS_BEARER_DEFERRED_DELIVERY_TIME_ABSOLUTE;
p_pkg_str[offset++] = 6;
p_pkg_str[offset++] = _convert_to_BCD(p_msg->defer_val_period.time.abs_time.year);
if (p_msg->callback_number.digit_mode == false) {
p_pkg_str[offset++] |= (p_msg->callback_number.addr_len & 0xfe) >> 1;
p_pkg_str[offset] |= (p_msg->callback_number.addr_len & 0x01) << 7;
- int addr_len = SmsPluginParamCodec::instance()->convertDigitToDTMF(p_msg->callback_number.szData, p_msg->callback_number.addr_len, 1, p_pkg_str+offset);
+ int addr_len = Sms3gpp2ParamCodec::instance()->convertDigitToDTMF(p_msg->callback_number.szData, p_msg->callback_number.addr_len, 1, p_pkg_str+offset);
offset += addr_len;
} else if (p_msg->callback_number.digit_mode == true) {
p_pkg_str[offset] |= p_msg->callback_number.number_type << 6;
}
-int SmsPluginMsgCodec::decodeMsg(const unsigned char *p_pkg_str, int pkg_len, sms_trans_msg_s *p_msg)
+int Sms3gpp2MsgCodec::decodeMsg(const unsigned char *p_pkg_str, int pkg_len, sms_3gpp2_trans_msg_s *p_msg)
{
MSG_BEGIN();
}
-int SmsPluginMsgCodec::decodeP2PMsg(const unsigned char *p_pkg_str, int pkg_len, sms_trans_p2p_msg_s *p_p2p)
+int Sms3gpp2MsgCodec::decodeP2PMsg(const unsigned char *p_pkg_str, int pkg_len, sms_3gpp2_trans_p2p_msg_s *p_p2p)
{
MSG_BEGIN();
/* Teleservice Identifier */
offset += decodeTeleId(p_pkg_str+offset, pkg_len, &(p_p2p->telesvc_id));
break;
- case 0x01:
+ case 0x01:
/* Service Category */
offset += decodeSvcCtg(p_pkg_str+offset, pkg_len, &(p_p2p->svc_ctg));
break;
case 0x06:
/* Bearer Reply Option*/
offset += 2;
- p_p2p->reply_seq = (sms_trans_reply_seq_t)(p_pkg_str[offset] >> 2);
+ p_p2p->reply_seq = (sms_3gpp2_trans_reply_seq_t)(p_pkg_str[offset] >> 2);
offset++;
break;
case 0x08:
}
-int SmsPluginMsgCodec::decodeCBMsg(const unsigned char *p_pkg_str, int pkg_len, sms_trans_broadcast_msg_s *p_cb)
+int Sms3gpp2MsgCodec::decodeCBMsg(const unsigned char *p_pkg_str, int pkg_len, sms_3gpp2_trans_broadcast_msg_s *p_cb)
{
MSG_BEGIN();
}
-int SmsPluginMsgCodec::decodeAckMsg(const unsigned char *p_pkg_str, int pkg_len, sms_trans_ack_msg_s *p_ack)
+int Sms3gpp2MsgCodec::decodeAckMsg(const unsigned char *p_pkg_str, int pkg_len, sms_3gpp2_trans_ack_msg_s *p_ack)
{
MSG_BEGIN();
} else if (p_pkg_str[offset] == 0x07) {
/* Cause Codes */
offset += 2;
- p_ack->cause_code.reply_seq = (sms_trans_reply_seq_t)p_pkg_str[offset] >> 2;
+ p_ack->cause_code.reply_seq = (sms_3gpp2_trans_reply_seq_t)p_pkg_str[offset] >> 2;
switch (p_pkg_str[offset++] & 0x03) {
- case 0x00:
+ case 0:
p_ack->cause_code.error_class = SMS_TRANS_ERR_CLASS_NONE;
break;
- case 0x01:
+ case 1:
+ /* Reserved */
break;
- case 0x10:
+ case 2:
p_ack->cause_code.error_class = SMS_TRANS_ERR_CLASS_TEMPORARY;
break;
- case 0x11:
+ case 3:
p_ack->cause_code.error_class = SMS_TRANS_ERR_CLASS_PERMANENT;
break;
}
if (p_ack->cause_code.error_class != SMS_TRANS_ERR_CLASS_NONE) {
- p_ack->cause_code.cause_code = (sms_trans_cause_code_t)p_pkg_str[offset++];
+ p_ack->cause_code.cause_code = (sms_3gpp2_trans_cause_code_t)p_pkg_str[offset++];
}
}
}
}
-void SmsPluginMsgCodec::decodeP2PTelesvcMsg(const unsigned char *p_pkg_str, int pkg_len, sms_telesvc_msg_s *p_telesvc)
+void Sms3gpp2MsgCodec::decodeP2PTelesvcMsg(const unsigned char *p_pkg_str, int pkg_len, sms_3gpp2_telesvc_msg_s *p_telesvc)
{
MSG_BEGIN();
}
-void SmsPluginMsgCodec::decodeP2PDeliverMsg(const unsigned char *p_pkg_str, int pkg_len, sms_telesvc_deliver_s *p_del)
+void Sms3gpp2MsgCodec::decodeP2PDeliverMsg(const unsigned char *p_pkg_str, int pkg_len, sms_3gpp2_telesvc_deliver_s *p_del)
{
MSG_BEGIN();
case 0x04:
/* Validity Period - Absolute */
offset += 2;
- p_del->val_period.format = SMS_TIME_ABSOLUTE;
+ p_del->val_period.format = SMS_3GPP2_TIME_ABSOLUTE;
offset += decodeAbsTime(p_pkg_str+offset, &(p_del->val_period.time.abs_time));
break;
case 0x05:
/* Validity Period - Relative */
offset += 2;
- p_del->val_period.format = SMS_TIME_RELATIVE;
- p_del->val_period.time.rel_time.rel_time = (sms_relative_time_t)p_pkg_str[offset++];
+ p_del->val_period.format = SMS_3GPP2_TIME_RELATIVE;
+ p_del->val_period.time.rel_time.rel_time = (sms_3gpp2_relative_time_t)p_pkg_str[offset++];
break;
case 0x08:
/* Priority Indicator */
offset += 2;
- p_del->priority = (sms_priority_indicator_t)((p_pkg_str[offset++] & 0xc0) >> 6);
+ p_del->priority = (sms_3gpp2_priority_indicator_t)((p_pkg_str[offset++] & 0xc0) >> 6);
break;
case 0x09:
/* Privacy Indicator */
offset += 2;
- p_del->privacy = (sms_privacy_indicator_t)((p_pkg_str[offset++] & 0xc0) >> 6);
+ p_del->privacy = (sms_3gpp2_privacy_indicator_t)((p_pkg_str[offset++] & 0xc0) >> 6);
break;
case 0x0a:
/* Reply Option */
offset += 2;
tmp_len = p_pkg_str[offset-1];
if (tmp_len > 0)
- p_del->alert_priority = (sms_alert_priority_t)((p_pkg_str[offset] & 0xc0) >> 6);
+ p_del->alert_priority = (sms_3gpp2_alert_priority_t)((p_pkg_str[offset] & 0xc0) >> 6);
offset += tmp_len;
break;
case 0x0d:
/* Language Indicator */
offset += 2;
- p_del->language = (sms_language_type_t)p_pkg_str[offset++];
+ p_del->language = (sms_3gpp2_language_type_t)p_pkg_str[offset++];
break;
case 0x0e:
/* Call-Back Number */
/* Message Display Mode */
offset += 2;
- p_del->display_mode = (sms_display_mode_t)((p_pkg_str[offset++] & 0xc0) >> 6);
+ p_del->display_mode = (sms_3gpp2_display_mode_t)((p_pkg_str[offset++] & 0xc0) >> 6);
break;
case 0x10:
/* Multiple Encoding User Data */
memcpy(tmp_str, p_pkg_str+offset, tmp_len);
tmp_off = 0;
- p_del->enhanced_vmn.priority = (sms_priority_indicator_t)(p_pkg_str[offset] >> 6);
+ p_del->enhanced_vmn.priority = (sms_3gpp2_priority_indicator_t)(p_pkg_str[offset] >> 6);
p_del->enhanced_vmn.password_req = p_pkg_str[offset] & 0x20 ? true : false;
p_del->enhanced_vmn.setup_req = p_pkg_str[offset] & 0x10 ? true : false;
p_del->enhanced_vmn.pw_change_req = p_pkg_str[offset] & 0x08 ? true : false;
p_del->enhanced_vmn.vm_mailbox_full = tmp_str[tmp_off] & 0x40 ? true : false;
p_del->enhanced_vmn.reply_allowed = tmp_str[tmp_off] & 0x20 ? true : false;
p_del->enhanced_vmn.fax_included = tmp_str[tmp_off] & 0x10 ? true : false;
- p_del->enhanced_vmn.vm_len = ((tmp_str[tmp_off] >> 0x0f) << 8) | tmp_str[tmp_off+1];
+ p_del->enhanced_vmn.vm_len = ((tmp_str[tmp_off] & 0x0f) << 8) | tmp_str[tmp_off+1];
tmp_off += 2;
p_del->enhanced_vmn.vm_ret_day = tmp_str[tmp_off] >> 1;
_shiftNBit_for_decode(tmp_str, tmp_len, 7);
p_del->enhanced_vmn.vm_mailbox_id = (tmp_str[tmp_off] << 8) | tmp_str[tmp_off+1];
tmp_off += 2;
- p_del->enhanced_vmn.an_digit_mode = (sms_digit_mode_t)(tmp_str[tmp_off] & 0x80 ? true : false);
- p_del->enhanced_vmn.an_number_type = (sms_number_type_t)((tmp_str[tmp_off] & 0x70) >> 4);
+ p_del->enhanced_vmn.an_digit_mode = (sms_3gpp2_digit_mode_t)(tmp_str[tmp_off] & 0x80 ? true : false);
+ p_del->enhanced_vmn.an_number_type = (sms_3gpp2_number_type_t)((tmp_str[tmp_off] & 0x70) >> 4);
if (p_del->enhanced_vmn.an_digit_mode) {
- p_del->enhanced_vmn.an_number_plan = (sms_number_plan_t)(tmp_str[tmp_off++] & 0x0f);
+ p_del->enhanced_vmn.an_number_plan = (sms_3gpp2_number_plan_t)(tmp_str[tmp_off++] & 0x0f);
p_del->enhanced_vmn.an_num_field = tmp_str[tmp_off++];
for (int i = 0; i < p_del->enhanced_vmn.an_num_field; i++) {
switch (tmp_str[tmp_off] & 0xf0) {
tmp_off += p_del->enhanced_vmn.an_num_field;
}
- p_del->enhanced_vmn.cli_digit_mode = (sms_digit_mode_t)(tmp_str[offset] & 0x80 ? true : false);
- p_del->enhanced_vmn.cli_number_type = (sms_number_type_t)(tmp_str[offset] & 0x70 >> 4);
+ p_del->enhanced_vmn.cli_digit_mode = (sms_3gpp2_digit_mode_t)(tmp_str[offset] & 0x80 ? true : false);
+ p_del->enhanced_vmn.cli_number_type = (sms_3gpp2_number_type_t)(tmp_str[offset] & 0x70 >> 4);
if (p_del->enhanced_vmn.cli_digit_mode) {
- p_del->enhanced_vmn.cli_number_plan = (sms_number_plan_t)(tmp_str[tmp_off++] & 0x0f);
+ p_del->enhanced_vmn.cli_number_plan = (sms_3gpp2_number_plan_t)(tmp_str[tmp_off++] & 0x0f);
p_del->enhanced_vmn.cli_num_field = tmp_str[tmp_off++];
for (int i = 0; i < p_del->enhanced_vmn.cli_num_field; i++) {
switch (tmp_str[tmp_off] & 0xf0) {
}
-void SmsPluginMsgCodec::decodeP2PSubmitMsg(const unsigned char *p_pkg_str, int pkg_len, sms_telesvc_submit_s *p_sub)
+void Sms3gpp2MsgCodec::decodeP2PSubmitMsg(const unsigned char *p_pkg_str, int pkg_len, sms_3gpp2_telesvc_submit_s *p_sub)
{
int offset = 0, tmp_len;
unsigned short tmp_param_s;
} else if (p_pkg_str[offset] == 0x04) {
/* Validity Period - Absolute */
offset += 2;
- p_sub->val_period.format = SMS_TIME_ABSOLUTE;
+ p_sub->val_period.format = SMS_3GPP2_TIME_ABSOLUTE;
offset += decodeAbsTime(p_pkg_str+offset, &(p_sub->val_period.time.abs_time));
} else if (p_pkg_str[offset] == 0x05) {
/* Validity Period - Relative */
offset += 2;
- p_sub->val_period.format = SMS_TIME_RELATIVE;
- p_sub->val_period.time.rel_time.rel_time = (sms_relative_time_t)p_pkg_str[offset++];
+ p_sub->val_period.format = SMS_3GPP2_TIME_RELATIVE;
+ p_sub->val_period.time.rel_time.rel_time = (sms_3gpp2_relative_time_t)p_pkg_str[offset++];
} else if (p_pkg_str[offset] == 0x06) {
/* Deferred Delivery Time - Absolute */
offset += 2;
- p_sub->defer_val_period.format = SMS_TIME_ABSOLUTE;
+ p_sub->defer_val_period.format = SMS_3GPP2_TIME_ABSOLUTE;
offset += decodeAbsTime(p_pkg_str+offset, &(p_sub->defer_val_period.time.abs_time));
} else if (p_pkg_str[offset] == 0x07) {
/* Deferred Delivery Time - Relative */
offset += 2;
- p_sub->defer_val_period.format = SMS_TIME_RELATIVE;
- p_sub->defer_val_period.time.rel_time.rel_time = (sms_relative_time_t)p_pkg_str[offset++];
+ p_sub->defer_val_period.format = SMS_3GPP2_TIME_RELATIVE;
+ p_sub->defer_val_period.time.rel_time.rel_time = (sms_3gpp2_relative_time_t)p_pkg_str[offset++];
} else if (p_pkg_str[offset] == 0x08) {
/* Priority indicator */
offset += 2;
- p_sub->priority = (sms_priority_indicator_t)((p_pkg_str[offset++] & 0xc0) >> 6);
+ p_sub->priority = (sms_3gpp2_priority_indicator_t)((p_pkg_str[offset++] & 0xc0) >> 6);
} else if (p_pkg_str[offset] == 0x09) {
/* Privacy indicator */
offset += 2;
- p_sub->privacy = (sms_privacy_indicator_t)((p_pkg_str[offset++] & 0xc0) >> 6);
+ p_sub->privacy = (sms_3gpp2_privacy_indicator_t)((p_pkg_str[offset++] & 0xc0) >> 6);
} else if (p_pkg_str[offset] == 0x0a) {
/* Reply Option */
offset += 2;
/* Alert on Message Delivery */
offset += 2;
- p_sub->alert_priority = (sms_alert_priority_t)((p_pkg_str[offset++] & 0xc0) >> 6);
+ p_sub->alert_priority = (sms_3gpp2_alert_priority_t)((p_pkg_str[offset++] & 0xc0) >> 6);
} else if (p_pkg_str[offset] == 0x0d) {
/* Language Indicator */
offset += 2;
- p_sub->language = (sms_language_type_t)p_pkg_str[offset++];
+ p_sub->language = (sms_3gpp2_language_type_t)p_pkg_str[offset++];
} else if (p_pkg_str[offset] == 0x0e) {
/* Call-Back Number */
offset += 2;
}
-void SmsPluginMsgCodec::decodeP2PUserAckMsg(const unsigned char *p_pkg_str, int pkg_len, sms_telesvc_user_ack_s *p_user_ack)
+void Sms3gpp2MsgCodec::decodeP2PUserAckMsg(const unsigned char *p_pkg_str, int pkg_len, sms_3gpp2_telesvc_user_ack_s *p_user_ack)
{
MSG_BEGIN();
}
-void SmsPluginMsgCodec::decodeP2PReadAckMsg(const unsigned char *p_pkg_str, int pkg_len, sms_telesvc_read_ack_s *p_read_ack)
+void Sms3gpp2MsgCodec::decodeP2PReadAckMsg(const unsigned char *p_pkg_str, int pkg_len, sms_3gpp2_telesvc_read_ack_s *p_read_ack)
{
MSG_BEGIN();
}
-void SmsPluginMsgCodec::decodeP2PSubmitReportMsg(const unsigned char *p_pkg_str, int pkg_len, sms_telesvc_report_s *p_sub_report)
+void Sms3gpp2MsgCodec::decodeP2PSubmitReportMsg(const unsigned char *p_pkg_str, int pkg_len, sms_3gpp2_telesvc_report_s *p_sub_report)
{
MSG_BEGIN();
case 0x0d:
/* Language Indicator */
offset += 2;
- p_sub_report->language = (sms_language_type_t)p_pkg_str[offset++];
+ p_sub_report->language = (sms_3gpp2_language_type_t)p_pkg_str[offset++];
break;
case 0x10:
/* Multiple Encoding User Data */
}
-void SmsPluginMsgCodec::decodeP2PDeliveryAckMsg(const unsigned char *p_pkg_str, int pkg_len, sms_telesvc_deliver_ack_s *p_del_ack)
+void Sms3gpp2MsgCodec::decodeP2PDeliveryAckMsg(const unsigned char *p_pkg_str, int pkg_len, sms_3gpp2_telesvc_deliver_ack_s *p_del_ack)
{
MSG_BEGIN();
case 0x14:
/* Message Status */
offset += 2;
- p_del_ack->msg_status = (sms_status_code_t)p_pkg_str[offset++];
+ p_del_ack->msg_status = (sms_3gpp2_status_code_t)p_pkg_str[offset++];
break;
default:
break;
}
-void SmsPluginMsgCodec::decodeCBBearerData(const unsigned char *p_pkg_str, int pkg_len, sms_telesvc_msg_s *p_telesvc, bool isCMAS)
+void Sms3gpp2MsgCodec::decodeCBBearerData(const unsigned char *p_pkg_str, int pkg_len, sms_3gpp2_telesvc_msg_s *p_telesvc, bool isCMAS)
{
MSG_BEGIN();
} else if (p_pkg_str[offset] == 0x04) {
/* Validity Period - Absolute */
offset += 2;
- p_telesvc->data.deliver.val_period.format = SMS_TIME_ABSOLUTE;
+ p_telesvc->data.deliver.val_period.format = SMS_3GPP2_TIME_ABSOLUTE;
offset += decodeAbsTime(p_pkg_str+offset, &(p_telesvc->data.deliver.val_period.time.abs_time));
} else if (p_pkg_str[offset] == 0x05) {
/* Validity Period - Relative */
offset += 2;
- p_telesvc->data.deliver.val_period.format = SMS_TIME_RELATIVE;
- p_telesvc->data.deliver.val_period.time.rel_time.rel_time = (sms_relative_time_t)p_pkg_str[offset++];
+ p_telesvc->data.deliver.val_period.format = SMS_3GPP2_TIME_RELATIVE;
+ p_telesvc->data.deliver.val_period.time.rel_time.rel_time = (sms_3gpp2_relative_time_t)p_pkg_str[offset++];
} else if (p_pkg_str[offset] == 0x08) {
/* Priority indicator */
offset += 2;
- p_telesvc->data.deliver.priority = (sms_priority_indicator_t)((p_pkg_str[offset++] & 0xc0) >> 6);
+ p_telesvc->data.deliver.priority = (sms_3gpp2_priority_indicator_t)((p_pkg_str[offset++] & 0xc0) >> 6);
} else if (p_pkg_str[offset] == 0x0c) {
/* Alert on Message Delivery */
offset += 2;
- p_telesvc->data.deliver.alert_priority = (sms_alert_priority_t)((p_pkg_str[offset++] & 0xc0) >> 6);
+ p_telesvc->data.deliver.alert_priority = (sms_3gpp2_alert_priority_t)((p_pkg_str[offset++] & 0xc0) >> 6);
} else if (p_pkg_str[offset] == 0x0d) {
/* Language Indicator */
offset += 2;
- p_telesvc->data.deliver.language = (sms_language_type_t)p_pkg_str[offset++];
+ p_telesvc->data.deliver.language = (sms_3gpp2_language_type_t)p_pkg_str[offset++];
} else if (p_pkg_str[offset] == 0x0e) {
/* Call-Back Number */
offset += 2;
/* Message Display Mode */
offset += 2;
- p_telesvc->data.deliver.display_mode = (sms_display_mode_t)((p_pkg_str[offset++] & 0xc0) >> 6);
+ p_telesvc->data.deliver.display_mode = (sms_3gpp2_display_mode_t)((p_pkg_str[offset++] & 0xc0) >> 6);
} else if (p_pkg_str[offset] == 0x10) {
/* Multiple Encoding User Data */
offset += 2;
}
-int SmsPluginMsgCodec::decodeTeleId(const unsigned char *p_pkg_str, int pkg_len, sms_trans_telesvc_id_t *tele_id)
+int Sms3gpp2MsgCodec::decodeTeleId(const unsigned char *p_pkg_str, int pkg_len, sms_3gpp2_trans_telesvc_id_t *tele_id)
{
int offset = 0;
unsigned short tmp_param_s;
}
-int SmsPluginMsgCodec::decodeSvcCtg(const unsigned char *p_pkg_str, int pkg_len, sms_trans_svc_ctg_t *svc_ctg)
+int Sms3gpp2MsgCodec::decodeSvcCtg(const unsigned char *p_pkg_str, int pkg_len, sms_3gpp2_trans_svc_ctg_t *svc_ctg)
{
int offset = 0;
unsigned short tmp_param_s;
if ((tmp_param_s >= SMS_TRANS_SVC_CTG_UNKNOWN && tmp_param_s <= SMS_TRANS_SVC_CTG_KDDI_CORP_MAX1)
|| (tmp_param_s >= SMS_TRANS_SVC_CTG_KDDI_CORP_MIN2 && tmp_param_s <= SMS_TRANS_SVC_CTG_KDDI_CORP_MAX2)
|| (tmp_param_s >= SMS_TRANS_SVC_CTG_KDDI_CORP_MIN3 && tmp_param_s <= SMS_TRANS_SVC_CTG_KDDI_CORP_MAX3)) {
- *svc_ctg = (sms_trans_svc_ctg_t)tmp_param_s;
+ *svc_ctg = (sms_3gpp2_trans_svc_ctg_t)tmp_param_s;
} else {
*svc_ctg = SMS_TRANS_SVC_CTG_RESERVED;
}
}
-int SmsPluginMsgCodec::decodeAddress(const unsigned char *p_pkg_str, int pkg_len, sms_trans_addr_s *addr)
+int Sms3gpp2MsgCodec::decodeAddress(const unsigned char *p_pkg_str, int pkg_len, sms_3gpp2_trans_addr_s *addr)
{
int offset = 0, tmp_len = 0;
unsigned char tmp_str[pkg_len+1];
switch (tmp_str[0] & 0xf0) {
case 0x00:
- addr->number_plan = SMS_NPI_UNKNOWN;
+ addr->number_plan = SMS_3GPP2_NPI_UNKNOWN;
break;
case 0x10:
- addr->number_plan = SMS_NPI_ISDN;
+ addr->number_plan = SMS_3GPP2_NPI_ISDN;
break;
case 0x30:
- addr->number_plan = SMS_NPI_DATA;
+ addr->number_plan = SMS_3GPP2_NPI_DATA;
break;
case 0x40:
- addr->number_plan = SMS_NPI_TELEX;
+ addr->number_plan = SMS_3GPP2_NPI_TELEX;
break;
case 0x90:
- addr->number_plan = SMS_NPI_PRIVATE;
+ addr->number_plan = SMS_3GPP2_NPI_PRIVATE;
break;
default:
- addr->number_plan = SMS_NPI_RESERVED;
+ addr->number_plan = SMS_3GPP2_NPI_RESERVED;
break;
}
}
-int SmsPluginMsgCodec::decodeSubAddress(const unsigned char *p_pkg_str, int pkg_len, sms_trans_sub_addr_s *sub_addr)
+int Sms3gpp2MsgCodec::decodeSubAddress(const unsigned char *p_pkg_str, int pkg_len, sms_3gpp2_trans_sub_addr_s *sub_addr)
{
int offset = 0, tmp_len = 0;
unsigned char tmp_str[pkg_len+1];
}
-int SmsPluginMsgCodec::decodeMsgId(const unsigned char *p_pkg_str, int pkg_len, sms_trans_msg_id_s *p_msg_id)
+int Sms3gpp2MsgCodec::decodeMsgId(const unsigned char *p_pkg_str, int pkg_len, sms_3gpp2_trans_msg_id_s *p_msg_id)
{
int offset = 0;
unsigned short tmp_param_s;
}
-void SmsPluginMsgCodec::decodeCallBackNum(const unsigned char *p_pkg_str, int pkg_len, sms_telesvc_addr_s *p_callback)
+void Sms3gpp2MsgCodec::decodeCallBackNum(const unsigned char *p_pkg_str, int pkg_len, sms_3gpp2_telesvc_addr_s *p_callback)
{
int offset = 0;
unsigned char tmp_str[pkg_len+1];
switch (p_pkg_str[offset++] & 0x0f) {
case 0x00:
- p_callback->number_plan = SMS_NPI_UNKNOWN;
+ p_callback->number_plan = SMS_3GPP2_NPI_UNKNOWN;
break;
case 0x01:
- p_callback->number_plan = SMS_NPI_ISDN;
+ p_callback->number_plan = SMS_3GPP2_NPI_ISDN;
break;
case 0x03:
- p_callback->number_plan = SMS_NPI_DATA;
+ p_callback->number_plan = SMS_3GPP2_NPI_DATA;
break;
case 0x04:
- p_callback->number_plan = SMS_NPI_TELEX;
+ p_callback->number_plan = SMS_3GPP2_NPI_TELEX;
break;
case 0x09:
- p_callback->number_plan = SMS_NPI_PRIVATE;
+ p_callback->number_plan = SMS_3GPP2_NPI_PRIVATE;
break;
case 0x0f:
default:
- p_callback->number_plan = SMS_NPI_RESERVED;
+ p_callback->number_plan = SMS_3GPP2_NPI_RESERVED;
break;
}
}
-int SmsPluginMsgCodec::decodeAbsTime(const unsigned char *p_pkg_str, sms_time_abs_s *p_time_abs)
+int Sms3gpp2MsgCodec::decodeAbsTime(const unsigned char *p_pkg_str, sms_3gpp2_time_abs_s *p_time_abs)
{
int offset = 0;
}
-int SmsPluginMsgCodec::encodeUserData(const unsigned char* src, unsigned char *dest, int src_size)
+int Sms3gpp2MsgCodec::encodeUserData(const unsigned char* src, unsigned char *dest, int src_size)
{
int i, j;
int shift = 0;
}
-void SmsPluginMsgCodec::decodeCMASData(unsigned char *p_pkg_str, int pkg_len, sms_telesvc_cmasdata_s *p_cmas)
+void Sms3gpp2MsgCodec::decodeCMASData(unsigned char *p_pkg_str, int pkg_len, sms_3gpp2_telesvc_cmasdata_s *p_cmas)
{
MSG_BEGIN();
if (p_pkg_str[offset++] != 0x00) {
MSG_ERR("Wrong protocol version = [%d]!! This field must be 0", p_pkg_str[offset-1]);
- p_cmas->is_wrong_recode_type = TRUE;
+ p_cmas->is_wrong_recode_type = TRUE;
return;
}
offset += 2;
tmp_len = p_pkg_str[offset-1];
MSG_DEBUG("Type 1 length = [%d]", tmp_len);
- p_cmas->category = (sms_cmae_category_t)p_pkg_str[offset++];
- p_cmas->response_type = (sms_cmae_response_type_t)p_pkg_str[offset++];
- p_cmas->severity = (sms_cmae_severity_t)(p_pkg_str[offset] >> 4);
- p_cmas->urgency = (sms_cmae_urgency_t)(p_pkg_str[offset++] & 0x0f);
- p_cmas->certainty = (sms_cmae_certainty_t)(p_pkg_str[offset++] >> 4);
+ p_cmas->category = (sms_3gpp2_cmae_category_t)p_pkg_str[offset++];
+ p_cmas->response_type = (sms_3gpp2_cmae_response_type_t)p_pkg_str[offset++];
+ p_cmas->severity = (sms_3gpp2_cmae_severity_t)(p_pkg_str[offset] >> 4);
+ p_cmas->urgency = (sms_3gpp2_cmae_urgency_t)(p_pkg_str[offset++] & 0x0f);
+ p_cmas->certainty = (sms_3gpp2_cmae_certainty_t)(p_pkg_str[offset++] >> 4);
} else if (p_pkg_str[offset] == 0x02) {
MSG_DEBUG("Type 2 Decode!");
offset += 2;
MSG_DEBUG("Type 2 length = [%d]", tmp_len);
_copy_char_to_short(&(p_cmas->id), p_pkg_str+offset);
offset += 2;
- p_cmas->alert_handle = (sms_cmae_alert_handle_t)p_pkg_str[offset++];
+ p_cmas->alert_handle = (sms_3gpp2_cmae_alert_handle_t)p_pkg_str[offset++];
offset += decodeAbsTime(p_pkg_str+offset, &(p_cmas->expires));
- p_cmas->language = (sms_language_type_t)p_pkg_str[offset++];
+ p_cmas->language = (sms_3gpp2_language_type_t)p_pkg_str[offset++];
}
MSG_DEBUG("offset = [%d], pkg_len = [%d]", offset, pkg_len);
}
-void SmsPluginMsgCodec::decodeUserData(unsigned char *p_pkg_str, int pkg_len, sms_telesvc_userdata_s *p_user)
+void Sms3gpp2MsgCodec::decodeUserData(unsigned char *p_pkg_str, int pkg_len, sms_3gpp2_telesvc_userdata_s *p_user)
{
switch (p_pkg_str[0] & 0xf8) {
case 0x00:
}
-sms_message_type_t SmsPluginMsgCodec::findMsgType(const unsigned char *p_pkg_str, int pkg_len)
+sms_3gpp2_message_type_t Sms3gpp2MsgCodec::findMsgType(const unsigned char *p_pkg_str, int pkg_len)
{
int offset = 0;
while (offset < pkg_len) {
if (p_pkg_str[offset] == 0x00) {
- return (sms_message_type_t)((p_pkg_str[offset+2]&0xf0)>>4);
+ return (sms_3gpp2_message_type_t)((p_pkg_str[offset + 2] & 0xf0) >> 4);
}
offset += (p_pkg_str[offset+1]+2);
}
#include "MsgGconfWrapper.h"
#include "MsgNotificationWrapper.h"
-#include "SmsCdmaPluginTransport.h"
-#include "SmsCdmaPluginStorage.h"
-#include "SmsCdmaPluginSetting.h"
-#include "SmsCdmaPluginEventHandler.h"
-#include "SmsCdmaPluginWapPushHandler.h"
+#include "Sms3gpp2Transport.h"
+#include "Sms3gpp2Setting.h"
+#include "Sms3gpp2EventHandler.h"
+#include "Sms3gpp2WapPushHandler.h"
+#include "SmsPluginDSHandler.h"
+#include "SmsPluginStorage.h"
-SmsPluginEventHandler* SmsPluginEventHandler::pInstance = NULL;
+Sms3gpp2EventHandler* Sms3gpp2EventHandler::pInstance = NULL;
-SmsPluginEventHandler::SmsPluginEventHandler()
+Sms3gpp2EventHandler::Sms3gpp2EventHandler()
{
- /* Initialize global parameters */
+ /* Initialize global parameters */
memset(&listener, 0x00, sizeof(MSG_PLUGIN_LISTENER_S));
- memset(&sentInfo, 0x00, sizeof(sms_sent_info_s));
+ memset(&sentInfo, 0x00, sizeof(sms_3gpp2_sent_info_s));
devStatus = false;
+ devHandle = NULL;
}
-SmsPluginEventHandler::~SmsPluginEventHandler()
+Sms3gpp2EventHandler::~Sms3gpp2EventHandler()
{
}
-SmsPluginEventHandler* SmsPluginEventHandler::instance()
+Sms3gpp2EventHandler* Sms3gpp2EventHandler::instance()
{
- if (!pInstance)
- pInstance = new SmsPluginEventHandler();
+ if (!pInstance) {
+ pInstance = new Sms3gpp2EventHandler();
+ }
return pInstance;
}
-void SmsPluginEventHandler::registerListener(MSG_PLUGIN_LISTENER_S *pListener)
+void Sms3gpp2EventHandler::registerListener(MSG_PLUGIN_LISTENER_S *pListener)
{
listener = *pListener;
}
-void SmsPluginEventHandler::convertTpduToMsginfo(sms_trans_p2p_msg_s *p_p2p_msg, MSG_MESSAGE_INFO_S *p_msg_info)
+void Sms3gpp2EventHandler::convertTpduToMsginfo(sms_3gpp2_trans_p2p_msg_s *p_p2p_msg, MSG_MESSAGE_INFO_S *p_msg_info)
{
MSG_BEGIN();
/* Teleservice message */
switch (p_p2p_msg->telesvc_msg.type) {
case SMS_TYPE_DELIVER:
- p_msg_info->msgType.subType = MSG_NORMAL_SMS;
- p_msg_info->folderId = MSG_INBOX_ID;
+ p_msg_info->msgType.subType = MSG_NORMAL_SMS;
+ p_msg_info->folderId = MSG_INBOX_ID;
- convertDeliverMsgToMsgInfo(&(p_p2p_msg->telesvc_msg.data.deliver), p_msg_info);
- break;
+ convertDeliverMsgToMsgInfo(&(p_p2p_msg->telesvc_msg.data.deliver), p_msg_info);
+ break;
case SMS_TYPE_DELIVERY_ACK:
convertAckMsgToMsgInfo(&(p_p2p_msg->telesvc_msg.data.delivery_ack), p_msg_info);
break;
}
-void SmsPluginEventHandler::convertTpduToMsginfo(sms_trans_broadcast_msg_s *p_cb_msg, MSG_MESSAGE_INFO_S *p_msg_info)
+void Sms3gpp2EventHandler::convertTpduToMsginfo(sms_3gpp2_trans_broadcast_msg_s *p_cb_msg, MSG_MESSAGE_INFO_S *p_msg_info)
{
MSG_BEGIN();
}
-void SmsPluginEventHandler::convertCMASMsgToMsgInfo(sms_telesvc_deliver_s *p_deliver, MSG_MESSAGE_INFO_S *p_msg_info)
+void Sms3gpp2EventHandler::convertCMASMsgToMsgInfo(sms_3gpp2_telesvc_deliver_s *p_deliver, MSG_MESSAGE_INFO_S *p_msg_info)
{
MSG_BEGIN();
memset(p_msg_info->addressList[0].addressVal, 0x00, MAX_ADDRESS_VAL_LEN+1);
p_msg_info->nAddressCnt = 1;
p_msg_info->addressList[0].addressType = MSG_ADDRESS_TYPE_UNKNOWN;
- snprintf(p_msg_info->addressList[0].addressVal, MAX_ADDRESS_VAL_LEN, "%s", p_deliver->callback_number.szData);
+ int wrn = snprintf(p_msg_info->addressList[0].addressVal, MAX_ADDRESS_VAL_LEN, "%s", p_deliver->callback_number.szData);
+ if (wrn < 0)
+ MSG_DEBUG("snprintf was failed");
p_msg_info->addressList[0].recipientType = MSG_RECIPIENTS_TYPE_TO;
}
}
-void SmsPluginEventHandler::convertDeliverMsgToMsgInfo(sms_telesvc_deliver_s *p_deliver, MSG_MESSAGE_INFO_S *p_msg_info)
+void Sms3gpp2EventHandler::convertDeliverMsgToMsgInfo(sms_3gpp2_telesvc_deliver_s *p_deliver, MSG_MESSAGE_INFO_S *p_msg_info)
{
MSG_BEGIN();
}
-void SmsPluginEventHandler::convertAckMsgToMsgInfo(sms_telesvc_deliver_ack_s *p_deliver, MSG_MESSAGE_INFO_S *p_msg_info)
+void Sms3gpp2EventHandler::convertAckMsgToMsgInfo(sms_3gpp2_telesvc_deliver_ack_s *p_deliver, MSG_MESSAGE_INFO_S *p_msg_info)
{
}
-void SmsPluginEventHandler::convertReportMsgToMsgInfo(sms_telesvc_report_s *p_deliver, MSG_MESSAGE_INFO_S *p_msg_info)
+void Sms3gpp2EventHandler::convertReportMsgToMsgInfo(sms_3gpp2_telesvc_report_s *p_deliver, MSG_MESSAGE_INFO_S *p_msg_info)
{
}
-void SmsPluginEventHandler::SetSentInfo(sms_sent_info_s *pSentInfo)
+void Sms3gpp2EventHandler::SetSentInfo(sms_3gpp2_sent_info_s *pSentInfo)
{
- memset(&sentInfo, 0x00, sizeof(sms_sent_info_s));
- memcpy(&sentInfo, pSentInfo, sizeof(sms_sent_info_s));
+ memset(&sentInfo, 0x00, sizeof(sms_3gpp2_sent_info_s));
+ memcpy(&sentInfo, pSentInfo, sizeof(sms_3gpp2_sent_info_s));
MSG_DEBUG("sentInfo.reqId : %d", sentInfo.reqInfo.reqId);
MSG_DEBUG("sentInfo.bLast : %d", sentInfo.bLast);
}
-
-void SmsPluginEventHandler::handleSentStatus(msg_network_status_t NetStatus)
+void Sms3gpp2EventHandler::handleSentStatus(msg_network_status_t NetStatus)
{
MSG_DEBUG("NetStatus[%d]", NetStatus);
}
-void SmsPluginEventHandler::handleMsgIncoming(sms_trans_p2p_msg_s *p_p2p_msg)
+void Sms3gpp2EventHandler::handleMsgIncoming(TapiHandle *handle, sms_3gpp2_trans_p2p_msg_s *p_p2p_msg)
{
/* Make MSG_MESSAGE_INFO_S */
MSG_MESSAGE_INFO_S msgInfo;
msgInfo.addressList = NULL;
unique_ptr<MSG_ADDRESS_INFO_S*, void(*)(MSG_ADDRESS_INFO_S**)> addressListBuf(&msgInfo.addressList, unique_ptr_deleter);
+ msgInfo.sim_idx = SmsPluginDSHandler::instance()->getSimIndex(handle);
+
/* convert to msgInfo */
convertTpduToMsginfo(p_p2p_msg, &msgInfo);
if (p_p2p_msg->telesvc_id == SMS_TRANS_TELESVC_RESERVED) {
MSG_DEBUG("This Incoming Message has Unknown Teleservice ID");
- SmsPluginTransport::instance()->sendDeliverReport(MSG_ERR_INVALID_MSG_TYPE, p_p2p_msg);
+ Sms3gpp2Transport::instance()->sendDeliverReport(handle, MSG_ERR_INVALID_MSG_TYPE, p_p2p_msg);
return;
}
else
msgInfo.msgType.subType = MSG_MWI_VOICE_SMS;
- if (p_p2p_msg->telesvc_msg.data.deliver.num_msg < 0)
- p_p2p_msg->telesvc_msg.data.deliver.num_msg = 0;
+ //if (p_p2p_msg->telesvc_msg.data.deliver.num_msg < 0)
+ // p_p2p_msg->telesvc_msg.data.deliver.num_msg = 0;
int voice_cnt = 0;
if (MsgSettingGetInt(VOICEMAIL_COUNT, &voice_cnt) != MSG_SUCCESS) {
}
/* repeated msg check for voicemail */
- if (voice_cnt == p_p2p_msg->telesvc_msg.data.deliver.num_msg) {
- SmsPluginTransport::instance()->sendDeliverReport(MSG_SUCCESS, p_p2p_msg);
+ if (voice_cnt == static_cast<int>(p_p2p_msg->telesvc_msg.data.deliver.num_msg)) {
+ Sms3gpp2Transport::instance()->sendDeliverReport(handle, MSG_SUCCESS, p_p2p_msg);
return;
}
- SmsPluginSetting::instance()->setMwiInfo(msgInfo.msgType.subType, p_p2p_msg->telesvc_msg.data.deliver.num_msg);
+ Sms3gpp2Setting::instance()->setMwiInfo(msgInfo.sim_idx, msgInfo.msgType.subType, p_p2p_msg->telesvc_msg.data.deliver.num_msg);
memset(msgInfo.msgText, 0x00, sizeof(msgInfo.msgText));
if (isUnique) {
err = SmsPluginStorage::instance()->checkMessage(&msgInfo);
} else {
- SmsPluginTransport::instance()->sendDeliverReport(MSG_SUCCESS, p_p2p_msg);
+ Sms3gpp2Transport::instance()->sendDeliverReport(handle, MSG_SUCCESS, p_p2p_msg);
return;
}
if (msgInfo.msgType.classType == MSG_CLASS_0) {
MSG_DEBUG("callback for class0 message to msg fw");
if (listener.pfMsgIncomingCb(&msgInfo) != MSG_SUCCESS)
- MSG_DEBUG("listener.pfMsgIncomingCb is failed!");
+ MSG_ERR("listener.pfMsgIncomingCb is failed!");
}
}
/* Send Deliver Report */
if (p_p2p_msg->telesvc_id == SMS_TRANS_TELESVC_WEMT) {
- SmsPluginTransport::instance()->sendDeliverReport(MSG_ERR_INVALID_MSG_TYPE, p_p2p_msg);
+ Sms3gpp2Transport::instance()->sendDeliverReport(handle, MSG_ERR_INVALID_MSG_TYPE, p_p2p_msg);
} else {
- SmsPluginTransport::instance()->sendDeliverReport(err, p_p2p_msg);
+ Sms3gpp2Transport::instance()->sendDeliverReport(handle, err, p_p2p_msg);
}
/* Tizen Validation System */
- char *msisdn = NULL;
- char keyName[MAX_VCONFKEY_NAME_LEN];
- int simIndex = 1;
-
- memset(keyName, 0x00, sizeof(keyName));
- snprintf(keyName, sizeof(keyName), "%s/%d", MSG_SIM_MSISDN, simIndex);
+ char keyName[MAX_VCONFKEY_NAME_LEN] = { 0, };
+ snprintf(keyName, sizeof(keyName), "%s/%d", MSG_SIM_MSISDN, msgInfo.sim_idx);
+ char *msisdn = NULL;
if (MsgSettingGetString(keyName, &msisdn) != MSG_SUCCESS) {
MSG_INFO("MsgSettingGetString() is failed");
}
}
-void SmsPluginEventHandler::handleCbMsgIncoming(sms_trans_broadcast_msg_s *p_cb_msg)
+void Sms3gpp2EventHandler::handleCbMsgIncoming(TapiHandle *handle, sms_3gpp2_trans_broadcast_msg_s *p_cb_msg)
{
MSG_BEGIN();
msgInfo.addressList = NULL;
unique_ptr<MSG_ADDRESS_INFO_S*, void(*)(MSG_ADDRESS_INFO_S**)> addressListBuf(&msgInfo.addressList, unique_ptr_deleter);
+ msgInfo.sim_idx = SmsPluginDSHandler::instance()->getSimIndex(handle);
+
/* convert to msgInfo */
convertTpduToMsginfo(p_cb_msg, &msgInfo);
msgInfo.msgId = p_cb_msg->telesvc_msg.data.deliver.msg_id.msg_id;
err = SmsPluginStorage::instance()->checkMessage(&msgInfo);
}
- if (!checkCbOpt(p_cb_msg->svc_ctg)) {
- MSG_DEBUG("The CB Msg is not supported by option.");
+ if (!checkCbOpt(handle, p_cb_msg->svc_ctg)) {
+ MSG_ERR("The CB Msg is not supported by option.");
return;
}
if (err != MSG_SUCCESS) {
MSG_WARN("callbackMsgIncoming() Error !! [%d]", err);
}
- } else {
- MSG_WARN("duplicate cb serialNum[%d] messageId[%d]", cbOutMsg.serialNum, cbOutMsg.messageId);
- }
+ } //else {
+ // MSG_WARN("duplicate cb serialNum[%d] messageId[%d]", cbOutMsg.serialNum, cbOutMsg.messageId);
+ //}
#else
err = listener.pfMsgIncomingCb(&msgInfo);
}
/* Send Deliver Report */
- /* SmsPluginTransport::instance()->sendDeliverReport(err, p_cb_msg); */
+ /* Sms3gpp2Transport::instance()->sendDeliverReport(handle, err, p_p2p_msg); */
/* Tizen Validation System */
- char *msisdn = NULL;
- char keyName[MAX_VCONFKEY_NAME_LEN];
- int simIndex = 1;
-
- memset(keyName, 0x00, sizeof(keyName));
- snprintf(keyName, sizeof(keyName), "%s/%d", MSG_SIM_MSISDN, simIndex);
+ char keyName[MAX_VCONFKEY_NAME_LEN] = { 0, };
+ snprintf(keyName, sizeof(keyName), "%s/%d", MSG_SIM_MSISDN, msgInfo.sim_idx);
+ char *msisdn = NULL;
if (MsgSettingGetString(keyName, &msisdn) != MSG_SUCCESS) {
MSG_INFO("MsgSettingGetString() is failed");
}
}
-void SmsPluginEventHandler::handleWapMsgIncoming(sms_trans_p2p_msg_s *p_p2p_msg)
+void Sms3gpp2EventHandler::handleWapMsgIncoming(TapiHandle *handle, sms_3gpp2_trans_p2p_msg_s *p_p2p_msg)
{
MSG_BEGIN();
- sms_wap_msg_s msg;
- memset(&msg, 0x00, sizeof(sms_wap_msg_s));
+ sms_3gpp2_wap_msg_s msg;
+ memset(&msg, 0x00, sizeof(sms_3gpp2_wap_msg_s));
msg.msgId = p_p2p_msg->telesvc_msg.data.deliver.msg_id.msg_id;
msg.totalSeg = p_p2p_msg->telesvc_msg.data.deliver.user_data.user_data[1];
msg.segNum = p_p2p_msg->telesvc_msg.data.deliver.user_data.user_data[2];
+ msg.simIndex = SmsPluginDSHandler::instance()->getSimIndex(handle);
char tmpUserText[SMS_MAX_USER_DATA_LEN+1] = {0, };
- sms_telesvc_userdata_s tmpUserData;
- memset(&tmpUserData, 0x00, sizeof(sms_telesvc_userdata_s));
+ sms_3gpp2_telesvc_userdata_s tmpUserData;
+ memset(&tmpUserData, 0x00, sizeof(sms_3gpp2_telesvc_userdata_s));
tmpUserData.data_len = p_p2p_msg->telesvc_msg.data.deliver.user_data.data_len - 3;
memcpy(tmpUserText, &(p_p2p_msg->telesvc_msg.data.deliver.user_data.user_data[3]), tmpUserData.data_len);
if (segCnt == msg.totalSeg) {
MSG_DEBUG("RECEIVED LAST WAP : %d", segCnt);
- unsigned short srcPort = 0, dstPort = 0;
+ unsigned short dstPort = 0;
int dataSize = 0;
char* pUserData = NULL;
char* pTmpUserData = NULL;
msgInfo.addressList = NULL;
unique_ptr<MSG_ADDRESS_INFO_S*, void(*)(MSG_ADDRESS_INFO_S**)> addressListBuf(&msgInfo.addressList, unique_ptr_deleter);
- dataSize = MakeWapUserData(msg.msgId, &pUserData);
+ dataSize = MakeWapUserData(msg.msgId, msg.simIndex, &pUserData);
pTmpUserData = new char[dataSize];
memcpy(pTmpUserData, pUserData, dataSize);
memset(pUserData, 0x00, dataSize);
- srcPort = pTmpUserData[0] << 8 | pTmpUserData[1];
dstPort = pTmpUserData[2] << 8 | pTmpUserData[3];
#ifndef FEATURE_OMADM_DUPLICATE_PORT_WAPPUSH
dataSize -= 4;
memcpy(pUserData, &pTmpUserData[4], dataSize);
#else
+ unsigned short srcPort = 0;
+ srcPort = pTmpUserData[0] << 8 | pTmpUserData[1];
+
if ((srcPort == 0x23f0 && dstPort == 0x0b84) &&
((pTmpUserData[4] << 8 | pTmpUserData[5]) == 0x23f0) &&
((pTmpUserData[6] << 8 | pTmpUserData[7]) == 0x0b84)) {
for (int i = 0; i < dataSize; i++)
MSG_DEBUG("UserData[%d] = [%c] [%02x]", i, pUserData[i], pUserData[i]);
- if (SmsPluginWapPushHandler::instance()->IsWapPushMsg(dstPort) == true) {
+ if (Sms3gpp2WapPushHandler::instance()->IsWapPushMsg(dstPort) == true) {
msgInfo.msgType.mainType = MSG_SMS_TYPE;
- SmsPluginWapPushHandler::instance()->copyDeliverData(&(p_p2p_msg->address));
- SmsPluginWapPushHandler::instance()->handleWapPushMsg(pUserData, dataSize);
+ Sms3gpp2WapPushHandler::instance()->copyDeliverData(&(p_p2p_msg->address));
+ Sms3gpp2WapPushHandler::instance()->handleWapPushMsg(pUserData, msg.simIndex, dataSize);
} else {
MSG_DEBUG("not supported wap push port [%x]", dstPort);
}
}
/* Send Deliver Report */
- SmsPluginTransport::instance()->sendDeliverReport(MSG_SUCCESS, p_p2p_msg);
+ Sms3gpp2Transport::instance()->sendDeliverReport(handle, MSG_SUCCESS, p_p2p_msg);
MSG_END();
}
-void SmsPluginEventHandler::handleResendMessage(void)
+void Sms3gpp2EventHandler::handleResendMessage(void)
{
listener.pfResendMessageCb();
}
-msg_error_t SmsPluginEventHandler::callbackMsgIncoming(MSG_MESSAGE_INFO_S *pMsgInfo)
+msg_error_t Sms3gpp2EventHandler::callbackMsgIncoming(MSG_MESSAGE_INFO_S *pMsgInfo)
{
MSG_BEGIN();
}
-msg_error_t SmsPluginEventHandler::callbackStorageChange(msg_storage_change_type_t storageChangeType, MSG_MESSAGE_INFO_S *pMsgInfo)
+msg_error_t Sms3gpp2EventHandler::callbackStorageChange(msg_storage_change_type_t storageChangeType, MSG_MESSAGE_INFO_S *pMsgInfo)
{
- /* Callback to MSG FW */
- listener.pfStorageChangeCb(storageChangeType, pMsgInfo);
+ msg_id_list_s msgIdList;
+ msg_message_id_t msgIds[1];
+ memset(&msgIdList, 0x00, sizeof(msg_id_list_s));
+
+ msgIdList.nCount = 1;
+ msgIds[0] = pMsgInfo->msgId;
+ msgIdList.msgIdList = msgIds;
+
+ /** Callback to MSG FW */
+ listener.pfStorageChangeCb(storageChangeType, &msgIdList);
return MSG_SUCCESS;
}
-void SmsPluginEventHandler::setDeviceStatus()
+void Sms3gpp2EventHandler::setDeviceStatus(TapiHandle *handle, bool status)
{
- mx.lock();
- devStatus = true;
- cv.signal();
- mx.unlock();
+ if (handle == devHandle) {
+ mx.lock();
+ devStatus = true;
+ cv.signal();
+ mx.unlock();
+ }
}
-bool SmsPluginEventHandler::getDeviceStatus()
+bool Sms3gpp2EventHandler::getDeviceStatus(TapiHandle *handle)
{
- int ret = 0;
-
mx.lock();
-
- ret = cv.timedwait(mx.pMsgMutex(), 25);
-
+ devHandle = handle;
+ int ret = cv.timedwait(mx.pMsgMutex(), MAX_TAPI_SIM_API_TIMEOUT);
if (ret == ETIMEDOUT) {
MSG_DEBUG("WARNING: DEVICE STATUS TIME-OUT");
devStatus = false;
- bNeedInitConfig = true;
}
+ devHandle = NULL;
mx.unlock();
return devStatus;
}
-void SmsPluginEventHandler::setNeedInitConfig(bool bNeeded)
+msg_encode_type_t Sms3gpp2EventHandler::getEncodeType(sms_3gpp2_encoding_type_t encode_type)
{
- bNeedInitConfig = bNeeded;
-}
-
-
-bool SmsPluginEventHandler::getNeedInitConfig()
-{
- return bNeedInitConfig;
-}
-
-
-msg_encode_type_t SmsPluginEventHandler::getEncodeType(sms_encoding_type_t encode_type)
-{
- switch (encode_type) {
+ switch(encode_type) {
case SMS_ENCODE_GSM7BIT:
return MSG_ENCODE_GSM7BIT;
case SMS_ENCODE_KOREAN:
}
-unsigned short SmsPluginEventHandler::checkWapMsg(sms_wap_msg_s *pMsg, sms_telesvc_userdata_s *pUserdata)
+unsigned short Sms3gpp2EventHandler::checkWapMsg(sms_3gpp2_wap_msg_s *pMsg, sms_3gpp2_telesvc_userdata_s *pUserdata)
{
unsigned char currSegNum = 0;
MSG_DEBUG("The Segment Number already exists [%d]", pMsg->segNum);
return 0;
}
- wap_data_s wapData = {0};
+ wap_3gpp2_data_s wapData = {0};
memcpy(wapData.data, pUserdata->user_data, pUserdata->data_len);
wapData.length = pUserdata->data_len;
- pair<unsigned char, wap_data_s> newData(pMsg->segNum, wapData);
+ pair<unsigned char, wap_3gpp2_data_s> newData(pMsg->segNum, wapData);
wapList[i].data.insert(newData);
MSG_DEBUG("MSG DATA : %s", pUserdata->user_data);
/* New Wap Push Msg */
if (bFind == false) {
- sms_wap_info_s tmpInfo;
+ sms_3gpp2_wap_info_s tmpInfo;
tmpInfo.msgId = pMsg->msgId;
tmpInfo.totalSeg = pMsg->totalSeg;
tmpInfo.segNum = 1;
+ tmpInfo.simIndex = pMsg->simIndex;
tmpInfo.totalSize = pUserdata->data_len;
- wap_data_s wapData = {0};
+ wap_3gpp2_data_s wapData = {0};
memcpy(wapData.data, pUserdata->user_data, pUserdata->data_len);
wapData.length = pUserdata->data_len;
- pair<unsigned char, wap_data_s> newData(pMsg->segNum, wapData);
+ pair<unsigned char, wap_3gpp2_data_s> newData(pMsg->segNum, wapData);
tmpInfo.data.insert(newData);
MSG_DEBUG("MSG DATA : %s", pUserdata->user_data);
}
-int SmsPluginEventHandler::MakeWapUserData(unsigned short msgId, char **ppTotalData)
+int Sms3gpp2EventHandler::MakeWapUserData(unsigned short msgId, msg_sim_slot_id_t simIndex, char **ppTotalData)
{
- wapDataMap::iterator it;
+ wap3gpp2DataMap::iterator it;
int totalSize = 0, offset = 0;
for (unsigned int i = 0; i < wapList.size(); i++) {
- if (wapList[i].msgId == msgId) {
+ if (wapList[i].msgId == msgId && wapList[i].simIndex == simIndex) {
totalSize = wapList[i].totalSize;
if (totalSize <= 0) {
}
-void SmsPluginEventHandler::handleSyncMLMsgIncoming(msg_syncml_message_type_t msgType, char* pPushBody, int PushBodyLen, char* pWspHeader, int WspHeaderLen)
+void Sms3gpp2EventHandler::handleSyncMLMsgIncoming(msg_syncml_message_type_t msgType, char* pPushBody, int PushBodyLen, char* pWspHeader, int WspHeaderLen)
{
MSG_SYNCML_MESSAGE_DATA_S syncMLData;
}
-void SmsPluginEventHandler::handleLBSMsgIncoming(char* pPushHeader, char* pPushBody, int pushBodyLen)
+void Sms3gpp2EventHandler::handleLBSMsgIncoming(char* pPushHeader, char* pPushBody, int pushBodyLen)
{
- MSG_LBS_MESSAGE_DATA_S lBSData;
+ MSG_LBS_MESSAGE_DATA_S lbsData;
- memset(&lBSData, 0x00, sizeof(MSG_LBS_MESSAGE_DATA_S));
+ memset(&lbsData, 0x00, sizeof(MSG_LBS_MESSAGE_DATA_S));
/* set LBA data */
- memcpy(lBSData.pushHeader, pPushHeader, strlen(pPushHeader));
+ memcpy(lbsData.pushHeader, pPushHeader, strlen(pPushHeader));
+ lbsData.pushHeader[strlen(pPushHeader)] = '\0';
- lBSData.pushBodyLen = pushBodyLen;
- memcpy(lBSData.pushBody, pPushBody, pushBodyLen);
+ lbsData.pushBodyLen = pushBodyLen;
+ memcpy(lbsData.pushBody, pPushBody, pushBodyLen);
+ lbsData.pushBody[pushBodyLen] = '\0';
/* Callback to MSG FW */
- listener.pfLBSMsgIncomingCb(&lBSData);
+ listener.pfLBSMsgIncomingCb(&lbsData);
}
-void SmsPluginEventHandler::handlePushMsgIncoming(char* pPushHeader, char* pPushBody, int pushBodyLen, char *application_id, char *content_type)
+void Sms3gpp2EventHandler::handlePushMsgIncoming(char* pPushHeader, char* pPushBody, int pushBodyLen, char *application_id, char *content_type)
{
MSG_PUSH_MESSAGE_DATA_S pushData;
/* set PUSH data */
memcpy(pushData.pushHeader, pPushHeader, strlen(pPushHeader));
+ pushData.pushHeader[strlen(pPushHeader)] = '\0';
pushData.pushBodyLen = pushBodyLen;
memcpy(pushData.pushBody, pPushBody, pushBodyLen);
+ pushData.pushBody[pushBodyLen] = '\0';
memcpy(pushData.pushAppId, application_id, MAX_WAPPUSH_ID_LEN);
memcpy(pushData.pushContentType, content_type, MAX_WAPPUSH_CONTENT_TYPE_LEN);
}
-bool SmsPluginEventHandler::checkCbOpt(sms_trans_svc_ctg_t svc_ctg)
+bool Sms3gpp2EventHandler::checkCbOpt(TapiHandle *handle, sms_3gpp2_trans_svc_ctg_t svc_ctg)
{
- bool bReceive = false;
- char keyName[MAX_VCONFKEY_NAME_LEN] = {0, };
- int sim_idx = 1;
+ char keyName[MAX_VCONFKEY_NAME_LEN] = { 0, };
+ snprintf(keyName, sizeof(keyName), "%s/%d", CB_RECEIVE, SmsPluginDSHandler::instance()->getSimIndex(handle));
- memset(keyName, 0x00, sizeof(keyName));
- snprintf(keyName, sizeof(keyName), "%s/%d", CB_RECEIVE, sim_idx);
- if (MsgSettingGetBool(keyName, &bReceive) != MSG_SUCCESS)
+ bool bReceive = false;
+ if (MsgSettingGetBool(keyName, &bReceive) != MSG_SUCCESS) {
MSG_INFO("MsgSettingGetBool() is failed");
+ }
/* Receive CB Msg = FALSE */
if (!bReceive) {
err = MsgStoGetCBChannelInfo(dbHandle, &cbChannelInfo);
if (err != MSG_SUCCESS) {
- MSG_DEBUG("Error value of MsgStoGetCBChannelInfo [%d]", err);
+ MSG_ERR("Error value of MsgStoGetCBChannelInfo [%d]", err);
return false;
}
#include <stdio.h>
#include <string.h>
-#include "SmsCdmaPluginParamCodec.h"
+#include "Sms3gpp2ParamCodec.h"
/*==================================================================================================
- IMPLEMENTATION OF SmsCdmaPluginParamCodec - Member Functions
+ IMPLEMENTATION OF Sms3gpp2ParamCodec - Member Functions
==================================================================================================*/
-SmsPluginParamCodec* SmsPluginParamCodec::pInstance = NULL;
+Sms3gpp2ParamCodec* Sms3gpp2ParamCodec::pInstance = NULL;
-SmsPluginParamCodec::SmsPluginParamCodec()
+Sms3gpp2ParamCodec::Sms3gpp2ParamCodec()
{
}
-SmsPluginParamCodec::~SmsPluginParamCodec()
+Sms3gpp2ParamCodec::~Sms3gpp2ParamCodec()
{
}
-
-SmsPluginParamCodec* SmsPluginParamCodec::instance()
+Sms3gpp2ParamCodec* Sms3gpp2ParamCodec::instance()
{
- if (!pInstance)
- pInstance = new SmsPluginParamCodec();
+ if (!pInstance) {
+ pInstance = new Sms3gpp2ParamCodec();
+ }
return pInstance;
}
/*==================================================================================================
Util Functions
==================================================================================================*/
-int SmsPluginParamCodec::convertDigitToBcd(char *pDigit, int DigitLen, unsigned char *pBcd)
+int Sms3gpp2ParamCodec::convertDigitToBcd(char *pDigit, int DigitLen, unsigned char *pBcd)
{
int offset = 0;
unsigned char temp;
}
-int SmsPluginParamCodec::convertBcdToDigit(const unsigned char *pBcd, int BcdLen, char *pDigit)
+int Sms3gpp2ParamCodec::convertBcdToDigit(const unsigned char *pBcd, int BcdLen, char *pDigit)
{
int offset = 0;
unsigned char temp;
}
-int SmsPluginParamCodec::convertDigitToDTMF(const char *pDigit, int DigitLen, int startBit, unsigned char *pDtmf)
+int Sms3gpp2ParamCodec::convertDigitToDTMF(const char *pDigit, int DigitLen, int startBit, unsigned char *pDtmf)
{
int shift = startBit;
int offset = 0;
}
-int SmsPluginParamCodec::convertDTMFToDigit(const unsigned char *pDtmf, int DtmfLen, int startBit, char *pDigit)
+int Sms3gpp2ParamCodec::convertDTMFToDigit(const unsigned char *pDtmf, int DtmfLen, int startBit, char *pDigit)
{
int shift = startBit;
int offset = 0;
}
-bool SmsPluginParamCodec::isDtmfNumber(const char *pDigit, int DigitLen)
+bool Sms3gpp2ParamCodec::isDtmfNumber(const char *pDigit, int DigitLen)
{
bool isDtmf = true;
#include "MsgUtilStorage.h"
#include "MsgTextConvert.h"
-#include "SmsCdmaPluginParamCodec.h"
-#include "SmsCdmaPluginCallback.h"
-#include "SmsCdmaPluginEventHandler.h"
-#include "SmsCdmaPluginMain.h"
-#include "SmsCdmaPluginSetting.h"
+#include "SmsPluginMain.h"
+#include "SmsPluginDSHandler.h"
+#include "Sms3gpp2ParamCodec.h"
+#include "Sms3gpp2TapiEventHandler.h"
+#include "Sms3gpp2EventHandler.h"
+#include "Sms3gpp2Setting.h"
-extern "C"
-{
- #include <tapi_common.h>
- #include <TelSms.h>
- #include <TapiUtility.h>
- #include <ITapiNetText.h>
- #include <ITapiSim.h>
- #include <ITapiModem.h>
-}
+#include <tapi_common.h>
+#include <TelSms.h>
+#include <TapiUtility.h>
+#include <ITapiNetText.h>
+#include <ITapiSim.h>
+#include <ITapiModem.h>
-extern struct tapi_handle *pTapiHandle;
/*==================================================================================================
IMPLEMENTATION OF SmsPluginSetting - Member Functions
==================================================================================================*/
-SmsPluginSetting* SmsPluginSetting::pInstance = NULL;
+Sms3gpp2Setting* Sms3gpp2Setting::pInstance = NULL;
-SmsPluginSetting::SmsPluginSetting()
+Sms3gpp2Setting::Sms3gpp2Setting()
{
/* Initialize member variables */
+ memset(&smscData, 0x00, sizeof(MSG_SMSC_DATA_S));
memset(&cbOpt, 0x00, sizeof(MSG_CBMSG_OPT_S));
memset(&meImei, 0x00, sizeof(meImei));
}
-SmsPluginSetting::~SmsPluginSetting()
+Sms3gpp2Setting::~Sms3gpp2Setting()
{
}
-SmsPluginSetting* SmsPluginSetting::instance()
+Sms3gpp2Setting* Sms3gpp2Setting::instance()
{
- if (!pInstance)
- pInstance = new SmsPluginSetting();
+ if (!pInstance) {
+ pInstance = new Sms3gpp2Setting();
+ }
return pInstance;
}
-void* SmsPluginSetting::initSimInfo(void *data)
+void Sms3gpp2Setting::initializeSimInfo(TapiHandle *handle)
{
- MSG_BEGIN();
-
+ pthread_t thd;
int tapiRet = TAPI_API_SUCCESS;
-
/* Get IMSI */
char imsi[17];
memset(imsi, 0x00, sizeof(imsi));
TelSimImsiInfo_t imsiInfo;
memset(&imsiInfo, 0x00, sizeof(TelSimImsiInfo_t));
- tapiRet = tel_get_sim_imsi(pTapiHandle, &imsiInfo);
+ tapiRet = tel_get_sim_imsi(handle, &imsiInfo);
if (tapiRet == TAPI_API_SUCCESS) {
MSG_SEC_DEBUG("tel_get_sim_imsi() Success - MCC [%s], MNC [%s], MSIN [%s]", imsiInfo.szMcc, imsiInfo.szMnc, imsiInfo.szMsin);
MsgSettingSetString(MSG_SIM_IMSI, imsi);
- instance()->updateSimStatus();
+ if (pthread_create(&thd, NULL, &initSimInfo, handle) < 0) {
+ MSG_ERR("pthread_create() error");
+ } else {
+ pthread_detach(thd);
+ }
+}
+
+
+void* Sms3gpp2Setting::initSimInfo(void *data)
+{
+ static MsgMutex mm;
+ MsgMutexLocker lock(mm);
+
+ Sms3gpp2Setting::instance()->updateSimStatus(static_cast<TapiHandle*>(data));
- MSG_END();
return NULL;
}
-
-void SmsPluginSetting::updateSimStatus()
+void Sms3gpp2Setting::updateSimStatus(TapiHandle *handle)
{
MSG_BEGIN();
- if (!pTapiHandle) {
- MSG_DEBUG("pTapiHandle is NULL.");
- return;
- }
+ MSG_ERR_RET_M(!handle, "handle is NULL!");
- int status = 0;
int tapiRet = TAPI_API_SUCCESS;
+ int simIndex = SmsPluginDSHandler::instance()->getSimIndex(handle);
- tapiRet = tel_check_sms_device_status(pTapiHandle, &status);
+ /* Check device ready & modem status */
+ int deviceStatus = 0;
+ tapiRet = tel_check_sms_device_status(handle, &deviceStatus);
+ MSG_ERR_RET_M(tapiRet != TAPI_API_SUCCESS, "tel_check_sms_device_status() failed: (%d)", tapiRet);
- if (tapiRet != TAPI_API_SUCCESS) {
- MSG_DEBUG("tel_check_sms_device_status() Error! [%d], Status [%d]", tapiRet, status);
- return;
- }
-
- if (status == 1 || status == 2) {
- MSG_DEBUG("Device Is Ready, status = %d", status);
- SmsPluginEventHandler::instance()->setNeedInitConfig(false);
- } else if (status == 0) {
- MSG_DEBUG("Device Is Not Ready.. Waiting For Ready Callback");
+ if (deviceStatus != TAPI_NETTEXT_READY_STATUS_NONE) {
+ MSG_INFO("Device is READY!");
+ } else {
+ MSG_INFO("Device is NOT READY.. Waiting for ready Callback!");
- if (SmsPluginEventHandler::instance()->getDeviceStatus() == true) {
- MSG_DEBUG("Device Is Ready");
+ if (Sms3gpp2EventHandler::instance()->getDeviceStatus(handle) == true) {
+ MSG_INFO("Device is finally READY!");
} else {
- MSG_DEBUG("Device Is Not Ready.");
+ SmsPluginDSHandler::instance()->setNeedToInitializeSim(handle, true);
+ MSG_ERR("Device is finally NOT READY!");
return;
}
}
- /* init config data. */
- initConfigData();
+ char keyName[MAX_VCONFKEY_NAME_LEN] = { 0, };
+
+ /* Save Subcriber ID */
+ char *subscriberId = NULL;
+ if (SmsPluginDSHandler::instance()->getSubscriberId(simIndex, &subscriberId) != MSG_SUCCESS) {
+ MSG_ERR("getSubscriberId() is failed");
+ } else {
+ snprintf(keyName, sizeof(keyName), "%s/%d", MSG_SIM_SUBS_ID, simIndex);
+ MsgSettingSetString(keyName, subscriberId);
+ }
+
+ g_free(subscriberId); subscriberId = NULL;
+
+ initConfigData(handle);
MSG_END();
}
-void SmsPluginSetting::setSimChangeStatus()
+void Sms3gpp2Setting::setSimChangeStatus(TapiHandle *handle)
{
MSG_BEGIN();
pthread_t thd;
-
- if (pthread_create(&thd, NULL, &initSimInfo, NULL) < 0) {
- MSG_DEBUG("pthread_create() error");
+ if (pthread_create(&thd, NULL, &initSimInfo, handle) < 0) {
+ MSG_ERR("pthread_create() error");
+ } else {
+ pthread_detach(thd);
}
- pthread_detach(thd);
-
MSG_END();
}
-void SmsPluginSetting::initConfigData()
+void Sms3gpp2Setting::initConfigData(TapiHandle *handle)
{
MSG_BEGIN();
msg_error_t err = MSG_SUCCESS;
char keyName[MAX_VCONFKEY_NAME_LEN];
- int sim_idx = 1;
+ int simIndex = SmsPluginDSHandler::instance()->getSimIndex(handle);
/*==================== CB configuration ====================*/
/*
MSG_DEBUG("simStatus == [%d]", simStatus);
*/
MSG_CBMSG_OPT_S cbMsgOpt = {0, };
-
+ cbMsgOpt.simIndex = simIndex;
if (getCbConfig(&cbMsgOpt) == true) {
err = addCbOpt(&cbMsgOpt);
MSG_DEBUG("######## Add CB Option Success !!! #######");
MSG_SETTING_S cbSetting;
cbSetting.type = MSG_CBMSG_OPT;
- getCbOpt(&cbSetting);
+ getCbOpt(&cbSetting, simIndex);
setCbConfig(&(cbSetting.option.cbMsgOpt));
} else {
MSG_DEBUG("######## Add CB Option Fail !!! return : %d #######", err);
}
/*==================== MSISDN update ====================*/
- if (getMsisdnInfo() == true) {
+ if (getMsisdnInfo(handle) == true) {
MSG_DEBUG("######## getMsisdnInfo Success !!! #######");
} else {
MSG_DEBUG("######## getMsisdnInfo Fail !!! #######");
/*==================== Default Voice mail Setting ====================*/
MSG_DEBUG("Voicemail Default Number is NULL");
memset(keyName, 0x00, sizeof(keyName));
- snprintf(keyName, sizeof(keyName), "%s/%d", VOICEMAIL_NUMBER, sim_idx);
- if (MsgSettingSetString(keyName, VOICEMAIL_DEFAULT_NUMBER) != MSG_SUCCESS)
+ snprintf(keyName, sizeof(keyName), "%s/%d", VOICEMAIL_NUMBER, simIndex);
+ if (MsgSettingSetString(keyName, "") != MSG_SUCCESS)
MSG_DEBUG("Error to set config data [%s]", keyName);
memset(keyName, 0x00, sizeof(keyName));
- snprintf(keyName, sizeof(keyName), "%s/%d", VOICEMAIL_NUMBER, sim_idx);
+ snprintf(keyName, sizeof(keyName), "%s/%d", VOICEMAIL_NUMBER, simIndex);
memset(keyName, 0x00, sizeof(keyName));
- snprintf(keyName, sizeof(keyName), "%s/%d", VOICEMAIL_ALPHA_ID, sim_idx);
+ snprintf(keyName, sizeof(keyName), "%s/%d", VOICEMAIL_ALPHA_ID, simIndex);
if (MsgSettingSetString(keyName, VOICEMAIL_DEFAULT_ALPHA_ID) != MSG_SUCCESS)
MSG_DEBUG("Error to set config data [%s]", keyName);
}
-void SmsPluginSetting::SimRefreshCb()
+void Sms3gpp2Setting::SimRefreshCb(TapiHandle *handle)
{
pthread_t thd;
- if (pthread_create(&thd, NULL, &init_config_data, NULL) < 0) {
- MSG_DEBUG("pthread_create() error");
+ if (pthread_create(&thd, NULL, &init_config_data, handle) < 0) {
+ MSG_ERR("pthread_create() error");
+ } else {
+ pthread_detach(thd);
}
-
- pthread_detach(thd);
}
-void* SmsPluginSetting::init_config_data(void *data)
+void* Sms3gpp2Setting::init_config_data(void *data)
{
- instance()->initConfigData();
+ instance()->initConfigData(static_cast<TapiHandle*>(data));
return NULL;
}
-void SmsPluginSetting::setConfigData(const MSG_SETTING_S *pSetting)
+void Sms3gpp2Setting::setConfigData(const MSG_SETTING_S *pSetting)
{
MSG_DEBUG("Setting Type : [%d]", pSetting->type);
case MSG_VOICEMAIL_OPT:
setVoiceMailInfo(&pSetting->option.voiceMailOpt);
break;
-
case MSG_CBMSG_OPT :
setCbConfig(&pSetting->option.cbMsgOpt);
break;
}
-void SmsPluginSetting::getConfigData(MSG_SETTING_S *pSetting)
+void Sms3gpp2Setting::getConfigData(MSG_SETTING_S *pSetting)
{
MSG_DEBUG("Setting Type : [%d]", pSetting->type);
case MSG_CBMSG_OPT :
getCbConfig(&pSetting->option.cbMsgOpt);
break;
-
default :
THROW(MsgException::SMS_PLG_ERROR, "The Setting type is not supported. [%d]", pSetting->type);
break;
}
-msg_error_t SmsPluginSetting::addCbOpt(MSG_CBMSG_OPT_S *pCbOpt)
+msg_error_t Sms3gpp2Setting::addCbOpt(MSG_CBMSG_OPT_S *pCbOpt)
{
msg_error_t err = MSG_SUCCESS;
}
-void SmsPluginSetting::getCbOpt(MSG_SETTING_S *pSetting)
+void Sms3gpp2Setting::getCbOpt(MSG_SETTING_S *pSetting, int simIndex)
{
msg_error_t err = MSG_SUCCESS;
MsgDbHandler dbHandle;
err = MsgStoGetCBChannelInfo(&dbHandle, &pSetting->option.cbMsgOpt.channelData);
MSG_DEBUG("MsgStoAddCBChannelInfo : err=[%d]", err);
+ pSetting->option.cbMsgOpt.simIndex = simIndex;
#if 0
char keyName[128];
#endif
}
-
-void SmsPluginSetting::setVoiceMailInfo(const MSG_VOICEMAIL_OPT_S *pVoiceOpt)
+void Sms3gpp2Setting::setVoiceMailInfo(const MSG_VOICEMAIL_OPT_S *pVoiceOpt)
{
bUpdateVoicemailByMdn = false;
-
- return;
}
-
-bool SmsPluginSetting::setCbConfig(const MSG_CBMSG_OPT_S *pCbOpt)
+bool Sms3gpp2Setting::setCbConfig(const MSG_CBMSG_OPT_S *pCbOpt)
{
- int ret = TAPI_API_SUCCESS;
+ TapiHandle *tHandle = SmsPluginDSHandler::instance()->getTelHandle(pCbOpt->simIndex);
+ MSG_DEBUG("simIndex: (%d)", pCbOpt->simIndex);
-#if 1
TelSmsCbConfig_t cbConfig = {};
-
cbConfig.CBEnabled = (int)pCbOpt->bReceive;
cbConfig.Net3gppType = TAPI_NETTEXT_NETTYPE_3GPP2;
/* cbConfig.MsgIdMaxCount = pCbOpt->maxSimCnt; */
}
MSG_DEBUG("CBEnabled: %d, range_count: %d", cbConfig.CBEnabled, cbConfig.MsgIdRangeCount);
- ret = tel_set_sms_cb_config(pTapiHandle, &cbConfig, TapiEventSetConfigData, NULL);
-
- if (ret == TAPI_API_SUCCESS) {
+ int tRet = tel_set_sms_cb_config(tHandle, &cbConfig, Sms3gpp2TapiEventHandler::respSetConfigData, NULL);
+ if (tRet == TAPI_API_SUCCESS) {
MSG_DEBUG("######## tel_set_sms_cb_config() Success !!! #######");
} else {
- MSG_DEBUG("######## tel_set_sms_cb_config() Fail !!! return : %d #######", ret);
+ MSG_ERR("######## tel_set_sms_cb_config() Fail !!! return : %d #######", tRet);
return false;
}
-#if 0
- if (getResultFromSim() == true) {
- MSG_DEBUG("######## Set Cb Config was Successful !!! #######");
- } else {
- MSG_DEBUG("######## Set Cb Config was Failed !!! #######");
- return false;
- }
-#endif
-#endif
return true;
}
-bool SmsPluginSetting::getCbConfig(MSG_CBMSG_OPT_S *pCbOpt)
+bool Sms3gpp2Setting::getCbConfig(MSG_CBMSG_OPT_S *pCbOpt)
{
- int ret = TAPI_API_SUCCESS;
-#if 1
- ret = tel_get_sms_cb_config(pTapiHandle, TapiEventGetCBConfig, NULL);
+ TapiHandle *tHandle = SmsPluginDSHandler::instance()->getTelHandle(pCbOpt->simIndex);
+ MSG_DEBUG("simIndex: (%d)", pCbOpt->simIndex);
- if (ret == TAPI_API_SUCCESS) {
+ int tRet = tel_get_sms_cb_config(tHandle, Sms3gpp2TapiEventHandler::respGetCBConfig, NULL);
+ if (tRet == TAPI_API_SUCCESS) {
MSG_DEBUG("######## tel_get_sms_cb_config() Success !!! #######");
} else {
- MSG_DEBUG("######## tel_get_sms_cb_config() Fail !!! return : %d #######", ret);
+ MSG_ERR("######## tel_get_sms_cb_config() Fail !!! return : %d #######", tRet);
return false;
}
if (getCbConfigEvent(pCbOpt) == true) {
MSG_DEBUG("######## Get Cb Config was Successful !!! #######");
} else {
- MSG_DEBUG("######## Get Cb Config was Failed !!! #######");
+ MSG_ERR("######## Get Cb Config was Failed !!! #######");
return false;
}
-#endif
+
return true;
}
-void SmsPluginSetting::getMeImei(char *pImei)
+void Sms3gpp2Setting::getMeImei(char *pImei)
{
#if 0
int ret = TAPI_API_SUCCESS;
#endif
}
-bool SmsPluginSetting::getUpdateVoicemailByMdn()
+bool Sms3gpp2Setting::getUpdateVoicemailByMdn()
{
return bUpdateVoicemailByMdn;
}
-void SmsPluginSetting::setCbConfigEvent(const MSG_CBMSG_OPT_S *pCbOpt, bool bSuccess)
+void Sms3gpp2Setting::setCbConfigEvent(const MSG_CBMSG_OPT_S *pCbOpt, bool bSuccess)
{
mx.lock();
}
-bool SmsPluginSetting::getCbConfigEvent(MSG_CBMSG_OPT_S *pCbOpt)
+bool Sms3gpp2Setting::getCbConfigEvent(MSG_CBMSG_OPT_S *pCbOpt)
{
int ret = 0;
}
-void SmsPluginSetting::setResultImei(bool bResult, char *pImei)
+void Sms3gpp2Setting::setResultImei(bool bResult, char *pImei)
{
mx.lock();
}
-bool SmsPluginSetting::getResultImei(char *pImei)
+bool Sms3gpp2Setting::getResultImei(char *pImei)
{
int ret = 0;
}
-void SmsPluginSetting::setResultFromEvent(bool bResult)
+void Sms3gpp2Setting::setResultFromEvent(bool bResult)
{
mx.lock();
}
-void SmsPluginSetting::setMwiInfo(MSG_SUB_TYPE_T type, int count)
+void Sms3gpp2Setting::setMwiInfo(int simIndex, MSG_SUB_TYPE_T type, int count)
{
MSG_DEBUG("SET MWI INFO, type=[%d]", type);
MSG_DEBUG("SET MWI INFO, count=[%d]", count);
}
-bool SmsPluginSetting::getMsisdnInfo(void)
+bool Sms3gpp2Setting::getMsisdnInfo(TapiHandle *handle)
{
- int ret = TAPI_API_SUCCESS;
-
- ret = tel_get_sim_msisdn(pTapiHandle, TapiEventGetMsisdnInfo, NULL);
+ int tRet = tel_get_sim_msisdn(handle, Sms3gpp2TapiEventHandler::respGetMsisdnInfo, NULL);
- if (ret == TAPI_API_SUCCESS) {
+ if (tRet == TAPI_API_SUCCESS) {
MSG_DEBUG("######## tel_get_sim_msisdn() Success !!! #######");
} else {
- MSG_DEBUG("######## tel_get_sim_msisdn() Fail !!! return : %d #######", ret);
+ MSG_ERR("######## tel_get_sim_msisdn() Fail !!! return : %d #######", tRet);
return false;
}
if (getResultFromSim() == true) {
MSG_DEBUG("######## Get Sim msisdn was Successful !!! #######");
} else {
- MSG_DEBUG("######## Get Sim msisdn was Failed !!! #######");
+ MSG_ERR("######## Get Sim msisdn was Failed !!! #######");
return false;
}
}
-void SmsPluginSetting::setResultFromSim(bool bResult)
+void Sms3gpp2Setting::setResultFromSim(bool bResult)
{
mx.lock();
}
-bool SmsPluginSetting::getResultFromSim()
+bool Sms3gpp2Setting::getResultFromSim()
{
int ret = 0;
*/
#include <glib.h>
-#include <pthread.h>
+#include <TelSms.h>
+#include <TelNetwork.h>
+#include <TelPower.h>
#include "MsgDebug.h"
#include "MsgCppTypes.h"
#include "MsgException.h"
#include "MsgGconfWrapper.h"
-#include "SmsCdmaPluginEventHandler.h"
-#include "SmsCdmaPluginParamCodec.h"
-#include "SmsCdmaPluginCodec.h"
-#include "SmsCdmaPluginTransport.h"
-#include "SmsCdmaPluginSetting.h"
-#include "SmsCdmaPluginCallback.h"
-
-extern struct tapi_handle *pTapiHandle;
-extern bool isMemAvailable;
-
-void _dnet_state_changed_cb(keynode_t *key, void* data);
-void _TapiMdnChangedCb(keynode_t *key, void *data);
+#include "SmsPluginDSHandler.h"
+#include "Sms3gpp2TapiEventHandler.h"
+#include "Sms3gpp2EventHandler.h"
+#include "Sms3gpp2Transport.h"
+#include "Sms3gpp2Setting.h"
+#include "Sms3gpp2Types.h"
+#include "Sms3gpp2Codec.h"
/*==================================================================================================
FUNCTION IMPLEMENTATION
==================================================================================================*/
-
-SmsPluginCallback* SmsPluginCallback::pInstance = NULL;
-
-
-SmsPluginCallback::SmsPluginCallback()
-{
-}
-
-
-SmsPluginCallback::~SmsPluginCallback()
-{
- if (pInstance != NULL) {
- delete pInstance;
- pInstance = NULL;
- }
-}
-
-
-SmsPluginCallback* SmsPluginCallback::instance()
-{
- if (!pInstance)
- pInstance = new SmsPluginCallback();
-
- return pInstance;
-}
-
-
-void SmsPluginCallback::registerEvent()
-{
- if (tel_register_noti_event(pTapiHandle, TAPI_NOTI_SMS_DEVICE_READY, TapiEventDeviceReady, NULL) != TAPI_API_SUCCESS)
- MSG_DEBUG("tel_register_noti_event is failed : [%s]", TAPI_NOTI_SMS_DEVICE_READY);
- if (tel_register_noti_event(pTapiHandle, TAPI_NOTI_SMS_INCOM_MSG, TapiEventMsgIncoming, NULL) != TAPI_API_SUCCESS)
- MSG_DEBUG("tel_register_noti_event is failed : [%s]", TAPI_NOTI_SMS_INCOM_MSG);
- if (tel_register_noti_event(pTapiHandle, TAPI_PROP_NETWORK_SERVICE_TYPE, TapiEventNetworkStatusChange, NULL) != TAPI_API_SUCCESS)
- MSG_DEBUG("tel_register_noti_event is failed : [%s]", TAPI_PROP_NETWORK_SERVICE_TYPE);
- if (tel_register_noti_event(pTapiHandle, TAPI_NOTI_SIM_REFRESHED, TapiEventSimRefreshed, NULL) != TAPI_API_SUCCESS)
- MSG_DEBUG("tel_register_noti_event is failed : [%s]", TAPI_NOTI_SIM_REFRESHED);
-
- msg_error_t err = MSG_SUCCESS;
- err = MsgSettingRegVconfCBCommon(VCONFKEY_DNET_STATE, _dnet_state_changed_cb);
- if (err != MSG_SUCCESS) {
- MSG_DEBUG("MsgSettingRegVconfCBCommon() is failed");
- }
- /* MsgSettingRegVconfCBCommon(VCONFKEY_TELEPHONY_MDN, _TapiMdnChangedCb); */
-}
-
-
-void SmsPluginCallback::deRegisterEvent()
+void Sms3gpp2TapiEventHandler::NotiSmsIncomMsg(TapiHandle *handle, const char *noti_id, void *data, void *user_data)
{
-}
-
-
-void TapiEventDeviceReady(TapiHandle *handle, const char *noti_id, void *data, void *user_data)
-{
- MSG_DEBUG("TapiEventDeviceReady is called. : noti_id = [%d]", noti_id);
-
- try {
- /* Call Event Handler */
- SmsPluginEventHandler::instance()->setDeviceStatus();
-
- if (SmsPluginEventHandler::instance()->getNeedInitConfig() == true) {
- SmsPluginEventHandler::instance()->setNeedInitConfig(false);
- SmsPluginSetting::instance()->SimRefreshCb();
- }
- } catch (MsgException& e) {
- MSG_FATAL("%s", e.what());
- return;
- }
-}
-
-
-void TapiEventMsgIncoming(TapiHandle *handle, const char *noti_id, void *data, void *user_data)
-{
- MSG_WARN("TapiEventMsgIncoming is called. noti_id [%s]", noti_id);
+ MSG_INFO("noti_id: (%s)", noti_id);
- if (data == NULL) {
- MSG_DEBUG("Error. evt->pData is NULL.");
- return;
- }
+ MSG_ERR_RET_M(data == NULL, "Invalid parameter: data is NULL!");
TelSmsDatapackageInfo_t* pDataPackage = (TelSmsDatapackageInfo_t*)data;
}
MSG_WARN("[%s]", tpduTmp);
- sms_trans_msg_s sms_trans_msg;
- memset(&sms_trans_msg, 0x00, sizeof(sms_trans_msg_s));
+ sms_3gpp2_trans_msg_s sms_trans_msg;
+ memset(&sms_trans_msg, 0x00, sizeof(sms_3gpp2_trans_msg_s));
if (pDataPackage->format == (TelSmsNetType_t)0x03) {
/* voice mail notification */
}
sms_trans_msg.data.p2p_msg.address.addr_len = strlen(sms_trans_msg.data.p2p_msg.address.szData);
} else {
- bool bInvalid = SmsPluginMsgCodec::checkInvalidPDU(pDataPackage->szData, pDataPackage->MsgLength);
+ bool bInvalid = Sms3gpp2MsgCodec::checkInvalidPDU(pDataPackage->szData, pDataPackage->MsgLength);
if (bInvalid == true) {
/* Decode Incoming Message */
- SmsPluginMsgCodec::decodeMsg(pDataPackage->szData, pDataPackage->MsgLength, &sms_trans_msg);
+ Sms3gpp2MsgCodec::decodeMsg(pDataPackage->szData, pDataPackage->MsgLength, &sms_trans_msg);
if (sms_trans_msg.data.cb_msg.telesvc_msg.data.deliver.cmas_data.is_wrong_recode_type) {
MSG_WARN("Invalid CMAS Record Type");
MSG_DEBUG("sms_trans_msg.data.p2p_msg.address.szData = [%s]", sms_trans_msg.data.p2p_msg.address.szData);
MSG_DEBUG("sms_trans_msg.data.p2p_msg.svc_ctg = [%d]", sms_trans_msg.data.p2p_msg.svc_ctg);
MSG_DEBUG("----------------------- teleservice layer : deliver data -------------------------");
- sms_telesvc_deliver_s *deliver_msg = &(sms_trans_msg.data.p2p_msg.telesvc_msg.data.deliver);
+ sms_3gpp2_telesvc_deliver_s *deliver_msg = &(sms_trans_msg.data.p2p_msg.telesvc_msg.data.deliver);
MSG_DEBUG("sms_trans_msg.data.p2p_msg.telesvc_msg.type = [%d]", sms_trans_msg.data.p2p_msg.telesvc_msg.type);
MSG_DEBUG("priority= [%d]", deliver_msg->priority);
MSG_DEBUG("privacy= [%d]", deliver_msg->privacy);
MSG_DEBUG("display_mode= [%d]", deliver_msg->display_mode);
MSG_DEBUG("language= [%d]", deliver_msg->language);
- MSG_DEBUG("msg_id= [%d]", deliver_msg->msg_id);
+ MSG_DEBUG("msg_id= [%u]", deliver_msg->msg_id.msg_id);
MSG_DEBUG("alert_priority= [%d]", deliver_msg->alert_priority);
MSG_DEBUG("num_msg= [%d]", deliver_msg->num_msg);
MSG_DEBUG("user_data.msg_type= [%d]", deliver_msg->user_data.msg_type);
MSG_DEBUG("------------------------------ transport layer data -----------------------------");
MSG_DEBUG("sms_trans_msg.data.cb_msg.svc_ctg = [%d]", sms_trans_msg.data.cb_msg.svc_ctg);
MSG_DEBUG("----------------------- teleservice layer : deliver data -------------------------");
- sms_telesvc_deliver_s *deliver_msg = &(sms_trans_msg.data.cb_msg.telesvc_msg.data.deliver);
+ sms_3gpp2_telesvc_deliver_s *deliver_msg = &(sms_trans_msg.data.cb_msg.telesvc_msg.data.deliver);
MSG_DEBUG("sms_trans_msg.data.cb_msg.telesvc_msg.type = [%d]", sms_trans_msg.data.cb_msg.telesvc_msg.type);
MSG_DEBUG("priority= [%d]", deliver_msg->priority);
MSG_DEBUG("display_mode= [%d]", deliver_msg->display_mode);
MSG_DEBUG("language= [%d]", deliver_msg->language);
- MSG_DEBUG("msg_id= [%d]", deliver_msg->msg_id);
+ MSG_DEBUG("msg_id= [%u]", deliver_msg->msg_id.msg_id);
MSG_DEBUG("msg_id.msg_id)= [%d]", deliver_msg->msg_id.msg_id);
MSG_DEBUG("header_ind= [%d]", deliver_msg->msg_id.header_ind);
MSG_DEBUG("alert_priority= [%d]", deliver_msg->alert_priority);
try {
if (sms_trans_msg.type == SMS_TRANS_P2P_MSG) {
if (sms_trans_msg.data.p2p_msg.telesvc_id == SMS_TRANS_TELESVC_WAP) {
- SmsPluginEventHandler::instance()->handleWapMsgIncoming(&(sms_trans_msg.data.p2p_msg));
+ Sms3gpp2EventHandler::instance()->handleWapMsgIncoming(handle, &(sms_trans_msg.data.p2p_msg));
} else {
/* Call Event Handler */
- SmsPluginEventHandler::instance()->handleMsgIncoming(&(sms_trans_msg.data.p2p_msg));
+ Sms3gpp2EventHandler::instance()->handleMsgIncoming(handle, &(sms_trans_msg.data.p2p_msg));
}
} else if (sms_trans_msg.type == SMS_TRANS_BROADCAST_MSG) {
/* Call Event Handler */
- SmsPluginEventHandler::instance()->handleCbMsgIncoming(&(sms_trans_msg.data.cb_msg));
+ Sms3gpp2EventHandler::instance()->handleCbMsgIncoming(handle, &(sms_trans_msg.data.cb_msg));
} else if (sms_trans_msg.type == SMS_TRANS_ACK_MSG) {
/* Call Event Handler */
- /* SmsPluginEventHandler::instance()->handleAckMsgIncoming(&(sms_trans_msg.data.ack_msg)); */
+ /* Sms3gpp2EventHandler::instance()->handleAckMsgIncoming(&(sms_trans_msg.data.ack_msg)); */
}
} catch (MsgException& e) {
MSG_FATAL("%s", e.what());
}
}
+void Sms3gpp2TapiEventHandler::NotiSimRefreshed(TapiHandle *handle, const char *noti_id, void *data, void *user_data)
+{
+ MSG_INFO("noti_id: (%s)", noti_id);
+
+ Sms3gpp2Setting::instance()->SimRefreshCb(handle);
+}
-void TapiEventNetworkStatusChange(TapiHandle *handle, const char *noti_id, void *data, void *user_data)
+void Sms3gpp2TapiEventHandler::NotiSmsDeviceReady(TapiHandle *handle, const char *noti_id, void *data, void *user_data)
{
- MSG_DEBUG("TapiEventNetworkStatusChange is called.");
+ try {
+ int deviceStatus = *(int*)data;
+ MSG_INFO("Device ready status: (%d)", deviceStatus);
- if (data == NULL) {
- MSG_DEBUG("Error. data is NULL.");
+ Sms3gpp2EventHandler::instance()->setDeviceStatus(handle, deviceStatus != TAPI_NETTEXT_READY_STATUS_NONE);
+
+ if (SmsPluginDSHandler::instance()->getNeedToInitializeSim(handle) == true) {
+ SmsPluginDSHandler::instance()->setNeedToInitializeSim(handle, false);
+ Sms3gpp2Setting::instance()->initializeSimInfo(handle);
+ }
+ } catch (MsgException& e) {
+ MSG_FATAL("%s", e.what());
return;
}
+}
- TelNetworkServiceType_t *type = (TelNetworkServiceType_t *)data;
+void Sms3gpp2TapiEventHandler::NotiNetworkRegistrationType(TapiHandle *handle, const char *noti_id, void *data, void *user_data)
+{
+ MSG_ERR_RET_M(data == NULL, "Invalid parameter: data is NULL!");
+
+ TelNetworkServiceType_t *type = (TelNetworkServiceType_t *)data;
MSG_DEBUG("network status type [%d]", *type);
if (*type > TAPI_NETWORK_SERVICE_TYPE_SEARCH) {
- /* Call Event Handler */
- SmsPluginEventHandler::instance()->handleResendMessage();
+ Sms3gpp2EventHandler::instance()->handleResendMessage();
}
}
-
-void TapiEventSimRefreshed(TapiHandle *handle, const char *noti_id, void *data, void *user_data)
+void Sms3gpp2TapiEventHandler::respSetMemoryStatus(TapiHandle *handle, int result, void *data, void *user_data)
{
- MSG_DEBUG("TapiEventSimRefreshed is called.");
-
- SmsPluginSetting::instance()->SimRefreshCb();
-}
+ MSG_INFO("result: (%d)", result);
-
-void TapiEventMemoryStatus(TapiHandle *handle, int result, void *data, void *user_data)
-{
- MSG_DEBUG("Tapi result is [%d]", result);
if (result == TAPI_API_SUCCESS) {
- isMemAvailable = true;
+ Sms3gpp2Transport::instance()->setIsMemAvailable(true);
}
}
-
-void TapiEventSentStatus(TapiHandle *handle, int result, void *data, void *user_data)
+void Sms3gpp2TapiEventHandler::respSentStatus(TapiHandle *handle, int result, void *data, void *user_data)
{
- MSG_DEBUG("TapiEventSentStatus is called. result = [%d]", result);
+ MSG_DEBUG("result: (0x%x)", result);
- sms_network_status_t sentStatus;
+ SMS_NETWORK_STATUS_T sentStatus;
/* Convert TAPI status -> SMS network status */
switch ((TelSmsResponse_t)result) {
MSG_DEBUG("SMS Network Status = [%d]", sentStatus);
if (sentStatus == SMS_NETWORK_SEND_FAIL_TEMPORARY ||
- sentStatus == SMS_NETWORK_SEND_FAIL_MANDATORY_INFO_MISSING ||
- sentStatus == SMS_NETWORK_SEND_FAIL_FDN_RESTRICED) {
- SmsPluginTransport::instance()->setNetStatus(sentStatus);
+ sentStatus == SMS_NETWORK_SEND_FAIL_MANDATORY_INFO_MISSING ||
+ sentStatus == SMS_NETWORK_SEND_FAIL_FDN_RESTRICED) {
+ Sms3gpp2Transport::instance()->setNetStatus(sentStatus);
return;
}
netStatus = MSG_NETWORK_SENDING;
} else if (sentStatus == SMS_NETWORK_SEND_PENDING) {
netStatus = MSG_NETWORK_SEND_PENDING;
+#if 0 /* sentStatus below is not used */
+ } else if (sentStatus == SMS_NETWORK_SENDING) {
+ netStatus = MSG_NETWORK_SENDING;
} else if (sentStatus == SMS_NETWORK_SEND_FAIL_UNKNOWN_SUBSCRIBER) {
netStatus = MSG_NETWORK_SEND_FAIL_UNKNOWN_SUBSCRIBER;
} else if (sentStatus == SMS_NETWORK_SEND_FAIL_MS_DISABLED) {
netStatus = MSG_NETWORK_SEND_FAIL_MS_DISABLED;
} else if (sentStatus == SMS_NETWORK_SEND_FAIL_NETWORK_NOT_READY) {
netStatus = MSG_NETWORK_SEND_FAIL_NETWORK_NOT_READY;
+#endif
} else {
netStatus = MSG_NETWORK_SEND_FAIL;
}
try {
- SmsPluginEventHandler::instance()->handleSentStatus(netStatus);
-
- SmsPluginTransport::instance()->setNetStatus(sentStatus);
+ Sms3gpp2EventHandler::instance()->handleSentStatus(netStatus);
+ Sms3gpp2Transport::instance()->setNetStatus(sentStatus);
} catch (MsgException& e) {
MSG_FATAL("%s", e.what());
return;
}
}
-
-void TapiEventDeliveryReportCNF(TapiHandle *handle, int result, void *data, void *user_data)
+void Sms3gpp2TapiEventHandler::respDeliveryReportCNF(TapiHandle *handle, int result, void *data, void *user_data)
{
- MSG_DEBUG("TapiEventDeliveryReportCNF is called. : result = [%d]", result);
-
- return;
+ MSG_DEBUG("result: (%d)", result);
}
-
-void TapiEventSetConfigData(TapiHandle *handle, int result, void *data, void *user_data)
+void Sms3gpp2TapiEventHandler::respSetConfigData(TapiHandle *handle, int result, void *data, void *user_data)
{
- MSG_DEBUG("TapiEventSetConfigData is called.");
+ MSG_INFO("result: (%d)", result);
if (data == NULL) {
- MSG_DEBUG("Error. data is NULL.");
- SmsPluginSetting::instance()->setResultFromEvent(false);
+ MSG_ERR("Error. data is NULL. result:%d", result);
+ Sms3gpp2Setting::instance()->setResultFromEvent(false);
return;
}
MSG_DEBUG("TAPI_NETTEXT_SETMESSAGESTATUS_RSP is called");
break;
default:
- MSG_DEBUG("Unknown Response is called [%d]", *responseType);
+ MSG_WARN("Unknown Response is called [%d]", *responseType);
break;
}
MSG_DEBUG("status : [%d]", (TelSmsCause_t)result);
- if ((TelSmsCause_t)result != TAPI_NETTEXT_SUCCESS) bRet = false;
+ if ((TelSmsCause_t)result != TAPI_NETTEXT_SUCCESS) {
+ bRet = false;
+ }
- SmsPluginSetting::instance()->setResultFromEvent(bRet);
+ Sms3gpp2Setting::instance()->setResultFromEvent(bRet);
}
-
-void TapiEventGetCBConfig(TapiHandle *handle, int result, void *data, void *user_data)
+void Sms3gpp2TapiEventHandler::respGetCBConfig(TapiHandle *handle, int result, void *data, void *user_data)
{
- MSG_DEBUG("TapiEventGetCBConfig is called.");
+ MSG_INFO("result: (%d)", result);
MSG_CBMSG_OPT_S cbOpt = {0};
if (result != TAPI_API_SUCCESS || data == NULL) {
- MSG_DEBUG("Error. data is NULL.");
-
- SmsPluginSetting::instance()->setCbConfigEvent(NULL, false);
-
+ MSG_ERR("Error. data is NULL. result:%d", result);
+ Sms3gpp2Setting::instance()->setCbConfigEvent(NULL, false);
return;
}
/* cbOpt.maxSimCnt = pCBConfig->MsgIdMaxCount; */
/* MSG_DEBUG("Receive [%d], Max SIM Count [%d]", cbOpt.bReceive, cbOpt.maxSimCnt); */
-
MSG_DEBUG("Receive [%d]", cbOpt.bReceive);
cbOpt.channelData.channelCnt = pCBConfig->MsgIdRangeCount;
MSG_DEBUG("Channel Category [%d], Channel Language [%d] ", cbOpt.channelData.channelInfo[i].ctg, cbOpt.channelData.channelInfo[i].lang);
}
- SmsPluginSetting::instance()->setCbConfigEvent(&cbOpt, true);
+ Sms3gpp2Setting::instance()->setCbConfigEvent(&cbOpt, true);
}
-
-void TapiEventGetMsisdnInfo(TapiHandle *handle, int result, void *data, void *user_data)
+void Sms3gpp2TapiEventHandler::respGetMsisdnInfo(TapiHandle *handle, int result, void *data, void *user_data)
{
- MSG_DEBUG("TapiEventGetMsisdnInfo is called.");
+ MSG_INFO("result: (%d)", result);
bool bRet = false;
if (result != TAPI_SIM_ACCESS_SUCCESS || data == NULL) {
- MSG_DEBUG("Error. data is NULL.");
- SmsPluginSetting::instance()->setResultFromSim(bRet);
+ MSG_ERR("Error. data is NULL. result:%d", result);
+ Sms3gpp2Setting::instance()->setResultFromSim(bRet);
return;
}
TelSimMsisdnList_t *list = (TelSimMsisdnList_t *)data;
- char keyName[MAX_VCONFKEY_NAME_LEN];
- int simIndex = 1;
-
- memset(keyName, 0x00, sizeof(keyName));
- snprintf(keyName, sizeof(keyName), "%s/%d", MSG_SIM_MSISDN, simIndex);
-
for (int i = 0; i < list->count; i++) {
if (list->list[i].num[0] != '\0') {
+ char keyName[MAX_VCONFKEY_NAME_LEN] = { 0, };
+ snprintf(keyName, sizeof(keyName), "%s/%d", MSG_SIM_MSISDN, SmsPluginDSHandler::instance()->getSimIndex(handle));
+
if (MsgSettingSetString(keyName, list->list[i].num) == MSG_SUCCESS) {
- MSG_SEC_DEBUG("Get MSISDN from SIM : [%s]", list->list[i].num);
+ MSG_SEC_INFO("Get MSISDN from SIM : [%s]", list->list[i].num);
bRet = true;
} else {
- MSG_DEBUG("Getting MSISDN is failed!");
+ MSG_ERR("Getting MSISDN is failed!");
}
break;
}
}
- SmsPluginSetting::instance()->setResultFromSim(bRet);
-}
-
-
-void _dnet_state_changed_cb(keynode_t *key, void* data)
-{
- int dnet_state = 0;
- if (MsgSettingGetInt(VCONFKEY_DNET_STATE, &dnet_state) != MSG_SUCCESS) {
- MSG_INFO("MsgSettingGetInt() is failed");
- }
-
- if (dnet_state > VCONFKEY_DNET_OFF) {
- /* Call Event Handler */
- SmsPluginEventHandler::instance()->handleResendMessage();
- }
-}
-
-
-void _TapiMdnChangedCb(keynode_t *key, void *data)
-{
- MSG_INFO("_TapiMdnChangedCb is called.");
-
- char *mdn = vconf_get_str("db/telephony/mdn");
-
- if (mdn) {
- bool bNeedToUpdateVoicemail = SmsPluginSetting::instance()->getUpdateVoicemailByMdn();
- MSG_INFO("bNeedToUpdateVoicemail:%d, mdn:[%s]", bNeedToUpdateVoicemail, mdn);
-
- if (bNeedToUpdateVoicemail) {
- char keyName[MAX_VCONFKEY_NAME_LEN];
- int sim_idx = 1;
-
- memset(keyName, 0x00, sizeof(keyName));
- snprintf(keyName, sizeof(keyName), "%s/%d", VOICEMAIL_NUMBER, sim_idx);
- if (MsgSettingSetString(keyName, mdn) != MSG_SUCCESS)
- MSG_DEBUG("Error to set config data [%s]", keyName);
- }
-
- free(mdn);
- }
+ Sms3gpp2Setting::instance()->setResultFromSim(bRet);
}
*/
#include <errno.h>
+#include <TapiUtility.h>
+#include <TelSms.h>
+#include <TelNetwork.h>
+#include <ITapiNetText.h>
#include "MsgGconfWrapper.h"
#include "MsgException.h"
+#include "MsgUtilFunction.h"
#include "MsgUtilStorage.h"
#include "MsgNotificationWrapper.h"
-#include "SmsCdmaPluginTransport.h"
-#include "SmsCdmaPluginCodec.h"
-#include "SmsCdmaPluginEventHandler.h"
-#include "SmsCdmaPluginCallback.h"
+#include "Sms3gpp2Transport.h"
+#include "Sms3gpp2Codec.h"
+#include "Sms3gpp2EventHandler.h"
+#include "Sms3gpp2TapiEventHandler.h"
+#include "Sms3gpp2UAManager.h"
+#include "SmsPluginDSHandler.h"
+#include "SmsPluginStorage.h"
-extern "C" {
-#include "TapiUtility.h"
-#include "TelSms.h"
-#include "TelNetwork.h"
-#include "ITapiNetText.h"
-}
-extern struct tapi_handle *pTapiHandle;
-extern bool isMemAvailable;
+Sms3gpp2Transport* Sms3gpp2Transport::pInstance = NULL;
-/*==================================================================================================
- FUNCTION IMPLEMENTATION
-==================================================================================================*/
+msg_error_t Sms3gpp2SubmitRequest(MSG_REQUEST_INFO_S *pReqInfo)
+{
+ msg_error_t err = MSG_SUCCESS;
+
+#ifdef MSG_FEATURE_MDM
+#ifdef MSG_FEATURE_MDM_PHASE_2
+ /* Check MDM policy for Normal SMS */
+ if (pReqInfo->msgInfo.msgType.subType == MSG_NORMAL_SMS) {
+ if (MsgMdmGetStatus(MSG_MDM_OUTGOING_COUNT_LIMIT, pReqInfo->msgInfo.sim_idx, NULL) == MDM_RESTRICTED) {
+ MSG_INFO("SmsPlgSubmitRequest is restricted by MDM count limit.");
+ err = SmsPluginStorage::instance()->updateSentMsg(&(pReqInfo->msgInfo), MSG_NETWORK_SEND_FAIL);
+ if (err == MSG_SUCCESS) {
+ return MSG_ERR_MDM_RESTRICT;
+ } else {
+ return err;
+ }
+ }
+
+ for (int i = 0; i < pReqInfo->msgInfo.nAddressCnt; i++) {
+ if (MsgMdmGetStatus(MSG_MDM_OUTGOING_RESTRICTION, pReqInfo->msgInfo.sim_idx, pReqInfo->msgInfo.addressList[i].addressVal) == MDM_RESTRICTED) {
+ MSG_INFO("SmsPlgSubmitRequest is restricted by MDM pattern matching.");
+ err = SmsPluginStorage::instance()->updateSentMsg(&(pReqInfo->msgInfo), MSG_NETWORK_SEND_FAIL);
+ if (err == MSG_SUCCESS) {
+ return MSG_ERR_MDM_RESTRICT;
+ } else {
+ return err;
+ }
+ }
+ }
+ }
+#endif
+#endif
+
+ /* Add Submit SMS into DB */
+ if (pReqInfo->msgInfo.msgId == 0) {
+ if (pReqInfo->msgInfo.msgPort.valid == false) {
+ err = SmsPluginStorage::instance()->checkMessage(&(pReqInfo->msgInfo));
+
+ if (err != MSG_SUCCESS) {
+ MSG_ERR("######## checkMessage Fail !! [err=%d]", err);
+ return MSG_ERR_PLUGIN_STORAGE;
+ }
+
+ err = SmsPluginStorage::instance()->addSmsMessage(&(pReqInfo->msgInfo));
+ if (err != MSG_SUCCESS) {
+ MSG_ERR("######## addSmsMessage Fail !! [err=%d]", err);
+ return MSG_ERR_PLUGIN_STORAGE;
+ }
+
+ if (SmsPluginStorage::instance()->addSmsSendOption(&(pReqInfo->msgInfo), &(pReqInfo->sendOptInfo)) != MSG_SUCCESS) {
+ MSG_ERR("######## addSmsSendOption Fail !!");
+ return MSG_ERR_PLUGIN_STORAGE;
+ }
+ }
+ }
+
+#ifdef MSG_FEATURE_MDM
+#ifdef MSG_FEATURE_MDM_PHASE_2
+ /* MDM :: SMS capture for outgoing SMS */
+ if (pReqInfo->msgInfo.msgType.subType == MSG_NORMAL_SMS) {
+ if (MsgMdmGetStatus(MSG_MDM_MESSAGE_COPY, pReqInfo->msgInfo.sim_idx, NULL) == MDM_ENABLED) {
+ mdm_result_t mdmResult = MsgMdmMessageCopy(&pReqInfo->msgInfo);
+ if (mdmResult != MDM_RESULT_SUCCESS) {
+ MSG_ERR("MsgMdmMessageCopy() failed: (%d)", mdmResult);
+ }
+ }
+ }
+#endif
+#endif
+
+ /* Check SIM is present or not */
+ /*
+ MSG_SIM_STATUS_T simStatus = 0;
+ if (MsgSettingGetInt(keyName, (int*)&simStatus) != MSG_SUCCESS) {
+ MSG_ERR("MsgSettingGetInt() failed!");
+ }
+
+ if (simStatus == MSG_SIM_STATUS_NOT_FOUND) {
+ MSG_DEBUG("SIM is not present..");
+
+ if (pReqInfo->msgInfo.msgPort.valid == false)
+ SmsPluginStorage::instance()->updateSentMsg(&(pReqInfo->msgInfo), MSG_NETWORK_SEND_FAIL);
+
+ return MSG_ERR_NO_SIM;
+ }
+ */
+
+ sms_3gpp2_request_info_s *request = NULL;
-SmsPluginTransport* SmsPluginTransport::pInstance = NULL;
+ request = (sms_3gpp2_request_info_s *)calloc(1, sizeof(sms_3gpp2_request_info_s));
+ if (request != NULL) {
+ request->reqId = pReqInfo->reqId;
-SmsPluginTransport::SmsPluginTransport()
+ memcpy(&(request->msgInfo), &(pReqInfo->msgInfo), sizeof(MSG_MESSAGE_INFO_S));
+ memcpy(&(request->sendOptInfo), &(pReqInfo->sendOptInfo), sizeof(MSG_SENDINGOPT_INFO_S));
+
+ /* Add Request into Queue and Start UA Manger */
+ Sms3gpp2UAManager::instance()->addReqEntity(request);
+
+ free(request);
+ }
+
+
+ return MSG_SUCCESS;
+}
+
+/*==================================================================================================
+ FUNCTION IMPLEMENTATION
+==================================================================================================*/
+Sms3gpp2Transport::Sms3gpp2Transport()
{
+ isMemAvailable = true;
msgRef = 0x00;
msgRef8bit = 0x00;
msgRef16bit = 0x0000;
+ curStatus = SMS_NETWORK_SEND_SUCCESS;
msgSeqNum = 0x00;
if (MsgSettingGetInt(MSG_MESSAGE_ID_COUNTER, (int *)&msgSubmitId) != MSG_SUCCESS) {
}
-SmsPluginTransport::~SmsPluginTransport()
+Sms3gpp2Transport::~Sms3gpp2Transport()
{
}
-SmsPluginTransport* SmsPluginTransport::instance()
+Sms3gpp2Transport* Sms3gpp2Transport::instance()
{
- if (!pInstance)
- pInstance = new SmsPluginTransport();
+ if (!pInstance) {
+ pInstance = new Sms3gpp2Transport();
+ }
return pInstance;
}
-unsigned char SmsPluginTransport::getMsgRef()
+unsigned char Sms3gpp2Transport::getMsgRef()
{
return msgRef++;
}
-unsigned char SmsPluginTransport::getSeqNum()
+unsigned char Sms3gpp2Transport::getSeqNum()
{
msgSeqNum = ((msgSeqNum + 1) % SMS_SEQ_NUM_MAX);
}
-unsigned char SmsPluginTransport::getSubmitMsgId()
+unsigned char Sms3gpp2Transport::getSubmitMsgId()
{
msgSubmitId = ((msgSubmitId + 1) % SMS_MAX_MESSAGE_ID);
}
-void SmsPluginTransport::convertMsgInfoToTelesvcMsg(const MSG_MESSAGE_INFO_S *pMsgInfo, sms_trans_msg_s *pTransMsg)
+void Sms3gpp2Transport::convertMsgInfoToTelesvcMsg(const MSG_MESSAGE_INFO_S *pMsgInfo, sms_3gpp2_trans_msg_s *pTransMsg)
{
switch (pTransMsg->type) {
case SMS_TRANS_P2P_MSG: {
MSG_DEBUG("Convert MSG_MESSAGE_INFO_S data to SMS_TRANS_MSG_S data.");
- sms_trans_p2p_msg_s *pPtpMsg = (sms_trans_p2p_msg_s *)&(pTransMsg->data.p2p_msg);
+ sms_3gpp2_trans_p2p_msg_s *pPtpMsg = (sms_3gpp2_trans_p2p_msg_s *)&(pTransMsg->data.p2p_msg);
convertMsgInfoToPtp(pMsgInfo, pPtpMsg);
}
}
-void SmsPluginTransport::convertMsgInfoToPtp(const MSG_MESSAGE_INFO_S *pMsgInfo, sms_trans_p2p_msg_s *pPtpMsg)
+void Sms3gpp2Transport::convertMsgInfoToPtp(const MSG_MESSAGE_INFO_S *pMsgInfo, sms_3gpp2_trans_p2p_msg_s *pPtpMsg)
{
/* 1. Set Teleservice ID */
pPtpMsg->telesvc_id = SMS_TRANS_TELESVC_CMT_95;
pPtpMsg->address.digit_mode = SMS_DIGIT_4BIT_DTMF;
pPtpMsg->address.number_mode = SMS_NUMBER_MODE_NONE_DATANETWORK;
pPtpMsg->address.number_type = SMS_NUMBER_TYPE_UNKNOWN;
- pPtpMsg->address.number_plan = SMS_NPI_UNKNOWN;
+ pPtpMsg->address.number_plan = SMS_3GPP2_NPI_UNKNOWN;
pPtpMsg->address.addr_len = strlen(pMsgInfo->addressList[0].addressVal);
strncpy(pPtpMsg->address.szData, pMsgInfo->addressList[0].addressVal, pPtpMsg->address.addr_len);
+ pPtpMsg->address.szData[pPtpMsg->address.addr_len] = '\0';
if (pMsgInfo->addressList[0].addressVal[0] == '+') {
pPtpMsg->address.digit_mode = SMS_DIGIT_8BIT;
/* TODO */
/* 5. Set Reply sequence number. */
- pPtpMsg->reply_seq = getSeqNum();
+ bool CDMASupported = MsgCheckFeatureSupport(MSG_TELEPHONY_CDMA_FEATURE);
+
+ if (CDMASupported) {
+ pPtpMsg->reply_seq = getSeqNum();
+ }
/* convert msgInfo to Teleservice Message */
switch (pPtpMsg->telesvc_msg.type) {
}
-void SmsPluginTransport::convertMsgInfoToSubmit(const MSG_MESSAGE_INFO_S *pMsgInfo, sms_telesvc_submit_s *pSubmit)
+void Sms3gpp2Transport::convertMsgInfoToSubmit(const MSG_MESSAGE_INFO_S *pMsgInfo, sms_3gpp2_telesvc_submit_s *pSubmit)
{
if (pSubmit == NULL)
return;
msg_encode_type_t encodeType = MSG_ENCODE_GSM7BIT;
-
if (pMsgInfo->bTextSms == true) {
if (pMsgInfo->encodeType == MSG_ENCODE_GSM7BIT) {
pSubmit->user_data.encode_type = SMS_ENCODE_GSM7BIT;
} else if (pMsgInfo->encodeType == MSG_ENCODE_UCS2) {
pSubmit->user_data.encode_type = SMS_ENCODE_UNICODE;
} else if (pMsgInfo->encodeType == MSG_ENCODE_AUTO) {
- textCvt->convertUTF8ToAuto(decodeData, SMS_MAX_USER_DATA_LEN + 1, (unsigned char*)pMsgInfo->msgText, (int)pMsgInfo->dataSize, &encodeType);
+ textCvt->convertUTF8ToAuto(decodeData, SMS_MAX_USER_DATA_LEN + 1, (unsigned char*)pMsgInfo->msgText, (int)pMsgInfo->dataSize, MSG_ENCODE_ASCII7BIT, &encodeType);
if (encodeType == MSG_ENCODE_ASCII7BIT) {
pSubmit->user_data.encode_type = SMS_ENCODE_7BIT_ASCII;
} else if (encodeType == MSG_ENCODE_8BIT) {
}
memset(pSubmit->user_data.user_data, 0x00, sizeof(pSubmit->user_data.user_data));
- snprintf((char *)pSubmit->user_data.user_data, sizeof(pSubmit->user_data.user_data), "%s", pMsgInfo->msgText);
+ int wrn = snprintf((char *)pSubmit->user_data.user_data, sizeof(pSubmit->user_data.user_data), "%s", pMsgInfo->msgText);
+ if (wrn < 0)
+ MSG_DEBUG("snprintf was failed");
pSubmit->user_data.data_len = pMsgInfo->dataSize;
MSG_DEBUG("encode type : [%d]", pSubmit->user_data.encode_type);
/* 3. Set Valid period */
#if 0
- pSubmit->val_period.format = SMS_TIME_ABSOLUTE;
+ pSubmit->val_period.format = SMS_3GPP2_TIME_ABSOLUTE;
pSubmit->val_period.time.abs_time.year = 0;
pSubmit->val_period.time.abs_time.month = 0;
pSubmit->val_period.time.abs_time.day = 0;
pSubmit->val_period.time.abs_time.minutes = 0;
pSubmit->val_period.time.abs_time.seconds = 0;
#else
- pSubmit->val_period.format = SMS_TIME_RELATIVE;
+ pSubmit->val_period.format = SMS_3GPP2_TIME_RELATIVE;
pSubmit->val_period.time.rel_time.rel_time = SMS_REL_TIME_INDEFINITE;
#endif
}
-void SmsPluginTransport::submitRequest(sms_request_info_s *pReqInfo)
+void Sms3gpp2Transport::submitRequest(sms_3gpp2_request_info_s *pReqInfo)
{
int tapiRet = TAPI_API_SUCCESS;
THROW(MsgException::SMS_PLG_ERROR, "pReqInfo is NULL");
}
+ TapiHandle *handle = SmsPluginDSHandler::instance()->getTelHandle(pReqInfo->msgInfo.sim_idx);
+
/* Get address informations. */
MsgDbHandler *dbHandle = getDbHandle();
MsgStoGetAddressByMsgId(dbHandle, pReqInfo->msgInfo.msgId, &pReqInfo->msgInfo.nAddressCnt, &pReqInfo->msgInfo.addressList);
/* Get MSISDN */
char *msisdn = NULL;
char keyName[MAX_VCONFKEY_NAME_LEN];
- int simIndex = 1;
memset(keyName, 0x00, sizeof(keyName));
- snprintf(keyName, sizeof(keyName), "%s/%d", MSG_SIM_MSISDN, simIndex);
+ snprintf(keyName, sizeof(keyName), "%s/%d", MSG_SIM_MSISDN, pReqInfo->msgInfo.sim_idx);
if (MsgSettingGetString(keyName, &msisdn) != MSG_SUCCESS) {
MSG_INFO("MsgSettingGetString() is failed");
tapi_data_pkg.format = (TelSmsNetType_t)TAPI_NETTEXT_NETTYPE_3GPP2;
/* convert msg_info to trans_msg */
- sms_trans_msg_s trans_msg;
- memset(&trans_msg, 0x00, sizeof(sms_trans_msg_s));
+ sms_3gpp2_trans_msg_s trans_msg;
+ memset(&trans_msg, 0x00, sizeof(sms_3gpp2_trans_msg_s));
- trans_msg.type = (sms_trans_msg_type_t)SMS_TRANS_P2P_MSG;
- trans_msg.data.p2p_msg.telesvc_msg.type = (sms_message_type_t)SMS_TYPE_SUBMIT;
+ trans_msg.type = (sms_3gpp2_trans_msg_type_t)SMS_TRANS_P2P_MSG;
+ trans_msg.data.p2p_msg.telesvc_msg.type = (sms_3gpp2_message_type_t)SMS_TYPE_SUBMIT;
convertMsgInfoToTelesvcMsg(&pReqInfo->msgInfo, &trans_msg);
/* encode msg data */
- unsigned char tel_sms_data[TAPI_NETTEXT_SMDATA_SIZE_MAX+1] = {0, };
-
- tapi_data_pkg.MsgLength = SmsPluginMsgCodec::instance()->encodeMsg(&trans_msg, tel_sms_data);
-
+ unsigned char tel_sms_data[TAPI_NETTEXT_SMDATA_SIZE_MAX+1] = {0,};
+ tapi_data_pkg.MsgLength = Sms3gpp2MsgCodec::instance()->encodeMsg(&trans_msg, tel_sms_data);
memcpy((void *)tapi_data_pkg.szData, (void *)tel_sms_data, sizeof(tapi_data_pkg.szData));
MSG_DEBUG("Submit Request TPDU.");
}
MSG_DEBUG("Encode PDU= [%s]", pduDbg);
- sms_network_status_t retStatus;
+ SMS_NETWORK_STATUS_T retStatus;
- for (int cnt = 0; cnt < MAX_SMS_SEND_RETRY; ++cnt) {
+ for (int cnt = 0; cnt < MAX_SMS_SEND_RETRY_FOR_3GPP2; cnt++) {
/* send request */
- sms_sent_info_s sent_info;
- memset(&sent_info, 0x00, sizeof(sms_sent_info_s));
+ sms_3gpp2_sent_info_s sent_info;
+ memset(&sent_info, 0x00, sizeof(sms_3gpp2_sent_info_s));
memcpy(&sent_info.reqInfo, pReqInfo, sizeof(sent_info.reqInfo));
sent_info.bLast = true;
-
- SmsPluginEventHandler::instance()->SetSentInfo(&sent_info);
+ Sms3gpp2EventHandler::instance()->SetSentInfo(&sent_info);
int svc_type;
- tel_get_property_int(pTapiHandle, TAPI_PROP_NETWORK_SERVICE_TYPE, &svc_type);
+ tel_get_property_int(handle, TAPI_PROP_NETWORK_SERVICE_TYPE, &svc_type);
if (svc_type < TAPI_NETWORK_SERVICE_TYPE_2G) {
MSG_DEBUG("Network service is not available : [%d]", svc_type);
- SmsPluginEventHandler::instance()->handleSentStatus(MSG_NETWORK_SEND_PENDING);
+ Sms3gpp2EventHandler::instance()->handleSentStatus(MSG_NETWORK_SEND_PENDING);
goto _RETURN_FUNC;
}
curStatus = SMS_NETWORK_SENDING;
/* Send SMS */
- tapiRet = tel_send_sms(pTapiHandle, &tapi_data_pkg, bMoreMsgToSend, TapiEventSentStatus, NULL);
-
+ tapiRet = tel_send_sms(handle, &tapi_data_pkg, bMoreMsgToSend, Sms3gpp2TapiEventHandler::respSentStatus, NULL);
if (tapiRet == TAPI_API_SUCCESS) {
MSG_DEBUG("######## tel_send_sms Success !!! return : [%d] #######", tapiRet);
} else {
- SmsPluginEventHandler::instance()->handleSentStatus(MSG_NETWORK_SEND_FAIL);
+ Sms3gpp2EventHandler::instance()->handleSentStatus(MSG_NETWORK_SEND_FAIL);
THROW(MsgException::SMS_PLG_ERROR, "######## tel_send_sms Fail !!! return : [%d] #######", tapiRet);
}
MSG_SMS_VLD_TXT("%d, [%s]", pReqInfo->msgInfo.msgId, pReqInfo->msgInfo.msgText);
retStatus = getNetStatus();
-
if (retStatus != SMS_NETWORK_SEND_FAIL_TEMPORARY)
break;
}
} else {
if (retStatus == SMS_NETWORK_SEND_FAIL_TIMEOUT || retStatus == SMS_NETWORK_SEND_FAIL_TEMPORARY
|| retStatus == SMS_NETWORK_SEND_FAIL_MANDATORY_INFO_MISSING || retStatus == SMS_NETWORK_SEND_FAIL_FDN_RESTRICED)
- SmsPluginEventHandler::instance()->handleSentStatus(MSG_NETWORK_SEND_FAIL);
+ Sms3gpp2EventHandler::instance()->handleSentStatus(MSG_NETWORK_SEND_FAIL);
if (retStatus == SMS_NETWORK_SEND_FAIL_FDN_RESTRICED)
MsgInsertTicker("Unable to send the message while Fixed dialling mode is enabled", SMS_FDN_RESTRICTED, true, 0);
}
MSG_END();
-
return;
}
-
-void SmsPluginTransport::sendDeliverReport(msg_error_t err, sms_trans_p2p_msg_s *p_p2p_msg)
+void Sms3gpp2Transport::sendDeliverReport(TapiHandle *handle, msg_error_t err, sms_3gpp2_trans_p2p_msg_s *p_p2p_msg)
{
MSG_BEGIN();
int tapiRet = TAPI_API_SUCCESS;
TelSmsResponse_t response;
- sms_trans_msg_s trans_msg;
- memset(&trans_msg, 0x00, sizeof(sms_trans_msg_s));
+ sms_3gpp2_trans_msg_s trans_msg;
+ memset(&trans_msg, 0x00, sizeof(sms_3gpp2_trans_msg_s));
- trans_msg.type = (sms_trans_msg_type_t)SMS_TRANS_ACK_MSG;
+ trans_msg.type = (sms_3gpp2_trans_msg_type_t)SMS_TRANS_ACK_MSG;
- if (p_p2p_msg)
- memcpy(&(trans_msg.data.ack_msg.address), &(p_p2p_msg->address), sizeof(sms_trans_addr_s));
+ if (p_p2p_msg) {
+ memcpy(&(trans_msg.data.ack_msg.address), &(p_p2p_msg->address), sizeof(sms_3gpp2_trans_addr_s));
+ }
- sms_trans_cause_code_s cause_code;
- memset(&cause_code, 0x00, sizeof(sms_trans_cause_code_s));
+ sms_3gpp2_trans_cause_code_s cause_code;
+ memset(&cause_code, 0x00, sizeof(sms_3gpp2_trans_cause_code_s));
- if (p_p2p_msg->reply_seq > 0)
+ if ((p_p2p_msg) && (p_p2p_msg->reply_seq > 0))
cause_code.reply_seq = p_p2p_msg->reply_seq;
response = TAPI_NETTEXT_SENDSMS_SUCCESS;
if (isMemAvailable == false) {
- tapiRet = tel_set_sms_memory_status(pTapiHandle, TAPI_NETTEXT_PDA_MEMORY_STATUS_AVAILABLE, TapiEventMemoryStatus, NULL);
+ tapiRet = tel_set_sms_memory_status(handle, TAPI_NETTEXT_PDA_MEMORY_STATUS_AVAILABLE, Sms3gpp2TapiEventHandler::respSetMemoryStatus, NULL);
if (tapiRet == TAPI_API_SUCCESS)
MSG_DEBUG("######## tel_set_sms_memory_status() Success !!! #######");
else
MSG_DEBUG("######## tel_set_sms_memory_status() Failed !!! return : [%d] #######", tapiRet);
}
-
} else if (err == MSG_ERR_MESSAGE_COUNT_FULL) {
cause_code.error_class = SMS_TRANS_ERR_CLASS_TEMPORARY;
-
response = TAPI_NETTEXT_ME_FULL;
/* MsgInsertTicker("Not enough memory. Delete some items.", SMS_MESSAGE_MEMORY_FULL, true, 0); */
- tapiRet = tel_set_sms_memory_status(pTapiHandle, TAPI_NETTEXT_PDA_MEMORY_STATUS_FULL, TapiEventMemoryStatus, NULL);
+ tapiRet = tel_set_sms_memory_status(handle, TAPI_NETTEXT_PDA_MEMORY_STATUS_FULL, Sms3gpp2TapiEventHandler::respSetMemoryStatus, NULL);
if (tapiRet == TAPI_API_SUCCESS)
MSG_DEBUG("######## tel_set_sms_memory_status() Success !!! #######");
cause_code.cause_code = SMS_CAUSE_CODE_SERVICE_TERMINATION_DENIED;
response = TAPI_NETTEXT_SENDSMS_SUCCESS;
-
} else if (err == MSG_ERR_INVALID_MSG_TYPE) {
cause_code.error_class = SMS_TRANS_ERR_CLASS_PERMANENT;
cause_code.cause_code = SMS_CAUSE_CODE_INVAILD_TELESERVICE_ID;
response = TAPI_NETTEXT_INVALID_MSG;
} else {
cause_code.error_class = SMS_TRANS_ERR_CLASS_TEMPORARY;
+
response = TAPI_NETTEXT_SIM_FULL;
}
- memcpy(&(trans_msg.data.ack_msg.cause_code), &(cause_code), sizeof(sms_trans_cause_code_s));
+ memcpy(&(trans_msg.data.ack_msg.cause_code), &(cause_code), sizeof(sms_3gpp2_trans_cause_code_s));
MSG_DEBUG("err : [%d], response : [%02x]", err, response);
int bufLen = 0;
-
unsigned char buf[512];
memset(buf, 0x00, sizeof(buf));
- bufLen = SmsPluginMsgCodec::encodeMsg(&trans_msg, buf);
-
+ bufLen = Sms3gpp2MsgCodec::encodeMsg(&trans_msg, buf);
MSG_DEBUG("######## DeliverReport tpdu #########");
for (int i=0; i < bufLen; i++) {
pkgInfo.szData[bufLen] = 0;
pkgInfo.MsgLength = bufLen;
-
/* Send Deliver Report */
- tapiRet = tel_send_sms_deliver_report(pTapiHandle, &pkgInfo, response, TapiEventDeliveryReportCNF, NULL);
+ tapiRet = tel_send_sms_deliver_report(handle, &pkgInfo, response, Sms3gpp2TapiEventHandler::respDeliveryReportCNF, NULL);
if (tapiRet == TAPI_API_SUCCESS)
MSG_DEBUG("######## tel_send_sms_deliver_report() Success !!! #######");
}
-void SmsPluginTransport::setNetStatus(sms_network_status_t sentStatus)
+void Sms3gpp2Transport::setNetStatus(SMS_NETWORK_STATUS_T sentStatus)
{
mx.lock();
curStatus = sentStatus;
}
-sms_network_status_t SmsPluginTransport::getNetStatus()
+void Sms3gpp2Transport::setIsMemAvailable(bool isAvailable)
+{
+ isMemAvailable = isAvailable;
+}
+
+
+SMS_NETWORK_STATUS_T Sms3gpp2Transport::getNetStatus()
{
mx.lock();
* limitations under the License.
*/
+
#include "MsgException.h"
#include "MsgCppTypes.h"
-#include "SmsCdmaPluginUAManager.h"
-#include "SmsCdmaPluginTransport.h"
+#include "Sms3gpp2UAManager.h"
+#include "Sms3gpp2Transport.h"
/*==================================================================================================
IMPLEMENTATION OF SmsPluginUAManager - Member Functions
==================================================================================================*/
-SmsPluginUAManager* SmsPluginUAManager::pInstance = NULL;
+Sms3gpp2UAManager* Sms3gpp2UAManager::pInstance = NULL;
-SmsPluginUAManager::SmsPluginUAManager() : mx(), cv()
+Sms3gpp2UAManager::Sms3gpp2UAManager() : mx(), cv()
{
start();
}
-SmsPluginUAManager::~SmsPluginUAManager()
+Sms3gpp2UAManager::~Sms3gpp2UAManager()
{
}
-SmsPluginUAManager* SmsPluginUAManager::instance()
+Sms3gpp2UAManager* Sms3gpp2UAManager::instance()
{
- if (!pInstance)
- pInstance = new SmsPluginUAManager();
+ if (!pInstance) {
+ pInstance = new Sms3gpp2UAManager();
+ }
return pInstance;
}
-void SmsPluginUAManager::run()
+void Sms3gpp2UAManager::run()
{
while (1) {
lock();
while (smsTranQ.empty()) {
wait();
}
- sms_request_info_s request;
+ sms_3gpp2_request_info_s request;
smsTranQ.front(&request);
unlock();
unique_ptr<MSG_ADDRESS_INFO_S*, void(*)(MSG_ADDRESS_INFO_S**)> addressListBuf(&request.msgInfo.addressList, unique_ptr_deleter);
try {
- SmsPluginTransport::instance()->submitRequest(&request);
+ Sms3gpp2Transport::instance()->submitRequest(&request);
} catch (MsgException& e) {
MSG_FATAL("%s", e.what());
}
-void SmsPluginUAManager::addReqEntity(sms_request_info_s *request)
+void Sms3gpp2UAManager::addReqEntity(sms_3gpp2_request_info_s *request)
{
- sms_request_info_s reqTmp = {0, };
+ sms_3gpp2_request_info_s reqTmp = {0, };
- memcpy(&reqTmp, request, sizeof(sms_request_info_s));
+ memcpy(&reqTmp, request, sizeof(sms_3gpp2_request_info_s));
lock();
smsTranQ.push_back(reqTmp);
* limitations under the License.
*/
+#include <glib.h>
+#include <gio/gio.h>
+#if MSG_DRM_SUPPORT
+#include <drm_client.h>
+#endif
+
#include "MsgDebug.h"
#include "MsgCppTypes.h"
#include "MsgGconfWrapper.h"
#include "MsgException.h"
#include "MsgUtilFile.h"
-#include "SmsCdmaPluginStorage.h"
-#include "SmsCdmaPluginTransport.h"
-#include "SmsCdmaPluginEventHandler.h"
-#include "SmsCdmaPluginWapPushHandler.h"
+#include "Sms3gpp2Transport.h"
+#include "Sms3gpp2EventHandler.h"
+#include "Sms3gpp2WapPushHandler.h"
+#include "SmsPluginStorage.h"
-#include <glib.h>
-#include <gio/gio.h>
-#if MSG_DRM_SUPPORT
-#include <drm_client.h>
-#endif
-static unsigned short wapPushPortList[] = {0x0b84, 0x0b85, 0x23F0, 0x23F1, 0x23F2, 0x23F3, 0xC34F};
+static unsigned short wapPushPortList[] = { 0x0b84, 0x0b85, 0x23F0, 0x23F1, 0x23F2, 0x23F3, 0xC34F };
-char gWapCodeBufferLeft[WSP_CODE_BUFFER_LEFT_LEN_MAX];
-char gWapCodeBufferRight[WSP_CODE_BUFFER_RIGHT_LEN_MAX];
+static char gWapCodeBufferLeft[WSP_CODE_BUFFER_LEFT_LEN_MAX];
+static char gWapCodeBufferRight[WSP_CODE_BUFFER_RIGHT_LEN_MAX];
-const unsigned long wspUintvarDecodeTable[] = { 0x00000001, 0x00000080, 0x00004000, 0x00200000, 0x10000000};
+static const unsigned long wspUintvarDecodeTable[] = { 0x00000001, 0x00000080, 0x00004000, 0x00200000, 0x10000000};
-const unsigned char wspHeaderFieldCount = 0x43;
-const unsigned char wspContentsTypeCount = 0x34;
-const unsigned long wspLanguageCount = 0x11a;
-const unsigned char wspSecurityTypeCount = 0x04;
+static const unsigned char wspHeaderFieldCount = 0x43;
+static const unsigned char wspContentsTypeCount = 0x34;
+static const unsigned long wspLanguageCount = 0x11a;
+static const unsigned char wspSecurityTypeCount = 0x04;
-static const SMS_WSP_CONTENTS_TYPE_S wspExtendedContentsType[] = {
+static const SMS_3GPP2_WSP_CONTENTS_TYPE_S wspExtendedContentsType[] = {
{ (char*)"text/vnd/wap/connectivity-xml", 0x35 },
{ (char*)"application/vnd.wap.connectivity-wbxml", 0x36 },
{ (char*)"application/pkcs7-mime", 0x37 },
};
-const char* wspHeaderFieldName[] = {
- (char*)"Accept", /* 0x00 */
- (char*)"Accept-Charset",
- (char*)"Accept-Encoding",
- (char*)"Accept-Language",
- (char*)"Accept-Ranges",
- (char*)"Age", /* 0x05 */
- (char*)"Allow",
- (char*)"Authorization",
- (char*)"Cache-Control",
- (char*)"Connection",
- (char*)"Content-Base", /* 0x0a */
- (char*)"Content-Encoding",
- (char*)"Content-Language",
- (char*)"Content-Length",
- (char*)"Content-Location",
- (char*)"Content-MD5",
- (char*)"Content-Range", /* 0x10 */
- (char*)"Content-Type",
- (char*)"Date",
- (char*)"ETag",
- (char*)"Expires",
- (char*)"From", /* 0x15 */
- (char*)"Host",
- (char*)"If-Modified-Since",
- (char*)"If-Match",
- (char*)"If-None-Match",
- (char*)"If-Range", /* 0x1a */
- (char*)"If-Unmodified-Since",
- (char*)"Location",
- (char*)"Last-Modified",
- (char*)"Max-Forwards",
- (char*)"Pragma",
- (char*)"Proxy-Authenticate", /* 0x20 */
- (char*)"Proxy-Authorization",
- (char*)"Public",
- (char*)"Range",
- (char*)"Referer",
- (char*)"Retry-After", /* 0x25 */
- (char*)"Server",
- (char*)"Transfer-Encodig",
- (char*)"Upgrade",
- (char*)"User-Agent",
- (char*)"Vary", /* 0x2a */
- (char*)"Via",
- (char*)"Warning",
- (char*)"Www-Authenticate",
- (char*)"Content-Disposition",
- (char*)"X-Wap-Application-Id",
- (char*)"X-Wap-Content-URI", /* 0x30 */
- (char*)"X-Wap-Iinitiator-URI",
- (char*)"Accept-Application", /* Back */
- (char*)"Bearer-Indication",
- (char*)"Push-Flag",
- (char*)"Profile", /* 0x35 */
- (char*)"Profile-Diff",
- (char*)"Profile-Warning", /* end of WAP 1.2 */
- (char*)"Expect",
- (char*)"Te",
- (char*)"Trailer", /* 0x3a */
- (char*)"Accept-Charset", /* Back */
- (char*)"Accept-Encoding", /* Back */
- (char*)"Cache-Control", /* back */
- (char*)"Content-Range",
- (char*)"X-Wap-Tod",
- (char*)"Content-ID", /*x40 */
- (char*)"Set-Cookie",
- (char*)"Cookie",
- (char*)"Encoding-Version"
+static const char* wspHeaderFieldName[] = {
+ (char*)"Accept", /* 0x00 */
+ (char*)"Accept-Charset",
+ (char*)"Accept-Encoding",
+ (char*)"Accept-Language",
+ (char*)"Accept-Ranges",
+ (char*)"Age", /* 0x05 */
+ (char*)"Allow",
+ (char*)"Authorization",
+ (char*)"Cache-Control",
+ (char*)"Connection",
+ (char*)"Content-Base", /* 0x0a */
+ (char*)"Content-Encoding",
+ (char*)"Content-Language",
+ (char*)"Content-Length",
+ (char*)"Content-Location",
+ (char*)"Content-MD5",
+ (char*)"Content-Range", /* 0x10 */
+ (char*)"Content-Type",
+ (char*)"Date",
+ (char*)"ETag",
+ (char*)"Expires",
+ (char*)"From", /* 0x15 */
+ (char*)"Host",
+ (char*)"If-Modified-Since",
+ (char*)"If-Match",
+ (char*)"If-None-Match",
+ (char*)"If-Range", /* 0x1a */
+ (char*)"If-Unmodified-Since",
+ (char*)"Location",
+ (char*)"Last-Modified",
+ (char*)"Max-Forwards",
+ (char*)"Pragma",
+ (char*)"Proxy-Authenticate", /* 0x20 */
+ (char*)"Proxy-Authorization",
+ (char*)"Public",
+ (char*)"Range",
+ (char*)"Referer",
+ (char*)"Retry-After", /* 0x25 */
+ (char*)"Server",
+ (char*)"Transfer-Encodig",
+ (char*)"Upgrade",
+ (char*)"User-Agent",
+ (char*)"Vary", /* 0x2a */
+ (char*)"Via",
+ (char*)"Warning",
+ (char*)"Www-Authenticate",
+ (char*)"Content-Disposition",
+ (char*)"X-Wap-Application-Id",
+ (char*)"X-Wap-Content-URI", /* 0x30 */
+ (char*)"X-Wap-Iinitiator-URI",
+ (char*)"Accept-Application", /* Back */
+ (char*)"Bearer-Indication",
+ (char*)"Push-Flag",
+ (char*)"Profile", /* 0x35 */
+ (char*)"Profile-Diff",
+ (char*)"Profile-Warning", /* end of WAP 1.2 */
+ (char*)"Expect",
+ (char*)"Te",
+ (char*)"Trailer", /* 0x3a */
+ (char*)"Accept-Charset", /* Back */
+ (char*)"Accept-Encoding", /* Back */
+ (char*)"Cache-Control", /* back */
+ (char*)"Content-Range",
+ (char*)"X-Wap-Tod",
+ (char*)"Content-ID", /* 0x40 */
+ (char*)"Set-Cookie",
+ (char*)"Cookie",
+ (char*)"Encoding-Version"
};
-const SMS_WSP_CHARSET_S wspCharset[] = {
- { (char*)"big5", 0x07ea },
- { (char*)"iso-10646-ucs-2", 0x03e8 },
- { (char*)"iso-8859-1", 0x04 },
- { (char*)"iso-8859-2", 0x05 },
- { (char*)"iso-8859-3", 0x06 },
- { (char*)"iso-8859-4", 0x07 },
- { (char*)"iso-8859-5", 0x08 },
- { (char*)"iso-8859-6", 0x09 },
- { (char*)"iso-8859-7", 0x0a },
- { (char*)"iso-8859-8", 0x0b },
- { (char*)"iso-8859-9", 0x0c },
- { (char*)"shift-JIS", 0x11 },
- { (char*)"us-ascii", 0x03 },
- { (char*)"utf-8", 0x6a },
- { (char*)"none", 0x26 },
- { (char*)"", 0xffff }
+static const SMS_3GPP2_WSP_CHARSET_S wspCharset[] = {
+ { (char*)"big5", 0x07ea },
+ { (char*)"iso-10646-ucs-2", 0x03e8 },
+ { (char*)"iso-8859-1", 0x04 },
+ { (char*)"iso-8859-2", 0x05 },
+ { (char*)"iso-8859-3", 0x06 },
+ { (char*)"iso-8859-4", 0x07 },
+ { (char*)"iso-8859-5", 0x08 },
+ { (char*)"iso-8859-6", 0x09 },
+ { (char*)"iso-8859-7", 0x0a },
+ { (char*)"iso-8859-8", 0x0b },
+ { (char*)"iso-8859-9", 0x0c },
+ { (char*)"shift-JIS", 0x11 },
+ { (char*)"us-ascii", 0x03 },
+ { (char*)"utf-8", 0x6a },
+ { (char*)"none", 0x26 },
+ { (char*)"", 0xffff }
};
-const char* wspEncodeMethod[] = {
- (char*)"Gzip",
- (char*)"Compress",
- (char*)"Deflate"
+static const char* wspEncodeMethod[] = {
+ (char*)"Gzip",
+ (char*)"Compress",
+ (char*)"Deflate"
};
-const SMS_WSP_CONTENTS_TYPE_S wspContentsType[] = {
- { (char*)"*/*", 0x00 },
- { (char*)"text/*", 0x01 },
- { (char*)"text/html", 0x02 },
- { (char*)"text/plain", 0x03 },
- { (char*)"text/x-hdml", 0x04 },
- { (char*)"text/x-ttml", 0x05 },
- { (char*)"text/x-vCalendar", 0x06 },
- { (char*)"text/x-vCard", 0x07 },
- { (char*)"text/vnd.wap.wml", 0x08 },
- { (char*)"text/vnd.wap.wmlscript", 0x09 },
- { (char*)"text/vnd.wap.wta-event", 0x0a },
- { (char*)"multipart/*", 0x0b },
- { (char*)"multipart/mixed", 0x0c },
- { (char*)"multipart/form-data", 0x0d },
- { (char*)"multipart/byteranges", 0x0e },
- { (char*)"multipart/alternative", 0x0f },
- { (char*)"application/*", 0x10 },
- { (char*)"application/java-vm", 0x11 },
- { (char*)"application/x-www-form-urlencoded", 0x12 },
- { (char*)"application/x-hdmlc", 0x13 },
- { (char*)"application/vnd.wap.wmlc", 0x14 },
- { (char*)"application/vnd.wap.wmlscriptc", 0x15 },
- { (char*)"application/vnd.wap.wta-eventc", 0x16 },
- { (char*)"application/vnd.wap.uaprof", 0x17 },
- { (char*)"application/vnd.wap.wtls-ca-certificate", 0x18 },
- { (char*)"application/vnd.wap.wtls-user-certificate", 0x19 },
- { (char*)"application/x-x509-ca-cert", 0x1a },
- { (char*)"application/x-x509-user-cert", 0x1b },
- { (char*)"image/*", 0x1c },
- { (char*)"image/gif", 0x1d },
- { (char*)"image/jpeg", 0x1e },
- { (char*)"image/tiff", 0x1f },
- { (char*)"image/png", 0x20 },
- { (char*)"image/vnd.wap.wbmp", 0x21 },
- { (char*)"application/vnd.wap.multipart.*", 0x22 },
- { (char*)"application/vnd.wap.multipart.mixed", 0x23 },
- { (char*)"application/vnd.wap.multipart.form-data", 0x24 },
- { (char*)"application/vnd.wap.multipart.byteranges", 0x25 },
- { (char*)"application/vnd.wap.multipart.alternative", 0x26 },
- { (char*)"application/xml", 0x27 },
- { (char*)"text/xml", 0x28 },
- { (char*)"application/vnd.wap.wbxml", 0x29 },
- { (char*)"application/x-x968-cross-cert", 0x2a },
- { (char*)"application/x-x968-ca-cert", 0x2b },
- { (char*)"application/x-x968-user-cert", 0x2c },
- { (char*)"text/vnd.wap.si", 0x2d },
- { (char*)"application/vnd.wap.sic", 0x2e },
- { (char*)"text/vnd.wap.sl", 0x2f },
- { (char*)"application/vnd.wap.slc", 0x30 },
- { (char*)"text/vnd.wap.co", 0x31 },
- { (char*)"application/vnd.wap.coc", 0x32 },
- { (char*)"application/vnd.wap.multipart.related", 0x33 },
- { (char*)"application/vnd.wap.sia", 0x34 },
+static const SMS_3GPP2_WSP_CONTENTS_TYPE_S wspContentsType[] = {
+ { (char*)"*/*", 0x00 },
+ { (char*)"text/*", 0x01 },
+ { (char*)"text/html", 0x02 },
+ { (char*)"text/plain", 0x03 },
+ { (char*)"text/x-hdml", 0x04 },
+ { (char*)"text/x-ttml", 0x05 },
+ { (char*)"text/x-vCalendar", 0x06 },
+ { (char*)"text/x-vCard", 0x07 },
+ { (char*)"text/vnd.wap.wml", 0x08 },
+ { (char*)"text/vnd.wap.wmlscript", 0x09 },
+ { (char*)"text/vnd.wap.wta-event", 0x0a },
+ { (char*)"multipart/*", 0x0b },
+ { (char*)"multipart/mixed", 0x0c },
+ { (char*)"multipart/form-data", 0x0d },
+ { (char*)"multipart/byteranges", 0x0e },
+ { (char*)"multipart/alternative", 0x0f },
+ { (char*)"application/*", 0x10 },
+ { (char*)"application/java-vm", 0x11 },
+ { (char*)"application/x-www-form-urlencoded", 0x12 },
+ { (char*)"application/x-hdmlc", 0x13 },
+ { (char*)"application/vnd.wap.wmlc", 0x14 },
+ { (char*)"application/vnd.wap.wmlscriptc", 0x15 },
+ { (char*)"application/vnd.wap.wta-eventc", 0x16 },
+ { (char*)"application/vnd.wap.uaprof", 0x17 },
+ { (char*)"application/vnd.wap.wtls-ca-certificate", 0x18 },
+ { (char*)"application/vnd.wap.wtls-user-certificate", 0x19 },
+ { (char*)"application/x-x509-ca-cert", 0x1a },
+ { (char*)"application/x-x509-user-cert", 0x1b },
+ { (char*)"image/*", 0x1c },
+ { (char*)"image/gif", 0x1d },
+ { (char*)"image/jpeg", 0x1e },
+ { (char*)"image/tiff", 0x1f },
+ { (char*)"image/png", 0x20 },
+ { (char*)"image/vnd.wap.wbmp", 0x21 },
+ { (char*)"application/vnd.wap.multipart.*", 0x22 },
+ { (char*)"application/vnd.wap.multipart.mixed", 0x23 },
+ { (char*)"application/vnd.wap.multipart.form-data", 0x24 },
+ { (char*)"application/vnd.wap.multipart.byteranges", 0x25 },
+ { (char*)"application/vnd.wap.multipart.alternative", 0x26 },
+ { (char*)"application/xml", 0x27 },
+ { (char*)"text/xml", 0x28 },
+ { (char*)"application/vnd.wap.wbxml", 0x29 },
+ { (char*)"application/x-x968-cross-cert", 0x2a },
+ { (char*)"application/x-x968-ca-cert", 0x2b },
+ { (char*)"application/x-x968-user-cert", 0x2c },
+ { (char*)"text/vnd.wap.si", 0x2d },
+ { (char*)"application/vnd.wap.sic", 0x2e },
+ { (char*)"text/vnd.wap.sl", 0x2f },
+ { (char*)"application/vnd.wap.slc", 0x30 },
+ { (char*)"text/vnd.wap.co", 0x31 },
+ { (char*)"application/vnd.wap.coc", 0x32 },
+ { (char*)"application/vnd.wap.multipart.related", 0x33 },
+ { (char*)"application/vnd.wap.sia", 0x34 },
{ (char*)"text/vnd/wap/connectivity-xml", 0x35 },
{ (char*)"application/vnd.connectivity-wbxml", 0x36 },
};
-static const SMS_WAP_UNREGISTER_CONTENTS_TYPE_S wspUnregisterContentsType[]= {
+static const SMS_3GPP2_WAP_UNREGISTER_CONTENTS_TYPE_S wspUnregisterContentsType[]= {
{ (char*)"application/vnd.wap.emn+wbxml", 0x30A},
{ (char*)"application/vnd.omaloc-supl-init", 0x312},
{ (char*)"application/vnd.oma.drm.roap-trigger+wbxml", 0x316}
};
-const unsigned long wspUnregisteredContentsTypeCount = sizeof(wspUnregisterContentsType)/sizeof(SMS_WAP_UNREGISTER_CONTENTS_TYPE_S);
-
-
-const SMS_WSP_LANGUAGE_S wspLanguage[] = {
- { (char*)"English", 0x19 },
- { (char*)"en", 0x19 },
- { (char*)"Korean", 0x3d },
- { (char*)"*", 0x00 },
- { (char*)"Afar", 0x01 },
- { (char*)"aa", 0x01 },
- { (char*)"Abkhazian", 0x02 },
- { (char*)"ab", 0x02 },
- { (char*)"Afrikaans", 0x03 },
- { (char*)"af", 0x03 },
- { (char*)"Amharic", 0x04 },
- { (char*)"am", 0x04 },
- { (char*)"Arabic", 0x05 },
- { (char*)"ar", 0x05 },
- { (char*)"Assamese", 0x06 },
- { (char*)"as", 0x06 },
- { (char*)"Aymara", 0x07 },
- { (char*)"ay", 0x07 },
- { (char*)"Azerbaijani", 0x08 },
- { (char*)"az", 0x08 },
- { (char*)"Bashkir", 0x09 },
- { (char*)"ba", 0x09 },
- { (char*)"Byelorussian", 0x0a },
- { (char*)"be", 0x0a },
- { (char*)"Bulgarian", 0x0b },
- { (char*)"bg", 0x0b },
- { (char*)"Bihari", 0x0c },
- { (char*)"bh", 0x0c },
- { (char*)"Bislama", 0x0d },
- { (char*)"bi", 0x0f },
- { (char*)"Bengali", 0x0e },
- { (char*)"Bangla", 0x0e },
- { (char*)"bn", 0x0e },
- { (char*)"Tibetan", 0x0f },
- { (char*)"bo", 0x0f },
- { (char*)"Breton", 0x10 },
- { (char*)"br", 0x10 },
- { (char*)"Catalan", 0x11 },
- { (char*)"ca", 0x11 },
- { (char*)"Corsican", 0x12 },
- { (char*)"co", 0x12 },
- { (char*)"Czech", 0x13 },
- { (char*)"cs", 0x13 },
- { (char*)"Welsh", 0x14 },
- { (char*)"cy", 0x14 },
- { (char*)"Denish", 0x15 },
- { (char*)"da", 0x15 },
- { (char*)"German", 0x16 },
- { (char*)"de", 0x16 },
- { (char*)"Bhutani", 0x17 },
- { (char*)"dz", 0x17 },
- { (char*)"Greek", 0x18 },
- { (char*)"el", 0x18 },
- { (char*)"Esperanto", 0x81 },
- { (char*)"eo", 0x1a },
- { (char*)"Spanish", 0x1b },
- { (char*)"es", 0x1b },
- { (char*)"Estonian", 0x1c },
- { (char*)"et", 0x1c },
- { (char*)"Basque", 0x1d },
- { (char*)"eu", 0x1d },
- { (char*)"Persian", 0x1e },
- { (char*)"fa", 0x1e },
- { (char*)"Finnish", 0x1f },
- { (char*)"fi", 0x1f },
- { (char*)"Fiji", 0x20 },
- { (char*)"fj", 0x20 },
- { (char*)"Faeroese", 0x82 },
- { (char*)"fo", 0x82 },
- { (char*)"French", 0x22 },
- { (char*)"fr", 0x22 },
- { (char*)"Frisian", 0x83 },
- { (char*)"fy", 0x83 },
- { (char*)"Irish", 0x24 },
- { (char*)"ga", 0x24 },
- { (char*)"Scots Gaelic", 0x25 },
- { (char*)"gd", 0x25 },
- { (char*)"Galician", 0x26 },
- { (char*)"gl", 0x26 },
- { (char*)"Guarani", 0x27 },
- { (char*)"gn", 0x27 },
- { (char*)"Gujarati", 0x28 },
- { (char*)"gu", 0x28 },
- { (char*)"Hausa", 0x29 },
- { (char*)"ha", 0x29 },
- { (char*)"Hebrew", 0x2a },
- { (char*)"he", 0x2a },
- { (char*)"Hindi", 0x2b },
- { (char*)"hi", 0x2b },
- { (char*)"Croatian", 0x2c },
- { (char*)"hr", 0x2c },
- { (char*)"Hungarian", 0x2d },
- { (char*)"hu", 0x2d },
- { (char*)"Armenian", 0x2e },
- { (char*)"hy", 0x2e },
- { (char*)"Interlingua", 0x84 },
- { (char*)"ia", 0x84 },
- { (char*)"Indonesian", 0x30 },
- { (char*)"id", 0x30 },
- { (char*)"Interlingue", 0x86 },
- { (char*)"ie", 0x86 },
- { (char*)"Maori", 0x47 },
- { (char*)"mi", 0x47 },
- { (char*)"Macedonian", 0x48 },
- { (char*)"mk", 0x48 },
- { (char*)"Malayalam", 0x49 },
- { (char*)"ml", 0x49 },
- { (char*)"Mongolian", 0x4a },
- { (char*)"mn", 0x4a },
- { (char*)"Moldavian", 0x4b },
- { (char*)"mo", 0x4d },
- { (char*)"Marathi", 0x4c },
- { (char*)"mr", 0x4c },
- { (char*)"Malay", 0x4d },
- { (char*)"ms", 0x4d },
- { (char*)"Maltese", 0x4e },
- { (char*)"mt", 0x4e },
- { (char*)"Burmese", 0x4f },
- { (char*)"my", 0x4f },
- { (char*)"Nauru", 0x50 },
- { (char*)"na", 0x50 },
- { (char*)"Nepali", 0x51 },
- { (char*)"ne", 0x51 },
- { (char*)"Dutch", 0x52 },
- { (char*)"nl", 0x52 },
- { (char*)"Norwegian", 0x53 },
- { (char*)"no", 0x53 },
- { (char*)"Occitan", 0x54 },
- { (char*)"oc", 0x54 },
- { (char*)"(Afan) Oromo", 0x55 },
- { (char*)"(Afan)Oromo", 0x55 },
- { (char*)"om", 0x55 },
- { (char*)"Oriya", 0x56 },
- { (char*)"or", 0x56 },
- { (char*)"Punjabi", 0x57 },
- { (char*)"pa", 0x57 },
- { (char*)"Polish", 0x58 },
- { (char*)"po", 0x58 },
- { (char*)"Pashto", 0x59 },
- { (char*)"Pushto", 0x59 },
- { (char*)"ps", 0x59 },
- { (char*)"Portugurse", 0x5a },
- { (char*)"pt", 0x5a },
- { (char*)"Quechua", 0x5b },
- { (char*)"qu", 0x5b },
- { (char*)"Rhaeto-Romance", 0x8c },
- { (char*)"rm", 0x8c },
- { (char*)"Kirundi", 0x5d },
- { (char*)"rn", 0x5d },
- { (char*)"Romanian", 0x5e },
- { (char*)"ro", 0x5e },
- { (char*)"Russian", 0x5f },
- { (char*)"ru", 0x5f },
- { (char*)"Kinyarwanda", 0x60 },
- { (char*)"rw", 0x60 },
- { (char*)"Sanskrit", 0x61 },
- { (char*)"sa", 0x61 },
- { (char*)"Sindhi", 0x62 },
- { (char*)"sd", 0x62 },
- { (char*)"Sangho", 0x63 },
- { (char*)"sg", 0x63 },
- { (char*)"Serbo-Croatian", 0x64 },
- { (char*)"sh", 0x64 },
- { (char*)"Sinhalese", 0x65 },
- { (char*)"si", 0x65 },
- { (char*)"Slovak", 0x66 },
- { (char*)"sk", 0x66 },
- { (char*)"Slovenian", 0x67 },
- { (char*)"sl", 0x67 },
- { (char*)"Samoan", 0x68 },
- { (char*)"sm", 0x68 },
- { (char*)"Shona", 0x69 },
- { (char*)"sn", 0x69 },
- { (char*)"Somali", 0x6a },
- { (char*)"so", 0x6a },
- { (char*)"Albanian", 0x6b },
- { (char*)"sq", 0x6b },
- { (char*)"Serbian", 0x6c },
- { (char*)"sr", 0x6c },
- { (char*)"Siswati", 0x6d },
- { (char*)"ss", 0x6d },
- { (char*)"Sesotho", 0x6e },
- { (char*)"st", 0x6e },
- { (char*)"Sundanese", 0x6f },
- { (char*)"su", 0x6f },
- { (char*)"Swedish", 0x70 },
- { (char*)"sv", 0x70 },
- { (char*)"Swahili", 0x71 },
- { (char*)"sw", 0x71 },
- { (char*)"Tamil", 0x72 },
- { (char*)"ta", 0x72 },
- { (char*)"Telugu", 0x73 },
- { (char*)"te", 0x73 },
- { (char*)"Tajik", 0x74 },
- { (char*)"tg", 0x74 },
- { (char*)"Thai", 0x75 },
- { (char*)"th", 0x75 },
- { (char*)"Tigrinya", 0x76 },
- { (char*)"ti", 0x76 },
- { (char*)"Turkmen", 0x77 },
- { (char*)"tk", 0x77 },
- { (char*)"Inupiak", 0x87 },
- { (char*)"ik", 0x87 },
- { (char*)"Icelandic", 0x33 },
- { (char*)"is", 0x33 },
- { (char*)"Italian", 0x34 },
- { (char*)"it", 0x34 },
- { (char*)"Inuktitut", 0x89 },
- { (char*)"iu", 0x89 },
- { (char*)"Japanese", 0x36 },
- { (char*)"ja", 0x36 },
- { (char*)"Javanese", 0x37 },
- { (char*)"jw", 0x37 },
- { (char*)"Georgian", 0x38 },
- { (char*)"ka", 0x38 },
- { (char*)"Kazakh", 0x39 },
- { (char*)"kk", 0x39 },
- { (char*)"Gerrnlandic", 0x8a },
- { (char*)"kl", 0x8a },
- { (char*)"Cambodian", 0x3b },
- { (char*)"km", 0x3b },
- { (char*)"Kannada", 0x3c },
- { (char*)"kn", 0x3c },
- { (char*)"Kashmiri", 0x3e },
- { (char*)"ks", 0x3e },
- { (char*)"Kurdish", 0x3f },
- { (char*)"ku", 0x3f },
- { (char*)"Kirghiz", 0x40 },
- { (char*)"ky", 0x40 },
- { (char*)"Latin", 0x8b },
- { (char*)"la", 0x8b },
- { (char*)"Lingala", 0x42 },
- { (char*)"ln", 0x42 },
- { (char*)"Laothian", 0x43 },
- { (char*)"lo", 0x43 },
- { (char*)"Lithuanian", 0x44 },
- { (char*)"lt", 0x44 },
- { (char*)"Lavian", 0x45 },
- { (char*)"Lettish", 0x45 },
- { (char*)"lv", 0x45 },
- { (char*)"Malagasy", 0x46 },
- { (char*)"mg", 0x46 },
- { (char*)"Tagalog", 0x78 },
- { (char*)"tl", 0x78 },
- { (char*)"Setswana", 0x79 },
- { (char*)"tn", 0x79 },
- { (char*)"Tonga", 0x7a },
- { (char*)"to", 0x7a },
- { (char*)"Turkish", 0x7b },
- { (char*)"tr", 0x7b },
- { (char*)"Tsonga", 0x7c },
- { (char*)"ts", 0x7c },
- { (char*)"Tatar", 0x7d },
- { (char*)"tt", 0x7d },
- { (char*)"Twi", 0x7e },
- { (char*)"tw", 0x7e },
- { (char*)"Uighur", 0x7f },
- { (char*)"ug", 0x7f },
- { (char*)"Ukrainian", 0x1a },
- { (char*)"uk", 0x1a },
- { (char*)"Urdu", 0x21 },
- { (char*)"ur", 0x21 },
- { (char*)"Uzbek", 0x23 },
- { (char*)"uz", 0x23 },
- { (char*)"Vietnamese", 0x2f },
- { (char*)"vi", 0x2f },
- { (char*)"Volapuk", 0x85 },
- { (char*)"vo", 0x85 },
- { (char*)"Wolof", 0x31 },
- { (char*)"wo" , 0x31 },
- { (char*)"Xhosa", 0x32 },
- { (char*)"xh", 0x32 },
- { (char*)"Yiddish", 0x88 },
- { (char*)"yi", 0x88 },
- { (char*)"Yoruba", 0x35 },
- { (char*)"yo", 0x35 },
- { (char*)"Zhuang", 0x3a },
- { (char*)"z", 0x3a },
- { (char*)"Chinese", 0x41 },
- { (char*)"ch", 0x41 },
- { (char*)"Zulu", 0x5c },
- { (char*)"zu", 0x5c },
- { (char*)"Ko", 0x3d }
+static const unsigned long wspUnregisteredContentsTypeCount = sizeof(wspUnregisterContentsType)/sizeof(SMS_3GPP2_WAP_UNREGISTER_CONTENTS_TYPE_S);
+
+
+static const SMS_3GPP2_WSP_LANGUAGE_S wspLanguage[] = {
+ { (char*)"English", 0x19 },
+ { (char*)"en", 0x19 },
+ { (char*)"Korean", 0x3d },
+ { (char*)"*", 0x00 },
+ { (char*)"Afar", 0x01 },
+ { (char*)"aa", 0x01 },
+ { (char*)"Abkhazian", 0x02 },
+ { (char*)"ab", 0x02 },
+ { (char*)"Afrikaans", 0x03 },
+ { (char*)"af", 0x03 },
+ { (char*)"Amharic", 0x04 },
+ { (char*)"am", 0x04 },
+ { (char*)"Arabic", 0x05 },
+ { (char*)"ar", 0x05 },
+ { (char*)"Assamese", 0x06 },
+ { (char*)"as", 0x06 },
+ { (char*)"Aymara", 0x07 },
+ { (char*)"ay", 0x07 },
+ { (char*)"Azerbaijani", 0x08 },
+ { (char*)"az", 0x08 },
+ { (char*)"Bashkir", 0x09 },
+ { (char*)"ba", 0x09 },
+ { (char*)"Byelorussian", 0x0a },
+ { (char*)"be", 0x0a },
+ { (char*)"Bulgarian", 0x0b },
+ { (char*)"bg", 0x0b },
+ { (char*)"Bihari", 0x0c },
+ { (char*)"bh", 0x0c },
+ { (char*)"Bislama", 0x0d },
+ { (char*)"bi", 0x0f },
+ { (char*)"Bengali", 0x0e },
+ { (char*)"Bangla", 0x0e },
+ { (char*)"bn", 0x0e },
+ { (char*)"Tibetan", 0x0f },
+ { (char*)"bo", 0x0f },
+ { (char*)"Breton", 0x10 },
+ { (char*)"br", 0x10 },
+ { (char*)"Catalan", 0x11 },
+ { (char*)"ca", 0x11 },
+ { (char*)"Corsican", 0x12 },
+ { (char*)"co", 0x12 },
+ { (char*)"Czech", 0x13 },
+ { (char*)"cs", 0x13 },
+ { (char*)"Welsh", 0x14 },
+ { (char*)"cy", 0x14 },
+ { (char*)"Denish", 0x15 },
+ { (char*)"da", 0x15 },
+ { (char*)"German", 0x16 },
+ { (char*)"de", 0x16 },
+ { (char*)"Bhutani", 0x17 },
+ { (char*)"dz", 0x17 },
+ { (char*)"Greek", 0x18 },
+ { (char*)"el", 0x18 },
+ { (char*)"Esperanto", 0x81 },
+ { (char*)"eo", 0x1a },
+ { (char*)"Spanish", 0x1b },
+ { (char*)"es", 0x1b },
+ { (char*)"Estonian", 0x1c },
+ { (char*)"et", 0x1c },
+ { (char*)"Basque", 0x1d },
+ { (char*)"eu", 0x1d },
+ { (char*)"Persian", 0x1e },
+ { (char*)"fa", 0x1e },
+ { (char*)"Finnish", 0x1f },
+ { (char*)"fi", 0x1f },
+ { (char*)"Fiji", 0x20 },
+ { (char*)"fj", 0x20 },
+ { (char*)"Faeroese", 0x82 },
+ { (char*)"fo", 0x82 },
+ { (char*)"French", 0x22 },
+ { (char*)"fr", 0x22 },
+ { (char*)"Frisian", 0x83 },
+ { (char*)"fy", 0x83 },
+ { (char*)"Irish", 0x24 },
+ { (char*)"ga", 0x24 },
+ { (char*)"Scots Gaelic", 0x25 },
+ { (char*)"gd", 0x25 },
+ { (char*)"Galician", 0x26 },
+ { (char*)"gl", 0x26 },
+ { (char*)"Guarani", 0x27 },
+ { (char*)"gn", 0x27 },
+ { (char*)"Gujarati", 0x28 },
+ { (char*)"gu", 0x28 },
+ { (char*)"Hausa", 0x29 },
+ { (char*)"ha", 0x29 },
+ { (char*)"Hebrew", 0x2a },
+ { (char*)"he", 0x2a },
+ { (char*)"Hindi", 0x2b },
+ { (char*)"hi", 0x2b },
+ { (char*)"Croatian", 0x2c },
+ { (char*)"hr", 0x2c },
+ { (char*)"Hungarian", 0x2d },
+ { (char*)"hu", 0x2d },
+ { (char*)"Armenian", 0x2e },
+ { (char*)"hy", 0x2e },
+ { (char*)"Interlingua", 0x84 },
+ { (char*)"ia", 0x84 },
+ { (char*)"Indonesian", 0x30 },
+ { (char*)"id", 0x30 },
+ { (char*)"Interlingue", 0x86 },
+ { (char*)"ie", 0x86 },
+ { (char*)"Maori", 0x47 },
+ { (char*)"mi", 0x47 },
+ { (char*)"Macedonian", 0x48 },
+ { (char*)"mk", 0x48 },
+ { (char*)"Malayalam", 0x49 },
+ { (char*)"ml", 0x49 },
+ { (char*)"Mongolian", 0x4a },
+ { (char*)"mn", 0x4a },
+ { (char*)"Moldavian", 0x4b },
+ { (char*)"mo", 0x4d },
+ { (char*)"Marathi", 0x4c },
+ { (char*)"mr", 0x4c },
+ { (char*)"Malay", 0x4d },
+ { (char*)"ms", 0x4d },
+ { (char*)"Maltese", 0x4e },
+ { (char*)"mt", 0x4e },
+ { (char*)"Burmese", 0x4f },
+ { (char*)"my", 0x4f },
+ { (char*)"Nauru", 0x50 },
+ { (char*)"na", 0x50 },
+ { (char*)"Nepali", 0x51 },
+ { (char*)"ne", 0x51 },
+ { (char*)"Dutch", 0x52 },
+ { (char*)"nl", 0x52 },
+ { (char*)"Norwegian", 0x53 },
+ { (char*)"no", 0x53 },
+ { (char*)"Occitan", 0x54 },
+ { (char*)"oc", 0x54 },
+ { (char*)"(Afan) Oromo", 0x55 },
+ { (char*)"(Afan)Oromo", 0x55 },
+ { (char*)"om", 0x55 },
+ { (char*)"Oriya", 0x56 },
+ { (char*)"or", 0x56 },
+ { (char*)"Punjabi", 0x57 },
+ { (char*)"pa", 0x57 },
+ { (char*)"Polish", 0x58 },
+ { (char*)"po", 0x58 },
+ { (char*)"Pashto", 0x59 },
+ { (char*)"Pushto", 0x59 },
+ { (char*)"ps", 0x59 },
+ { (char*)"Portugurse", 0x5a },
+ { (char*)"pt", 0x5a },
+ { (char*)"Quechua", 0x5b },
+ { (char*)"qu", 0x5b },
+ { (char*)"Rhaeto-Romance", 0x8c },
+ { (char*)"rm", 0x8c },
+ { (char*)"Kirundi", 0x5d },
+ { (char*)"rn", 0x5d },
+ { (char*)"Romanian", 0x5e },
+ { (char*)"ro", 0x5e },
+ { (char*)"Russian", 0x5f },
+ { (char*)"ru", 0x5f },
+ { (char*)"Kinyarwanda", 0x60 },
+ { (char*)"rw", 0x60 },
+ { (char*)"Sanskrit", 0x61 },
+ { (char*)"sa", 0x61 },
+ { (char*)"Sindhi", 0x62 },
+ { (char*)"sd", 0x62 },
+ { (char*)"Sangho", 0x63 },
+ { (char*)"sg", 0x63 },
+ { (char*)"Serbo-Croatian", 0x64 },
+ { (char*)"sh", 0x64 },
+ { (char*)"Sinhalese", 0x65 },
+ { (char*)"si", 0x65 },
+ { (char*)"Slovak", 0x66 },
+ { (char*)"sk", 0x66 },
+ { (char*)"Slovenian", 0x67 },
+ { (char*)"sl", 0x67 },
+ { (char*)"Samoan", 0x68 },
+ { (char*)"sm", 0x68 },
+ { (char*)"Shona", 0x69 },
+ { (char*)"sn", 0x69 },
+ { (char*)"Somali", 0x6a },
+ { (char*)"so", 0x6a },
+ { (char*)"Albanian", 0x6b },
+ { (char*)"sq", 0x6b },
+ { (char*)"Serbian", 0x6c },
+ { (char*)"sr", 0x6c },
+ { (char*)"Siswati", 0x6d },
+ { (char*)"ss", 0x6d },
+ { (char*)"Sesotho", 0x6e },
+ { (char*)"st", 0x6e },
+ { (char*)"Sundanese", 0x6f },
+ { (char*)"su", 0x6f },
+ { (char*)"Swedish", 0x70 },
+ { (char*)"sv", 0x70 },
+ { (char*)"Swahili", 0x71 },
+ { (char*)"sw", 0x71 },
+ { (char*)"Tamil", 0x72 },
+ { (char*)"ta", 0x72 },
+ { (char*)"Telugu", 0x73 },
+ { (char*)"te", 0x73 },
+ { (char*)"Tajik", 0x74 },
+ { (char*)"tg", 0x74 },
+ { (char*)"Thai", 0x75 },
+ { (char*)"th", 0x75 },
+ { (char*)"Tigrinya", 0x76 },
+ { (char*)"ti", 0x76 },
+ { (char*)"Turkmen", 0x77 },
+ { (char*)"tk", 0x77 },
+ { (char*)"Inupiak", 0x87 },
+ { (char*)"ik", 0x87 },
+ { (char*)"Icelandic", 0x33 },
+ { (char*)"is", 0x33 },
+ { (char*)"Italian", 0x34 },
+ { (char*)"it", 0x34 },
+ { (char*)"Inuktitut", 0x89 },
+ { (char*)"iu", 0x89 },
+ { (char*)"Japanese", 0x36 },
+ { (char*)"ja", 0x36 },
+ { (char*)"Javanese", 0x37 },
+ { (char*)"jw", 0x37 },
+ { (char*)"Georgian", 0x38 },
+ { (char*)"ka", 0x38 },
+ { (char*)"Kazakh", 0x39 },
+ { (char*)"kk", 0x39 },
+ { (char*)"Gerrnlandic", 0x8a },
+ { (char*)"kl", 0x8a },
+ { (char*)"Cambodian", 0x3b },
+ { (char*)"km", 0x3b },
+ { (char*)"Kannada", 0x3c },
+ { (char*)"kn", 0x3c },
+ { (char*)"Kashmiri", 0x3e },
+ { (char*)"ks", 0x3e },
+ { (char*)"Kurdish", 0x3f },
+ { (char*)"ku", 0x3f },
+ { (char*)"Kirghiz", 0x40 },
+ { (char*)"ky", 0x40 },
+ { (char*)"Latin", 0x8b },
+ { (char*)"la", 0x8b },
+ { (char*)"Lingala", 0x42 },
+ { (char*)"ln", 0x42 },
+ { (char*)"Laothian", 0x43 },
+ { (char*)"lo", 0x43 },
+ { (char*)"Lithuanian", 0x44 },
+ { (char*)"lt", 0x44 },
+ { (char*)"Lavian", 0x45 },
+ { (char*)"Lettish", 0x45 },
+ { (char*)"lv", 0x45 },
+ { (char*)"Malagasy", 0x46 },
+ { (char*)"mg", 0x46 },
+ { (char*)"Tagalog", 0x78 },
+ { (char*)"tl", 0x78 },
+ { (char*)"Setswana", 0x79 },
+ { (char*)"tn", 0x79 },
+ { (char*)"Tonga", 0x7a },
+ { (char*)"to", 0x7a },
+ { (char*)"Turkish", 0x7b },
+ { (char*)"tr", 0x7b },
+ { (char*)"Tsonga", 0x7c },
+ { (char*)"ts", 0x7c },
+ { (char*)"Tatar", 0x7d },
+ { (char*)"tt", 0x7d },
+ { (char*)"Twi", 0x7e },
+ { (char*)"tw", 0x7e },
+ { (char*)"Uighur", 0x7f },
+ { (char*)"ug", 0x7f },
+ { (char*)"Ukrainian", 0x1a },
+ { (char*)"uk", 0x1a },
+ { (char*)"Urdu", 0x21 },
+ { (char*)"ur", 0x21 },
+ { (char*)"Uzbek", 0x23 },
+ { (char*)"uz", 0x23 },
+ { (char*)"Vietnamese", 0x2f },
+ { (char*)"vi", 0x2f },
+ { (char*)"Volapuk", 0x85 },
+ { (char*)"vo", 0x85 },
+ { (char*)"Wolof", 0x31 },
+ { (char*)"wo" , 0x31 },
+ { (char*)"Xhosa", 0x32 },
+ { (char*)"xh", 0x32 },
+ { (char*)"Yiddish", 0x88 },
+ { (char*)"yi", 0x88 },
+ { (char*)"Yoruba", 0x35 },
+ { (char*)"yo", 0x35 },
+ { (char*)"Zhuang", 0x3a },
+ { (char*)"z", 0x3a },
+ { (char*)"Chinese", 0x41 },
+ { (char*)"ch", 0x41 },
+ { (char*)"Zulu", 0x5c },
+ { (char*)"zu", 0x5c },
+ { (char*)"Ko", 0x3d }
};
-const SMS_WSP_HEADER_PARAMETER_S wspHeaderApplId[] = {
+static const SMS_3GPP2_WSP_HEADER_PARAMETER_S wspHeaderApplId[] = {
{ (char*)"x-wap-application:*", 0x00 },
{ (char*)"x-wap-application:push.sia", 0x01},
{ (char*)"x-wap-application:wml.ua", 0x02 },
};
-const char* wspCacheControl[] = {
- (char*)"No-cache",
- (char*)"No-store",
- (char*)"Max-age",
- (char*)"Max-stale",
- (char*)"Min-fresh",
- (char*)"Only-if-cached",
- (char*)"Public",
- (char*)"Private",
- (char*)"No-transform",
- (char*)"Must-revalidate",
- (char*)"Proxy-revalidate"
+static const char* wspCacheControl[] = {
+ (char*)"No-cache",
+ (char*)"No-store",
+ (char*)"Max-age",
+ (char*)"Max-stale",
+ (char*)"Min-fresh",
+ (char*)"Only-if-cached",
+ (char*)"Public",
+ (char*)"Private",
+ (char*)"No-transform",
+ (char*)"Must-revalidate",
+ (char*)"Proxy-revalidate"
};
-const SMS_WSP_METHOD_TYPE_S wspMethodType[] = {
- { (char*)"GET", 0x40 },
- { (char*)"OPTIONS", 0x41 },
- { (char*)"HEAD", 0x42 },
- { (char*)"DELETE", 0x43 },
- { (char*)"TRACE", 0x44 },
- { (char*)"POST", 0x60 },
- { (char*)"PUT", 0x61 }
+
+static const SMS_3GPP2_WSP_METHOD_TYPE_S wspMethodType[] = {
+ { (char*)"GET", 0x40 },
+ { (char*)"OPTIONS", 0x41 },
+ { (char*)"HEAD", 0x42 },
+ { (char*)"DELETE", 0x43 },
+ { (char*)"TRACE", 0x44 },
+ { (char*)"POST", 0x60 },
+ { (char*)"PUT", 0x61 }
};
-const SMS_WSP_SECURITY_TYPE_S wspSecurityType[] = {
- {(char*)"NETWPIN", 0x00},
- {(char*)"USERPIN", 0x01},
- {(char*)"USERNETWPIN", 0x02},
- {(char*)"USERPINMAC", 0x03}
+static const SMS_3GPP2_WSP_SECURITY_TYPE_S wspSecurityType[] = {
+ {(char*)"NETWPIN", 0x00},
+ {(char*)"USERPIN", 0x01},
+ {(char*)"USERNETWPIN", 0x02},
+ {(char*)"USERPINMAC", 0x03}
};
-
-const char* wspWeek[] = {
- (char*)"Sun",
- (char*)"Mon",
- (char*)"Tue",
- (char*)"Wed",
- (char*)"Thu",
- (char*)"Fri",
- (char*)"Sat"
+static const char* wspWeek[] = {
+ (char*)"Sun",
+ (char*)"Mon",
+ (char*)"Tue",
+ (char*)"Wed",
+ (char*)"Thu",
+ (char*)"Fri",
+ (char*)"Sat"
};
-const char* wspWeekDay[] = {
- (char*)"Sunday",
- (char*)"Monday",
- (char*)"Tuesday",
- (char*)"Wednesday",
- (char*)"Thursday",
- (char*)"Friday",
- (char*)"Saturday"
+#ifdef MSG_FW_FOR_DEBUG
+static const char* wspWeekDay[] = {
+ (char*)"Sunday",
+ (char*)"Monday",
+ (char*)"Tuesday",
+ (char*)"Wednesday",
+ (char*)"Thursday",
+ (char*)"Friday",
+ (char*)"Saturday"
};
+#endif
+
-const char* wspMonth[] = {
- (char*)"Jan",
- (char*)"Feb",
- (char*)"Mar",
- (char*)"Apr",
- (char*)"May",
- (char*)"Jun",
- (char*)"Jul",
- (char*)"Aug",
- (char*)"Sep",
- (char*)"Oct",
- (char*)"Nov",
- (char*)"Dec"
+static const char* wspMonth[] = {
+ (char*)"Jan",
+ (char*)"Feb",
+ (char*)"Mar",
+ (char*)"Apr",
+ (char*)"May",
+ (char*)"Jun",
+ (char*)"Jul",
+ (char*)"Aug",
+ (char*)"Sep",
+ (char*)"Oct",
+ (char*)"Nov",
+ (char*)"Dec"
};
/*==================================================================================================
IMPLEMENTATION OF SmsPluginWapPushHandler - Member Functions
==================================================================================================*/
-SmsPluginWapPushHandler* SmsPluginWapPushHandler::pInstance = NULL;
+Sms3gpp2WapPushHandler* Sms3gpp2WapPushHandler::pInstance = NULL;
-SmsPluginWapPushHandler::SmsPluginWapPushHandler()
+Sms3gpp2WapPushHandler::Sms3gpp2WapPushHandler()
{
memset(&tmpAddress, 0x00, sizeof(tmpAddress));
}
-SmsPluginWapPushHandler::~SmsPluginWapPushHandler()
+Sms3gpp2WapPushHandler::~Sms3gpp2WapPushHandler()
{
}
-SmsPluginWapPushHandler* SmsPluginWapPushHandler::instance()
+Sms3gpp2WapPushHandler* Sms3gpp2WapPushHandler::instance()
{
- if (!pInstance)
- pInstance = new SmsPluginWapPushHandler();
+ if (!pInstance) {
+ pInstance = new Sms3gpp2WapPushHandler();
+ }
return pInstance;
}
-bool SmsPluginWapPushHandler::IsWapPushMsg(unsigned short dstport)
+bool Sms3gpp2WapPushHandler::IsWapPushMsg(unsigned short dstport)
{
MSG_BEGIN();
}
#if 0
-sms_wap_app_code_t SmsPluginWapPushHandler::getAppCode(const char *pPushHeader)
+sms_wap_app_code_t Sms3gpp2WapPushHandler::getAppCode(const char *pPushHeader)
{
int appCount = sizeof(pushDefaultApplication)/sizeof(pushDefaultApplication[0]) - 1;
#endif
-void SmsPluginWapPushHandler::copyDeliverData(sms_trans_addr_s *pAddr)
+void Sms3gpp2WapPushHandler::copyDeliverData(sms_3gpp2_trans_addr_s *pAddr)
{
memcpy(&tmpAddress, pAddr, sizeof(tmpAddress));
/*
tmpTimeStamp.format = pDeliver->timeStamp.format;
- if (tmpTimeStamp.format == SMS_TIME_ABSOLUTE) {
+ if (tmpTimeStamp.format == SMS_3GPP2_TIME_ABSOLUTE) {
tmpTimeStamp.time.absolute.year = pDeliver->timeStamp.time.absolute.year;
tmpTimeStamp.time.absolute.month = pDeliver->timeStamp.time.absolute.month;
tmpTimeStamp.time.absolute.day = pDeliver->timeStamp.time.absolute.day;
}
-void SmsPluginWapPushHandler::handleWapPushMsg(const char *pUserData, int DataSize)
+void Sms3gpp2WapPushHandler::handleWapPushMsg(const char *pUserData, int simIndex, int DataSize)
{
MSG_BEGIN();
pushHeaderLen = wspRetriveUintvarDecode(pPDUTypeData, &iPDU);
- MSG_DEBUG("PDUTypeDataLen [%d]", PDUTypeDataLen);
- MSG_DEBUG("pushHeaderLen [%d]", pushHeaderLen);
- MSG_DEBUG("iPDU [%d]", iPDU);
+ MSG_DEBUG("PDUTypeDataLen [%lu]", PDUTypeDataLen);
+ MSG_DEBUG("pushHeaderLen [%lu]", pushHeaderLen);
+ MSG_DEBUG("iPDU [%lu]", iPDU);
wspHeaderLen = pushHeaderLen + iPDU;
- MSG_DEBUG("wspBodyLen [%d]", wspBodyLen);
+ MSG_DEBUG("wspBodyLen [%lu]", wspBodyLen);
if (wspHeaderLen > 0) {
pWspHeader = new char[wspHeaderLen];
return;
}
- handleWapPushCallback((char *)pPushHeader, (char *)pPushBody, (int)pushBodyLen, (char *)pWspHeader, (int)wspHeaderLen, (char *)pWspBody, (int)wspBodyLen);
+ handleWapPushCallback((char *)pPushHeader, (char *)pPushBody, (int)pushBodyLen, (char *)pWspHeader, (int)wspHeaderLen, (char *)pWspBody, (int)wspBodyLen, simIndex);
MSG_END();
}
}
-void SmsPluginWapPushHandler::handleWapPushCallback(char* pPushHeader, char* pPushBody, int PushBodyLen, char* pWspHeader, int WspHeaderLen, char* pWspBody, int WspBodyLen)
+void Sms3gpp2WapPushHandler::handleWapPushCallback(char* pPushHeader, char* pPushBody, int PushBodyLen, char* pWspHeader, int WspHeaderLen, char* pWspBody, int WspBodyLen, int simIndex)
{
MSG_BEGIN();
switch (appcode) {
case SMS_WAP_APPLICATION_MMS_UA:
MSG_DEBUG("Received MMS Notification");
- handleMMSNotification(pPushBody, PushBodyLen);
+ handleMMSNotification(pPushBody, PushBodyLen, simIndex);
break;
case SMS_WAP_APPLICATION_PUSH_SI:
MSG_DEBUG("Received WAP Push (Service Indication Textual form)");
break;
case SMS_WAP_APPLICATION_SYNCML_DM_BOOTSTRAP:
MSG_DEBUG("Received DM BOOTSTRAP");
- SmsPluginEventHandler::instance()->handleSyncMLMsgIncoming(DM_WBXML, pPushBody, PushBodyLen, pWspHeader, WspHeaderLen);
+ Sms3gpp2EventHandler::instance()->handleSyncMLMsgIncoming(DM_WBXML, pPushBody, PushBodyLen, pWspHeader, WspHeaderLen);
break;
case SMS_WAP_APPLICATION_SYNCML_DM_BOOTSTRAP_XML:
MSG_DEBUG("Received DM BOOTSTRAP");
- SmsPluginEventHandler::instance()->handleSyncMLMsgIncoming(DM_XML, pPushBody, PushBodyLen, pWspHeader, WspHeaderLen);
+ Sms3gpp2EventHandler::instance()->handleSyncMLMsgIncoming(DM_XML, pPushBody, PushBodyLen, pWspHeader, WspHeaderLen);
break;
case SMS_WAP_APPLICATION_PUSH_PROVISIONING_XML:
MSG_DEBUG("Received Provisioning");
- SmsPluginEventHandler::instance()->handleSyncMLMsgIncoming(CP_XML, pPushBody, PushBodyLen, pWspHeader, WspHeaderLen);
+ Sms3gpp2EventHandler::instance()->handleSyncMLMsgIncoming(CP_XML, pPushBody, PushBodyLen, pWspHeader, WspHeaderLen);
break;
case SMS_WAP_APPLICATION_PUSH_PROVISIONING_WBXML:
MSG_DEBUG("Received Provisioning");
- SmsPluginEventHandler::instance()->handleSyncMLMsgIncoming(CP_WBXML, pPushBody, PushBodyLen, pWspHeader, WspHeaderLen);
+ Sms3gpp2EventHandler::instance()->handleSyncMLMsgIncoming(CP_WBXML, pPushBody, PushBodyLen, pWspHeader, WspHeaderLen);
break;
case SMS_WAP_APPLICATION_PUSH_BROWSER_SETTINGS:
case SMS_WAP_APPLICATION_PUSH_BROWSER_BOOKMARKS:
MSG_DEBUG("Received Provisioning");
- SmsPluginEventHandler::instance()->handleSyncMLMsgIncoming(OTHERS, pPushBody, PushBodyLen, pWspHeader, WspHeaderLen);
+ Sms3gpp2EventHandler::instance()->handleSyncMLMsgIncoming(OTHERS, pPushBody, PushBodyLen, pWspHeader, WspHeaderLen);
break;
case SMS_WAP_APPLICATION_SYNCML_DM_NOTIFICATION:
MSG_DEBUG("Received DM Notification");
- SmsPluginEventHandler::instance()->handleSyncMLMsgIncoming(DM_NOTIFICATION, pPushBody, PushBodyLen, pWspHeader, WspHeaderLen);
+ Sms3gpp2EventHandler::instance()->handleSyncMLMsgIncoming(DM_NOTIFICATION, pPushBody, PushBodyLen, pWspHeader, WspHeaderLen);
break;
case SMS_WAP_APPLICATION_SYNCML_DS_NOTIFICATION:
MSG_DEBUG("Received DS Notification");
- SmsPluginEventHandler::instance()->handleSyncMLMsgIncoming(DS_NOTIFICATION, pPushBody, PushBodyLen, pWspHeader, WspHeaderLen);
+ Sms3gpp2EventHandler::instance()->handleSyncMLMsgIncoming(DS_NOTIFICATION, pPushBody, PushBodyLen, pWspHeader, WspHeaderLen);
break;
case SMS_WAP_APPLICATION_SYNCML_DS_NOTIFICATION_WBXML:
MSG_DEBUG("Received DS Notification");
- SmsPluginEventHandler::instance()->handleSyncMLMsgIncoming(DS_WBXML, pPushBody, PushBodyLen, pWspHeader, WspHeaderLen);
+ Sms3gpp2EventHandler::instance()->handleSyncMLMsgIncoming(DS_WBXML, pPushBody, PushBodyLen, pWspHeader, WspHeaderLen);
break;
case SMS_WAP_APPLICATION_DRM_UA_RIGHTS_XML:
case SMS_WAP_APPLICATION_DRM_UA_RIGHTS_WBXML:
break;
case SMS_WAP_APPLICATION_LBS:
MSG_DEBUG("Received LBS related message");
- SmsPluginEventHandler::instance()->handleLBSMsgIncoming(pPushHeader, pPushBody, PushBodyLen);
+ Sms3gpp2EventHandler::instance()->handleLBSMsgIncoming(pPushHeader, pPushBody, PushBodyLen);
/* TODO: LBS */
break;
case SMS_WAP_APPLICATION_PUSH_SIA:
/* TODO: SIA */
break;
default:
- SmsPluginEventHandler::instance()->handlePushMsgIncoming(pPushHeader, pPushBody, PushBodyLen, app_id, content_type);
+ Sms3gpp2EventHandler::instance()->handlePushMsgIncoming(pPushHeader, pPushBody, PushBodyLen, app_id, content_type);
break;
}
}
}
#endif
-void SmsPluginWapPushHandler::handleMMSNotification(const char *pPushBody, int PushBodyLen)
+void Sms3gpp2WapPushHandler::handleMMSNotification(const char *pPushBody, int PushBodyLen, int simIndex)
{
MSG_BEGIN();
if (err == MSG_SUCCESS) {
/* Callback */
- err = SmsPluginEventHandler::instance()->callbackMsgIncoming(&msgInfo);
+ err = Sms3gpp2EventHandler::instance()->callbackMsgIncoming(&msgInfo);
if (err != MSG_SUCCESS)
MSG_DEBUG("callbackMsgIncoming() Error !! [%d]", err);
}
-void SmsPluginWapPushHandler::handleSIMessage(char* pPushBody, int PushBodyLen, bool isText)
+void Sms3gpp2WapPushHandler::handleSIMessage(char* pPushBody, int PushBodyLen, bool isText)
{
MSG_BEGIN();
if (err == MSG_SUCCESS) {
/* Callback */
- err = SmsPluginEventHandler::instance()->callbackMsgIncoming(&msgInfo);
+ err = Sms3gpp2EventHandler::instance()->callbackMsgIncoming(&msgInfo);
if (err != MSG_SUCCESS) {
MSG_DEBUG("callbackMsgIncoming() Error !! [%d]", err);
}
-void SmsPluginWapPushHandler::handleSLMessage(char* pPushBody, int PushBodyLen, bool isText)
+void Sms3gpp2WapPushHandler::handleSLMessage(char* pPushBody, int PushBodyLen, bool isText)
{
MSG_BEGIN();
MSG_DEBUG("check pushMsg data");
MSG_DEBUG("pushMsg.action : [%d]", pushMsg.action);
- MSG_DEBUG("pushMsg.received : [%d]", pushMsg.received);
- MSG_DEBUG("pushMsg.created : [%d]", pushMsg.created);
- MSG_DEBUG("pushMsg.expires : [%d]", pushMsg.expires);
+ MSG_DEBUG("pushMsg.received : [%lu]", pushMsg.received);
+ MSG_DEBUG("pushMsg.created : [%lu]", pushMsg.created);
+ MSG_DEBUG("pushMsg.expires : [%lu]", pushMsg.expires);
MSG_SEC_DEBUG("pushMsg.id : [%s]", pushMsg.id);
MSG_DEBUG("pushMsg.href : [%s]", pushMsg.href);
MSG_DEBUG("pushMsg.contents : [%s]", pushMsg.contents);
if (err == MSG_SUCCESS) {
/* Callback to MSG FW */
- err = SmsPluginEventHandler::instance()->callbackMsgIncoming(&msgInfo);
+ err = Sms3gpp2EventHandler::instance()->callbackMsgIncoming(&msgInfo);
if (err != MSG_SUCCESS)
MSG_DEBUG("callbackMsgIncoming is failed, err=[%d]", err);
}
-void SmsPluginWapPushHandler::handleCOMessage(char* pPushBody, int PushBodyLen, bool isText)
+void Sms3gpp2WapPushHandler::handleCOMessage(char* pPushBody, int PushBodyLen, bool isText)
{
MSG_PUSH_CACHEOP_S cacheOp;
if (err == MSG_SUCCESS) {
/* Callback */
- err = SmsPluginEventHandler::instance()->callbackMsgIncoming(&msgInfo);
+ err = Sms3gpp2EventHandler::instance()->callbackMsgIncoming(&msgInfo);
if (err != MSG_SUCCESS) {
MSG_DEBUG("callbackMsgIncoming() Error !! [%d]", err);
}
-void SmsPluginWapPushHandler::handleDrmVer1(char* pPushBody, int PushBodyLen)
+void Sms3gpp2WapPushHandler::handleDrmVer1(char* pPushBody, int PushBodyLen)
{
#if MSG_DRM_SUPPORT
int drmRt = DRM_RETURN_SUCCESS;
}
-void SmsPluginWapPushHandler::createMsgInfo(MSG_MESSAGE_INFO_S* pMsgInfo)
+void Sms3gpp2WapPushHandler::createMsgInfo(MSG_MESSAGE_INFO_S* pMsgInfo)
{
/* Convert class Type values */
pMsgInfo->msgType.classType = MSG_CLASS_NONE;
- /* set folder id (temporary) */
+ /* set folder id (temporary) */
pMsgInfo->folderId = MSG_INBOX_ID;
pMsgInfo->networkStatus = MSG_NETWORK_RECEIVED;
time_t rawtime = time(NULL);
/* Comment below lines to save local UTC time..... (it could be used later.) */
/*
- if (tmpTimeStamp.format == SMS_TIME_ABSOLUTE) {
+ if (tmpTimeStamp.format == SMS_3GPP2_TIME_ABSOLUTE) {
MSG_DEBUG("year : %d", tmpTimeStamp.time.absolute.year);
MSG_DEBUG("month : %d", tmpTimeStamp.time.absolute.month);
pMsgInfo->displayTime = rawtime;
- /* Convert Address values */
+ /* Convert Address values */
pMsgInfo->nAddressCnt = 1;
pMsgInfo->addressList = (MSG_ADDRESS_INFO_S *)new char[sizeof(MSG_ADDRESS_INFO_S)];
pMsgInfo->msgPort.srcPort = 0;
}
-
-void SmsPluginWapPushHandler::getXmlDoc(const char* pPushBody, const int PushBodyLen, xmlDocPtr *pXmlDoc, const bool isText)
+void Sms3gpp2WapPushHandler::getXmlDoc(const char* pPushBody, const int PushBodyLen, xmlDocPtr *pXmlDoc, const bool isText)
{
if (pPushBody == NULL) {
MSG_DEBUG("pPushBody is NULL");
}
}
-
-unsigned long SmsPluginWapPushHandler::convertXmlCharToSec(char* pDate)
+unsigned long Sms3gpp2WapPushHandler::convertXmlCharToSec(char* pDate)
{
struct tm timeStruct;
time_t nTimeInSec = 0;
}
-msg_push_action_t SmsPluginWapPushHandler::convertSIActionStrToEnum(char* pAction)
+msg_push_action_t Sms3gpp2WapPushHandler::convertSIActionStrToEnum(char* pAction)
{
int comp = 0;
}
-msg_push_action_t SmsPluginWapPushHandler::convertSLActionStrToEnum(char* pAction)
+msg_push_action_t Sms3gpp2WapPushHandler::convertSLActionStrToEnum(char* pAction)
{
int comp = 0;
}
-unsigned long SmsPluginWapPushHandler::wspRetriveUintvarDecode(unsigned char* sourceData, unsigned long* currentPointer)
+unsigned long Sms3gpp2WapPushHandler::wspRetriveUintvarDecode(unsigned char* sourceData, unsigned long* currentPointer)
{
unsigned long i = 0;
unsigned long decodedValue;
decodedValue = wspDecodeUintvar(i+1, sourceData + *currentPointer);
*currentPointer = *currentPointer + i + 1;
- MSG_DEBUG("wspRetriveUintvarDecode: decodedValue=%d .\n", decodedValue);
+ MSG_DEBUG("wspRetriveUintvarDecode: decodedValue=%lu .\n", decodedValue);
return decodedValue;
}
-unsigned long SmsPluginWapPushHandler::wspDecodeUintvar(unsigned long length, unsigned char* userVar)
+unsigned long Sms3gpp2WapPushHandler::wspDecodeUintvar(unsigned long length, unsigned char* userVar)
{
unsigned long i;
unsigned long decodedUintvar = 0;
}
-void SmsPluginWapPushHandler::wspDecodeHeader(unsigned char* sEncodedHeader, unsigned long encodedHeaderLen, unsigned long contentsLength, bool fContentType, char** pHeader)
+void Sms3gpp2WapPushHandler::wspDecodeHeader(unsigned char* sEncodedHeader, unsigned long encodedHeaderLen, unsigned long contentsLength, bool fContentType, char** pHeader)
{
unsigned long iField;
bool continueField = FALSE;
/* processing normal pre-defined field decoding */
MSG_DEBUG("WspLDecodeHeader: FieldCode %X\n", fieldCode);
- MSG_DEBUG("WspLDecodeHeader: fieldSize %d\n", fieldValueLen);
+ MSG_DEBUG("WspLDecodeHeader: fieldSize %lu\n", fieldValueLen);
if ((fieldCode > wspHeaderFieldCount) && (fieldCode != 0xff)) {
MSG_DEBUG("WspLDecodeHeader: unknown fieldcode %X \n", track);
unsigned long i = 0;
/* encoded content type length body */
unsigned long tempLen;
- MSG_DEBUG("fieldValueLen: %d", fieldValueLen);
+ MSG_DEBUG("fieldValueLen: %lu", fieldValueLen);
/* Like HTTP result state 304, it's for processing without Content type. This part doesn't defined. */
if (0 == fieldValueLen) {
i++;
/* If there is a Content-Type assigned, */
- if (i < wspUnregisteredContentsTypeCount)
+ if (i < wspUnregisteredContentsTypeCount) {
strncat((char*)temper, (char*)wspUnregisterContentsType[i].contentsTypeName, (WSP_STANDARD_STR_LEN_MAX * 5)-AcStrlen((char*)temper)-1);
+ }
tempLen +=1;
}
} else {
tempLen = AcStrlen((char*)fieldValue) + 1;
strncat((char*)temper, (char*)fieldValue, (WSP_STANDARD_STR_LEN_MAX * 5)-AcStrlen((char*)temper)-1);
- MSG_DEBUG("WspLDecodeHeader: Attention, Decoding Check of Content-Type\n ", tempLen);
+ MSG_DEBUG("WspLDecodeHeader: Attention, Decoding Check of Content-Type: %lu \n ", tempLen);
}
/* If there is a parameter */
integerValue = wspHeaderDecodeIntegerByLength(fieldValue, fieldValueLen);
- int count = sizeof(wspHeaderApplId)/sizeof(SMS_WSP_HEADER_PARAMETER_S);
+ int count = sizeof(wspHeaderApplId)/sizeof(SMS_3GPP2_WSP_HEADER_PARAMETER_S);
for (int i = 0; i < count ; ++i) {
if ((unsigned int)integerValue == wspHeaderApplId[i].parameterCode) {
snprintf((char*)temp, 64, "%s", wspHeaderApplId[i].parameterToken);
iField = AcStrlen((char*)authScheme) + 1;
strncpy((char*)realmValue, (char*)(fieldValue + iField), WSP_STANDARD_STR_LEN_MAX-1);
iField = iField + AcStrlen((char*)realmValue) + 1;
- snprintf((char*)addedString, sizeof(addedString), "%s %s", authScheme, realmValue);
+ int wrn = snprintf((char*)addedString, sizeof(addedString), "%s %s", authScheme, realmValue);
+ if(wrn < 0)
+ MSG_DEBUG("snprintf was failed");
wspHeaderCopyDecodedString(addedString, ¤tLength, &temper);
if (iField < fieldValueLen) {
strncpy((char*)agent, (char*)(fieldValue + iField), WSP_STANDARD_STR_LEN_MAX-1);
iField = iField + AcStrlen((char*)agent) + 1;
strncpy((char*)text, (char*)(fieldValue + iField), WSP_STANDARD_STR_LEN_MAX-1);
- snprintf((char*)temp, sizeof(temp), " %s %s", agent, text);
+ int wrn = snprintf((char*)temp, sizeof(temp), " %s %s", agent, text);
+ if (wrn < 0)
+ MSG_DEBUG("snprintf was failed");
wspHeaderCopyDecodedString(temp, ¤tLength, &temper);
}
}
}
-unsigned long SmsPluginWapPushHandler::wspHeaderDecodeInteger(unsigned char* data)
+unsigned long Sms3gpp2WapPushHandler::wspHeaderDecodeInteger(unsigned char* data)
{
/* we only can handle max 32bit integer */
unsigned long i;
IntLen = (data[0] > 0x04) ? 0x04:data[0];
- MSG_DEBUG("WspLHeaderDecodeInteger: input %d , length %d\n", data[0], IntLen);
+ MSG_DEBUG("WspLHeaderDecodeInteger: input %d , length %lu\n", data[0], IntLen);
for (i = 0; i < IntLen; i++)
returner.seg[IntLen-(i+1)] = data[i+1];
}
-void SmsPluginWapPushHandler::wspHeaderDecodeQValue(unsigned long length, unsigned char* data, char** pDecodedString)
+void Sms3gpp2WapPushHandler::wspHeaderDecodeQValue(unsigned long length, unsigned char* data, char** pDecodedString)
{
unsigned short qBase = 0;
float qValue;
}
-unsigned long SmsPluginWapPushHandler::wspHeaderDecodeIntegerByLength(unsigned char* data, unsigned long length)
+unsigned long Sms3gpp2WapPushHandler::wspHeaderDecodeIntegerByLength(unsigned char* data, unsigned long length)
{
unsigned long i;
for (i = 0 ; i < length; i++) {
returner.integer = returner.integer + (data[i] * (0x1 << ((length - (i + 1)) * 8)));
- MSG_DEBUG("WspLHeaderDecodeIntegerByLength: %d \n", returner.integer);
+ MSG_DEBUG("WspLHeaderDecodeIntegerByLength: %lu \n", returner.integer);
}
return returner.integer;
}
-char* SmsPluginWapPushHandler::wspExtendedDecodeType(char contentType)
+char* Sms3gpp2WapPushHandler::wspExtendedDecodeType(char contentType)
{
int i = 0;
}
-void SmsPluginWapPushHandler::wspHeaderDecodeParameter(unsigned char* data, unsigned long length, char** pParam)
+void Sms3gpp2WapPushHandler::wspHeaderDecodeParameter(unsigned char* data, unsigned long length, char** pParam)
{
char* param = *pParam;
}
-void SmsPluginWapPushHandler::wspHeaderDecodeCharset(unsigned long length, unsigned char* data, char**pDecodedString)
+void Sms3gpp2WapPushHandler::wspHeaderDecodeCharset(unsigned long length, unsigned char* data, char**pDecodedString)
{
*pDecodedString = new char[WSP_STANDARD_STR_LEN_MAX];
}
-void SmsPluginWapPushHandler::wspHeaderDecodeVersion(unsigned long length, unsigned char* data, char** pDecodedString)
+void Sms3gpp2WapPushHandler::wspHeaderDecodeVersion(unsigned long length, unsigned char* data, char** pDecodedString)
{
*pDecodedString = new char[WSP_STANDARD_STR_LEN_MAX];
}
-void SmsPluginWapPushHandler::wspHeaderDecodeDateValue(unsigned long length, unsigned char* data, char** pDecodedString)
+void Sms3gpp2WapPushHandler::wspHeaderDecodeDateValue(unsigned long length, unsigned char* data, char** pDecodedString)
{
time_t lTime;
struct tm* pTMData;
return;
}
-
-void SmsPluginWapPushHandler::wspHeaderCopyDecodedString(unsigned char* szDecodedString, unsigned long* currentLen, char** pTemper)
+void Sms3gpp2WapPushHandler::wspHeaderCopyDecodedString(unsigned char* szDecodedString, unsigned long* currentLen, char** pTemper)
{
unsigned long elementLen = AcStrlen((char*)szDecodedString);
char* temper2 = NULL;
}
-void SmsPluginWapPushHandler::wspHeaderDecodeAuth(unsigned long fieldValueLen, unsigned char* fieldValue, char** pDecodedString)
+void Sms3gpp2WapPushHandler::wspHeaderDecodeAuth(unsigned long fieldValueLen, unsigned char* fieldValue, char** pDecodedString)
{
unsigned char userId[WSP_STANDARD_STR_LEN_MAX];
unsigned char passWd[WSP_STANDARD_STR_LEN_MAX];
snprintf(authStr, sizeof(authStr), "%%%ds", sizeof(passWd));
sscanf((char*)(fieldValue + iField), authStr, passWd);
iField = iField + AcStrlen((char*)userId) + 1;
- snprintf((char*)*pDecodedString, (sizeof(char)*WSP_STANDARD_STR_LEN_MAX*2), "basic %s/%s", userId, passWd);
+ int wrn = snprintf((char*)*pDecodedString, (sizeof(char)*WSP_STANDARD_STR_LEN_MAX*2), "basic %s/%s", userId, passWd);
+ if (wrn < 0)
+ MSG_DEBUG("snprintf was failed");
return;
}
-void SmsPluginWapPushHandler::wspHeaderDecodeChallenge(unsigned long fieldValueLen, unsigned char* fieldValue, char** pDecodedString)
+void Sms3gpp2WapPushHandler::wspHeaderDecodeChallenge(unsigned long fieldValueLen, unsigned char* fieldValue, char** pDecodedString)
{
unsigned char userId[WSP_STANDARD_STR_LEN_MAX];
unsigned long iField = 0;
sscanf((char*)(fieldValue + iField), authStr, userId);
iField = iField + AcStrlen((char*)userId) + 1;
- snprintf((char*)*pDecodedString, (sizeof(char)*WSP_STANDARD_STR_LEN_MAX), "basic realm=\"%s\"", userId);
+ int wrn = snprintf((char*)*pDecodedString, (sizeof(char)*WSP_STANDARD_STR_LEN_MAX), "basic realm=\"%s\"", userId);
+ if (wrn < 0)
+ MSG_DEBUG("snprintf was failed");
return;
}
-void SmsPluginWapPushHandler::wspHeaderDecodeCacheControl(unsigned char* fieldValue, unsigned long fieldValueLen, char** pCacheString)
+void Sms3gpp2WapPushHandler::wspHeaderDecodeCacheControl(unsigned char* fieldValue, unsigned long fieldValueLen, char** pCacheString)
{
unsigned char paramString[WSP_STANDARD_STR_LEN_MAX];
unsigned char cacheCode;
default:
break;
}
- snprintf((char*)*pCacheString, (sizeof(char)*WSP_STANDARD_STR_LEN_MAX), "%s=%s", (char*)wspCacheControl[cacheCode], (char*)paramString);
+ int wrn = snprintf((char*)*pCacheString, (sizeof(char)*WSP_STANDARD_STR_LEN_MAX), "%s=%s", (char*)wspCacheControl[cacheCode], (char*)paramString);
+ if (wrn < 0)
+ MSG_DEBUG("snprintf was failed");
} else {
/* cache extentions */
/* In case of come directive of doesn't specified string style */
* limitations under the License.
*/
-#ifndef SMS_CDMA_PLUGIN_CODEC_H
-#define SMS_CDMA_PLUGIN_CODEC_H
+#ifndef SMS_3GPP2_CODEC_H
+#define SMS_3GPP2_CODEC_H
/*==================================================================================================
INCLUDE FILES
==================================================================================================*/
-#include "SmsCdmaPluginTypes.h"
+#include "Sms3gpp2Types.h"
/*==================================================================================================
CLASS DEFINITIONS
==================================================================================================*/
-class SmsPluginMsgCodec
+class Sms3gpp2MsgCodec
{
public:
- static SmsPluginMsgCodec* instance();
+
+ static Sms3gpp2MsgCodec* instance();
static bool checkInvalidPDU(const unsigned char *p_pkg_str, const int p_pkg_len);
- static int encodeMsg(const sms_trans_msg_s *pMsg, unsigned char *p_pkg_str);
- static int decodeMsg(const unsigned char *p_pkg_str, int p_pkg_len, sms_trans_msg_s *p_msg);
+ static int encodeMsg(const sms_3gpp2_trans_msg_s *pMsg, unsigned char *p_pkg_str);
+ static int decodeMsg(const unsigned char *p_pkg_str, int p_pkg_len, sms_3gpp2_trans_msg_s *p_msg);
private:
- SmsPluginMsgCodec();
- ~SmsPluginMsgCodec();
+ Sms3gpp2MsgCodec();
+ ~Sms3gpp2MsgCodec();
- static SmsPluginMsgCodec* pInstance;
+ static Sms3gpp2MsgCodec* pInstance;
- static int encodeP2PMsg(const sms_trans_p2p_msg_s *p_msg, unsigned char *p_pkg_str);
- static int encodeAckMsg(const sms_trans_ack_msg_s *p_msg, unsigned char *p_pkg_str);
- static int encodeCBMsg(const sms_trans_broadcast_msg_s *p_msg, unsigned char *p_pkg_str);
+ static int encodeP2PMsg(const sms_3gpp2_trans_p2p_msg_s *p_msg, unsigned char *p_pkg_str);
+ static int encodeAckMsg(const sms_3gpp2_trans_ack_msg_s *p_msg, unsigned char *p_pkg_str);
+ static int encodeCBMsg(const sms_3gpp2_trans_broadcast_msg_s *p_msg, unsigned char *p_pkg_str);
- static int encodeTelesvcMsg(const sms_telesvc_msg_s *p_msg, unsigned char *p_pkg_str);
+ static int encodeTelesvcMsg(const sms_3gpp2_telesvc_msg_s *p_msg, unsigned char *p_pkg_str);
- static int encodeTelesvcCancelMsg(const sms_telesvc_cancel_s *p_msg, unsigned char *p_pkg_str);
- static int encodeTelesvcSubmitMsg(const sms_telesvc_submit_s *p_msg, unsigned char *p_pkg_str);
- static int encodeTelesvcUserAckMsg(const sms_telesvc_user_ack_s *p_msg, unsigned char *p_pkg_str);
- static int encodeTelesvcReadAckMsg(const sms_telesvc_read_ack_s *p_msg, unsigned char *p_pkg_str);
- static int encodeTelesvcDeliverReportMsg(const sms_telesvc_report_s *p_msg, unsigned char *p_pkg_str);
+ static int encodeTelesvcCancelMsg(const sms_3gpp2_telesvc_cancel_s *p_msg, unsigned char *p_pkg_str);
+ static int encodeTelesvcSubmitMsg(const sms_3gpp2_telesvc_submit_s *p_msg, unsigned char *p_pkg_str);
+ static int encodeTelesvcUserAckMsg(const sms_3gpp2_telesvc_user_ack_s *p_msg, unsigned char *p_pkg_str);
+ static int encodeTelesvcReadAckMsg(const sms_3gpp2_telesvc_read_ack_s *p_msg, unsigned char *p_pkg_str);
+ static int encodeTelesvcDeliverReportMsg(const sms_3gpp2_telesvc_report_s *p_msg, unsigned char *p_pkg_str);
- static int decodeP2PMsg(const unsigned char *p_pkg_str, int p_pkg_len, sms_trans_p2p_msg_s *p_p2p);
- static int decodeCBMsg(const unsigned char *p_pkg_str, int p_pkg_len, sms_trans_broadcast_msg_s *p_cb);
- static int decodeAckMsg(const unsigned char *p_pkg_str, int p_pkg_len, sms_trans_ack_msg_s *p_ack);
+ static int decodeP2PMsg(const unsigned char *p_pkg_str, int p_pkg_len, sms_3gpp2_trans_p2p_msg_s *p_p2p);
+ static int decodeCBMsg(const unsigned char *p_pkg_str, int p_pkg_len, sms_3gpp2_trans_broadcast_msg_s *p_cb);
+ static int decodeAckMsg(const unsigned char *p_pkg_str, int p_pkg_len, sms_3gpp2_trans_ack_msg_s *p_ack);
- static void decodeP2PTelesvcMsg(const unsigned char *p_pkg_str, int p_pkg_len, sms_telesvc_msg_s *p_telesvc);
- static void decodeP2PDeliveryAckMsg(const unsigned char *p_pkg_str, int p_pkg_len, sms_telesvc_deliver_ack_s *p_del_ack);
- static void decodeP2PSubmitReportMsg(const unsigned char *p_pkg_str, int p_pkg_len, sms_telesvc_report_s *p_sub_report);
- static void decodeP2PUserAckMsg(const unsigned char *p_pkg_str, int p_pkg_len, sms_telesvc_user_ack_s *p_user_ack);
- static void decodeP2PReadAckMsg(const unsigned char *p_pkg_str, int p_pkg_len, sms_telesvc_read_ack_s *p_read_ack);
- static void decodeP2PDeliverMsg(const unsigned char *p_pkg_str, int p_pkg_len, sms_telesvc_deliver_s *p_del);
- static void decodeP2PSubmitMsg(const unsigned char *p_pkg_str, int p_pkg_len, sms_telesvc_submit_s *p_sub);
- static void decodeCBBearerData(const unsigned char *p_pkg_str, int p_pkg_len, sms_telesvc_msg_s *p_telesvc, bool isCMAS);
+ static void decodeP2PTelesvcMsg(const unsigned char *p_pkg_str, int p_pkg_len, sms_3gpp2_telesvc_msg_s *p_telesvc);
+ static void decodeP2PDeliveryAckMsg(const unsigned char *p_pkg_str, int p_pkg_len, sms_3gpp2_telesvc_deliver_ack_s *p_del_ack);
+ static void decodeP2PSubmitReportMsg(const unsigned char *p_pkg_str, int p_pkg_len, sms_3gpp2_telesvc_report_s *p_sub_report);
+ static void decodeP2PUserAckMsg(const unsigned char *p_pkg_str, int p_pkg_len, sms_3gpp2_telesvc_user_ack_s *p_user_ack);
+ static void decodeP2PReadAckMsg(const unsigned char *p_pkg_str, int p_pkg_len, sms_3gpp2_telesvc_read_ack_s *p_read_ack);
+ static void decodeP2PDeliverMsg(const unsigned char *p_pkg_str, int p_pkg_len, sms_3gpp2_telesvc_deliver_s *p_del);
+ static void decodeP2PSubmitMsg(const unsigned char *p_pkg_str, int p_pkg_len, sms_3gpp2_telesvc_submit_s *p_sub);
+ static void decodeCBBearerData(const unsigned char *p_pkg_str, int p_pkg_len, sms_3gpp2_telesvc_msg_s *p_telesvc, bool isCMAS);
static int encodeUserData(const unsigned char* src, unsigned char *dest, int src_size);
- static void decodeUserData(unsigned char *p_pkg_str, int p_pkg_len, sms_telesvc_userdata_s *p_user);
- static void decodeCMASData(unsigned char *p_pkg_str, int p_pkg_len, sms_telesvc_cmasdata_s *p_cmas);
-
- static int decodeTeleId(const unsigned char *p_pkg_str, int p_pkg_len, sms_trans_telesvc_id_t *tele_id);
- static int decodeSvcCtg(const unsigned char *p_pkg_str, int p_pkg_len, sms_trans_svc_ctg_t *svc_ctg);
- static int decodeAddress(const unsigned char *p_pkg_str, int p_pkg_len, sms_trans_addr_s *addr);
- static int decodeSubAddress(const unsigned char *p_pkg_str, int p_pkg_len, sms_trans_sub_addr_s *sub_addr);
-
- static int decodeMsgId(const unsigned char *p_pkg_str, int pkg_len, sms_trans_msg_id_s *p_msg_id);
- static void decodeCallBackNum(const unsigned char *p_pkg_str, int pkg_len, sms_telesvc_addr_s *p_callback);
- static int decodeAbsTime(const unsigned char *p_pkg_str, sms_time_abs_s *p_time_abs);
- static sms_message_type_t findMsgType(const unsigned char *p_pkg_str, int pkg_len);
+ static void decodeUserData(unsigned char *p_pkg_str, int p_pkg_len, sms_3gpp2_telesvc_userdata_s *p_user);
+ static void decodeCMASData(unsigned char *p_pkg_str, int p_pkg_len, sms_3gpp2_telesvc_cmasdata_s *p_cmas);
+
+ static int decodeTeleId(const unsigned char *p_pkg_str, int p_pkg_len, sms_3gpp2_trans_telesvc_id_t *tele_id);
+ static int decodeSvcCtg(const unsigned char *p_pkg_str, int p_pkg_len, sms_3gpp2_trans_svc_ctg_t *svc_ctg);
+ static int decodeAddress(const unsigned char *p_pkg_str, int p_pkg_len, sms_3gpp2_trans_addr_s *addr);
+ static int decodeSubAddress(const unsigned char *p_pkg_str, int p_pkg_len, sms_3gpp2_trans_sub_addr_s *sub_addr);
+
+ static int decodeMsgId(const unsigned char *p_pkg_str, int pkg_len, sms_3gpp2_trans_msg_id_s *p_msg_id);
+ static void decodeCallBackNum(const unsigned char *p_pkg_str, int pkg_len, sms_3gpp2_telesvc_addr_s *p_callback);
+ static int decodeAbsTime(const unsigned char *p_pkg_str, sms_3gpp2_time_abs_s *p_time_abs);
+ static sms_3gpp2_message_type_t findMsgType(const unsigned char *p_pkg_str, int pkg_len);
};
-#endif /* SMS_CDMA_PLUGIN_CODEC_H */
+#endif /* SMS_3GPP2_CODEC_H */
* limitations under the License.
*/
-#ifndef SMS_CDMA_PLUGIN_EVENT_HANDLER_H
-#define SMS_CDMA_PLUGIN_EVENT_HANDLER_H
+#ifndef SMS_3GPP2_EVENT_HANDLER_H
+#define SMS_3GPP2_EVENT_HANDLER_H
/*==================================================================================================
using namespace std;
+#include <tapi_common.h>
+#include <TelSms.h>
#include "MsgMutex.h"
#include "MsgTextConvert.h"
#include "MsgPluginInterface.h"
-#include "SmsCdmaPluginTypes.h"
-
+#include "Sms3gpp2Types.h"
/*==================================================================================================
VARIABLES AND DEFINES
==================================================================================================*/
-struct wap_data_s {
+struct wap_3gpp2_data_s {
int length;
char data[SMS_MAX_USER_DATA_LEN+1];
};
-typedef map<unsigned char, wap_data_s> wapDataMap;
+typedef map<unsigned char, wap_3gpp2_data_s> wap3gpp2DataMap;
typedef struct _sms_wap_msg_s {
unsigned short msgId;
unsigned char totalSeg;
unsigned char segNum;
-} sms_wap_msg_s;
+ int simIndex;
+} sms_3gpp2_wap_msg_s;
typedef struct _sms_wap_info_s {
unsigned short msgId;
unsigned char totalSeg;
unsigned char segNum;
+ int simIndex;
unsigned int totalSize;
- wapDataMap data;
-} sms_wap_info_s;
+ wap3gpp2DataMap data;
+} sms_3gpp2_wap_info_s;
+
/*==================================================================================================
CLASS DEFINITIONS
==================================================================================================*/
-class SmsPluginEventHandler
+class Sms3gpp2EventHandler
{
public:
- static SmsPluginEventHandler* instance();
+ static Sms3gpp2EventHandler* instance();
void registerListener(MSG_PLUGIN_LISTENER_S *pListener);
void handleSentStatus(msg_network_status_t NetStatus);
- void handleMsgIncoming(sms_trans_p2p_msg_s *p_p2p_msg);
- void handleCbMsgIncoming(sms_trans_broadcast_msg_s *p_cb_msg);
- void handleWapMsgIncoming(sms_trans_p2p_msg_s *p_p2p_msg);
+ void handleMsgIncoming(TapiHandle *handle, sms_3gpp2_trans_p2p_msg_s *p_p2p_msg);
+ void handleCbMsgIncoming(TapiHandle *handle, sms_3gpp2_trans_broadcast_msg_s *p_cb_msg);
+ void handleWapMsgIncoming(TapiHandle *handle, sms_3gpp2_trans_p2p_msg_s *p_p2p_msg);
void handleResendMessage(void);
msg_error_t callbackMsgIncoming(MSG_MESSAGE_INFO_S *pMsgInfo);
msg_error_t callbackStorageChange(msg_storage_change_type_t storageChangeType, MSG_MESSAGE_INFO_S *pMsgInfo);
- void convertTpduToMsginfo(sms_trans_p2p_msg_s *p_p2p_msg, MSG_MESSAGE_INFO_S *p_msg_info);
- void convertTpduToMsginfo(sms_trans_broadcast_msg_s *p_cb_msg, MSG_MESSAGE_INFO_S *p_msg_info);
+ void convertTpduToMsginfo(sms_3gpp2_trans_p2p_msg_s *p_p2p_msg, MSG_MESSAGE_INFO_S *p_msg_info);
+ void convertTpduToMsginfo(sms_3gpp2_trans_broadcast_msg_s *p_cb_msg, MSG_MESSAGE_INFO_S *p_msg_info);
- void SetSentInfo(sms_sent_info_s *pSentInfo);
+ void SetSentInfo(sms_3gpp2_sent_info_s *pSentInfo);
- void setDeviceStatus();
- bool getDeviceStatus();
- void setNeedInitConfig(bool bNeeded);
- bool getNeedInitConfig();
+ void setDeviceStatus(TapiHandle *handle, bool status);
+ bool getDeviceStatus(TapiHandle *handle);
void handleSyncMLMsgIncoming(msg_syncml_message_type_t msgType, char* pPushBody, int PushBodyLen, char* pWspHeader, int WspHeaderLen);
void handleLBSMsgIncoming(char* pPushHeader, char* pPushBody, int pushBodyLen);
void handlePushMsgIncoming(char* pPushHeader, char* pPushBody, int pushBodyLen, char *app_id, char *content_type);
private:
- SmsPluginEventHandler();
- virtual ~SmsPluginEventHandler();
+ Sms3gpp2EventHandler();
+ virtual ~Sms3gpp2EventHandler();
- static SmsPluginEventHandler* pInstance;
+ static Sms3gpp2EventHandler* pInstance;
MSG_PLUGIN_LISTENER_S listener;
- sms_sent_info_s sentInfo;
+ sms_3gpp2_sent_info_s sentInfo;
bool devStatus;
- bool bNeedInitConfig;
+ TapiHandle *devHandle;
MsgMutex mx;
MsgCndVar cv;
- vector<sms_wap_info_s> wapList;
+ vector<sms_3gpp2_wap_info_s> wapList;
- void convertDeliverMsgToMsgInfo(sms_telesvc_deliver_s *p_deliver, MSG_MESSAGE_INFO_S *p_msg_info);
- void convertCMASMsgToMsgInfo(sms_telesvc_deliver_s *p_deliver, MSG_MESSAGE_INFO_S *p_msg_info);
- void convertAckMsgToMsgInfo(sms_telesvc_deliver_ack_s *p_deliver, MSG_MESSAGE_INFO_S *p_msg_info);
- void convertReportMsgToMsgInfo(sms_telesvc_report_s *p_deliver, MSG_MESSAGE_INFO_S *p_msg_info);
+ void convertDeliverMsgToMsgInfo(sms_3gpp2_telesvc_deliver_s *p_deliver, MSG_MESSAGE_INFO_S *p_msg_info);
+ void convertCMASMsgToMsgInfo(sms_3gpp2_telesvc_deliver_s *p_deliver, MSG_MESSAGE_INFO_S *p_msg_info);
+ void convertAckMsgToMsgInfo(sms_3gpp2_telesvc_deliver_ack_s *p_deliver, MSG_MESSAGE_INFO_S *p_msg_info);
+ void convertReportMsgToMsgInfo(sms_3gpp2_telesvc_report_s *p_deliver, MSG_MESSAGE_INFO_S *p_msg_info);
- msg_encode_type_t getEncodeType(sms_encoding_type_t encode_type);
+ msg_encode_type_t getEncodeType(sms_3gpp2_encoding_type_t encode_type);
- unsigned short checkWapMsg(sms_wap_msg_s *pMsg, sms_telesvc_userdata_s *pUserdata);
- int MakeWapUserData(unsigned short msgId, char **ppTotalData);
+ unsigned short checkWapMsg(sms_3gpp2_wap_msg_s *pMsg, sms_3gpp2_telesvc_userdata_s *pUserdata);
+ int MakeWapUserData(unsigned short msgId, msg_sim_slot_id_t simIndex, char **ppTotalData);
- bool checkCbOpt(sms_trans_svc_ctg_t svc_ctg);
+ bool checkCbOpt(TapiHandle *handle, sms_3gpp2_trans_svc_ctg_t svc_ctg);
};
-#endif /* SMS_CDMA_PLUGIN_EVENT_HANDLER_H */
+#endif /* SMS_3GPP2_EVENT_HANDLER_H */
* limitations under the License.
*/
-#ifndef SMS_CDMA_PLUGIN_PARAMCODEC_H
-#define SMS_CDMA_PLUGIN_PARAMCODEC_H
+#ifndef SMS_3GPP2_PARAM_CODEC_H
+#define SMS_3GPP2_PARAM_CODEC_H
/*==================================================================================================
INCLUDE FILES
==================================================================================================*/
-#include "SmsCdmaPluginTypes.h"
+#include "Sms3gpp2Types.h"
/*==================================================================================================
CLASS DEFINITIONS
==================================================================================================*/
-class SmsPluginParamCodec
+class Sms3gpp2ParamCodec
{
public:
- static SmsPluginParamCodec* instance();
+
+ static Sms3gpp2ParamCodec* instance();
static int convertDigitToBcd(char *pDigit, int DigitLen, unsigned char *pBcd);
static int convertBcdToDigit(const unsigned char *pBcd, int BcdLen, char *pDigit);
static int convertDTMFToDigit(const unsigned char *pDtmf, int DtmfLen, int startBit, char *pDigit);
private:
- SmsPluginParamCodec();
- virtual ~SmsPluginParamCodec();
+ Sms3gpp2ParamCodec();
+ virtual ~Sms3gpp2ParamCodec();
- static SmsPluginParamCodec* pInstance;
+ static Sms3gpp2ParamCodec* pInstance;
static bool isDtmfNumber(const char *pDigit, int DigitLen);
};
-#endif /*SMS_CDMA_PLUGIN_PARAMCODEC_H*/
+#endif /* SMS_3GPP2_PARAM_CODEC_H */
* limitations under the License.
*/
-#ifndef SMS_CDMA_PLUGIN_SETTING_H
-#define SMS_CDMA_PLUGIN_SETTING_H
+#ifndef SMS_3GPP2_SETTING_H
+#define SMS_3GPP2_SETTING_H
/*==================================================================================================
/*==================================================================================================
CLASS DEFINITIONS
==================================================================================================*/
-class SmsPluginSetting
+class Sms3gpp2Setting
{
public:
- static SmsPluginSetting* instance();
+ static Sms3gpp2Setting* instance();
- void setSimChangeStatus();
+ void setSimChangeStatus(TapiHandle *handle);
void setConfigData(const MSG_SETTING_S *pSetting);
void getConfigData(MSG_SETTING_S *pSetting);
void setResultFromEvent(bool bResult);
void setResultFromSim(bool bResult);
- void setMwiInfo(MSG_SUB_TYPE_T type, int count);
- void SimRefreshCb();
+ void setMwiInfo(int simIndex, MSG_SUB_TYPE_T type, int count);
+ void SimRefreshCb(TapiHandle *handle);
+ void initializeSimInfo(TapiHandle *handle);
bool getUpdateVoicemailByMdn();
private:
- SmsPluginSetting();
- ~SmsPluginSetting();
+ Sms3gpp2Setting();
+ ~Sms3gpp2Setting();
- void updateSimStatus();
+ void updateSimStatus(TapiHandle *handle);
- void initConfigData();
+ void initConfigData(TapiHandle *handle);
static void* init_config_data(void *data);
static void* initSimInfo(void *data);
msg_error_t addCbOpt(MSG_CBMSG_OPT_S *pCbOpt);
- void getCbOpt(MSG_SETTING_S *pSetting);
+ void getCbOpt(MSG_SETTING_S *pSetting, int simIndex);
void setVoiceMailInfo(const MSG_VOICEMAIL_OPT_S *pVoiceOpt);
bool setCbConfig(const MSG_CBMSG_OPT_S *pCbOpt);
bool getCbConfig(MSG_CBMSG_OPT_S *pCbOpt);
- bool getMsisdnInfo(void);
+ bool getMsisdnInfo(TapiHandle *handle);
bool getResultImei(char *pImei);
bool getResultFromSim();
- static SmsPluginSetting* pInstance;
+ static Sms3gpp2Setting* pInstance;
MSG_SMSC_DATA_S smscData;
MSG_CBMSG_OPT_S cbOpt;
MsgCndVar cv;
};
-#endif /* SMS_CDMA_PLUGIN_SETTING_H */
+#endif /* SMS_3GPP2_SETTING_H */
+
--- /dev/null
+/*
+ * Copyright (c) 2015 Samsung Electronics Co., Ltd. All rights reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+*/
+
+#ifndef SMS_3GPP2_TAPI_EVENT_HANDLER_H
+#define SMS_3GPP2_TAPI_EVENT_HANDLER_H
+
+/*==================================================================================================
+ INCLUDE FILES
+==================================================================================================*/
+#include <tapi_common.h>
+
+/*==================================================================================================
+ FUNCTION PROTOTYPES
+==================================================================================================*/
+class Sms3gpp2TapiEventHandler
+{
+public:
+ static void NotiSmsIncomMsg(TapiHandle *handle, const char *noti_id, void *data, void *user_data);
+ static void NotiSimRefreshed(TapiHandle *handle, const char *noti_id, void *data, void *user_data);
+ static void NotiSmsDeviceReady(TapiHandle *handle, const char *noti_id, void *data, void *user_data);
+ static void NotiNetworkRegistrationType(TapiHandle *handle, const char *noti_id, void *data, void *user_data);
+
+ static void respSetMemoryStatus(TapiHandle *handle, int result, void *data, void *user_data);
+ static void respSentStatus(TapiHandle *handle, int result, void *data, void *user_data);
+ static void respDeliveryReportCNF(TapiHandle *handle, int result, void *data, void *user_data);
+ static void respSetConfigData(TapiHandle *handle, int result, void *data, void *user_data);
+ static void respGetCBConfig(TapiHandle *handle, int result, void *data, void *user_data);
+ static void respGetMsisdnInfo(TapiHandle *handle, int result, void *data, void *user_data);
+};
+
+#endif /* SMS_3GPP2_TAPI_EVENT_HANDLER_H */
* limitations under the License.
*/
-#ifndef SMS_CDMA_PLUGIN_TRANSPORT_H
-#define SMS_CDMA_PLUGIN_TRANSPORT_H
+#ifndef SMS_3GPP2_TRANSPORT_H
+#define SMS_3GPP2_TRANSPORT_H
/*==================================================================================================
INCLUDE FILES
==================================================================================================*/
+#include <tapi_common.h>
+#include <TelSms.h>
#include "MsgInternalTypes.h"
#include "MsgMutex.h"
-#include "SmsCdmaPluginTypes.h"
-
-extern "C"
-{
- #include <TelSat.h>
-}
+#include "Sms3gpp2Types.h"
/*==================================================================================================
CLASS DEFINITIONS
==================================================================================================*/
-class SmsPluginTransport
+msg_error_t Sms3gpp2SubmitRequest(MSG_REQUEST_INFO_S *pReqInfo);
+
+class Sms3gpp2Transport
{
public:
- static SmsPluginTransport* instance();
+ static Sms3gpp2Transport* instance();
- void submitRequest(sms_request_info_s *pReqInfo);
- void sendDeliverReport(msg_error_t err, sms_trans_p2p_msg_s *p_p2p_msg);
+ void submitRequest(sms_3gpp2_request_info_s *pReqInfo);
+ void sendDeliverReport(TapiHandle *handle, msg_error_t err, sms_3gpp2_trans_p2p_msg_s *p_p2p_msg);
- void setNetStatus(sms_network_status_t sentStatus);
+ void setNetStatus(SMS_NETWORK_STATUS_T sentStatus);
+ void setIsMemAvailable(bool isAvailable);
private:
- SmsPluginTransport();
- ~SmsPluginTransport();
+ Sms3gpp2Transport();
+ ~Sms3gpp2Transport();
- static SmsPluginTransport* pInstance;
+ static Sms3gpp2Transport* pInstance;
unsigned char getMsgRef();
unsigned char getSeqNum();
unsigned char getSubmitMsgId();
- sms_network_status_t getNetStatus();
+ SMS_NETWORK_STATUS_T getNetStatus();
- void convertMsgInfoToTelesvcMsg(const MSG_MESSAGE_INFO_S *pMsgInfo, sms_trans_msg_s *pMsg);
- void convertMsgInfoToPtp(const MSG_MESSAGE_INFO_S *pMsgInfo, sms_trans_p2p_msg_s *pPtpMsg);
- void convertMsgInfoToSubmit(const MSG_MESSAGE_INFO_S *pMsgInfo, sms_telesvc_submit_s *pSubmit);
+ void convertMsgInfoToTelesvcMsg(const MSG_MESSAGE_INFO_S *pMsgInfo, sms_3gpp2_trans_msg_s *pMsg);
+ void convertMsgInfoToPtp(const MSG_MESSAGE_INFO_S *pMsgInfo, sms_3gpp2_trans_p2p_msg_s *pPtpMsg);
+ void convertMsgInfoToSubmit(const MSG_MESSAGE_INFO_S *pMsgInfo, sms_3gpp2_telesvc_submit_s *pSubmit);
+ bool isMemAvailable;
unsigned char msgRef;
unsigned char msgSeqNum;
unsigned char msgSubmitId;
unsigned char msgRef8bit;
unsigned short msgRef16bit;
- sms_network_status_t curStatus;
+ SMS_NETWORK_STATUS_T curStatus;
MsgMutex mx;
MsgCndVar cv;
};
-#endif /* SMS_PLUGIN_TRANSPORT_H */
+#endif /* SMS_3GPP2_TRANSPORT_H */
/*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd. All rights reserved
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd. All rights reserved
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* limitations under the License.
*/
+#ifndef SMS_3GPP2_TYPES_H
+#define SMS_3GPP2_TYPES_H
+
#include "MsgDebug.h"
#include "MsgTypes.h"
#include "MsgInternalTypes.h"
+#include "SmsPluginTypes.h"
-#ifndef SMS_CDMA_PLUGIN_TYPES_H
-#define SMS_CDMA_PLUGIN_TYPES_H
-
-#define MAX_SMS_SEND_RETRY 4
#define SMS_MAX_MESSAGE_ID 65536
#define SMS_SEQ_NUM_MAX 64
#define SMS_MAX_USER_DATA_LEN 160
#define SMS_PUSH_XML_CO_URI "uri"
-typedef unsigned char sms_wap_app_code_t; /* _sms_wap_app_code_e */
-
-typedef struct _SMS_WSP_CONTENTS_TYPE_S {
- char* contentsTypeName;
- unsigned char contentsTypeCode;
-} SMS_WSP_CONTENTS_TYPE_S;
+typedef struct {
+ char* contentsTypeName;
+ unsigned char contentsTypeCode;
+} SMS_3GPP2_WSP_CONTENTS_TYPE_S;
-typedef struct _SMS_WSP_CHARSET_S {
- char* charsetName;
- unsigned short charsetCode;
-} SMS_WSP_CHARSET_S;
+typedef struct {
+ char* charsetName;
+ unsigned short charsetCode;
+} SMS_3GPP2_WSP_CHARSET_S;
-typedef struct _SMS_WAP_UNREGISTER_CONTENTS_TYPE_S {
- char* contentsTypeName;
- unsigned short contentsTypeCode;
-} SMS_WAP_UNREGISTER_CONTENTS_TYPE_S;
+typedef struct {
+ char* contentsTypeName;
+ unsigned short contentsTypeCode;
+} SMS_3GPP2_WAP_UNREGISTER_CONTENTS_TYPE_S;
-typedef struct _SMS_WSP_LANGUAGE_S {
+typedef struct {
char* languageName;
unsigned char languageCode;
-} SMS_WSP_LANGUAGE_S;
+} SMS_3GPP2_WSP_LANGUAGE_S;
-typedef struct _SMS_WSP_HEADER_PARAMETER_S {
+typedef struct {
char* parameterToken;
unsigned int parameterCode;
-} SMS_WSP_HEADER_PARAMETER_S;
+} SMS_3GPP2_WSP_HEADER_PARAMETER_S;
-typedef struct _SMS_WSP_METHOD_TYPE_S {
+typedef struct {
char* methodName;
unsigned char methodCode;
-} SMS_WSP_METHOD_TYPE_S;
+} SMS_3GPP2_WSP_METHOD_TYPE_S;
-typedef struct _SMS_WSP_SECURITY_TYPE_S {
+typedef struct {
char* SecurityTypeName;
unsigned char SecurityTypeCode;
-} SMS_WSP_SECURITY_TYPE_S;
+} SMS_3GPP2_WSP_SECURITY_TYPE_S;
typedef struct {
msg_request_id_t reqId; /* < Indicates the request ID, which is unique. When applications submit a request to the framework, this value will be set by the framework. */
MSG_MESSAGE_INFO_S msgInfo; /* < Indicates the message structure to be sent by applications. */
MSG_SENDINGOPT_INFO_S sendOptInfo;
-} sms_request_info_s;
+} sms_3gpp2_request_info_s;
-typedef struct _sms_sent_info_s {
- sms_request_info_s reqInfo; /* < Indicates the corresponding request structure. */
+typedef struct {
+ sms_3gpp2_request_info_s reqInfo; /* < Indicates the corresponding request structure. */
bool bLast;
-} sms_sent_info_s;
-
-
-enum _sms_network_status_e {
- SMS_NETWORK_SEND_SUCCESS = 0x00,
- SMS_NETWORK_SENDING,
- SMS_NETWORK_SEND_FAIL,
- SMS_NETWORK_SEND_FAIL_TIMEOUT,
- SMS_NETWORK_SEND_FAIL_MANDATORY_INFO_MISSING,
- SMS_NETWORK_SEND_FAIL_TEMPORARY,
- SMS_NETWORK_SEND_FAIL_BY_MO_CONTROL_WITH_MOD,
- SMS_NETWORK_SEND_FAIL_BY_MO_CONTROL_NOT_ALLOWED,
- SMS_NETWORK_SEND_FAIL_FDN_RESTRICED,
- SMS_NETWORK_SEND_PENDING,
- SMS_NETWORK_SEND_FAIL_UNKNOWN_SUBSCRIBER,
- SMS_NETWORK_SEND_FAIL_MS_DISABLED,
- SMS_NETWORK_SEND_FAIL_NETWORK_NOT_READY,
-};
-
-
-enum _sms_wap_app_code_e {
- SMS_WAP_APPLICATION_DEFAULT = 0x00,
-
- SMS_WAP_APPLICATION_PUSH_SI,
- SMS_WAP_APPLICATION_PUSH_SIC,
-
- SMS_WAP_APPLICATION_PUSH_SL,
- SMS_WAP_APPLICATION_PUSH_SLC,
-
- SMS_WAP_APPLICATION_PUSH_CO,
- SMS_WAP_APPLICATION_PUSH_COC,
-
- SMS_WAP_APPLICATION_MMS_UA,
-
- SMS_WAP_APPLICATION_PUSH_SIA,
-
- SMS_WAP_APPLICATION_SYNCML_DM_BOOTSTRAP,
- SMS_WAP_APPLICATION_SYNCML_DM_BOOTSTRAP_XML,
- SMS_WAP_APPLICATION_SYNCML_DM_NOTIFICATION,
- SMS_WAP_APPLICATION_SYNCML_DS_NOTIFICATION,
- SMS_WAP_APPLICATION_SYNCML_DS_NOTIFICATION_WBXML,
-
- SMS_WAP_APPLICATION_LOC_UA_WBXML,
- SMS_WAP_APPLICATION_LOC_UA_XML,
-
- SMS_WAP_APPLICATION_DRM_UA_XML,
- SMS_WAP_APPLICATION_DRM_UA_MESSAGE,
- SMS_WAP_APPLICATION_DRM_UA_CONETENT,
- SMS_WAP_APPLICATION_DRM_UA_RIGHTS_XML,
- SMS_WAP_APPLICATION_DRM_UA_RIGHTS_WBXML,
- SMS_WAP_APPLICATION_DRM_V2_RO_XML,
- SMS_WAP_APPLICATION_DRM_V2_ROAP_PDU_XML,
- SMS_WAP_APPLICATION_DRM_V2_ROAP_TRIGGER_XML,
- SMS_WAP_APPLICATION_DRM_V2_ROAP_TRIGGER_WBXML,
-
- SMS_WAP_APPLICATION_PUSH_PROVISIONING,
- SMS_WAP_APPLICATION_PUSH_PROVISIONING_XML,
- SMS_WAP_APPLICATION_PUSH_PROVISIONING_WBXML,
-
- SMS_WAP_APPLICATION_PUSH_BROWSER_SETTINGS,
- SMS_WAP_APPLICATION_PUSH_BROWSER_BOOKMARKS,
- SMS_WAP_APPLICATION_PUSH_SYNCSET_WBXML,
- SMS_WAP_APPLICATION_PUSH_SYNCSET_XML,
-
- SMS_WAP_APPLICATION_PUSH_EMAIL_XML,
- SMS_WAP_APPLICATION_PUSH_EMAIL_WBXML,
-
- SMS_WAP_APPLICATION_PUSH_IMPS_CIR,
-
- SMS_WAP_APPLICATION_PUSH_WAP_WMLC,
-
- SMS_WAP_APPLICATION_WML_UA,
- SMS_WAP_APPLICATION_WTA_UA,
-
- SMS_WAP_APPLICATION_PUSH_SYNCML,
- SMS_WAP_APPLICATION_LOC_UA,
- SMS_WAP_APPLICATION_SYNCML_DM,
- SMS_WAP_APPLICATION_PUSH_EMAIL,
-
- SMS_OMA_APPLICATION_ULP_UA,
- SMS_OMA_APPLICATION_DLOTA_UA,
-
- SMS_WAP_APPLICATION_LBS,
-};
-
-
-typedef unsigned char sms_network_status_t; /* _sms_network_status_e */
+} sms_3gpp2_sent_info_s;
/********************************************************************************/
/* TELESERVICE LAYER */
/********************************************************************************/
+typedef bool sms_3gpp2_digit_mode_t; /* _sms_digit_mode_e */
+typedef bool sms_3gpp2_number_mode_t; /* _sms_number_mode_e */
+typedef unsigned char sms_3gpp2_number_type_t; /* _sms_number_type_e */
+typedef unsigned char sms_3gpp2_number_plan_t; /* _sms_number_plan_e */
-typedef bool sms_digit_mode_t; /* _sms_digit_mode_e */
-
-typedef bool sms_number_mode_t; /* _sms_number_mode_e */
-
-typedef unsigned char sms_number_type_t; /* _sms_number_type_e */
-
-typedef unsigned char sms_number_plan_t; /* _sms_number_plan_e */
-
-
-typedef enum _sms_message_type_e {
+typedef enum {
SMS_TYPE_RESERVED = 0x00, /* reserved */
SMS_TYPE_DELIVER, /* mobile-terminated only */
SMS_TYPE_SUBMIT, /* mobile-originated only */
SMS_TYPE_DELIVER_REPORT, /* mobile-originated only */
SMS_TYPE_SUBMIT_REPORT = 0x08, /* mobile-terminated only */
SMS_TYPE_MAX_VALUE
-} sms_message_type_t;
+} sms_3gpp2_message_type_t;
-typedef enum _sms_alert_option_e {
+typedef enum {
SMS_ALERT_NO_ALERT = 0,
SMS_ALERT_DEFAULT_ALERT,
SMS_ALERT_VIBRATE_ONCE,
SMS_ALERT_HIGH_PRIORITY_ONCE,
SMS_ALERT_HIGH_PRIORITY_REPEAT,
SMS_ALERT_RESERVED
-} sms_alert_option_t;
+} sms_3gpp2_alert_option_t;
-typedef enum _sms_language_type_e {
+typedef enum {
SMS_LAN_UNKNOWN,
SMS_LAN_ENGLISH,
SMS_LAN_FRENCH,
SMS_LAN_KOREAN,
SMS_LAN_CHINESE,
SMS_LAN_HEBREW,
-} sms_language_type_t;
+} sms_3gpp2_language_type_t;
-typedef enum _sms_priority_indicator_e {
+typedef enum {
SMS_PRIORITY_NORMAL = 0x00,
SMS_PRIORITY_INTERACTIVE,
SMS_PRIORITY_URGENT,
SMS_PRIORITY_EMERGENCY
-} sms_priority_indicator_t;
+} sms_3gpp2_priority_indicator_t;
-typedef enum _sms_privacy_indicator_e {
+typedef enum {
SMS_PRIVACY_NOT_RESTRICTED = 0x00,
SMS_PRIVACY_RESTRICTED,
SMS_PRIVACY_CONFIDENTIAL,
SMS_PRIVACY_SECRET
-} sms_privacy_indicator_t;
+} sms_3gpp2_privacy_indicator_t;
-typedef enum _sms_alert_priority_e {
+typedef enum {
SMS_ALERT_MOBILE_DEFAULT = 0x00,
SMS_ALERT_LOW_PRIORITY,
SMS_ALERT_MEDIUM_PRIORITY,
SMS_ALERT_HIGH_PRIORITY
-} sms_alert_priority_t;
+} sms_3gpp2_alert_priority_t;
-typedef enum _sms_display_mode_e {
+typedef enum {
SMS_DISPLAY_IMMEDIATE = 0x00,
SMS_DISPLAY_DEFAULT_SETTING,
SMS_DISPLAY_USER_INVOKE,
SMS_DISPLAY_RESERVED
-} sms_display_mode_t;
+} sms_3gpp2_display_mode_t;
-typedef enum _sms_encoding_type_e {
+typedef enum {
SMS_ENCODE_OCTET = 0x0,
SMS_ENCODE_EPM = 0x1, /*IS-91 Extended Protocol Message*/
SMS_ENCODE_7BIT_ASCII = 0x2,
SMS_ENCODE_GSMDCS = 0xa,
SMS_ENCODE_EUCKR = 0x10,
SMS_ENCODE_RESERVED
-} sms_encoding_type_t;
+} sms_3gpp2_encoding_type_t;
-typedef enum _sms_relative_time_e {
+typedef enum {
SMS_REL_TIME_5_MINS = 0,
SMS_REL_TIME_12_HOURS = 143,
SMS_REL_TIME_1_DAY = 167,
SMS_REL_TIME_ACTIVE = 247,
SMS_REL_TIME_REGISTRATION = 248,
SMS_REL_TIME_RESERVED
-} sms_relative_time_t;
+} sms_3gpp2_relative_time_t;
-typedef enum _sms_status_code_e {
+typedef enum {
/* ERROR_CLASS = '00' (no error) */
SMS_STATUS_ACCEPTED = 0x00,
SMS_STATUS_DEPOSITED = 0x01,
SMS_STATUS_PERMANENT_INVALID_DESTINATION = 0xCA,
SMS_STATUS_PERMANENT_MESSAGE_EXPIRED = 0xCD,
SMS_STATUS_PERMANENT_UNKNOWN_ERROR = 0xDF,
-} sms_status_code_t;
+} sms_3gpp2_status_code_t;
-typedef enum _sms_cmae_category_e {
+typedef enum {
SMS_CMAE_CTG_GEO = 0x00,
SMS_CMAE_CTG_MET = 0x01,
SMS_CMAE_CTG_SAFETY = 0x02,
SMS_CMAE_CTG_CBRNE = 0x0a,
SMS_CMAE_CTG_OTHER = 0x0b,
SMS_CMAE_CTG_RESERVED,
-} sms_cmae_category_t;
+} sms_3gpp2_cmae_category_t;
-typedef enum _sms_cmae_response_type_e {
+typedef enum {
SMS_CMAE_RESP_TYPE_SHELTER = 0x00,
SMS_CMAE_RESP_TYPE_EVACUATE = 0x01,
SMS_CMAE_RESP_TYPE_PREPARE = 0x02,
SMS_CMAE_RESP_TYPE_EXECUTE = 0x03,
SMS_CMAE_RESP_TYPE_MONITOR = 0x04,
- SMS_CMAE_RESP_TYPE_AVOID = 0x05,
+ SMS_CMAE_RESP_TYPE_AVOID = 0x05,
SMS_CMAE_RESP_TYPE_ASSESS = 0x06,
SMS_CMAE_RESP_TYPE_NONE = 0x07,
SMS_CMAE_RESP_TYPE_RESERVED,
-} sms_cmae_response_type_t;
+} sms_3gpp2_cmae_response_type_t;
-typedef enum _sms_cmae_severity_e {
+typedef enum {
SMS_CMAE_SEVERITY_EXTREME = 0x0,
- SMS_CMAE_SEVERITY_SEVERE = 0x1,
+ SMS_CMAE_SEVERITY_SEVERE = 0x1,
SMS_CMAE_SEVERITY_RESERVED,
-} sms_cmae_severity_t;
+} sms_3gpp2_cmae_severity_t;
-typedef enum _sms_cmae_urgency_e {
+typedef enum {
SMS_CMAE_URGENCY_IMMEDIATE = 0x0,
SMS_CMAE_URGENCY_EXPECTED = 0x1,
SMS_CMAE_URGENCY_RESERVED,
-} sms_cmae_urgency_t;
+} sms_3gpp2_cmae_urgency_t;
-typedef enum _sms_cmae_certainty_e {
+typedef enum {
SMS_CMAE_CERTAINTY_OBSERVED = 0x0,
SMS_CMAE_CERTAINTY_LIKELY = 0x1,
SMS_CMAE_CERTAINTY_RESERVED,
-} sms_cmae_certainty_t;
+} sms_3gpp2_cmae_certainty_t;
-typedef enum _sms_cmae_alert_handle_e {
+typedef enum {
SMS_CMAE_ALERT_PRESIDENTIAL = 0x00,
SMS_CMAE_ALERT_EXTREME = 0x01,
SMS_CMAE_ALERT_SEVERE = 0x02,
- SMS_CMAE_ALERT_AMBER = 0x03,
+ SMS_CMAE_ALERT_AMBER = 0x03,
SMS_CMAE_ALERT_RESERVED,
-} sms_cmae_alert_handle_t;
+} sms_3gpp2_cmae_alert_handle_t;
enum _sms_bearer_sub_param_e {
};
-enum _SMS_TIME_FORMAT_E {
- SMS_TIME_EMPTY = 0,
- SMS_TIME_RELATIVE ,
- SMS_TIME_ABSOLUTE
+enum _SMS_3GPP2_TIME_FORMAT_E {
+ SMS_3GPP2_TIME_EMPTY = 0,
+ SMS_3GPP2_TIME_RELATIVE,
+ SMS_3GPP2_TIME_ABSOLUTE
};
/* 0x80 ~ 0x8f TP-PID errors */
SMS_TP_CAUSE_TELEMATIC_INTERWORKING_NOT_SUPPORTED = 0x80,
SMS_TP_CAUSE_SHORT_MSG_TYPE_0_NOT_SUPPORTED = 0x81,
- SMS_TP_CAUSE_CANNOT_REPLACE_SHORT_MSG = 0x82,
- SMS_TP_CAUSE_UNSPECIFIED_TP_PID_ERROR = 0x8f,
+ SMS_TP_CAUSE_CANNOT_REPLACE_SHORT_MSG = 0x82,
+ SMS_TP_CAUSE_UNSPECIFIED_TP_PID_ERROR = 0x8f,
/* 0x90 ~ 0x9f TP-DCS errors */
SMS_TP_CAUSE_DCS_NOT_SPPORTED = 0x90,
SMS_TP_CAUSE_UNSPECIFIED_TP_DCS_ERROR = 0x9f,
/* 0xa0 ~ 0xaf TP-Command Errors */
- SMS_TP_CAUSE_CMD_CANNOT_BE_ACTIONED = 0xa0,
+ SMS_TP_CAUSE_CMD_CANNOT_BE_ACTIONED = 0xa0,
SMS_TP_CAUSE_CMD_UNSUPPORTED = 0xa1,
SMS_TP_CAUSE_UNSPECIFIED_TP_CMD_ERROR = 0xaf,
SMS_TP_CAUSE_TPDU_NOT_SUPPORTED = 0xb0,
- SMS_TP_CAUSE_SC_BUSY = 0xc0,
+ SMS_TP_CAUSE_SC_BUSY = 0xc0,
SMS_TP_CAUSE_NO_SC_SUBCRIPTION = 0xc1,
SMS_TP_CAUSE_SC_SYSTEM_FAILURE = 0xc2,
SMS_TP_CAUSE_INVALID_SME_ADDRESS = 0xc3,
- SMS_TP_CAUSE_DESTINATION_SME_BARRED = 0xc4,
+ SMS_TP_CAUSE_DESTINATION_SME_BARRED = 0xc4,
SMS_TP_CAUSE_SM_REJECTED_DUPLICATE_SM = 0xc5,
SMS_TP_CAUSE_TP_VPF_NOT_SUPPORTED = 0xc6,
SMS_TP_CAUSE_TP_VP_NOT_SUPPORTED = 0xc7,
SMS_TP_CAUSE_SIM_SMS_STORAGE_FULL = 0xd0,
SMS_TP_CAUSE_NO_SMS_STORAGE_CAPABILITY_IN_SIM = 0xd1,
- SMS_TP_CAUSE_ERROR_IN_MS = 0xd2,
+ SMS_TP_CAUSE_ERROR_IN_MS = 0xd2,
SMS_TP_CAUSE_MEMORY_CAPACITY_EXCEEDED = 0xd3,
SMS_TP_CAUSE_SIM_APPLICATION_TOOLKIT_BUSY = 0xd4,
SMS_TP_CAUSE_SIM_DATA_DOWNLOAD_ERROR = 0xd5,
};
-typedef struct _sms_trans_msg_id_s {
+typedef struct {
unsigned short msg_id;
bool header_ind;
-} sms_trans_msg_id_s;
+} sms_3gpp2_trans_msg_id_s;
-typedef struct _sms_telesvc_addr_s {
- sms_digit_mode_t digit_mode;
- sms_number_type_t number_type;
- sms_number_plan_t number_plan;
+typedef struct {
+ sms_3gpp2_digit_mode_t digit_mode;
+ sms_3gpp2_number_type_t number_type;
+ sms_3gpp2_number_plan_t number_plan;
unsigned int addr_len;
char szData[SMS_TRANS_ADDRESS_MAX_LEN + 1];
-} sms_telesvc_addr_s;
+} sms_3gpp2_telesvc_addr_s;
-typedef struct _sms_reply_option_s {
+typedef struct {
bool user_ack_req;
bool deliver_ack_req;
bool read_ack_req;
bool report_req;
-} sms_reply_option_s;
+} sms_3gpp2_reply_option_s;
-typedef struct _sms_time_relative_s {
- sms_relative_time_t rel_time;
-} sms_time_rel_s;
+typedef struct {
+ sms_3gpp2_relative_time_t rel_time;
+} sms_3gpp2_time_rel_s;
-typedef struct _sms_time_stamp_s {
+typedef struct {
unsigned char year; /* range 00-99 (96~99 : 19xx, 00~95 : 20xx) */
unsigned char month; /* range 1-12 */
unsigned char day;
unsigned char hours; /* range 0-23 */
unsigned char minutes; /* range 0-59 */
unsigned char seconds; /* range 0-59 */
-} sms_time_abs_s;
+} sms_3gpp2_time_abs_s;
-typedef struct _sms_val_period_s {
- unsigned char format;
+typedef struct {
+ unsigned char format;
union {
- sms_time_rel_s rel_time;
- sms_time_abs_s abs_time;
+ sms_3gpp2_time_rel_s rel_time;
+ sms_3gpp2_time_abs_s abs_time;
} time;
-} sms_val_period_s;
+} sms_3gpp2_val_period_s;
-typedef struct _sms_encoding_specific_s {
- sms_encoding_type_t encode_type;
- unsigned int data_len;
- char user_data[SMS_MAX_USER_DATA_LEN +1];
-} sms_encoding_specific_s;
+typedef struct {
+ sms_3gpp2_encoding_type_t encode_type;
+ unsigned int data_len;
+ char user_data[SMS_MAX_USER_DATA_LEN +1];
+} sms_3gpp2_encoding_specific_s;
-typedef struct _sms_ctg_specific_s {
+typedef struct {
unsigned char operation_code;
unsigned short category;
- sms_language_type_t language;
+ sms_3gpp2_language_type_t language;
unsigned char max_msg;
- sms_alert_option_t alert_option;
+ sms_3gpp2_alert_option_t alert_option;
unsigned int data_len;
char user_data[SMS_MAX_USER_DATA_LEN +1];
-} sms_ctg_specific_s;
+} sms_3gpp2_ctg_specific_s;
-typedef struct _sms_svc_ctg_program_data_s {
- sms_encoding_type_t encode_type;
+typedef struct {
+ sms_3gpp2_encoding_type_t encode_type;
unsigned int num_data;
- sms_ctg_specific_s *specific_data;
-} sms_svc_ctg_program_data_s;
+ sms_3gpp2_ctg_specific_s *specific_data;
+} sms_3gpp2_svc_ctg_program_data_s;
-typedef struct _sms_telesvc_userdata_s {
- sms_encoding_type_t encode_type;
+typedef struct {
+ sms_3gpp2_encoding_type_t encode_type;
unsigned char msg_type;
unsigned int data_len;
unsigned char user_data[SMS_MAX_USER_DATA_LEN +1];
-} sms_telesvc_userdata_s;
+} sms_3gpp2_telesvc_userdata_s;
-typedef struct _sms_telesvc_cmasdata_s {
- unsigned int data_len;
- sms_encoding_type_t encode_type;
- unsigned char alert_text[SMS_MAX_USER_DATA_LEN +1];
- sms_cmae_category_t category;
- sms_cmae_response_type_t response_type;
- sms_cmae_severity_t severity;
- sms_cmae_urgency_t urgency;
- sms_cmae_certainty_t certainty;
- unsigned short id;
- sms_cmae_alert_handle_t alert_handle; /* 00:Presidential 01:Extreme 02:Severe 03:AMBER 04:Test */
- sms_time_abs_s expires;
- sms_language_type_t language;
- bool is_wrong_recode_type;
-} sms_telesvc_cmasdata_s;
-
-
-typedef struct _sms_enhanced_vmn_s {
- sms_priority_indicator_t priority;
+typedef struct {
+ unsigned int data_len;
+ sms_3gpp2_encoding_type_t encode_type;
+ unsigned char alert_text[SMS_MAX_USER_DATA_LEN +1];
+ sms_3gpp2_cmae_category_t category;
+ sms_3gpp2_cmae_response_type_t response_type;
+ sms_3gpp2_cmae_severity_t severity;
+ sms_3gpp2_cmae_urgency_t urgency;
+ sms_3gpp2_cmae_certainty_t certainty;
+ unsigned short id;
+ sms_3gpp2_cmae_alert_handle_t alert_handle; /* 00:Presidential 01:Extreme 02:Severe 03:AMBER 04:Test */
+ sms_3gpp2_time_abs_s expires;
+ sms_3gpp2_language_type_t language;
+ bool is_wrong_recode_type;
+} sms_3gpp2_telesvc_cmasdata_s;
+
+
+typedef struct {
+ sms_3gpp2_priority_indicator_t priority;
bool password_req;
bool setup_req;
bool pw_change_req;
unsigned short vm_msg_id;
unsigned short vm_mailbox_id;
- sms_digit_mode_t an_digit_mode;
- sms_number_type_t an_number_type;
- sms_number_plan_t an_number_plan;
+ sms_3gpp2_digit_mode_t an_digit_mode;
+ sms_3gpp2_number_type_t an_number_type;
+ sms_3gpp2_number_plan_t an_number_plan;
unsigned char an_num_field;
unsigned char an_char[SMS_MAX_USER_DATA_LEN+1];
- sms_digit_mode_t cli_digit_mode;
- sms_number_type_t cli_number_type;
- sms_number_plan_t cli_number_plan;
+ sms_3gpp2_digit_mode_t cli_digit_mode;
+ sms_3gpp2_number_type_t cli_number_type;
+ sms_3gpp2_number_plan_t cli_number_plan;
unsigned char cli_num_field;
unsigned char cli_char[SMS_MAX_USER_DATA_LEN+1];
-} sms_enhanced_vmn_s;
+} sms_3gpp2_enhanced_vmn_s;
-typedef struct _sms_enhanced_vmn_ack_s {
+typedef struct {
unsigned short vm_mailbox_id;
unsigned char vm_num_unheard_msg;
unsigned char num_delete_ack;
unsigned short da_vm_msg_id[SMS_MAX_NUMBER_OF_ACK+1];
unsigned short pa_vm_msg_id[SMS_MAX_NUMBER_OF_ACK+1];
-} sms_enhanced_vmn_ack_s;
-
-
-typedef struct _sms_telesvc_deliver_s {
- sms_trans_msg_id_s msg_id;
- sms_telesvc_userdata_s user_data;
- sms_telesvc_cmasdata_s cmas_data;
- sms_time_abs_s time_stamp;
- sms_val_period_s val_period;
- sms_val_period_s defer_val_period;
- sms_priority_indicator_t priority;
- sms_privacy_indicator_t privacy;
- sms_reply_option_s reply_opt;
- unsigned int num_msg;
- sms_alert_priority_t alert_priority;
- sms_language_type_t language;
- sms_telesvc_addr_s callback_number;
- sms_display_mode_t display_mode;
- sms_encoding_specific_s multi_encode_data;
- unsigned short deposit_id;
- /* sms_svc_ctg_program_data_s svc_ctg; */
- sms_enhanced_vmn_s enhanced_vmn;
- sms_enhanced_vmn_ack_s enhanced_vmn_ack;
-} sms_telesvc_deliver_s;
-
-
-typedef struct _sms_telesvc_submit_s {
- sms_trans_msg_id_s msg_id;
- sms_telesvc_userdata_s user_data;
- sms_val_period_s val_period;
- sms_val_period_s defer_val_period;
- sms_priority_indicator_t priority;
- sms_privacy_indicator_t privacy;
- sms_reply_option_s reply_opt;
- sms_alert_priority_t alert_priority;
- sms_language_type_t language;
- sms_telesvc_addr_s callback_number;
- sms_encoding_specific_s multi_encode_data;
- unsigned char deposit_id;
- /* sms_svc_ctg_program_data_s svc_ctg; */
-} sms_telesvc_submit_s;
-
-
-typedef struct _sms_telesvc_cancel_s {
- sms_trans_msg_id_s msg_id;
-} sms_telesvc_cancel_s;
-
-
-typedef struct _sms_telesvc_user_ack_s {
- sms_trans_msg_id_s msg_id;
- sms_telesvc_userdata_s user_data;
- unsigned char resp_code;
- sms_time_abs_s time_stamp;
- sms_encoding_specific_s multi_encode_data;
- unsigned char deposit_id;
-} sms_telesvc_user_ack_s;
-
-
-typedef struct _sms_telesvc_deliver_ack_s {
- sms_trans_msg_id_s msg_id;
- sms_telesvc_userdata_s user_data;
- sms_time_abs_s time_stamp;
- sms_encoding_specific_s multi_encode_data;
- sms_status_code_t msg_status;
-} sms_telesvc_deliver_ack_s;
-
-
-typedef struct _sms_telesvc_read_ack_s {
- sms_trans_msg_id_s msg_id;
- sms_telesvc_userdata_s user_data;
- sms_time_abs_s time_stamp;
- sms_encoding_specific_s multi_encode_data;
- unsigned char deposit_id;
-} sms_telesvc_read_ack_s;
-
-typedef struct _sms_telesvc_deliver_report_s {
- sms_trans_msg_id_s msg_id;
+} sms_3gpp2_enhanced_vmn_ack_s;
+
+
+typedef struct {
+ sms_3gpp2_trans_msg_id_s msg_id;
+ sms_3gpp2_telesvc_userdata_s user_data;
+ sms_3gpp2_telesvc_cmasdata_s cmas_data;
+ sms_3gpp2_time_abs_s time_stamp;
+ sms_3gpp2_val_period_s val_period;
+ sms_3gpp2_val_period_s defer_val_period;
+ sms_3gpp2_priority_indicator_t priority;
+ sms_3gpp2_privacy_indicator_t privacy;
+ sms_3gpp2_reply_option_s reply_opt;
+ unsigned int num_msg;
+ sms_3gpp2_alert_priority_t alert_priority;
+ sms_3gpp2_language_type_t language;
+ sms_3gpp2_telesvc_addr_s callback_number;
+ sms_3gpp2_display_mode_t display_mode;
+ sms_3gpp2_encoding_specific_s multi_encode_data;
+ unsigned short deposit_id;
+ /* sms_3gpp2_svc_ctg_program_data_s svc_ctg; */
+ sms_3gpp2_enhanced_vmn_s enhanced_vmn;
+ sms_3gpp2_enhanced_vmn_ack_s enhanced_vmn_ack;
+} sms_3gpp2_telesvc_deliver_s;
+
+
+typedef struct {
+ sms_3gpp2_trans_msg_id_s msg_id;
+ sms_3gpp2_telesvc_userdata_s user_data;
+ sms_3gpp2_val_period_s val_period;
+ sms_3gpp2_val_period_s defer_val_period;
+ sms_3gpp2_priority_indicator_t priority;
+ sms_3gpp2_privacy_indicator_t privacy;
+ sms_3gpp2_reply_option_s reply_opt;
+ sms_3gpp2_alert_priority_t alert_priority;
+ sms_3gpp2_language_type_t language;
+ sms_3gpp2_telesvc_addr_s callback_number;
+ sms_3gpp2_encoding_specific_s multi_encode_data;
+ unsigned char deposit_id;
+ /* sms_3gpp2_svc_ctg_program_data_s svc_ctg; */
+} sms_3gpp2_telesvc_submit_s;
+
+
+typedef struct {
+ sms_3gpp2_trans_msg_id_s msg_id;
+} sms_3gpp2_telesvc_cancel_s;
+
+
+typedef struct {
+ sms_3gpp2_trans_msg_id_s msg_id;
+ sms_3gpp2_telesvc_userdata_s user_data;
+ unsigned char resp_code;
+ sms_3gpp2_time_abs_s time_stamp;
+ sms_3gpp2_encoding_specific_s multi_encode_data;
+ unsigned char deposit_id;
+} sms_3gpp2_telesvc_user_ack_s;
+
+
+typedef struct {
+ sms_3gpp2_trans_msg_id_s msg_id;
+ sms_3gpp2_telesvc_userdata_s user_data;
+ sms_3gpp2_time_abs_s time_stamp;
+ sms_3gpp2_encoding_specific_s multi_encode_data;
+ sms_3gpp2_status_code_t msg_status;
+} sms_3gpp2_telesvc_deliver_ack_s;
+
+
+typedef struct {
+ sms_3gpp2_trans_msg_id_s msg_id;
+ sms_3gpp2_telesvc_userdata_s user_data;
+ sms_3gpp2_time_abs_s time_stamp;
+ sms_3gpp2_encoding_specific_s multi_encode_data;
+ unsigned char deposit_id;
+} sms_3gpp2_telesvc_read_ack_s;
+
+
+typedef struct {
+ sms_3gpp2_trans_msg_id_s msg_id;
unsigned char tp_fail_cause;
- sms_telesvc_userdata_s user_data;
- sms_language_type_t language;
+ sms_3gpp2_telesvc_userdata_s user_data;
+ sms_3gpp2_language_type_t language;
unsigned char multi_encode_data;
-} sms_telesvc_report_s;
+} sms_3gpp2_telesvc_report_s;
-typedef struct _sms_telesvc_msg_s {
- sms_message_type_t type;
+typedef struct {
+ sms_3gpp2_message_type_t type;
union {
- sms_telesvc_deliver_s deliver;
- sms_telesvc_submit_s submit;
- sms_telesvc_cancel_s cancel;
- sms_telesvc_user_ack_s user_ack;
- sms_telesvc_deliver_ack_s delivery_ack;
- sms_telesvc_read_ack_s read_ack;
- sms_telesvc_report_s report;
+ sms_3gpp2_telesvc_deliver_s deliver;
+ sms_3gpp2_telesvc_submit_s submit;
+ sms_3gpp2_telesvc_cancel_s cancel;
+ sms_3gpp2_telesvc_user_ack_s user_ack;
+ sms_3gpp2_telesvc_deliver_ack_s delivery_ack;
+ sms_3gpp2_telesvc_read_ack_s read_ack;
+ sms_3gpp2_telesvc_report_s report;
} data;
-} sms_telesvc_msg_s;
+} sms_3gpp2_telesvc_msg_s;
/* TRANSPORT LAYER */
/********************************************************************************/
-typedef unsigned short sms_trans_param_id_t; /* _sms_trans_param_id_e */
-
-typedef unsigned short sms_trans_telesvc_id_t; /* _sms_trans_telesvc_id_e */
-
-typedef unsigned short sms_trans_svc_ctg_t; /* _sms_trans_svc_ctg_e */
-
-typedef unsigned char sms_trans_reply_seq_t;
+typedef unsigned short sms_3gpp2_trans_param_id_t; /* _sms_trans_param_id_e */
+typedef unsigned short sms_3gpp2_trans_telesvc_id_t; /* _sms_trans_telesvc_id_e */
+typedef unsigned short sms_3gpp2_trans_svc_ctg_t; /* _sms_trans_svc_ctg_e */
+typedef unsigned char sms_3gpp2_trans_reply_seq_t;
-typedef enum _sms_trans_msg_type_e {
+typedef enum {
SMS_TRANS_P2P_MSG = 0x00,
SMS_TRANS_BROADCAST_MSG = 0x01,
SMS_TRANS_ACK_MSG = 0x02,
SMS_TRANS_TYPE_RESERVED
-} sms_trans_msg_type_t;
+} sms_3gpp2_trans_msg_type_t;
enum _sms_trans_param_id_e {
};
-typedef enum _sms_trans_err_class_e {
+typedef enum {
SMS_TRANS_ERR_CLASS_NONE = 0x00,
SMS_TRANS_ERR_CLASS_TEMPORARY = 0x02,
SMS_TRANS_ERR_CLASS_PERMANENT = 0x03
-} sms_trans_err_class_t;
+} sms_3gpp2_trans_err_class_t;
-typedef enum _sms_trans_cause_code_e {
+typedef enum {
SMS_CAUSE_CODE_INVAILD_TELESERVICE_ID = 0x04,
SMS_CAUSE_CODE_SERVICE_TERMINATION_DENIED = 0x62,
SMS_TODO_FILL_THIS_ENUMS
-} sms_trans_cause_code_t;
+} sms_3gpp2_trans_cause_code_t;
-typedef enum _sms_trans_sub_addr_type_e {
+typedef enum {
SMS_TRANS_SUB_ADDR_NSAP = 0x00,
SMS_TRANS_SUB_ADDR_USER = 0x01,
SMS_TRANS_SUB_ADDR_RESERVED
-} sms_trans_sub_addr_type_t;
-
+} sms_3gpp2_trans_sub_addr_type_t;
enum _sms_trans_dnet_addr_type_e {
enum _sms_digit_mode_e {
SMS_DIGIT_4BIT_DTMF = 0,
- SMS_DIGIT_8BIT = 1
+ SMS_DIGIT_8BIT = 1
};
enum _sms_number_plan_e {
- SMS_NPI_UNKNOWN = 0,
- SMS_NPI_ISDN = 1,
- SMS_NPI_DATA = 3,
- SMS_NPI_TELEX = 4,
- SMS_NPI_PRIVATE = 9,
- SMS_NPI_RESERVED = 15,
+ SMS_3GPP2_NPI_UNKNOWN = 0,
+ SMS_3GPP2_NPI_ISDN = 1,
+ SMS_3GPP2_NPI_DATA = 3,
+ SMS_3GPP2_NPI_TELEX = 4,
+ SMS_3GPP2_NPI_PRIVATE = 9,
+ SMS_3GPP2_NPI_RESERVED = 15,
};
-typedef struct _sms_trans_addr_s {
- sms_digit_mode_t digit_mode;
- sms_number_mode_t number_mode;
- sms_number_type_t number_type;
- sms_number_plan_t number_plan;
- unsigned int addr_len;
- char szData[SMS_TRANS_ADDRESS_MAX_LEN + 1];
-} sms_trans_addr_s;
+typedef struct {
+ sms_3gpp2_digit_mode_t digit_mode;
+ sms_3gpp2_number_mode_t number_mode;
+ sms_3gpp2_number_type_t number_type;
+ sms_3gpp2_number_plan_t number_plan;
+ unsigned int addr_len;
+ char szData[SMS_TRANS_ADDRESS_MAX_LEN + 1];
+} sms_3gpp2_trans_addr_s;
-typedef struct _sms_trans_sub_addr_s {
- sms_trans_sub_addr_type_t type;
- bool odd;
- unsigned int addr_len;
- char szData[SMS_TRANS_ADDRESS_MAX_LEN + 1];
-} sms_trans_sub_addr_s;
+typedef struct {
+ sms_3gpp2_trans_sub_addr_type_t type;
+ bool odd;
+ unsigned int addr_len;
+ char szData[SMS_TRANS_ADDRESS_MAX_LEN + 1];
+} sms_3gpp2_trans_sub_addr_s;
-typedef struct _sms_trans_cause_code_s {
- sms_trans_reply_seq_t reply_seq;
- sms_trans_err_class_t error_class;
- sms_trans_cause_code_t cause_code;
-} sms_trans_cause_code_s;
+typedef struct {
+ sms_3gpp2_trans_reply_seq_t reply_seq;
+ sms_3gpp2_trans_err_class_t error_class;
+ sms_3gpp2_trans_cause_code_t cause_code;
+} sms_3gpp2_trans_cause_code_s;
-typedef struct _sms_trans_p2p_msg_s {
- sms_trans_telesvc_id_t telesvc_id;
- sms_trans_svc_ctg_t svc_ctg;
- sms_trans_addr_s address;
- sms_trans_sub_addr_s sub_address;
- sms_trans_reply_seq_t reply_seq;
- sms_telesvc_msg_s telesvc_msg;
-} sms_trans_p2p_msg_s;
+typedef struct {
+ sms_3gpp2_trans_telesvc_id_t telesvc_id;
+ sms_3gpp2_trans_svc_ctg_t svc_ctg;
+ sms_3gpp2_trans_addr_s address;
+ sms_3gpp2_trans_sub_addr_s sub_address;
+ sms_3gpp2_trans_reply_seq_t reply_seq;
+ sms_3gpp2_telesvc_msg_s telesvc_msg;
+} sms_3gpp2_trans_p2p_msg_s;
-typedef struct _sms_trans_broadcast_msg_s {
- sms_trans_svc_ctg_t svc_ctg;
- sms_telesvc_msg_s telesvc_msg;
-} sms_trans_broadcast_msg_s;
+typedef struct {
+ sms_3gpp2_trans_svc_ctg_t svc_ctg;
+ sms_3gpp2_telesvc_msg_s telesvc_msg;
+} sms_3gpp2_trans_broadcast_msg_s;
-typedef struct _sms_trans_ack_msg_s {
- sms_trans_addr_s address;
- sms_trans_sub_addr_s sub_address;
- sms_trans_cause_code_s cause_code;
-} sms_trans_ack_msg_s;
+typedef struct {
+ sms_3gpp2_trans_addr_s address;
+ sms_3gpp2_trans_sub_addr_s sub_address;
+ sms_3gpp2_trans_cause_code_s cause_code;
+} sms_3gpp2_trans_ack_msg_s;
-typedef struct _sms_trans_msg_s {
- sms_trans_msg_type_t type;
+typedef struct {
+ sms_3gpp2_trans_msg_type_t type;
union {
- sms_trans_p2p_msg_s p2p_msg;
- sms_trans_broadcast_msg_s cb_msg;
- sms_trans_ack_msg_s ack_msg;
+ sms_3gpp2_trans_p2p_msg_s p2p_msg;
+ sms_3gpp2_trans_broadcast_msg_s cb_msg;
+ sms_3gpp2_trans_ack_msg_s ack_msg;
} data;
-} sms_trans_msg_s;
-
+} sms_3gpp2_trans_msg_s;
-#endif /* SMS_CDMA_PLUGIN_TYPES_H */
+#endif /* SMS_3GPP2_TYPES_H */
* limitations under the License.
*/
-#ifndef SMS_CDMA_PLUGIN_UA_MANAGER_H
-#define SMS_CDMA_PLUGIN_UA_MANAGER_H
+#ifndef SMS_3GPP2_UA_MANAGER_H
+#define SMS_3GPP2_UA_MANAGER_H
/*==================================================================================================
#include "MsgMutex.h"
#include "MsgQueue.h"
#include "MsgThread.h"
-#include "SmsCdmaPluginTypes.h"
+#include "Sms3gpp2Types.h"
/*==================================================================================================
CLASS DEFINITIONS
==================================================================================================*/
-class SmsPluginUAManager : public MsgThread
+class Sms3gpp2UAManager : public MsgThread
{
public:
- static SmsPluginUAManager* instance();
+ static Sms3gpp2UAManager* instance();
/* virtual void start(); */
- void addReqEntity(sms_request_info_s *request);
+ void addReqEntity(sms_3gpp2_request_info_s *request);
private:
- SmsPluginUAManager();
- ~SmsPluginUAManager();
+ Sms3gpp2UAManager();
+ ~Sms3gpp2UAManager();
void lock() { mx.lock(); };
void unlock() { mx.unlock(); };
void wait() { cv.wait(mx.pMsgMutex()); };
virtual void run();
- static SmsPluginUAManager* pInstance;
+ static Sms3gpp2UAManager* pInstance;
bool bRunning;
- MsgSimpleQ <sms_request_info_s> smsTranQ;
+ MsgSimpleQ <sms_3gpp2_request_info_s> smsTranQ;
MsgMutex mx;
MsgCndVar cv;
};
-#endif /* SMS_CDMA_PLUGIN_UA_MANAGER_H */
+#endif /* SMS_3GPP2_UA_MANAGER_H */
* limitations under the License.
*/
-#ifndef SMS_CDMA_PLUGIN_WAPPUSH_HANDLER_H
-#define SMS_CDMA_PLUGIN_WAPPUSH_HANDLER_H
+#ifndef SMS_3GPP2_WAP_PUSH_HANDLER_H
+#define SMS_3GPP2_WAP_PUSH_HANDLER_H
/*==================================================================================================
#include <libxml/parser.h>
-#include "SmsCdmaPluginTypes.h"
+#include "Sms3gpp2Types.h"
/*==================================================================================================
DEFINES
==================================================================================================*/
#define WSP_STANDARD_STR_LEN_MAX 255
-#define LENGTH_QUOTE 0x1F
+#define LENGTH_QUOTE 0x1F
#define NO_VALUE 0x00
#define WSP_CODE_BUFFER_LEFT_LEN_MAX 1024
#define WSP_CODE_BUFFER_RIGHT_LEN_MAX 2048
-#define AcStrlen(x) ((x == NULL) ? 0 : strlen(x))
+#define AcStrlen(x) ((x == NULL) ? 0 : strlen(x))
#define MIN(a, b) (((a) < (b)) ? (a) : (b))
/*==================================================================================================
CLASS DEFINITIONS
==================================================================================================*/
-class SmsPluginWapPushHandler
+class Sms3gpp2WapPushHandler
{
public:
- static SmsPluginWapPushHandler* instance();
+ static Sms3gpp2WapPushHandler* instance();
/* void registerPushCallback(); */
bool IsWapPushMsg(unsigned short dstport);
- void copyDeliverData(sms_trans_addr_s *pAddr);
- void handleWapPushMsg(const char *pUserData, int DataSize);
- void handleWapPushCallback(char* pPushHeader, char* pPushBody, int PushBodyLen, char* pWspHeader, int WspHeaderLen, char* pWspBody, int WspBodyLen);
+ void copyDeliverData(sms_3gpp2_trans_addr_s *pAddr);
+ void handleWapPushMsg(const char *pUserData, int simIndex, int DataSize);
+ void handleWapPushCallback(char* pPushHeader, char* pPushBody, int PushBodyLen, char* pWspHeader, int WspHeaderLen, char* pWspBody, int WspBodyLen, int simIndex);
private:
- SmsPluginWapPushHandler();
- virtual ~SmsPluginWapPushHandler();
+ Sms3gpp2WapPushHandler();
+ virtual ~Sms3gpp2WapPushHandler();
- static SmsPluginWapPushHandler* pInstance;
+ static Sms3gpp2WapPushHandler* pInstance;
- sms_wap_app_code_t getAppCode(const char *pPushHeader);
+ SMS_WAP_APP_CODE_T getAppCode(const char *pPushHeader);
- void handleMMSNotification(const char *pPushBody, int PushBodyLen);
+ void handleMMSNotification(const char *pPushBody, int PushBodyLen, int simIndex);
void handleSIMessage(char* pPushBody, int PushBodyLen, bool isText);
void handleSLMessage(char* pPushBody, int PushBodyLen, bool isText);
void handleCOMessage(char* pPushBody, int PushBodyLen, bool isText);
void wspHeaderDecodeCacheControl(unsigned char* fieldValue, unsigned long fieldValueLen, char** pCacheString);
- sms_trans_addr_s tmpAddress;
+ sms_3gpp2_trans_addr_s tmpAddress;
/* SMS_TIMESTAMP_S tmpTimeStamp; */
};
-#endif /* SmsPluginWapPushHandler */
+#endif /* SMS_3GPP2_WAP_PUSH_HANDLER_H */
##########################################################
SET(SMS-PLUGIN-SRCS
- ${CMAKE_SOURCE_DIR}/plugin/sms_plugin/SmsPluginUDCodec.cpp
- ${CMAKE_SOURCE_DIR}/plugin/sms_plugin/SmsPluginParamCodec.cpp
- ${CMAKE_SOURCE_DIR}/plugin/sms_plugin/SmsPluginTpduCodec.cpp
- ${CMAKE_SOURCE_DIR}/plugin/sms_plugin/SmsPluginSatHandler.cpp
- ${CMAKE_SOURCE_DIR}/plugin/sms_plugin/SmsPluginCbMsgHandler.cpp
- ${CMAKE_SOURCE_DIR}/plugin/sms_plugin/SmsPluginWapPushHandler.cpp
- ${CMAKE_SOURCE_DIR}/plugin/sms_plugin/SmsPluginConcatHandler.cpp
- ${CMAKE_SOURCE_DIR}/plugin/sms_plugin/SmsPluginSetting.cpp
- ${CMAKE_SOURCE_DIR}/plugin/sms_plugin/SmsPluginSimMsg.cpp
- ${CMAKE_SOURCE_DIR}/plugin/sms_plugin/SmsPluginStorage.cpp
- ${CMAKE_SOURCE_DIR}/plugin/sms_plugin/SmsPluginTransport.cpp
- ${CMAKE_SOURCE_DIR}/plugin/sms_plugin/SmsPluginEventHandler.cpp
- ${CMAKE_SOURCE_DIR}/plugin/sms_plugin/SmsPluginUAManager.cpp
${CMAKE_SOURCE_DIR}/plugin/sms_plugin/SmsPluginCallback.cpp
- ${CMAKE_SOURCE_DIR}/plugin/sms_plugin/SmsPluginMain.cpp
${CMAKE_SOURCE_DIR}/plugin/sms_plugin/SmsPluginDSHandler.cpp
+ ${CMAKE_SOURCE_DIR}/plugin/sms_plugin/SmsPluginMain.cpp
+ ${CMAKE_SOURCE_DIR}/plugin/sms_plugin/SmsPluginStorage.cpp
+ # 3gpp module
+ ${CMAKE_SOURCE_DIR}/plugin/sms_plugin/3gpp/Sms3gppUDCodec.cpp
+ ${CMAKE_SOURCE_DIR}/plugin/sms_plugin/3gpp/Sms3gppParamCodec.cpp
+ ${CMAKE_SOURCE_DIR}/plugin/sms_plugin/3gpp/Sms3gppTpduCodec.cpp
+ ${CMAKE_SOURCE_DIR}/plugin/sms_plugin/3gpp/Sms3gppSatHandler.cpp
+ ${CMAKE_SOURCE_DIR}/plugin/sms_plugin/3gpp/Sms3gppCbMsgHandler.cpp
+ ${CMAKE_SOURCE_DIR}/plugin/sms_plugin/3gpp/Sms3gppWapPushHandler.cpp
+ ${CMAKE_SOURCE_DIR}/plugin/sms_plugin/3gpp/Sms3gppConcatHandler.cpp
+ ${CMAKE_SOURCE_DIR}/plugin/sms_plugin/3gpp/Sms3gppSetting.cpp
+ ${CMAKE_SOURCE_DIR}/plugin/sms_plugin/3gpp/Sms3gppSimMsg.cpp
+ ${CMAKE_SOURCE_DIR}/plugin/sms_plugin/3gpp/Sms3gppStorage.cpp
+ ${CMAKE_SOURCE_DIR}/plugin/sms_plugin/3gpp/Sms3gppTransport.cpp
+ ${CMAKE_SOURCE_DIR}/plugin/sms_plugin/3gpp/Sms3gppEventHandler.cpp
+ ${CMAKE_SOURCE_DIR}/plugin/sms_plugin/3gpp/Sms3gppUAManager.cpp
+ ${CMAKE_SOURCE_DIR}/plugin/sms_plugin/3gpp/Sms3gppTapiEventHandler.cpp
+ # 3gpp2 module
+ ${CMAKE_SOURCE_DIR}/plugin/sms_plugin/3gpp2/Sms3gpp2TapiEventHandler.cpp
+ ${CMAKE_SOURCE_DIR}/plugin/sms_plugin/3gpp2/Sms3gpp2Codec.cpp
+ ${CMAKE_SOURCE_DIR}/plugin/sms_plugin/3gpp2/Sms3gpp2EventHandler.cpp
+ ${CMAKE_SOURCE_DIR}/plugin/sms_plugin/3gpp2/Sms3gpp2ParamCodec.cpp
+ ${CMAKE_SOURCE_DIR}/plugin/sms_plugin/3gpp2/Sms3gpp2Transport.cpp
+ ${CMAKE_SOURCE_DIR}/plugin/sms_plugin/3gpp2/Sms3gpp2UAManager.cpp
+ ${CMAKE_SOURCE_DIR}/plugin/sms_plugin/3gpp2/Sms3gpp2Setting.cpp
+ ${CMAKE_SOURCE_DIR}/plugin/sms_plugin/3gpp2/Sms3gpp2WapPushHandler.cpp
)
INCLUDE_DIRECTORIES(
${CMAKE_SOURCE_DIR}/include/common
${CMAKE_SOURCE_DIR}/include/utils
${CMAKE_SOURCE_DIR}/include/externals
+ ${CMAKE_SOURCE_DIR}/include/framework
${CMAKE_CURRENT_SOURCE_DIR}/include
+ ${CMAKE_CURRENT_SOURCE_DIR}/3gpp/include
+ ${CMAKE_CURRENT_SOURCE_DIR}/3gpp2/include
)
INCLUDE(FindPkgConfig)
SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed")
ADD_LIBRARY(${SMS-PLUGIN-LIB} SHARED ${SMS-PLUGIN-SRCS})
-TARGET_LINK_LIBRARIES(${SMS-PLUGIN-LIB} ${sms_plugin_pkgs_LDFLAGS} ${UTILS-LIB} ${EXTERNALS-LIB})
+TARGET_LINK_LIBRARIES(${SMS-PLUGIN-LIB} ${sms_plugin_pkgs_LDFLAGS} ${FW-HANDLER-LIB} ${UTILS-LIB} ${EXTERNALS-LIB})
INSTALL(TARGETS ${SMS-PLUGIN-LIB} LIBRARY DESTINATION ${LIBDIR})
* limitations under the License.
*/
-#include <glib.h>
-#include <pthread.h>
+#include <ITapiNetText.h>
+#include <tapi_common.h>
+#include <vconf.h>
#include "MsgDebug.h"
-#include "MsgCppTypes.h"
#include "MsgException.h"
-#include "SmsPluginEventHandler.h"
-#include "SmsPluginCbMsgHandler.h"
-#include "SmsPluginConcatHandler.h"
-#include "SmsPluginWapPushHandler.h"
-#include "SmsPluginSatHandler.h"
-#include "SmsPluginParamCodec.h"
-#include "SmsPluginTpduCodec.h"
-#include "SmsPluginTransport.h"
-#include "SmsPluginSimMsg.h"
-#include "SmsPluginSetting.h"
#include "MsgGconfWrapper.h"
-#include "MsgDevicedWrapper.h"
+
#include "SmsPluginCallback.h"
#include "SmsPluginDSHandler.h"
-
-extern bool isMemAvailable;
-
+#include "SmsPluginStorage.h"
+#include "Sms3gppEventHandler.h"
+#include "Sms3gppSetting.h"
+#include "Sms3gppTapiEventHandler.h"
+#include "Sms3gppEventHandler.h"
+#include "Sms3gpp2Setting.h"
+#include "Sms3gpp2TapiEventHandler.h"
/*==================================================================================================
- FUNCTION IMPLEMENTATION
+ Methods of SmsPluginCallback
==================================================================================================*/
-void TapiEventDeviceReady(TapiHandle *handle, const char *noti_id, void *data, void *user_data)
-{
- MSG_DEBUG("TapiEventDeviceReady is called. : noti_id = [%s]", noti_id);
-
- try {
- /* Call Event Handler */
- SmsPluginEventHandler::instance()->setDeviceStatus(handle);
- } catch (MsgException& e) {
- MSG_FATAL("%s", e.what());
- return;
- }
-}
-
-SMS_NETWORK_STATUS_T convertTapiRespToSmsPlugin(int result)
-{
- SMS_NETWORK_STATUS_T sentStatus;
-
- /* Convert TAPI status -> SMS network status */
- switch ((TelSmsResponse_t)result) {
- case TAPI_NETTEXT_SENDSMS_SUCCESS :
- sentStatus = SMS_NETWORK_SEND_SUCCESS;
- break;
-
- case TAPI_NETTEXT_INVALID_MANDATORY_INFO :
- sentStatus = SMS_NETWORK_SEND_FAIL_MANDATORY_INFO_MISSING;
- break;
-
- case TAPI_NETTEXT_DESTINAITION_OUTOFSERVICE :
- case TAPI_NETTEXT_TEMPORARY_FAILURE :
- case TAPI_NETTEXT_CONGESTION :
- case TAPI_NETTEXT_RESOURCES_UNAVAILABLE :
- case TAPI_NETTEXT_MESSAGE_NOT_COMPAT_PROTOCOL :
- case TAPI_NETTEXT_NETWORK_OUTOFORDER:
- sentStatus = SMS_NETWORK_SEND_FAIL_TEMPORARY;
- break;
-
- case TAPI_NETTEXT_MESSAGE_TRANSFER_REJECTED :
- sentStatus = SMS_NETWORK_SEND_FAIL_BY_MO_CONTROL_NOT_ALLOWED;
- break;
-
- case TAPI_NETTEXT_DEST_ADDRESS_FDN_RESTRICTED :
- case TAPI_NETTEXT_SCADDRESS_FDN_RESTRICTED :
- sentStatus = SMS_NETWORK_SEND_FAIL_FDN_RESTRICED;
- break;
- case TAPI_NETTEXT_ROUTING_NOT_AVAILABLE :
- sentStatus = SMS_NETWORK_SEND_FAIL_NO_ROUTING;
- break;
- default :
- sentStatus = SMS_NETWORK_SEND_FAIL;
- break;
- }
-
- return sentStatus;
-}
-
-void TapiEventSentStatus(TapiHandle *handle, int result, void *data, void *user_data)
-{
- MSG_DEBUG("TapiEventSentStatus is called. : result = [0x%x]", result);
-
- SMS_NETWORK_STATUS_T sentStatus;
-
- TelSatMoSmCtrlIndData_t *moCtrlStatus = (TelSatMoSmCtrlIndData_t *)user_data;
-
- sentStatus = convertTapiRespToSmsPlugin(result);
-
- if (moCtrlStatus && sentStatus == SMS_NETWORK_SEND_FAIL_BY_MO_CONTROL_NOT_ALLOWED) {
- if (moCtrlStatus->moSmsCtrlResult == TAPI_SAT_CALL_CTRL_R_ALLOWED_WITH_MOD)
- sentStatus = SMS_NETWORK_SEND_FAIL_BY_MO_CONTROL_WITH_MOD;
- }
-
- if (result != TAPI_NETTEXT_SENDSMS_SUCCESS)
- MSG_INFO("sentStatus:[%d], tapi_result:[0x%x]", sentStatus, result);
-
- MSG_DEBUG("SMS Network Status = [%d]", sentStatus);
-
- /* only temporary errors should be returned without calling handleSentStatus() in order to resend sms */
- if (sentStatus == SMS_NETWORK_SEND_FAIL_TEMPORARY ||
- sentStatus == SMS_NETWORK_SEND_FAIL_BY_MO_CONTROL_WITH_MOD ||
- sentStatus == SMS_NETWORK_SEND_FAIL_FDN_RESTRICED) {
- SmsPluginTransport::instance()->setNetStatus(sentStatus);
- return;
- }
-
- if (sentStatus == SMS_NETWORK_SEND_FAIL) {
- int svc_type;
- tel_get_property_int(handle, TAPI_PROP_NETWORK_SERVICE_TYPE, &svc_type);
- if (svc_type < TAPI_NETWORK_SERVICE_TYPE_2G)
- sentStatus = SMS_NETWORK_SEND_PENDING;
- }
-
- /* Convert SMS status -> Messaging network status */
- msg_network_status_t netStatus;
-
- if (sentStatus == SMS_NETWORK_SEND_SUCCESS) {
- netStatus = MSG_NETWORK_SEND_SUCCESS;
- } else if (sentStatus == SMS_NETWORK_SENDING) {
- netStatus = MSG_NETWORK_SENDING;
- } else if (sentStatus == SMS_NETWORK_SEND_PENDING) {
- netStatus = MSG_NETWORK_SEND_PENDING;
- } else {
- netStatus = MSG_NETWORK_SEND_FAIL;
- }
-
- try {
- SmsPluginEventHandler::instance()->handleSentStatus(netStatus);
-
- SmsPluginTransport::instance()->setNetStatus(sentStatus);
- } catch (MsgException& e) {
- MSG_FATAL("%s", e.what());
- return;
- }
-}
-
-void TapiEventSatSmsSentStatus(TapiHandle *handle, int result, void *data, void *user_data)
-{
- MSG_INFO("TapiEventSatSmsSentStatus is called. : result = [%d]", result);
-
- SMS_NETWORK_STATUS_T sentStatus;
-
- sentStatus = convertTapiRespToSmsPlugin(result);
-
- MSG_DEBUG("SMS Network Status = [%d]", sentStatus);
-
- if (sentStatus == SMS_NETWORK_SEND_FAIL && result != TAPI_NETTEXT_DEVICE_FAILURE) {
- int svc_type;
- tel_get_property_int(handle, TAPI_PROP_NETWORK_SERVICE_TYPE, &svc_type);
- if (svc_type < TAPI_NETWORK_SERVICE_TYPE_2G)
- sentStatus = SMS_NETWORK_SEND_PENDING;
- }
-
- try {
- SmsPluginSatHandler::instance()->ctrlSms(handle, sentStatus);
- } catch (MsgException& e) {
- MSG_FATAL("%s", e.what());
- return;
- }
-}
-
-void TapiEventMsgIncoming(TapiHandle *handle, const char *noti_id, void *data, void *user_data)
-{
- MSG_SEC_DEBUG("TapiEventMsgIncoming is called. noti_id [%s]", noti_id);
-
- if (data == NULL) {
- MSG_ERR("Error. data is NULL.");
- return;
- }
-#if 0
- SmsPluginCbMsgHandler::instance()->handleCbMsg(handle, NULL);
- return;
-#endif
- /* make a margin timeout(500ms) till suspending status */
- MsgDisplayLock();
-
- TelSmsDatapackageInfo_t* pDataPackage = (TelSmsDatapackageInfo_t*)data;
-
- SMS_TPDU_S tpdu;
- memset(&tpdu, 0x00, sizeof(SMS_TPDU_S));
-
- /* Decode Incoming Message */
- SmsPluginTpduCodec::decodeTpdu(pDataPackage->szData, pDataPackage->MsgLength, &tpdu);
-
- /* Print tpdu */
- if (tpdu.tpduType == SMS_TPDU_DELIVER) {
- MSG_DEBUG("############# SMS_TPDU_DELIVER Incoming decoded tpdu values ####################");
- MSG_DEBUG("tpdu.data.deliver.bMoreMsg : %d", tpdu.data.deliver.bMoreMsg);
- MSG_DEBUG("tpdu.data.deliver.bStatusReport : %d", tpdu.data.deliver.bStatusReport);
- MSG_DEBUG("tpdu.data.deliver.bHeaderInd : %d", tpdu.data.deliver.bHeaderInd);
- MSG_DEBUG("tpdu.data.deliver.bReplyPath : %d", tpdu.data.deliver.bReplyPath);
- MSG_DEBUG("tpdu.data.deliver.pid : %d", tpdu.data.deliver.pid);
- MSG_DEBUG("tpdu.data.deliver.dcs.bCompressed : %d", tpdu.data.deliver.dcs.bCompressed);
- MSG_DEBUG("tpdu.data.deliver.dcs.msgClass : %d", tpdu.data.deliver.dcs.msgClass);
- MSG_DEBUG("tpdu.data.deliver.dcs.codingScheme : %d", tpdu.data.deliver.dcs.codingScheme);
- MSG_DEBUG("tpdu.data.deliver.dcs.codingGroup : %d", tpdu.data.deliver.dcs.codingGroup);
- MSG_DEBUG("tpdu.data.deliver.dcs.bIndActive : %d", tpdu.data.deliver.dcs.bIndActive);
- MSG_SEC_DEBUG("tpdu.data.deliver.originAddress.address : %s", tpdu.data.deliver.originAddress.address);
- MSG_DEBUG("tpdu.data.deliver.timeStamp.time : %d/%d/%d %d:%d:%d ", tpdu.data.deliver.timeStamp.time.absolute.year, tpdu.data.deliver.timeStamp.time.absolute.month, tpdu.data.deliver.timeStamp.time.absolute.day,
- tpdu.data.deliver.timeStamp.time.absolute.hour, tpdu.data.deliver.timeStamp.time.absolute.minute, tpdu.data.deliver.timeStamp.time.absolute.second);
- MSG_DEBUG("tpdu.data.deliver.userData.headerCnt : %d", tpdu.data.deliver.userData.headerCnt);
- MSG_DEBUG("tpdu.data.deliver.userData.length : %d", tpdu.data.deliver.userData.length);
- MSG_DEBUG("tpdu.data.deliver.userData.data : %s", tpdu.data.deliver.userData.data);
- MSG_DEBUG("#####################################################");
- } else if (tpdu.tpduType == SMS_TPDU_STATUS_REP) {
- MSG_DEBUG("############# SMS_TPDU_STATUS_REP Incoming decoded tpdu values ####################");
- MSG_DEBUG("tpdu.data.statusRep.msgRef : %d", tpdu.data.statusRep.msgRef);
- MSG_DEBUG("tpdu.data.statusRep.bMoreMsg : %d", tpdu.data.statusRep.bMoreMsg);
- MSG_DEBUG("tpdu.data.statusRep.bStatusReport : %d", tpdu.data.statusRep.bStatusReport);
- MSG_DEBUG("tpdu.data.statusRep.statusRep : %d", tpdu.data.statusRep.bHeaderInd);
- MSG_DEBUG("tpdu.data.statusRep.status : %02x", tpdu.data.statusRep.status);
- MSG_DEBUG("tpdu.data.statusRep.pid : %d", tpdu.data.statusRep.pid);
- MSG_DEBUG("tpdu.data.statusRep.dcs.bCompressed : %d", tpdu.data.statusRep.dcs.bCompressed);
- MSG_DEBUG("tpdu.data.statusRep.dcs.msgClass : %d", tpdu.data.statusRep.dcs.msgClass);
- MSG_DEBUG("tpdu.data.statusRep.dcs.codingScheme : %d", tpdu.data.statusRep.dcs.codingScheme);
- MSG_DEBUG("tpdu.data.statusRep.dcs.codingGroup : %d", tpdu.data.statusRep.dcs.codingGroup);
- MSG_SEC_DEBUG("tpdu.data.statusRep.recipAddress.address : %s", tpdu.data.statusRep.recipAddress.address);
- MSG_DEBUG("tpdu.data.statusRep.timeStamp.time : %d/%d/%d %d:%d:%d ", tpdu.data.statusRep.timeStamp.time.absolute.year, tpdu.data.statusRep.timeStamp.time.absolute.month, tpdu.data.statusRep.timeStamp.time.absolute.day,
- tpdu.data.statusRep.timeStamp.time.absolute.hour, tpdu.data.statusRep.timeStamp.time.absolute.minute, tpdu.data.statusRep.timeStamp.time.absolute.second);
- MSG_DEBUG("tpdu.data.statusRep.dischargeTime.time : %d/%d/%d %d:%d:%d ", tpdu.data.statusRep.dischargeTime.time.absolute.year, tpdu.data.statusRep.dischargeTime.time.absolute.month, tpdu.data.statusRep.dischargeTime.time.absolute.day,
- tpdu.data.statusRep.dischargeTime.time.absolute.hour, tpdu.data.statusRep.dischargeTime.time.absolute.minute, tpdu.data.statusRep.dischargeTime.time.absolute.second);
- MSG_DEBUG("tpdu.data.statusRep.userData.headerCnt : %d", tpdu.data.statusRep.userData.headerCnt);
- MSG_DEBUG("tpdu.data.statusRep.userData.length : %d", tpdu.data.statusRep.userData.length);
- MSG_DEBUG("tpdu.data.statusRep.userData.data : %s", tpdu.data.statusRep.userData.data);
- MSG_DEBUG("#####################################################");
- }
-
- MsgDisplayUnlock();
-
- try {
- if (tpdu.tpduType == SMS_TPDU_DELIVER) {
- if (tpdu.data.deliver.dcs.msgClass == SMS_MSG_CLASS_2) {
- /* For GCF test, 34.2.5.3 */
- SmsPluginSimMsg::instance()->setSmsData((const char*)pDataPackage->Sca, (const char *)pDataPackage->szData, pDataPackage->MsgLength);
- }
-
- if (SmsPluginConcatHandler::instance()->IsConcatMsg(&(tpdu.data.deliver.userData)) == true ||
- SmsPluginWapPushHandler::instance()->IsWapPushMsg(&(tpdu.data.deliver.userData)) == true) {
- /* Call Concat Msg Handler */
- SmsPluginConcatHandler::instance()->handleConcatMsg(handle, &tpdu);
- } else {
- /* Call Event Handler */
- SmsPluginEventHandler::instance()->handleMsgIncoming(handle, &tpdu);
- }
- } else if (tpdu.tpduType == SMS_TPDU_STATUS_REP) {
- /* Call Event Handler */
- SmsPluginEventHandler::instance()->handleMsgIncoming(handle, &tpdu);
- }
- } catch (MsgException& e) {
- MSG_FATAL("%s", e.what());
- return;
- }
-}
-
-
-void TapiEventCbMsgIncoming(TapiHandle *handle, const char *noti_id, void *data, void *user_data)
-{
- MSG_SEC_DEBUG("TapiEventCbMsgIncoming is called. noti_id [%s]", noti_id);
-
- if (data == NULL) {
- MSG_ERR("Error. data is NULL.");
- return;
- }
-
- TelSmsCbMsg_t *pCbMsg = (TelSmsCbMsg_t*)data;
-
- try {
- SmsPluginCbMsgHandler::instance()->handleCbMsg(handle, pCbMsg);
- } catch (MsgException& e) {
- MSG_FATAL("%s", e.what());
- return;
- }
-}
-
-
-void TapiEventEtwsMsgIncoming(TapiHandle *handle, const char *noti_id, void *data, void *user_data)
-{
- MSG_SEC_DEBUG("TapiEventEtwsMsgIncoming is called. noti_id [%s]", noti_id);
-
- if (data == NULL) {
- MSG_ERR("Error. data is NULL.");
- return;
- }
-
- TelSmsEtwsMsg_t *pEtwsMsg = (TelSmsEtwsMsg_t*)data;
-
- try {
- SmsPluginCbMsgHandler::instance()->handleEtwsMsg(handle, pEtwsMsg);
- } catch (MsgException& e) {
- MSG_FATAL("%s", e.what());
- return;
- }
-}
-
-
-void TapiEventDeliveryReportCNF(TapiHandle *handle, int result, void *data, void *user_data)
-{
- MSG_DEBUG("TapiEventDeliveryReportCNF is called. : result = [%d]", result);
-
- return;
-}
-
-
-void TapiEventGetSimMsgCnt(TapiHandle *handle, int result, void *data, void *user_data)
-{
- MSG_DEBUG("TapiEventGetSimMsgCnt is called.");
-
- if (result != TAPI_API_SUCCESS || data == NULL) {
- MSG_ERR("Error. data is NULL. result:[0x%x]", result);
- MSG_SIM_COUNT_S simCnt;
- memset(&simCnt, 0x00, sizeof(MSG_SIM_COUNT_S));
- SmsPluginSimMsg::instance()->setSimMsgCntEvent(handle, &simCnt);
- return;
- }
-
- SmsPluginSimMsg::instance()->setSimMsgCntEvent(handle, (MSG_SIM_COUNT_S *)data);
-}
-
-
-void TapiEventGetSimMsg(TapiHandle *handle, int result, void *data, void *user_data)
+void SmsPluginCallbacks::registerEvents()
{
- MSG_DEBUG("TapiEventGetSimMsg is called.");
-
- if (result != TAPI_API_SUCCESS || data == NULL) {
- MSG_ERR("Error!! result [0x%x]", result);
-
- SmsPluginSimMsg::instance()->setSimMsgEvent(handle, NULL, false);
-
- return;
- }
-
-
- TelSmsData_t* pSmsTpdu = (TelSmsData_t*)data;
-
- int *simIdList = (int *)user_data;
-
- /* Reading TelSmsData_t */
- MSG_DEBUG("sim index %d", pSmsTpdu->SimIndex);
- MSG_DEBUG("status %d", pSmsTpdu->MsgStatus);
- MSG_DEBUG("sim msg [%s]", pSmsTpdu->SmsData.szData);
-
- /* Reading TelSmsDatapackageInfo_t */
- if (pSmsTpdu->SmsData.MsgLength > MAX_TPDU_DATA_LEN) {
- MSG_DEBUG("WARNING: tpdu_len > MAX_SMS_TPDU_SIZE [%d] bytes. setting to 0.", pSmsTpdu->SmsData.MsgLength);
-
- SmsPluginSimMsg::instance()->setSimMsgEvent(handle, NULL, false);
-
- return;
- }
-
- SMS_TPDU_S tpdu;
-
- /* decode Tpdu */
- SmsPluginTpduCodec::decodeTpdu(pSmsTpdu->SmsData.szData, pSmsTpdu->SmsData.MsgLength, &tpdu);
-
- MSG_DEBUG("Sim Message Type [%d]", tpdu.tpduType);
-
- bool bRead = false;
-
- /* set read status */
- if (pSmsTpdu->MsgStatus == TAPI_NETTEXT_STATUS_READ)
- bRead = true;
- else if (pSmsTpdu->MsgStatus == TAPI_NETTEXT_STATUS_UNREAD)
- bRead = false;
-
- if (tpdu.tpduType == SMS_TPDU_DELIVER) {
- if (tpdu.data.deliver.dcs.codingScheme == SMS_CHARSET_8BIT && tpdu.data.deliver.pid == 0x11) {
- MSG_DEBUG("Unsupported message!!");
- SmsPluginSimMsg::instance()->setSimMsgEvent(handle, NULL, false);
- return;
- }
-
- MSG_DEBUG("headerCnt [%d]", tpdu.data.deliver.userData.headerCnt);
- for (int i = 0; i < tpdu.data.deliver.userData.headerCnt; i++) {
- /* Handler Concatenated Message */
- if (tpdu.data.deliver.userData.header[i].udhType == SMS_UDH_CONCAT_8BIT ||
- tpdu.data.deliver.userData.header[i].udhType == SMS_UDH_CONCAT_16BIT) {
- SmsPluginConcatHandler::instance()->handleSimConcatMsg(handle, &tpdu, pSmsTpdu->SimIndex, bRead, simIdList);
- return;
- }
-
- if (tpdu.data.deliver.userData.header[i].udhType == SMS_UDH_SPECIAL_SMS) {
- MSG_DEBUG("Unsupported Special SMS!!");
- SmsPluginSimMsg::instance()->setSimMsgEvent(handle, NULL, false);
- return;
- }
- }
- } else if (tpdu.tpduType == SMS_TPDU_SUBMIT) {
- if (tpdu.data.submit.dcs.codingScheme == SMS_CHARSET_8BIT && tpdu.data.submit.pid == 0x11) {
- MSG_DEBUG("Unsupported message!!");
- SmsPluginSimMsg::instance()->setSimMsgEvent(handle, NULL, false);
- return;
- }
- MSG_DEBUG("headerCnt [%d]", tpdu.data.submit.userData.headerCnt);
-
- for (int i = 0; i < tpdu.data.submit.userData.headerCnt; i++) {
- /* Handler Concatenated Message */
- if (tpdu.data.submit.userData.header[i].udhType == SMS_UDH_CONCAT_8BIT ||
- tpdu.data.submit.userData.header[i].udhType == SMS_UDH_CONCAT_16BIT) {
- SmsPluginConcatHandler::instance()->handleSimConcatMsg(handle, &tpdu, pSmsTpdu->SimIndex, bRead, simIdList);
- return;
- }
- }
- }
-
- /* Make MSG_MESSAGE_INFO_S */
- MSG_MESSAGE_INFO_S msgInfo;
- memset(&msgInfo, 0x00, sizeof(MSG_MESSAGE_INFO_S));
-
- /* set storage id */
- msgInfo.storageId = MSG_STORAGE_SIM;
-
- msgInfo.addressList = NULL;
- unique_ptr<MSG_ADDRESS_INFO_S*, void(*)(MSG_ADDRESS_INFO_S**)> addressListBuf(&msgInfo.addressList, unique_ptr_deleter);
-
- SmsPluginEventHandler::instance()->convertTpduToMsginfo(&tpdu, &msgInfo);
-
- msgInfo.sim_idx = SmsPluginDSHandler::instance()->getSimIndex(handle);
-
- if (tpdu.tpduType == SMS_TPDU_DELIVER && tpdu.data.deliver.dcs.bMWI == true) {
- if (tpdu.data.deliver.pid == 0x20 && tpdu.data.deliver.originAddress.ton == SMS_TON_ALPHANUMERIC) {
- char keyName[MAX_VCONFKEY_NAME_LEN];
- char *voiceNumber = NULL;
- char *voiceAlphaId = NULL;
-
- memset(keyName, 0x00, sizeof(keyName));
- snprintf(keyName, sizeof(keyName), "%s/%d", VOICEMAIL_NUMBER, msgInfo.sim_idx);
- if (MsgSettingGetString(keyName, &voiceNumber) != MSG_SUCCESS) {
- MSG_INFO("MsgSettingGetString() is failed");
- }
-
- memset(keyName, 0x00, sizeof(keyName));
- snprintf(keyName, sizeof(keyName), "%s/%d", VOICEMAIL_ALPHA_ID, msgInfo.sim_idx);
- if (MsgSettingGetString(keyName, &voiceAlphaId) != MSG_SUCCESS) {
- MSG_INFO("MsgSettingGetString() is failed");
- }
-
- memset(msgInfo.addressList[0].addressVal, 0x00, sizeof(msgInfo.addressList[0].addressVal));
- memset(msgInfo.addressList[0].displayName, 0x00, sizeof(msgInfo.addressList[0].displayName));
-
- if (voiceNumber) {
- snprintf(msgInfo.addressList[0].addressVal, sizeof(msgInfo.addressList[0].addressVal), "%s", voiceNumber);
- free(voiceNumber);
- voiceNumber = NULL;
- }
-
- if (voiceAlphaId) {
- snprintf(msgInfo.addressList[0].displayName, sizeof(msgInfo.addressList[0].displayName), "%s", voiceAlphaId);
- free(voiceAlphaId);
- voiceAlphaId = NULL;
- }
-
- memset(msgInfo.msgText, 0x00, sizeof(msgInfo.msgText));
- snprintf(msgInfo.msgText, sizeof(msgInfo.msgText), "Voice message");
- }
- } else if (tpdu.tpduType == SMS_TPDU_SUBMIT) {
- msgInfo.displayTime = time(NULL);
- }
-
- /* set read status */
- msgInfo.bRead = bRead;
-
- simIdList[0] = pSmsTpdu->SimIndex + 1;
- /* Print MSG_MESSAGE_INFO_S */
- MSG_DEBUG("############# Convert tpdu values to Message Info values ####################");
- MSG_DEBUG("msgInfo.msgId : %d", msgInfo.msgId);
- MSG_DEBUG("msgInfo.nAddressCnt : %d", msgInfo.nAddressCnt);
- MSG_DEBUG("msgInfo.addressList[0].addressType : %d", msgInfo.addressList[0].addressType);
- MSG_SEC_DEBUG("msgInfo.addressList[0].addressVal : %s", msgInfo.addressList[0].addressVal);
- MSG_SEC_DEBUG("msgInfo.addressList[0].displayName : %s", msgInfo.addressList[0].displayName);
- MSG_DEBUG("msgInfo.priority : %d", msgInfo.priority);
- MSG_DEBUG("msgInfo.bProtected : %d", msgInfo.bProtected);
- MSG_DEBUG("msgInfo.bRead : %d", msgInfo.bRead);
- MSG_DEBUG("msgInfo.bTextSms : %d", msgInfo.bTextSms);
- MSG_DEBUG("msgInfo.direction : %d", msgInfo.direction);
- MSG_DEBUG("msgInfo.msgType.mainType : %d", msgInfo.msgType.mainType);
- MSG_DEBUG("msgInfo.msgType.subType : %d", msgInfo.msgType.subType);
- MSG_DEBUG("msgInfo.msgType.classType : %d", msgInfo.msgType.classType);
- MSG_DEBUG("msgInfo.displayTime : %ld", msgInfo.displayTime);
- MSG_DEBUG("msgInfo.dataSize : %zu", msgInfo.dataSize);
- if (msgInfo.bTextSms == true)
- MSG_SEC_DEBUG("msgInfo.msgText : %s", msgInfo.msgText);
- else
- MSG_SEC_DEBUG("msgInfo.msgData : %s", msgInfo.msgData);
- MSG_DEBUG("msgInfo.sim_idx : %d", msgInfo.sim_idx);
- MSG_DEBUG("###############################################################");
-
- /* Call Event Handler */
- SmsPluginSimMsg::instance()->setSimMsgEvent(handle, &msgInfo, true);
-}
-
+ int count = SmsPluginDSHandler::instance()->getTelHandleCount();
-void TapiEventSaveSimMsg(TapiHandle *handle, int result, void *data, void *user_data)
-{
- MSG_DEBUG("TapiEventSaveSimMsg is called. result [%d]", result);
+ for (int i = 1; i <= count; i++) {
+ int tRet = TAPI_API_SUCCESS;
+ TapiHandle *tHandle = SmsPluginDSHandler::instance()->getTelHandle(i);
- int simId = -1;
+ tRet = tel_register_noti_event(tHandle, TAPI_NOTI_SMS_INCOM_MSG, tapiNotiSmsIncomMsg, NULL);
+ MSG_WARN_M(tRet != TAPI_API_SUCCESS, "tel_register_noti_event() for (%s) failed: (%d)", TAPI_NOTI_SMS_INCOM_MSG, tRet);
- if (data != NULL)
- simId = *((int*)data);
- else
- MSG_ERR("Data(SIM Msg ID) is NULL");
+ tRet = tel_register_noti_event(tHandle, TAPI_NOTI_SIM_REFRESHED, tapiNotiSimRefreshed, NULL);
+ MSG_WARN_M(tRet != TAPI_API_SUCCESS, "tel_register_noti_event() for (%s) failed: (%d)", TAPI_NOTI_SIM_REFRESHED, tRet);
- SmsPluginSimMsg::instance()->setSaveSimMsgEvent(handle, simId, result);
-}
+ tRet = tel_register_noti_event(tHandle, TAPI_NOTI_SMS_DEVICE_READY, tapiNotiSmsDeviceReady, NULL);
+ MSG_WARN_M(tRet != TAPI_API_SUCCESS, "tel_register_noti_event() for (%s) failed: (%d)", TAPI_NOTI_SMS_DEVICE_READY, tRet);
+ tRet = tel_register_noti_event(tHandle, TAPI_NOTI_NETWORK_REGISTRATION_STATUS, tapiNotiNetworkRegistrationStatus, NULL);
+ MSG_WARN_M(tRet != TAPI_API_SUCCESS, "tel_register_noti_event() for (%s) failed: (%d)", TAPI_NOTI_NETWORK_REGISTRATION_STATUS, tRet);
-void TapiEventSaveClass2Msg(TapiHandle *handle, int result, void *data, void *user_data)
-{
- MSG_DEBUG("TapiEventSaveClass2Msg is called. result [%d]", result);
+ if (SmsPluginDSHandler::instance()->getHandleType(tHandle) == SmsPluginDSHandler::HandleType::H_3GPP) {
+ tRet = tel_register_noti_event(tHandle, TAPI_NOTI_SMS_CB_INCOM_MSG, tapiNotiSmsCbIncomMsg, NULL);
+ MSG_WARN_M(tRet != TAPI_API_SUCCESS, "tel_register_noti_event() for (%s) failed: (%d)", TAPI_NOTI_SMS_CB_INCOM_MSG, tRet);
- int simId = -1;
+ tRet = tel_register_noti_event(tHandle, TAPI_NOTI_SMS_ETWS_INCOM_MSG, tapiNotiSmsEtwsIncomMsg, NULL);
+ MSG_WARN_M(tRet != TAPI_API_SUCCESS, "tel_register_noti_event() for (%s) failed: (%d)", TAPI_NOTI_SMS_ETWS_INCOM_MSG, tRet);
- if (data != NULL) {
- simId = *((int*)data);
- MSG_DEBUG("SIM Msg ID : %d", simId);
- } else {
- MSG_ERR("Data(SIM Msg ID) is NULL");
- }
+ tRet = tel_register_noti_event(tHandle, TAPI_NOTI_SAT_SEND_SMS, tapiNotiSatSendSms, NULL);
+ MSG_WARN_M(tRet != TAPI_API_SUCCESS, "tel_register_noti_event() for (%s) failed: (%d)", TAPI_NOTI_SAT_SEND_SMS, tRet);
- MSG_MESSAGE_INFO_S *pMsgInfo = (MSG_MESSAGE_INFO_S *)user_data;
+ tRet = tel_register_noti_event(tHandle, TAPI_NOTI_SAT_MO_SM_CONTROL_RESULT, tapiNotiSatMoSmControlResult, NULL);
+ MSG_WARN_M(tRet != TAPI_API_SUCCESS, "tel_register_noti_event() for (%s) failed: (%d)", TAPI_NOTI_SAT_MO_SM_CONTROL_RESULT, tRet);
- SmsPluginSimMsg::instance()->setSaveClass2MsgEvent(handle, simId, result, pMsgInfo);
+ tRet = tel_register_noti_event(tHandle, TAPI_NOTI_SIM_STATUS, tapiNotiSimStatus, NULL);
+ MSG_WARN_M(tRet != TAPI_API_SUCCESS, "tel_register_noti_event() for (%s) failed: (%d)", TAPI_NOTI_SIM_STATUS, tRet);
- if (result == TAPI_NETTEXT_SENDSMS_SUCCESS)
- SmsPluginSimMsg::instance()->setSimEvent((msg_sim_id_t)simId, true);
- else
- SmsPluginSimMsg::instance()->setSimEvent((msg_sim_id_t)0, false);
+ tRet = tel_register_noti_event(tHandle, TAPI_NOTI_SMS_MEMORY_STATUS, tapiNotiSmsMemoryStatus, NULL);
+ MSG_WARN_M(tRet != TAPI_API_SUCCESS, "tel_register_noti_event() for (%s) failed: (%d)", TAPI_NOTI_SMS_MEMORY_STATUS, tRet);
- if (pMsgInfo) {
- if (pMsgInfo->addressList) {
- delete[] pMsgInfo->addressList;
- pMsgInfo->addressList = NULL;
}
- free(pMsgInfo);
- pMsgInfo = NULL;
- }
-}
-
-
-void TapiEventDeleteSimMsg(TapiHandle *handle, int result, void *data, void *user_data)
-{
- MSG_DEBUG("TapiEventDeleteSimMsg is called. result [%d]", result);
-
- if (result != TAPI_API_SUCCESS || data == NULL) {
- MSG_ERR("Error. data is NULL. result:0x%x", result);
- SmsPluginSimMsg::instance()->setDelSimEvent(-1, false);
- return;
- }
-
- int sim_id = *((int*)data);
-
- SmsPluginSimMsg::instance()->setDelSimEvent(sim_id, true);
-}
-
-
-void TapiEventSetConfigData(TapiHandle *handle, int result, void *data, void *user_data)
-{
- MSG_DEBUG("TapiEventSetConfigData is called.");
-
- if (data == NULL) {
- MSG_ERR("Error. data is NULL. result:%d", result);
- SmsPluginSetting::instance()->setResultFromSim(false);
- return;
- }
-
- TelSmsSetResponse* responseType = (TelSmsSetResponse*)data;
-
- MSG_DEBUG("responseType : [%d]", *responseType);
-
- switch (*responseType) {
- case TAPI_NETTEXT_SETPREFERREDBEARER_RSP :
- MSG_DEBUG("TAPI_NETTEXT_SETPREFERREDBEARER_RSP is called");
- break;
-
- case TAPI_NETTEXT_SETPARAMETERS_RSP :
- MSG_DEBUG("TAPI_NETTEXT_SETPARAMETERS_RSP is called");
- break;
-
- case TAPI_NETTEXT_CBSETCONFIG_RSP :
- MSG_DEBUG("TAPI_NETTEXT_CBSETCONFIG_RSP is called");
- break;
-
- case TAPI_NETTEXT_SETMEMORYSTATUS_RSP :
- MSG_DEBUG("TAPI_NETTEXT_SETMEMORYSTATUS_RSP is called");
- break;
-
- case TAPI_NETTEXT_SETMESSAGESTATUS_RSP :
- MSG_DEBUG("TAPI_NETTEXT_SETMESSAGESTATUS_RSP is called");
- break;
-
- default :
- MSG_DEBUG("Unknown Response is called [%d]", *responseType);
- break;
}
+ MsgSettingRegVconfCBCommon(VCONFKEY_DNET_STATE, vconfDnetStateChanged);
- bool bRet = true;
-
- MSG_DEBUG("status : [%d]", (TelSmsCause_t)result);
-
- if ((TelSmsCause_t)result != TAPI_NETTEXT_SUCCESS) bRet = false;
-
- if (*responseType == TAPI_NETTEXT_SETMESSAGESTATUS_RSP)
- SmsPluginSimMsg::instance()->setSimEvent(0, bRet);
- else
- SmsPluginSetting::instance()->setResultFromSim(bRet);
}
-void TapiEventGetParamCnt(TapiHandle *handle, int result, void *data, void *user_data)
+void SmsPluginCallbacks::deRegisterEvents()
{
- MSG_DEBUG("TapiEventGetParamCnt is called.");
-
- if (result != TAPI_API_SUCCESS || data == NULL) {
- MSG_ERR("Error. data is NULL. result:0x%x", result);
- SmsPluginSetting::instance()->setParamCntEvent(0);
- return;
- }
-
- int paramCnt = 0;
- paramCnt = *((int*)data);
-
- SmsPluginSetting::instance()->setParamCntEvent(paramCnt);
+ MsgSettingRemoveVconfCBCommon(VCONFKEY_DNET_STATE, vconfDnetStateChanged);
}
-
-void TapiEventGetParam(TapiHandle *handle, int result, void *data, void *user_data)
+void SmsPluginCallbacks::tapiNotiSmsIncomMsg(TapiHandle *handle, const char *noti_id, void *data, void *user_data)
{
- MSG_DEBUG("TapiEventGetConfigData is called.");
-
- if (result != TAPI_API_SUCCESS || data == NULL) {
- MSG_ERR("Error. data is NULL. result:0x%x", result);
- SmsPluginSetting::instance()->setParamEvent(handle, NULL, -1, false);
- return;
- }
-
- TelSmsParams_t* smsParam = (TelSmsParams_t*)data;
-
- int alphaIdLen = 0;
- int addrLen = 0;
- MSG_SMSC_DATA_S smscData = {0, };
-
- /*Check Alpha ID value*/
- alphaIdLen = smsParam->AlphaIdLen;
- MSG_DEBUG("alphaId_len[%d]", alphaIdLen);
-
- if (alphaIdLen < 0 || alphaIdLen > SMSC_NAME_MAX) {
- MSG_DEBUG("Wrong Alpha ID Length[%d]", alphaIdLen);
-
- SmsPluginSetting::instance()->setParamEvent(handle, NULL, -1, false);
+ MSG_WARN("noti_id: (%s)", noti_id);
- return;
- }
-
-
- /*Check Address value*/
- addrLen = smsParam->TpSvcCntrAddr.DialNumLen;
-
- if (addrLen > SMSC_ADDR_MAX) {
- MSG_DEBUG("addrLen is too long: %d", addrLen);
- SmsPluginSetting::instance()->setParamEvent(handle, NULL, -1, false);
- return;
- } else if (addrLen < 2) {
- MSG_DEBUG("addrLen is too short: %d", addrLen);
- SmsPluginSetting::instance()->setParamEvent(handle, NULL, -1, false);
- return;
- }
-
- MSG_DEBUG("addrLen : %d", addrLen);
-
- /*SMSP Parameter Indicator value*/
- MSG_DEBUG("ParamIndicator[%02x]", smsParam->ParamIndicator);
-
- /*Get SMSC Address*/
- if (0x00 == (0x02 & smsParam->ParamIndicator)) {
- MSG_DEBUG("record index[%d]", (int)smsParam->RecordIndex);
-
- MSG_DEBUG("TON : %d", smsParam->TpSvcCntrAddr.Ton);
- MSG_DEBUG("NPI : %d", smsParam->TpSvcCntrAddr.Npi);
-
- smscData.smscAddr.ton = smsParam->TpSvcCntrAddr.Ton;
- smscData.smscAddr.npi = smsParam->TpSvcCntrAddr.Npi;
-
- SmsPluginParamCodec paramCodec;
-
- memset(smscData.smscAddr.address, 0x00, SMSC_ADDR_MAX+1);
- paramCodec.decodeSMSC(smsParam->TpSvcCntrAddr.szDiallingNum, addrLen, smscData.smscAddr.ton, smscData.smscAddr.address);
-
- MSG_SEC_DEBUG("SMSC Address : [%s]", smscData.smscAddr.address);
-
- memset(smscData.name, 0x00, SMSC_NAME_MAX+1);
- memcpy(smscData.name, smsParam->szAlphaId, alphaIdLen);
- smscData.name[alphaIdLen] = '\0';
-
- MSG_SEC_DEBUG("SMSC Name : [%s]", smscData.name);
- } else {
- MSG_DEBUG("SMSC Address is not present");
-
- SmsPluginSetting::instance()->setParamEvent(handle, NULL, -1, false);
-
- return;
- }
-
- /*Get the PID value*/
- if (0x00 == (0x04 & smsParam->ParamIndicator)) {
- SMS_PID_T pid = (SMS_PID_T)smsParam->TpProtocolId;
-
- MSG_DEBUG("smsParam->TpProtocolId : %d", smsParam->TpProtocolId);
-
- switch (pid) {
- case SMS_PID_NORMAL:
- smscData.pid = MSG_PID_TEXT;
- break;
- case SMS_PID_VOICE:
- smscData.pid = MSG_PID_VOICE;
- break;
- case SMS_PID_TELEX:
- smscData.pid = MSG_PID_FAX;
- break;
- case SMS_PID_x400:
- smscData.pid = MSG_PID_X400;
- break;
- case SMS_PID_ERMES:
- smscData.pid = MSG_PID_ERMES;
- break;
- case SMS_PID_EMAIL:
- smscData.pid = MSG_PID_EMAIL;
- break;
- default:
- smscData.pid = MSG_PID_TEXT;
- break;
+ if (SmsPluginDSHandler::instance()->getHandleType(handle) == SmsPluginDSHandler::HandleType::H_3GPP) {
+ TelSmsDatapackageInfo_t* smsDataPackage = static_cast<TelSmsDatapackageInfo_t *>(data);
+ if (smsDataPackage->format == TAPI_NETTEXT_NETTYPE_3GPP || smsDataPackage->format == 0) {
+ Sms3gppTapiEventHandler::NotiSmsIncomMsg(handle, noti_id, data, user_data);
+ } else if (smsDataPackage->format == TAPI_NETTEXT_NETTYPE_3GPP2) {
+ Sms3gpp2TapiEventHandler::NotiSmsIncomMsg(handle, noti_id, data, user_data);
+ } else {
+ MSG_ERR("Invalid sms format: (%d)", smsDataPackage->format);
}
-
- MSG_DEBUG("smscData.pid : %d", smscData.pid);
- } else {
- MSG_DEBUG("PID is not present");
- smscData.pid = MSG_PID_TEXT;
- MSG_DEBUG("MSG_PID_TEXT is inserted to PID");
- }
-
-#if 0
- /*Get the DCS value*/
- if (0x00 == (0x08 & smsParam->ParamIndicator)) {
- smscList.smscData[index].dcs = smsParam->TpDataCodingScheme;
- MSG_DEBUG("dcs : %d", smscList.smscData[index].dcs);
- } else {
- smscList.smscData[index].dcs = MSG_ENCODE_GSM7BIT;
- MSG_DEBUG("DCS is not present");
- }
-#endif
-
- /*Get the ValidityPeriod value*/
- if (0x00 == (0x10 & smsParam->ParamIndicator)) {
- smscData.valPeriod = smsParam->TpValidityPeriod;
- MSG_DEBUG("valPeriod : %d", smscData.valPeriod);
} else {
- smscData.valPeriod = 0;
-
- MSG_DEBUG("Validity Period is not present");
+ Sms3gpp2TapiEventHandler::NotiSmsIncomMsg(handle, noti_id, data, user_data);
}
-
- SmsPluginSetting::instance()->setParamEvent(handle, &smscData, (int)smsParam->RecordIndex, true);
}
-
-void TapiEventSetSmscInfo(TapiHandle *handle, int result, void *data, void *user_data)
+void SmsPluginCallbacks::tapiNotiSmsCbIncomMsg(TapiHandle *handle, const char *noti_id, void *data, void *user_data)
{
- MSG_DEBUG("TapiEventSetSmscInfo is called. result=[%d]", result);
-
- if (result != TAPI_API_SUCCESS)
- SmsPluginSetting::instance()->setResultFromSim(false);
- else
- SmsPluginSetting::instance()->setResultFromSim(true);
-}
-
-
-void TapiEventGetCBConfig(TapiHandle *handle, int result, void *data, void *user_data)
-{
- MSG_DEBUG("TapiEventGetCBConfig is called.");
-
- MSG_CBMSG_OPT_S cbOpt = {0};
-
- int simIndex = SmsPluginDSHandler::instance()->getSimIndex(handle);
-
- if (result != TAPI_API_SUCCESS || data == NULL || simIndex == 0) {
- MSG_ERR("Error. data is NULL. result:0x%x, simIndex:%d", result, simIndex);
-
- SmsPluginSetting::instance()->setCbConfigEvent(handle, NULL, false);
-
- return;
- }
-
- TelSmsCbConfig_t* pCBConfig = (TelSmsCbConfig_t*)data;
-
- cbOpt.bReceive = (bool)pCBConfig->CBEnabled;
+ MSG_WARN("noti_id: (%s)", noti_id);
- cbOpt.maxSimCnt = TAPI_NETTEXT_SMS_CBMI_LIST_SIZE_MAX;
+ MSG_ERR_RET_M(SmsPluginDSHandler::instance()->getHandleType(handle) != SmsPluginDSHandler::HandleType::H_3GPP, "Invalid tapi handle type!");
- cbOpt.simIndex = simIndex;
-
- MSG_DEBUG("Sim Index [%d], Receive [%d], Max SIM Count [%d]", simIndex, cbOpt.bReceive, cbOpt.maxSimCnt);
-
- cbOpt.channelData.channelCnt = pCBConfig->MsgIdRangeCount;
-
- if (cbOpt.channelData.channelCnt > CB_CHANNEL_MAX) {
- MSG_DEBUG("Channel Count [%d] from TAPI is over MAX", cbOpt.channelData.channelCnt);
- cbOpt.channelData.channelCnt = CB_CHANNEL_MAX;
- }
-
- MSG_DEBUG("Channel Count [%d]", cbOpt.channelData.channelCnt);
-
- for (int i = 0; i < cbOpt.channelData.channelCnt; 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 FROM [%d], Channel TO [%d] ", cbOpt.channelData.channelInfo[i].from, cbOpt.channelData.channelInfo[i].to);
- }
-
- SmsPluginSetting::instance()->setCbConfigEvent(handle, &cbOpt, true);
+ Sms3gppTapiEventHandler::NotiSmsCbIncomMsg(handle, noti_id, data, user_data);
}
-void TapiEventSetMailboxInfo(TapiHandle *handle, int result, void *data, void *user_data)
+void SmsPluginCallbacks::tapiNotiSmsEtwsIncomMsg(TapiHandle *handle, const char *noti_id, void *data, void *user_data)
{
- MSG_DEBUG("TapiEventSetMailboxInfo is called. result = [%d]", result);
+ MSG_WARN("noti_id: (%s)", noti_id);
- bool bRet = true;
- bool *bShowError = (bool*)user_data;
+ MSG_ERR_RET_M(SmsPluginDSHandler::instance()->getHandleType(handle) != SmsPluginDSHandler::HandleType::H_3GPP, "Invalid tapi handle type!");
- if (result != TAPI_SIM_ACCESS_SUCCESS && *bShowError == true)
- bRet = false;
-
- SmsPluginSetting::instance()->setResultFromSim(bRet);
+ Sms3gppTapiEventHandler::NotiSmsEtwsIncomMsg(handle, noti_id, data, user_data);
}
-void TapiEventGetMailboxInfo(TapiHandle *handle, int result, void *data, void *user_data)
+void SmsPluginCallbacks::tapiNotiSatSendSms(TapiHandle *handle, const char *noti_id, void *data, void *user_data)
{
- MSG_DEBUG("TapiEventGetMailboxInfo is called. result=[%d]", result);
-
- if (result == TAPI_API_SIM_SERVICE_IS_DISABLED) {
- MSG_INFO("result is TAPI_API_SIM_SERVICE_IS_DISABLED");
- char keyName[MAX_VCONFKEY_NAME_LEN];
- int sim_idx = SmsPluginDSHandler::instance()->getSimIndex(handle);
- char *voiceNum = NULL;
- memset(keyName, 0x00, sizeof(keyName));
- snprintf(keyName, sizeof(keyName), "%s/%d", VOICEMAIL_NUMBER, sim_idx);
- if (MsgSettingGetString(keyName, &voiceNum) != MSG_SUCCESS) {
- MSG_INFO("MsgSettingGetString() is failed");
- }
+ MSG_WARN("noti_id: (%s)", noti_id);
- if (voiceNum && strlen(voiceNum)) {
- MSG_DEBUG("Voice mailbox number exist in vconf");
- SmsPluginSetting::instance()->setMailboxInfoEvent(handle, NULL, true, false);
- free(voiceNum);
- voiceNum = NULL;
- return;
- } else {
- SmsPluginSetting::instance()->setMailboxInfoEvent(handle, NULL, false, false);
- if (voiceNum) {
- free(voiceNum);
- voiceNum = NULL;
- }
- return;
- }
- } else if (result != TAPI_SIM_ACCESS_SUCCESS || data == NULL) {
- MSG_ERR("Error. data is NULL.");
- /*If result is not TAPI_SIM_ACCESS_SUCCESS, set bMbdnEnable to false*/
- SmsPluginSetting::instance()->setMailboxInfoEvent(handle, NULL, false, false);
- return;
- }
-
- TelSimMailboxList_t *list = (TelSimMailboxList_t *)data;
- SMS_SIM_MAILBOX_LIST_S mbList = {0, };
-
- if (list->count <= 0) {
- MSG_INFO("Mailbox list is empty");
- SmsPluginSetting::instance()->setMailboxInfoEvent(handle, NULL, false, true);
- return;
- }
-
- mbList.count = list->count;
-
- for (int i = 0; i < mbList.count; i++) {
- mbList.list[i].b_cphs = list->list[i].b_cphs;
- mbList.list[i].alpha_id_max_len = list->list[i].alpha_id_max_len;
- mbList.list[i].mb_type = list->list[i].mb_type;
- mbList.list[i].profile_num = list->list[i].profile_num;
- mbList.list[i].rec_index = list->list[i].rec_index;
- mbList.list[i].ton = list->list[i].ton;
- mbList.list[i].npi = list->list[i].npi;
- snprintf(mbList.list[i].alpha_id, sizeof(mbList.list[i].alpha_id), "%s", list->list[i].alpha_id);
- snprintf(mbList.list[i].num, sizeof(mbList.list[i].num), "%s", list->list[i].num);
- mbList.list[i].cc_id = list->list[i].cc_id;
- mbList.list[i].ext1_id = list->list[i].ext1_id;
- mbList.list[i].num_len = strlen(mbList.list[i].num);
- }
-
- SmsPluginSetting::instance()->setMailboxInfoEvent(handle, &mbList, true, true);
-}
+ MSG_ERR_RET_M(SmsPluginDSHandler::instance()->getHandleType(handle) != SmsPluginDSHandler::HandleType::H_3GPP, "Invalid tapi handle type!");
-void TapiEventSetMwiInfo(TapiHandle *handle, int result, void *data, void *user_data)
-{
- MSG_DEBUG("TapiEventSetMwiInfo is called. result = [%d]", result);
+ Sms3gppTapiEventHandler::NotiSatSendSms(handle, noti_id, data, user_data);
}
-void TapiEventGetMwiInfo(TapiHandle *handle, int result, void *data, void *user_data)
+void SmsPluginCallbacks::tapiNotiSatMoSmControlResult(TapiHandle *handle, const char *noti_id, void *data, void *user_data)
{
- MSG_DEBUG("TapiEventGetMwiInfo is called.");
-
- if (result != TAPI_SIM_ACCESS_SUCCESS || data == NULL) {
- MSG_ERR("Error. data is NULL. result:0x%x", result);
- SmsPluginSetting::instance()->setMwiInfoEvent(handle, NULL, false);
-
- return;
- }
-
- TelSimMessageWaitingResp_t *MwiInfo = (TelSimMessageWaitingResp_t *)data;
- SMS_SIM_MWI_INFO_S simMwiInfo = {0, };
+ MSG_WARN("noti_id: (%s)", noti_id);
- memcpy(&simMwiInfo, MwiInfo, sizeof(SMS_SIM_MWI_INFO_S));
+ MSG_ERR_RET_M(SmsPluginDSHandler::instance()->getHandleType(handle) != SmsPluginDSHandler::HandleType::H_3GPP, "Invalid tapi handle type!");
- SmsPluginSetting::instance()->setMwiInfoEvent(handle, &simMwiInfo, true);
+ Sms3gppTapiEventHandler::NotiSatMoSmControlResult(handle, noti_id, data, user_data);
}
-void TapiEventGetMsisdnInfo(TapiHandle *handle, int result, void *data, void *user_data)
+void SmsPluginCallbacks::tapiNotiSimStatus(TapiHandle *handle, const char *noti_id, void *data, void *user_data)
{
- MSG_DEBUG("TapiEventGetMsisdnInfo is called.");
-
- bool bRet = false;
- bool bDisableGroupMessage = false;
+ MSG_WARN("noti_id: (%s)", noti_id);
- if (result != TAPI_SIM_ACCESS_SUCCESS || data == NULL) {
- MSG_ERR("Error. data is NULL. result:0x%x", result);
- SmsPluginSetting::instance()->setResultFromSim(bRet);
- return;
- }
-
- TelSimMsisdnList_t *list = (TelSimMsisdnList_t *)data;
-
- for (int i = 0; i < list->count; i++) {
- if (list->list[i].num[0] != '\0') {
- char keyName[MAX_VCONFKEY_NAME_LEN];
- int simIndex = SmsPluginDSHandler::instance()->getSimIndex(handle);
+ MSG_ERR_RET_M(SmsPluginDSHandler::instance()->getHandleType(handle) != SmsPluginDSHandler::HandleType::H_3GPP, "Invalid tapi handle type!");
- memset(keyName, 0x00, sizeof(keyName));
- snprintf(keyName, sizeof(keyName), "%s/%d", MSG_SIM_MSISDN, simIndex);
-
- if (MsgSettingSetString(keyName, list->list[i].num) == MSG_SUCCESS) {
- MSG_SEC_INFO("Get MSISDN from SIM : [%s]", list->list[i].num);
- bRet = true;
- } else {
- MSG_DEBUG("Getting MSISDN is failed!");
- }
- break;
- } else {
- bDisableGroupMessage = true;
- }
- }
-
- int tmpVal = 0;
- if (MsgSettingGetInt(MMS_RECV_GROUP_MESSAGE, &tmpVal) != MSG_SUCCESS)
- MSG_INFO("MsgSettingGetInt() is failed");
-
- /* If the value from MMS_RECV_GROUP_MESSAGE is less than 0, it means group message mode is disabled. */
- if ((tmpVal < 0 && bDisableGroupMessage == false) || (tmpVal > 0 && bDisableGroupMessage == true)) {
- if (MsgSettingSetInt(MMS_RECV_GROUP_MESSAGE, -tmpVal))
- MSG_ERR("Error to set config data [%s]", MMS_RECV_GROUP_MESSAGE);
- }
-
- SmsPluginSetting::instance()->setResultFromSim(bRet);
+ Sms3gppTapiEventHandler::NotiSimStatus(handle, noti_id, data, user_data);
}
-void TapiEventGetSimServiceTable(TapiHandle *handle, int result, void *data, void *user_data)
+void SmsPluginCallbacks::tapiNotiSimRefreshed(TapiHandle *handle, const char *noti_id, void *data, void *user_data)
{
- MSG_DEBUG("TapiEventGetSimServiceTable is called.");
-
- TelSimAccessResult_t access_rt = (TelSimAccessResult_t)result;
- TelSimServiceTable_t *svct = (TelSimServiceTable_t *)data;
-
- bool bRet = true;
-
- if (access_rt != TAPI_SIM_ACCESS_SUCCESS || svct == NULL) {
- MSG_ERR("Error. data is NULL and access_rt [%d] failed", access_rt);
- SmsPluginSetting::instance()->setResultFromSim(false);
- return;
- }
-
- msg_error_t err = MSG_SUCCESS;
-
- char sstKey[128];
- char moCtrlKey[128];
-
- int simIndex = SmsPluginDSHandler::instance()->getSimIndex(handle);
-
- memset(sstKey, 0x00, sizeof(sstKey));
- snprintf(sstKey, sizeof(sstKey), "%s/%d", MSG_SIM_SERVICE_TABLE, simIndex);
-
- memset(moCtrlKey, 0x00, sizeof(moCtrlKey));
- snprintf(moCtrlKey, sizeof(moCtrlKey), "%s/%d", MSG_SIM_MO_CONTROL, simIndex);
-
- if (svct->sim_type == TAPI_SIM_CARD_TYPE_GSM) {
- if (svct->table.sst.service[TAPI_SIM_SST_SMS] == 1) {
- err = MsgSettingSetBool(sstKey, true);
- } else {
- err = MsgSettingSetBool(sstKey, false);
- }
- MSG_DEBUG("Setting result = [%d]", err);
-
- if (svct->table.sst.service[TAPI_SIM_SST_MO_SMS_CTRL_BY_SIM] == 1) {
- err = MsgSettingSetBool(moCtrlKey, true);
- } else {
- err = MsgSettingSetBool(moCtrlKey, false);
- }
- MSG_DEBUG("Setting result = [%d]", err);
-
- } else if (svct->sim_type == TAPI_SIM_CARD_TYPE_USIM) {
- if (svct->table.ust.service[TAPI_SIM_UST_SMS] == 1) {
- err = MsgSettingSetBool(sstKey, true);
- } else {
- err = MsgSettingSetBool(sstKey, false);
- }
- MSG_DEBUG("Setting result = [%d]", err);
-
- if (svct->table.ust.service[TAPI_SIM_UST_MO_SMS_CTRL] == 1) {
- err = MsgSettingSetBool(moCtrlKey, true);
- } else {
- err = MsgSettingSetBool(moCtrlKey, false);
- }
- MSG_DEBUG("Setting result = [%d]", err);
+ MSG_WARN("noti_id: (%s)", noti_id);
+ if (SmsPluginDSHandler::instance()->getHandleType(handle) == SmsPluginDSHandler::HandleType::H_3GPP) {
+ Sms3gppTapiEventHandler::NotiSimRefreshed(handle, noti_id, data, user_data);
} else {
- MSG_DEBUG("Unknown SIM type value");
- }
-
- SmsPluginSetting::instance()->setResultFromSim(bRet);
-}
-
-void TapiEventSatSmsRefresh(TapiHandle *handle, int result, void *data, void *user_data)
-{
- MSG_DEBUG("TapiEventSatSmsRefresh is called.");
-
- if (result != TAPI_API_SUCCESS || data == NULL) {
- MSG_ERR("Error. data is NULL. result:0x%x", result);
- return;
- }
-
- try {
- SmsPluginSatHandler::instance()->refreshSms(handle, data);
- } catch (MsgException& e) {
- MSG_FATAL("%s", e.what());
- return;
+ Sms3gpp2TapiEventHandler::NotiSimRefreshed(handle, noti_id, data, user_data);
}
}
-
-void TapiEventSatSendSms(TapiHandle *handle, const char *noti_id, void *data, void *user_data)
-{
- MSG_DEBUG("TapiEventSatSendSms is called.");
-
- if (data == NULL) {
- MSG_ERR("Error. data is NULL.");
- return;
- }
-
- try {
- SmsPluginSatHandler::instance()->sendSms(handle, data);
- } catch (MsgException& e) {
- MSG_FATAL("%s", e.what());
- return;
- }
-}
-
-
-void TapiEventSatMoSmsCtrl(TapiHandle *handle, const char *noti_id, void *data, void *user_data)
+void SmsPluginCallbacks::tapiNotiSmsDeviceReady(TapiHandle *handle, const char *noti_id, void *data, void *user_data)
{
- MSG_DEBUG("TapiEventSatMoSmsCtrl is called.");
+ MSG_WARN("noti_id: (%s)", noti_id);
- if (data == NULL) {
- MSG_ERR("Error. data is NULL.");
- return;
- }
-
- try {
- SmsPluginSatHandler::instance()->ctrlSms(handle, data);
- } catch (MsgException& e) {
- MSG_FATAL("%s", e.what());
- return;
- }
-}
-
-void TapiEventMemoryStatus(TapiHandle *handle, int result, void *data, void *user_data)
-{
- MSG_DEBUG("Tapi result is [%d]", result);
- if (result == TAPI_API_SUCCESS)
- isMemAvailable = true;
-}
-
-void TapiEventSetMsgStatus(TapiHandle *handle, int result, void *data, void *user_data)
-{
- MSG_DEBUG("TapiEventSetMsgStatus is called. result [%d]", result);
-
- if (result != TAPI_API_SUCCESS || data == NULL) {
- MSG_ERR("Error. data is NULL. result:0x%x", result);
- SmsPluginSimMsg::instance()->setSimEvent((msg_sim_id_t)0, false);
- return;
- }
-
- msg_sim_id_t sim_id = *((msg_sim_id_t *)user_data);
-
- SmsPluginSimMsg::instance()->setSimEvent(sim_id, true);
-}
-
-
-void TapiEventGetMeImei(TapiHandle *handle, int result, void *data, void *user_data)
-{
- MSG_SEC_DEBUG("TapiEventGetMeImei is called. result [%d]", result);
-
- if (result != TAPI_API_SUCCESS || data == NULL) {
- MSG_ERR("Error. data is NULL. result:0x%x", result);
- SmsPluginSetting::instance()->setResultImei(false, NULL);
- return;
+ if (SmsPluginDSHandler::instance()->getHandleType(handle) == SmsPluginDSHandler::HandleType::H_3GPP) {
+ Sms3gppTapiEventHandler::NotiSmsDeviceReady(handle, noti_id, data, user_data);
+ } else {
+ Sms3gpp2TapiEventHandler::NotiSmsDeviceReady(handle, noti_id, data, user_data);
}
-
- char *tmpImei = (char *)data;
-
- SmsPluginSetting::instance()->setResultImei(true, tmpImei);
}
-
-void TapiEventSimStatusChange(TapiHandle *handle, const char *noti_id, void *data, void *user_data)
+void SmsPluginCallbacks::tapiNotiNetworkRegistrationStatus(TapiHandle *handle, const char *noti_id, void *data, void *user_data)
{
- MSG_DEBUG("TapiEventSimStatusChange is called.");
+ MSG_WARN("noti_id: (%s)", noti_id);
- if (data == NULL) {
- MSG_ERR("Error. data is NULL.");
- return;
+ if (SmsPluginDSHandler::instance()->getHandleType(handle) == SmsPluginDSHandler::HandleType::H_3GPP) {
+ Sms3gppTapiEventHandler::NotiNetworkRegistrationType(handle, noti_id, data, user_data);
+ } else {
+ Sms3gpp2TapiEventHandler::NotiNetworkRegistrationType(handle, noti_id, data, user_data);
}
-
- int status = *(int *)data;
-
- MSG_DEBUG("SIM Status [%d]", status);
-
- if (status == TAPI_SIM_STATUS_SIM_INIT_COMPLETED) {
- MSG_INFO("SIM Initialize by sim status change callback");
- SmsPluginSetting::instance()->setSimChangeStatus(handle, false);
- }
}
-void TapiEventNetworkStatusChange(TapiHandle *handle, const char *noti_id, void *data, void *user_data)
+void SmsPluginCallbacks::tapiNotiSmsMemoryStatus(TapiHandle *handle, const char *noti_id, void *data, void *user_data)
{
- MSG_DEBUG("TapiEventNetworkStatusChange is called.");
+ MSG_WARN("noti_id: (%s)", noti_id);
- if (data == NULL) {
- MSG_ERR("Error. data is NULL.");
- return;
- }
-
- TelNetworkServiceType_t *type = (TelNetworkServiceType_t *)data;
-
- MSG_INFO("network status type [%d]", *type);
+ MSG_ERR_RET_M(SmsPluginDSHandler::instance()->getHandleType(handle) != SmsPluginDSHandler::HandleType::H_3GPP, "Invalid tapi handle type!");
- if (*type > TAPI_NETWORK_SERVICE_TYPE_SEARCH) {
- /* Call Event Handler */
- SmsPluginEventHandler::instance()->handleResendMessage();
- }
+ Sms3gppTapiEventHandler::NotiSmsMemoryStatus(handle, noti_id, data, user_data);
}
-void TapiEventSimRefreshed(TapiHandle *handle, const char *noti_id, void *data, void *user_data)
+void SmsPluginCallbacks::vconfDnetStateChanged(keynode_t *key, void* data)
{
- MSG_DEBUG("TapiEventSimRefreshed is called.");
-
- SmsPluginSetting::instance()->SimRefreshCb(handle);
-}
-
-/*==================================================================================================
- IMPLEMENTATION OF SmsPluginCallback - Member Functions
-==================================================================================================*/
-SmsPluginCallback* SmsPluginCallback::pInstance = NULL;
-
-
-SmsPluginCallback::SmsPluginCallback()
-{
-}
-
-
-SmsPluginCallback::~SmsPluginCallback()
-{
- if (pInstance != NULL) {
- delete pInstance;
- pInstance = NULL;
+ int dnet_state = 0;
+ if (MsgSettingGetInt(VCONFKEY_DNET_STATE, &dnet_state) != MSG_SUCCESS) {
+ MSG_ERR("MsgSettingGetInt() failed!");
}
-}
-
-
-SmsPluginCallback* SmsPluginCallback::instance()
-{
- if (!pInstance)
- pInstance = new SmsPluginCallback();
-
- return pInstance;
-}
-
-void SmsPluginCallback::registerEvent()
-{
- TapiHandle *pTapiHandle;
-
- int count = SmsPluginDSHandler::instance()->getTelHandleCount();
-
- for (int i = 1; i <= count; ++i) {
- pTapiHandle = SmsPluginDSHandler::instance()->getTelHandle(i);
-/* int simIndex = SmsPluginDSHandler::instance()->getSimIndex(pTapiHandle); */
-
- if (tel_register_noti_event(pTapiHandle, TAPI_NOTI_SMS_DEVICE_READY, TapiEventDeviceReady, NULL) != TAPI_API_SUCCESS)
- MSG_DEBUG("tel_register_noti_event is failed : [%s]", TAPI_NOTI_SMS_DEVICE_READY);
- if (tel_register_noti_event(pTapiHandle, TAPI_NOTI_SMS_INCOM_MSG, TapiEventMsgIncoming, NULL) != TAPI_API_SUCCESS)
- MSG_DEBUG("tel_register_noti_event is failed : [%s]", TAPI_NOTI_SMS_INCOM_MSG);
- if (tel_register_noti_event(pTapiHandle, TAPI_NOTI_SMS_CB_INCOM_MSG, TapiEventCbMsgIncoming, NULL) != TAPI_API_SUCCESS)
- MSG_DEBUG("tel_register_noti_event is failed : [%s]", TAPI_NOTI_SMS_CB_INCOM_MSG);
- if (tel_register_noti_event(pTapiHandle, TAPI_NOTI_SMS_ETWS_INCOM_MSG, TapiEventEtwsMsgIncoming, NULL) != TAPI_API_SUCCESS)
- MSG_DEBUG("tel_register_noti_event is failed : [%s]", TAPI_NOTI_SMS_ETWS_INCOM_MSG);
- if (tel_register_noti_event(pTapiHandle, TAPI_NOTI_SAT_SEND_SMS, TapiEventSatSendSms, NULL) != TAPI_API_SUCCESS)
- MSG_DEBUG("tel_register_noti_event is failed : [%s]", TAPI_NOTI_SAT_SEND_SMS);
- if (tel_register_noti_event(pTapiHandle, TAPI_NOTI_SAT_MO_SM_CONTROL_RESULT, TapiEventSatMoSmsCtrl, NULL) != TAPI_API_SUCCESS)
- MSG_DEBUG("tel_register_noti_event is failed : [%s]", TAPI_NOTI_SAT_MO_SM_CONTROL_RESULT);
- if (tel_register_noti_event(pTapiHandle, TAPI_NOTI_SIM_STATUS, TapiEventSimStatusChange, NULL) != TAPI_API_SUCCESS)
- MSG_DEBUG("tel_register_noti_event is failed : [%s]", TAPI_NOTI_SIM_STATUS);
- if (tel_register_noti_event(pTapiHandle, TAPI_PROP_NETWORK_SERVICE_TYPE, TapiEventNetworkStatusChange, NULL) != TAPI_API_SUCCESS)
- MSG_DEBUG("tel_register_noti_event is failed : [%s]", TAPI_PROP_NETWORK_SERVICE_TYPE);
- if (tel_register_noti_event(pTapiHandle, TAPI_NOTI_SIM_REFRESHED, TapiEventSimRefreshed, NULL) != TAPI_API_SUCCESS)
- MSG_DEBUG("tel_register_noti_event is failed : [%s]", TAPI_NOTI_SIM_REFRESHED);
-/* if (tel_register_noti_event(pTapiHandle, TAPI_NOTI_SAT_REFRESH, TapiEventSatSmsRefresh, NULL) != TAPI_API_SUCCESS) */
-/* MSG_DEBUG("tel_register_noti_event is failed : [%s]", TAPI_NOTI_SAT_REFRESH); */
-/* if (tel_register_noti_event(pTapiHandle, TAPI_NOTI_SAT_MO_SMS_CTRL, TapiEventSatMoSmsCtrl, NULL) != TAPI_API_SUCCESS) */
-/* MSG_DEBUG("tel_register_noti_event is failed : [%s]", TAPI_NOTI_SAT_MO_SMS_CTRL); */
+ if (dnet_state > VCONFKEY_DNET_OFF) {
+ Sms3gppEventHandler::instance()->handleResendMessage();
}
}
-
-
-void SmsPluginCallback::deRegisterEvent()
-{
-}
-
* limitations under the License.
*/
-#include <errno.h>
+#include <utility>
+#include <telephony_common.h>
+#include <telephony_sim.h>
+#include <ITapiNetwork.h>
+#include <ITapiSim.h>
+#include <TelSms.h>
+
#include "MsgDebug.h"
#include "MsgException.h"
-#include "SmsPluginDSHandler.h"
#include "MsgGconfWrapper.h"
+#include "MsgUtilFunction.h"
-extern "C" {
- #include <tapi_common.h>
- #include <TelNetwork.h>
- #include <ITapiNetwork.h>
- #include <ITapiSim.h>
- #include <telephony_common.h>
- #include <telephony_sim.h>
-}
+#include "SmsPluginDSHandler.h"
/*==================================================================================================
- IMPLEMENTATION OF SmsPluginCbMsgHandler - Member Functions
+ Variables
==================================================================================================*/
SmsPluginDSHandler* SmsPluginDSHandler::pInstance = NULL;
-
-SmsPluginDSHandler::SmsPluginDSHandler()
-{
- cp_list = NULL;
- memset(&handle_list, 0x00, sizeof(handle_list));
-}
-
-
-SmsPluginDSHandler::~SmsPluginDSHandler()
-{
-}
-
-
+/*==================================================================================================
+ Methods of SmsPluginDSHandler
+==================================================================================================*/
SmsPluginDSHandler* SmsPluginDSHandler::instance()
{
- if (!pInstance)
+ if (!pInstance) {
pInstance = new SmsPluginDSHandler();
+ }
return pInstance;
}
int SmsPluginDSHandler::initTelHandle()
{
- int cnt = 0;
- cp_list = tel_get_cp_name_list();
+ HandleType type = (MsgCheckFeatureSupport(MSG_TELEPHONY_CDMA_FEATURE) == false) ? HandleType::H_3GPP : HandleType::H_3GPP2;
- if (!cp_list) {
- MSG_FATAL("tel_get_cp_name_list returns null");
- goto FINISH;
- }
+ char **cpNameList = tel_get_cp_name_list();
+ MSG_ERR_RET_VM(!cpNameList, 0, "tel_get_cp_name_list() returns null!");
- while (cp_list[cnt] && cnt < MAX_TELEPHONY_HANDLE_CNT) {
- MSG_SEC_INFO("cp_list[%d]:[%s]", cnt, cp_list[cnt]);
- handle_list.handle[cnt]= tel_init(cp_list[cnt]);
+ int cnt = 0;
+ while (cpNameList[cnt] && cnt < MAX_TELEPHONY_HANDLE_CNT) {
+ MSG_SEC_INFO("cpNameList[%d]: (%s)", cnt, cpNameList[cnt]);
+ TapiHandle *handle = tel_init(cpNameList[cnt]);
+ tapiHandles.push_back(std::pair<TapiHandle *, HandleType>(handle, type));
cnt++;
- }
- g_strfreev(cp_list);
+ int smsFormat = 0x03;
+ //in SR Tapi side, TAPI_PROP_SMS_FORMAT is not defined.
+ //So setting the SMS format from MEssage Service side.
+ //Will change the below comments after discussing with HQ Team.
+ /*int tRet = tel_get_property_int(handle, TAPI_PROP_SMS_FORMAT, &smsFormat);
+ if (tRet != TAPI_API_SUCCESS) {
+ MSG_ERR("tel_get_property_int() failed (%d)", tRet);
+ //0x03 means Default SMS format - real format should be determined by msg-service side
+ smsFormat = 0x03;
+ }*/
+
+ setSmsFormat(handle, smsFormat);
+ }
+ g_strfreev(cpNameList);
-FINISH:
- handle_list.count = cnt;
return cnt;
}
void SmsPluginDSHandler::deinitTelHandle()
{
- int ret = 0;
+ int tRet = 0;
- for (int i = 0; i < handle_list.count; i++) {
- ret = tel_deinit(handle_list.handle[i]);
- MSG_DEBUG("tel_deinit ret=[%d]", ret);
- handle_list.handle[i] = NULL;
+ for (const std::pair<TapiHandle *, HandleType> &handleInfo : tapiHandles) {
+ tRet = tel_deinit(handleInfo.first);
+ MSG_WARN_M(tRet != TAPI_API_SUCCESS, "tel_deinit() failed: (%d)", tRet);
}
-
- handle_list.count = 0;
- cp_list = NULL;
-
- return;
+ tapiHandles.clear();
}
-TapiHandle *SmsPluginDSHandler::getTelHandle(int sim_idx)
+TapiHandle *SmsPluginDSHandler::getTelHandle(int simIndex)
{
- if (sim_idx > 0 && sim_idx < MAX_TELEPHONY_HANDLE_CNT) {
- return handle_list.handle[sim_idx-1];
- } else {
- int SIM_Status = 0;
- if (MsgSettingGetInt(VCONFKEY_TELEPHONY_SIM_SLOT, &SIM_Status) != MSG_SUCCESS) {
- MSG_INFO("MsgSettingGetInt() is failed");
- }
- if (SIM_Status == 1) {
- return handle_list.handle[0];
+ if (tapiHandles.size() > 0) {
+ if (simIndex > 0 && simIndex <= static_cast<int>(tapiHandles.size())) {
+ return tapiHandles[simIndex - 1].first;
+ } else {
+ int simStatus = 0;
+ if (MsgSettingGetInt(VCONFKEY_TELEPHONY_SIM_SLOT, &simStatus) != MSG_SUCCESS) {
+ MSG_INFO("MsgSettingGetInt() failed!");
+ }
+
+ if (simStatus == 1) {
+ return tapiHandles[0].first;
+ }
+
+ if (MsgSettingGetInt(VCONFKEY_TELEPHONY_SIM_SLOT2, &simStatus) != MSG_SUCCESS) {
+ MSG_INFO("MsgSettingGetInt() failed!");
+ }
+
+ if (simStatus == 1) {
+ return tapiHandles[1].first;
+ }
}
- if (MsgSettingGetInt(VCONFKEY_TELEPHONY_SIM_SLOT2, &SIM_Status) != MSG_SUCCESS) {
- MSG_INFO("MsgSettingGetInt() is failed");
- }
- if (SIM_Status == 1) {
- return handle_list.handle[1];
- }
+ return tapiHandles[tapiHandles.size() - 1].first;
+ } else {
+ MSG_ERR("Error tapiHandles.size [%d]", tapiHandles.size());
+ return NULL;
}
-
- return handle_list.handle[handle_list.count - 1];
}
int SmsPluginDSHandler::getSimIndex(TapiHandle *handle)
{
- for (int index = 0; index < handle_list.count; ++index) {
- if (handle_list.handle[index] == handle)
- return index+1;
+ for (unsigned int index = 0; index < tapiHandles.size(); index++) {
+ if (tapiHandles[index].first == handle) {
+ return index + 1;
+ }
}
+
return 0;
}
+int SmsPluginDSHandler::getTelHandleCount()
+{
+ return tapiHandles.size();
+}
-void SmsPluginDSHandler::getDefaultNetworkSimId(int *simId)
+int SmsPluginDSHandler::getActiveSimCount()
{
- TelNetworkDefaultDataSubs_t defaultSimId = TAPI_NETWORK_DEFAULT_DATA_SUBS_UNKNOWN;
+ int activeSimCount = 0;
+ int simStatus = VCONFKEY_TELEPHONY_SIM_UNKNOWN;
+
+ if (MsgSettingGetInt(VCONFKEY_TELEPHONY_SIM_SLOT, &simStatus) != MSG_SUCCESS) {
+ MSG_INFO("MsgSettingGetInt() failed!");
+ }
- int tapi_ret = TAPI_API_SUCCESS;
+ if (simStatus == VCONFKEY_TELEPHONY_SIM_INSERTED)
+ activeSimCount++;
- if (handle_list.count == 1) {
- *simId = 1;
- return;
+ if (MsgSettingGetInt(VCONFKEY_TELEPHONY_SIM_SLOT2, &simStatus) != MSG_SUCCESS) {
+ MSG_INFO("MsgSettingGetInt() failed!");
}
- tapi_ret = tel_get_network_default_data_subscription(handle_list.handle[0], &defaultSimId);
+ if (simStatus == VCONFKEY_TELEPHONY_SIM_INSERTED)
+ activeSimCount++;
- MSG_INFO("Default network subscription = [SIM %d]", (int)defaultSimId+1);
+ MSG_DEBUG("active sim count: (%d)", activeSimCount);
- if (tapi_ret != TAPI_API_SUCCESS) {
- *simId = 0;
- THROW(MsgException::SMS_PLG_ERROR, "######## tel_get_network_default_data_subscription Fail !!! return : %d #######", tapi_ret);
- } else {
- *simId = (int)defaultSimId + 1;
- }
+ return activeSimCount;
}
-int SmsPluginDSHandler::getTelHandleCount()
+void SmsPluginDSHandler::getDefaultNetworkSimId(int *simIndex)
{
- return handle_list.count;
+ if (tapiHandles.size() == 1) {
+ *simIndex = 1;
+ return;
+ }
+
+ *simIndex = 0;
+
+ TelNetworkDefaultDataSubs_t defaultSimIndex = TAPI_NETWORK_DEFAULT_DATA_SUBS_UNKNOWN;
+ int tRet = tel_get_network_default_data_subscription(tapiHandles[0].first, &defaultSimIndex);
+
+ MSG_INFO("Default network subscription = [SIM %d]", (int)defaultSimIndex + 1);
+
+ if (tRet != TAPI_API_SUCCESS) {
+ THROW(MsgException::SMS_PLG_ERROR, "######## tel_get_network_default_data_subscription Fail !!! return : %d #######", tRet);
+ } else {
+ if (defaultSimIndex == TAPI_NETWORK_DEFAULT_DATA_SUBS_SIM1) {
+ *simIndex = 1;
+ } else if (defaultSimIndex == TAPI_NETWORK_DEFAULT_DATA_SUBS_SIM2) {
+ *simIndex = 2;
+ }
+ }
}
-int SmsPluginDSHandler::getActiveSimCount()
+msg_error_t SmsPluginDSHandler::getSubscriberId(int simIndex, char **subscriber_id)
{
- int active_count = 0;
- int sim_status = VCONFKEY_TELEPHONY_SIM_UNKNOWN;
+ MSG_ERR_RET_VM(simIndex <= 0 || simIndex > static_cast<int>(tapiHandles.size()), MSG_ERR_INVALID_PARAMETER, "Invalid parameter: simIndex: (%d)", simIndex);
- if (MsgSettingGetInt(VCONFKEY_TELEPHONY_SIM_SLOT, &sim_status) != MSG_SUCCESS) {
- MSG_INFO("MsgSettingGetInt() is failed");
- }
- MSG_DEBUG("sim1 status : %d", sim_status);
- if (sim_status == VCONFKEY_TELEPHONY_SIM_INSERTED)
- active_count++;
+ telephony_handle_list_s capi_tel_handle_list;
- sim_status = VCONFKEY_TELEPHONY_SIM_UNKNOWN;
- if (MsgSettingGetInt(VCONFKEY_TELEPHONY_SIM_SLOT2, &sim_status) != MSG_SUCCESS) {
- MSG_INFO("MsgSettingGetInt() is failed");
- }
- MSG_DEBUG("sim2 status : %d", sim_status);
- if (sim_status == VCONFKEY_TELEPHONY_SIM_INSERTED)
- active_count++;
+ int tRet = telephony_init(&capi_tel_handle_list);
+ MSG_ERR_RET_VM(tRet != TELEPHONY_ERROR_NONE, MSG_ERR_PLUGIN_TAPIINIT, "telephony_init() failed: (%d)", tRet);
- MSG_DEBUG("active sim count : %d", active_count);
+ tRet = telephony_sim_get_subscriber_id(capi_tel_handle_list.handle[simIndex - 1], subscriber_id);
+ MSG_WARN_M(tRet != TELEPHONY_ERROR_NONE, "telephony_sim_get_subscriber_id() failed: (%d)", tRet);
- return active_count;
-}
+ MSG_DEBUG("Subscriber ID is [%s]", *subscriber_id);
+ tRet = telephony_deinit(&capi_tel_handle_list);
+ MSG_WARN_M(tRet != TELEPHONY_ERROR_NONE, "telephony_deinit() failed: (%d)", tRet);
-int SmsPluginDSHandler::getSubscriberId(unsigned int simIndex, char **subscriber_id)
-{
- if (simIndex <= 0 || simIndex > (unsigned int)handle_list.count) {
- MSG_DEBUG("Invalid SIM index");
- return MSG_ERR_INVALID_PARAMETER;
- }
+ return MSG_SUCCESS;
+}
- int tel_ret = TELEPHONY_ERROR_NONE;
- telephony_handle_list_s capi_tel_handle_list;
+int SmsPluginDSHandler::getSmsFormat(TapiHandle *handle)
+{
+ return smsFormatInfo[handle];
+}
- tel_ret = telephony_init(&capi_tel_handle_list);
- if (tel_ret != TELEPHONY_ERROR_NONE) {
- MSG_DEBUG("Initialize failed!!!");
- return MSG_ERR_PLUGIN_TAPIINIT;
+void SmsPluginDSHandler::setSmsFormat(TapiHandle *handle, int smsFormat)
+{
+ MSG_INFO("Sms format: (%d)", smsFormat);
+
+ /* SMS Format
+ * 3gpp : TAPI_NETTEXT_NETTYPE_3GPP
+ * 3gpp2 : TAPI_NETTEXT_NETTYPE_3GPP2
+ * default : Default SMS format - real format should be determined by msg-service side
+ */
+
+ if (smsFormat == TAPI_NETTEXT_NETTYPE_3GPP || smsFormat == TAPI_NETTEXT_NETTYPE_3GPP2) {
+ smsFormatInfo[handle] = smsFormat;
+ } else if (smsFormat == 0x03) {
+ if (getHandleType(handle) == HandleType::H_3GPP) {
+ smsFormatInfo[handle] = TAPI_NETTEXT_NETTYPE_3GPP;
+ } else {
+ smsFormatInfo[handle] = TAPI_NETTEXT_NETTYPE_3GPP2;
+ }
+ } else {
+ MSG_ERR("Invalid sms format: (%d) - set as default!", smsFormat);
+ smsFormatInfo[handle] = TAPI_NETTEXT_NETTYPE_3GPP;
}
+}
- tel_ret = telephony_sim_get_subscriber_id(capi_tel_handle_list.handle[simIndex-1], subscriber_id);
- if (tel_ret != TELEPHONY_ERROR_NONE) {
- MSG_DEBUG("telephony_sim_get_subscriber_id() failed!!! [%d]", tel_ret);
+bool SmsPluginDSHandler::getNeedToInitializeSim(TapiHandle *handle)
+{
+ auto search = _needToInitializeSim.find(handle);
+ if (search != _needToInitializeSim.end()) {
+ return search->second;
} else {
- MSG_DEBUG("Subscriber ID is [%s]", *subscriber_id);
+ return false;
}
+}
- tel_ret = telephony_deinit(&capi_tel_handle_list);
- if (tel_ret != TELEPHONY_ERROR_NONE) {
- MSG_DEBUG("Deinitialize failed!!!");
- }
+void SmsPluginDSHandler::setNeedToInitializeSim(TapiHandle *handle, bool needToInitialize)
+{
+ _needToInitializeSim[handle] = needToInitialize;
+}
- return MSG_SUCCESS;
+SmsPluginDSHandler::HandleType SmsPluginDSHandler::getHandleType(TapiHandle *handle)
+{
+ for (const std::pair<TapiHandle *, HandleType> &handleInfo : tapiHandles) {
+ if (handleInfo.first == handle) {
+ return handleInfo.second;
+ }
+ }
+ return SmsPluginDSHandler::HandleType::H_3GPP;
}
* limitations under the License.
*/
-#include <errno.h>
+#include <glib.h>
+#include <gio/gio.h>
+#include <tapi_common.h>
+#include <ITapiNetText.h>
+#include <TelSms.h>
+#include <tzplatform_config.h>
#include "MsgDebug.h"
#include "MsgException.h"
#include "MsgGconfWrapper.h"
+#include "MsgPluginInterface.h"
-#include "MsgMutex.h"
-#include "SmsPluginTransport.h"
-#include "SmsPluginSimMsg.h"
-#include "SmsPluginStorage.h"
-#include "SmsPluginSetting.h"
-#include "SmsPluginCallback.h"
-#include "SmsPluginEventHandler.h"
-#include "SmsPluginUAManager.h"
#include "SmsPluginMain.h"
#include "SmsPluginDSHandler.h"
-#include <gio/gio.h>
-#include <tzplatform_config.h>
-
-
-extern "C" {
- #include <tapi_common.h>
- #include <TelSms.h>
- #include <TapiUtility.h>
- #include <ITapiSim.h>
- #include <ITapiNetText.h>
-}
+#include "SmsPluginCallback.h"
+#include "SmsPluginStorage.h"
+#include "Sms3gppEventHandler.h"
+#include "Sms3gppSetting.h"
+#include "Sms3gppSimMsg.h"
+#include "Sms3gppStorage.h"
+#include "Sms3gppTapiEventHandler.h"
+#include "Sms3gppTransport.h"
+#include "Sms3gpp2EventHandler.h"
+#include "Sms3gpp2Setting.h"
+#include "Sms3gpp2TapiEventHandler.h"
+#include "Sms3gpp2Transport.h"
#define BUS_NAME "org.tizen.system.storage"
#define PATH_NAME "/Org/Tizen/System/Storage/Lowmem"
#define MEMBER_NAME "NeedCleanup"
#define SIGNAL_VAL "Full"
-
+gint subs_id = 0;
GDBusConnection *gdbus_conn = NULL;
GDBusProxy *gdbus_proxy = NULL;
-gint subs_id = 0;
-
-bool isMemAvailable = true;
-
-MsgMutex mx;
-MsgCndVar cv;
-
-void MsgResourceMonitorInit(void);
-void MsgResourceMonitorDeinit(void);
+static void MsgResourceMonitorInit(void);
+static void MsgResourceMonitorDeinit(void);
/*==================================================================================================
FUNCTION IMPLEMENTATION
==================================================================================================*/
-
-msg_error_t MsgPlgCreateHandle(MSG_PLUGIN_HANDLER_S *pPluginHandle)
+EXPORT_API msg_error_t MsgPlgCreateHandle(MSG_PLUGIN_HANDLER_S *pPluginHandle)
{
- if (pPluginHandle == NULL) {
- MSG_DEBUG("SMS plugin: create handler error ");
- return MSG_ERR_NULL_POINTER;
- } else {
- pPluginHandle->pfInitialize = SmsPlgInitialize;
- pPluginHandle->pfFinalize = SmsPlgFinalize;
- pPluginHandle->pfRegisterListener = SmsPlgRegisterListener;
- pPluginHandle->pfSubmitRequest = SmsPlgSubmitRequest;
- pPluginHandle->pfSaveSimMessage = SmsPlgSaveSimMessage;
- pPluginHandle->pfDeleteSimMessage = SmsPlgDeleteSimMessage;
- pPluginHandle->pfSetReadStatus = SmsPlgSetReadStatus;
- pPluginHandle->pfSetMemoryStatus = SmsPlgSetMemoryStatus;
- pPluginHandle->pfSetConfigData = SmsPlgSetConfigData;
- pPluginHandle->pfGetConfigData = SmsPlgGetConfigData;
- pPluginHandle->pfAddMessage = SmsPlgAddMessage;
- pPluginHandle->pfGetDefaultNetworkSimId = SmsPlgGetDefaultNetworkSimId;
-
- MSG_DEBUG("SMS plugin: create handler OK");
- MSG_DEBUG("SMS plugin %p", pPluginHandle);
- }
+ MSG_ERR_RET_VM(pPluginHandle == NULL, MSG_ERR_NULL_POINTER, "Invalid parameter: pPluginHandle is null!");
+
+ pPluginHandle->pfInitialize = SmsPlgInitialize;
+ pPluginHandle->pfFinalize = SmsPlgFinalize;
+ pPluginHandle->pfRegisterListener = SmsPlgRegisterListener;
+ pPluginHandle->pfSubmitRequest = SmsPlgSubmitRequest;
+ pPluginHandle->pfSaveSimMessage = SmsPlgSaveSimMessage;
+ pPluginHandle->pfDeleteSimMessage = SmsPlgDeleteSimMessage;
+ pPluginHandle->pfSetReadStatus = SmsPlgSetReadStatus;
+ pPluginHandle->pfSetMemoryStatus = SmsPlgSetMemoryStatus;
+ pPluginHandle->pfSetConfigData = SmsPlgSetConfigData;
+ pPluginHandle->pfGetConfigData = SmsPlgGetConfigData;
+ pPluginHandle->pfAddMessage = SmsPlgAddMessage;
+ pPluginHandle->pfGetDefaultNetworkSimId = SmsPlgGetDefaultNetworkSimId;
+
+ MSG_DEBUG("SMS plugin: create handler OK");
return MSG_SUCCESS;
}
-
-msg_error_t MsgPlgDestroyHandle(MSG_PLUGIN_HANDLER_S *pPluginHandle)
+EXPORT_API msg_error_t MsgPlgDestroyHandle(MSG_PLUGIN_HANDLER_S *pPluginHandle)
{
if (pPluginHandle != NULL) {
free(pPluginHandle);
return MSG_SUCCESS;
}
-
msg_error_t SmsPlgInitialize()
{
MSG_BEGIN();
- bool bReady = false;
+ bool isTelephonyReady = false;
for (int i = 0; i < 100; i++) {
- if (MsgSettingGetBool(VCONFKEY_TELEPHONY_READY, &bReady) != MSG_SUCCESS)
+ if (MsgSettingGetBool(VCONFKEY_TELEPHONY_READY, &isTelephonyReady) != MSG_SUCCESS) {
MSG_INFO("MsgSettingGetBool() is failed");
+ }
- MSG_DEBUG("Get VCONFKEY_TELEPHONY_READY [%d].", bReady ? 1 : 0);
+ MSG_DEBUG("VCONFKEY_TELEPHONY_READY: (%d)", isTelephonyReady);
- if (bReady)
+ if (isTelephonyReady) {
break;
-
+ }
sleep(1);
}
+ MSG_ERR_RET_VM(!isTelephonyReady, MSG_ERR_PLUGIN_TAPIINIT, "Failed to wait telephony init complete!");
- if (!bReady) {
- MSG_ERR("Fail to wait telephony init complete.");
- return MSG_ERR_PLUGIN_TAPIINIT;
- }
-
- int simCnt = 0;
- char keyName[MAX_VCONFKEY_NAME_LEN];
-
- SmsPluginDSHandler::instance()->initTelHandle();
- simCnt = SmsPluginDSHandler::instance()->getTelHandleCount();
-
- MSG_DEBUG("simCnt [%d]", simCnt);
+ int simCount = SmsPluginDSHandler::instance()->initTelHandle();
- for (int i = 1; i <= simCnt; i++) {
- memset(keyName, 0x00, sizeof(keyName));
- snprintf(keyName, sizeof(keyName), "%s/%d", MSG_SIM_CHANGED, i);
- MSG_DEBUG("set MSG_SIM_CHANGED to MSG_SIM_STATUS_NOT_FOUND.");
- if (MsgSettingSetInt(keyName, MSG_SIM_STATUS_NOT_FOUND) != MSG_SUCCESS)
- MSG_DEBUG("MsgSettingSetInt is failed!!");
- }
+ SmsPluginCallbacks::registerEvents();
- SmsPluginCallback::instance()->registerEvent();
+ for (int i = 1; i <= simCount; i++) {
+ TapiHandle *tHandle = SmsPluginDSHandler::instance()->getTelHandle(i);
+ if (SmsPluginDSHandler::instance()->getHandleType(tHandle) == SmsPluginDSHandler::HandleType::H_3GPP) {
+ char keyName[MAX_VCONFKEY_NAME_LEN] = {};
+ snprintf(keyName, sizeof(keyName), "%s/%d", MSG_SIM_CHANGED, i);
+ if (MsgSettingSetInt(keyName, MSG_SIM_STATUS_NOT_FOUND) != MSG_SUCCESS) {
+ MSG_ERR("MsgSettingSetInt() failed![%s]", keyName);
+ }
- for (int i = 1; i <= simCnt; ++i) {
- TapiHandle *handle;
- handle = SmsPluginDSHandler::instance()->getTelHandle(i);
- SmsPluginSetting::instance()->setSimChangeStatus(handle, true);
+ Sms3gppSetting::instance()->setSimChangeStatus(tHandle);
+ } else {
+ Sms3gpp2Setting::instance()->setSimChangeStatus(tHandle);
+ }
}
- /* set resource monitor */
MsgResourceMonitorInit();
MSG_END();
-
return MSG_SUCCESS;
}
-
msg_error_t SmsPlgFinalize()
{
MSG_BEGIN();
MsgResourceMonitorDeinit();
-
- SmsPluginCallback::instance()->deRegisterEvent();
-
+ SmsPluginCallbacks::deRegisterEvents();
SmsPluginDSHandler::instance()->deinitTelHandle();
MSG_END();
-
return MSG_SUCCESS;
}
-
msg_error_t SmsPlgRegisterListener(MSG_PLUGIN_LISTENER_S *pListener)
{
MSG_BEGIN();
- SmsPluginEventHandler::instance()->registerListener(pListener);
+ Sms3gppEventHandler::instance()->registerListener(pListener);
+ Sms3gpp2EventHandler::instance()->registerListener(pListener);
MSG_END();
-
return MSG_SUCCESS;
}
-
msg_error_t SmsPlgSubmitRequest(MSG_REQUEST_INFO_S *pReqInfo)
{
- msg_error_t err = MSG_SUCCESS;
-
- /* Add Submit SMS into DB */
- if (pReqInfo->msgInfo.msgId == 0) {
- if (pReqInfo->msgInfo.msgPort.valid == false) {
- err = SmsPluginStorage::instance()->checkMessage(&(pReqInfo->msgInfo));
-
- if (err != MSG_SUCCESS) {
- MSG_DEBUG("######## checkMessage Fail !! [err=%d]", err);
- return MSG_ERR_PLUGIN_STORAGE;
- }
-
- err = SmsPluginStorage::instance()->addSmsMessage(&(pReqInfo->msgInfo));
- if (err != MSG_SUCCESS) {
- MSG_DEBUG("######## addSmsMessage Fail !! [err=%d]", err);
- return MSG_ERR_PLUGIN_STORAGE;
- }
-
- if (SmsPluginStorage::instance()->addSmsSendOption(&(pReqInfo->msgInfo), &(pReqInfo->sendOptInfo)) != MSG_SUCCESS) {
- MSG_DEBUG("######## addSmsSendOption Fail !!");
- return MSG_ERR_PLUGIN_STORAGE;
- }
- }
- }
-
- /* Check SIM is present or not */
- char keyName[MAX_VCONFKEY_NAME_LEN] = {0, };
- snprintf(keyName, sizeof(keyName), "%s/%d", MSG_SIM_CHANGED, pReqInfo->msgInfo.sim_idx);
- int tmpValue = 0;
- if (MsgSettingGetInt(keyName, &tmpValue) != MSG_SUCCESS) {
- MSG_INFO("MsgSettingGetInt() is failed");
- }
- MSG_SIM_STATUS_T simStatus = (MSG_SIM_STATUS_T)tmpValue;
-
- if (simStatus == MSG_SIM_STATUS_NOT_FOUND) {
- MSG_DEBUG("SIM is not present..");
-
- /* Update Msg Status */
- if (pReqInfo->msgInfo.msgPort.valid == false)
- SmsPluginStorage::instance()->updateSentMsg(&(pReqInfo->msgInfo), MSG_NETWORK_SEND_FAIL);
-
- return MSG_ERR_NO_SIM;
- }
-
- SMS_REQUEST_INFO_S *request = NULL;
-
- request = (SMS_REQUEST_INFO_S *)calloc(1, sizeof(SMS_REQUEST_INFO_S));
-
- if (request != NULL) {
- request->reqId = pReqInfo->reqId;
-
- memcpy(&(request->msgInfo), &(pReqInfo->msgInfo), sizeof(MSG_MESSAGE_INFO_S));
- memcpy(&(request->sendOptInfo), &(pReqInfo->sendOptInfo), sizeof(MSG_SENDINGOPT_INFO_S));
+ MSG_BEGIN();
- /* Add Request into Queue and Start UA Manger */
- SmsPluginUAManager::instance()->addReqEntity(request);
+ msg_error_t ret = MSG_SUCCESS;
+ TapiHandle *tHandle = SmsPluginDSHandler::instance()->getTelHandle(pReqInfo->msgInfo.sim_idx);
- free(request);
+ if (SmsPluginDSHandler::instance()->getSmsFormat(tHandle) == TAPI_NETTEXT_NETTYPE_3GPP) {
+ ret = Sms3gppSubmitRequest(pReqInfo);
+ } else {
+ ret = Sms3gpp2SubmitRequest(pReqInfo);
}
-
- return MSG_SUCCESS;
+ MSG_END();
+ return ret;
}
-
msg_error_t SmsPlgSaveSimMessage(const MSG_MESSAGE_INFO_S *pMsgInfo, SMS_SIM_ID_LIST_S *pSimIdList)
{
- /* Check SIM is present or not */
- char keyName[MAX_VCONFKEY_NAME_LEN];
- memset(keyName, 0x00, sizeof(keyName));
- snprintf(keyName, sizeof(keyName), "%s/%d", MSG_SIM_CHANGED, pMsgInfo->sim_idx);
- int tmpValue = 0;
- if (MsgSettingGetInt(keyName, &tmpValue) != MSG_SUCCESS) {
- MSG_INFO("MsgSettingGetInt() is failed");
+ MSG_BEGIN();
+
+ TapiHandle *tHandle = SmsPluginDSHandler::instance()->getTelHandle(pMsgInfo->sim_idx);
+ if (SmsPluginDSHandler::instance()->getHandleType(tHandle) == SmsPluginDSHandler::HandleType::H_3GPP2) {
+ MSG_WARN("CDMA does not support sim card operations.");
+ return MSG_SUCCESS;
}
- MSG_SIM_STATUS_T simStatus = (MSG_SIM_STATUS_T)tmpValue;
- if (simStatus == MSG_SIM_STATUS_NOT_FOUND) {
- MSG_DEBUG("SIM is not present..");
- return MSG_ERR_NO_SIM;
+ char keyName[MAX_VCONFKEY_NAME_LEN] = { 0, };
+ snprintf(keyName, sizeof(keyName), "%s/%d", MSG_SIM_CHANGED, pMsgInfo->sim_idx);
+
+ MSG_SIM_STATUS_T simStatus = 0;
+ if (MsgSettingGetInt(keyName, (int*)&simStatus) != MSG_SUCCESS) {
+ MSG_INFO("MsgSettingGetInt() failed!");
}
+ MSG_ERR_RET_VM(simStatus == MSG_SIM_STATUS_NOT_FOUND, MSG_ERR_NO_SIM, "SIM (%d) is not present!", pMsgInfo->sim_idx);
msg_error_t err = MSG_SUCCESS;
try {
- err = SmsPluginSimMsg::instance()->saveSimMessage(pMsgInfo, pSimIdList);
+ err = Sms3gppSimMsg::instance()->saveSimMessage(pMsgInfo, pSimIdList);
} catch (MsgException& e) {
MSG_FATAL("%s", e.what());
return MSG_ERR_PLUGIN_STORAGE;
return MSG_ERR_PLUGIN_STORAGE;
}
+ MSG_END();
return err;
}
-
-msg_error_t SmsPlgDeleteSimMessage(msg_sim_slot_id_t sim_idx, msg_sim_id_t SimMsgId)
+msg_error_t SmsPlgDeleteSimMessage(msg_sim_slot_id_t simIndex, msg_sim_id_t SimMsgId)
{
- /* Check SIM is present or not */
- char keyName[MAX_VCONFKEY_NAME_LEN] = {0, };
- snprintf(keyName, sizeof(keyName), "%s/%d", MSG_SIM_CHANGED, sim_idx);
- int tmpValue = 0;
- if (MsgSettingGetInt(keyName, &tmpValue) != MSG_SUCCESS) {
- MSG_INFO("MsgSettingGetInt() is failed");
+ MSG_BEGIN();
+
+ TapiHandle *tHandle = SmsPluginDSHandler::instance()->getTelHandle(simIndex);
+ if (SmsPluginDSHandler::instance()->getHandleType(tHandle) == SmsPluginDSHandler::HandleType::H_3GPP2) {
+ MSG_WARN("CDMA does not support sim card operations.");
+ return MSG_SUCCESS;
}
- MSG_SIM_STATUS_T simStatus = (MSG_SIM_STATUS_T)tmpValue;
- if (simStatus == MSG_SIM_STATUS_NOT_FOUND) {
- MSG_DEBUG("SIM is not present..");
- return MSG_ERR_NO_SIM;
+ char keyName[MAX_VCONFKEY_NAME_LEN] = { 0, };
+ snprintf(keyName, sizeof(keyName), "%s/%d", MSG_SIM_CHANGED, simIndex);
+
+ MSG_SIM_STATUS_T simStatus = 0;
+ if (MsgSettingGetInt(keyName, (int*)&simStatus) != MSG_SUCCESS) {
+ MSG_INFO("MsgSettingGetInt() failed!");
}
+ MSG_ERR_RET_VM(simStatus == MSG_SIM_STATUS_NOT_FOUND, MSG_ERR_NO_SIM, "SIM (%d) is not present!", simIndex);
try {
- SmsPluginSimMsg::instance()->deleteSimMessage(sim_idx, SimMsgId);
+ Sms3gppSimMsg::instance()->deleteSimMessage(simIndex, SimMsgId);
} catch (MsgException& e) {
MSG_FATAL("%s", e.what());
return MSG_ERR_PLUGIN_STORAGE;
return MSG_ERR_PLUGIN_STORAGE;
}
+ MSG_END();
return MSG_SUCCESS;
}
-
-msg_error_t SmsPlgSetReadStatus(msg_sim_slot_id_t sim_idx, msg_sim_id_t SimMsgId)
+msg_error_t SmsPlgSetReadStatus(msg_sim_slot_id_t simIndex, msg_sim_id_t SimMsgId)
{
- /* Check SIM is present or not */
- char keyName[MAX_VCONFKEY_NAME_LEN] = {0, };
- snprintf(keyName, sizeof(keyName), "%s/%d", MSG_SIM_CHANGED, sim_idx);
- int tmpValue = 0;
- if (MsgSettingGetInt(keyName, &tmpValue) != MSG_SUCCESS) {
- MSG_INFO("MsgSettingGetInt() is failed");
+ MSG_BEGIN();
+
+ TapiHandle *tHandle = SmsPluginDSHandler::instance()->getTelHandle(simIndex);
+ if (SmsPluginDSHandler::instance()->getHandleType(tHandle) == SmsPluginDSHandler::HandleType::H_3GPP2) {
+ MSG_WARN("CDMA does not support sim card operations.");
+ return MSG_SUCCESS;
}
- MSG_SIM_STATUS_T simStatus = (MSG_SIM_STATUS_T)tmpValue;
- if (simStatus == MSG_SIM_STATUS_NOT_FOUND) {
- MSG_DEBUG("SIM is not present..");
- return MSG_ERR_NO_SIM;
+ char keyName[MAX_VCONFKEY_NAME_LEN] = { 0, };
+ snprintf(keyName, sizeof(keyName), "%s/%d", MSG_SIM_CHANGED, simIndex);
+
+ MSG_SIM_STATUS_T simStatus = 0;
+ if (MsgSettingGetInt(keyName, (int*)&simStatus) != MSG_SUCCESS) {
+ MSG_INFO("MsgSettingGetInt() failed!");
}
+ MSG_ERR_RET_VM(simStatus == MSG_SIM_STATUS_NOT_FOUND, MSG_ERR_NO_SIM, "SIM (%d) is not present!", simIndex);
try {
- SmsPluginSimMsg::instance()->setReadStatus(sim_idx, SimMsgId);
+ Sms3gppSimMsg::instance()->setReadStatus(simIndex, SimMsgId);
} catch (MsgException& e) {
MSG_FATAL("%s", e.what());
return MSG_ERR_PLUGIN_STORAGE;
return MSG_ERR_PLUGIN_STORAGE;
}
+ MSG_END();
return MSG_SUCCESS;
}
-
msg_error_t SmsPlgSetMemoryStatus(msg_sim_slot_id_t simIndex, msg_error_t Error)
{
- /* Check SIM is present or not */
- char keyName[MAX_VCONFKEY_NAME_LEN];
+ MSG_BEGIN();
- memset(keyName, 0x00, sizeof(keyName));
- snprintf(keyName, sizeof(keyName), "%s/%d", MSG_SIM_CHANGED, simIndex);
- int tmpValue = 0;
- if (MsgSettingGetInt(keyName, &tmpValue) != MSG_SUCCESS) {
- MSG_INFO("MsgSettingGetInt() is failed");
- }
- MSG_SIM_STATUS_T simStatus = (MSG_SIM_STATUS_T)tmpValue;
+ tapi_response_cb responseCallback = NULL;
+ TapiHandle *tHandle = SmsPluginDSHandler::instance()->getTelHandle(simIndex);
+ if (SmsPluginDSHandler::instance()->getHandleType(tHandle) == SmsPluginDSHandler::HandleType::H_3GPP) {
+ char keyName[MAX_VCONFKEY_NAME_LEN] = { 0, };
+ snprintf(keyName, sizeof(keyName), "%s/%d", MSG_SIM_CHANGED, simIndex);
+
+ MSG_SIM_STATUS_T simStatus = 0;
+ if (MsgSettingGetInt(keyName, (int*)&simStatus) != MSG_SUCCESS) {
+ MSG_INFO("MsgSettingGetInt() failed!");
+ }
+ MSG_ERR_RET_VM(simStatus == MSG_SIM_STATUS_NOT_FOUND, MSG_ERR_NO_SIM, "SIM (%d) is not present!", simIndex);
- if (simStatus == MSG_SIM_STATUS_NOT_FOUND) {
- MSG_DEBUG("SIM is not present..");
- return MSG_ERR_NO_SIM;
+ responseCallback = Sms3gppTapiEventHandler::respSetMemoryStatus;
+ } else {
+ responseCallback = Sms3gpp2TapiEventHandler::respSetMemoryStatus;
}
- int tapiRet = TAPI_API_SUCCESS;
int status = TAPI_NETTEXT_PDA_MEMORY_STATUS_AVAILABLE;
-
- if (Error == MSG_ERR_SIM_STORAGE_FULL || Error == MSG_ERR_MESSAGE_COUNT_FULL)
+ if (Error == MSG_ERR_SIM_STORAGE_FULL || Error == MSG_ERR_MESSAGE_COUNT_FULL) {
status = TAPI_NETTEXT_PDA_MEMORY_STATUS_FULL;
+ }
- MSG_DEBUG("Set Status : [%d]", status);
-
- TapiHandle *handle = SmsPluginDSHandler::instance()->getTelHandle(simIndex);
-
- tapiRet = tel_set_sms_memory_status(handle, status, TapiEventMemoryStatus, NULL);
+ MSG_INFO("Set Status : [%d]", status);
- if (tapiRet == TAPI_API_SUCCESS)
+ int tRet = tel_set_sms_memory_status(tHandle, status, responseCallback, NULL);
+ if (tRet == TAPI_API_SUCCESS) {
MSG_DEBUG("######## tel_set_sms_memory_status() Success !!! #######");
- else
- MSG_DEBUG("######## tel_set_sms_memory_status() Success !!! return : [%d] #######", tapiRet);
+ } else {
+ MSG_ERR("######## tel_set_sms_memory_status() Failed !!! return : [%d] #######", tRet);
+ }
+ MSG_END();
return MSG_SUCCESS;
}
-
msg_error_t SmsPlgSetConfigData(const MSG_SETTING_S *pSetting)
{
+ MSG_BEGIN();
+
+ int simIndex = 0;
+ switch (pSetting->type) {
+ case MSG_SMSC_LIST :
+ simIndex = pSetting->option.smscList.simIndex;
+ break;
+ case MSG_CBMSG_OPT :
+ simIndex = pSetting->option.cbMsgOpt.simIndex;
+ break;
+ case MSG_VOICEMAIL_OPT:
+ simIndex = pSetting->option.voiceMailOpt.simIndex;
+ break;
+ default :
+ THROW(MsgException::SMS_PLG_ERROR, "The Setting type is not supported. [%d]", pSetting->type);
+ break;
+ }
+
+ MSG_DEBUG("Sim index: (%d)", simIndex);
+
+ /* SIM presence was already checked in framework layer */
+
try {
- SmsPluginSetting::instance()->setConfigData(pSetting);
+ TapiHandle *tHandle = SmsPluginDSHandler::instance()->getTelHandle(simIndex);
+ if (SmsPluginDSHandler::instance()->getHandleType(tHandle) == SmsPluginDSHandler::HandleType::H_3GPP) {
+ Sms3gppSetting::instance()->setConfigData(pSetting);
+ } else {
+ Sms3gpp2Setting::instance()->setConfigData(pSetting);
+ }
} catch (MsgException& e) {
MSG_FATAL("%s", e.what());
return MSG_ERR_PLUGIN_SETTING;
return MSG_ERR_PLUGIN_SETTING;
}
+ MSG_END();
return MSG_SUCCESS;
}
-
msg_error_t SmsPlgGetConfigData(MSG_SETTING_S *pSetting)
{
+ MSG_BEGIN();
+
+ int simIndex = 0;
+ switch (pSetting->type) {
+ case MSG_SMSC_LIST :
+ simIndex = pSetting->option.smscList.simIndex;
+ break;
+ case MSG_CBMSG_OPT :
+ simIndex = pSetting->option.cbMsgOpt.simIndex;
+ break;
+ case MSG_VOICEMAIL_OPT:
+ simIndex = pSetting->option.voiceMailOpt.simIndex;
+ break;
+ default :
+ THROW(MsgException::SMS_PLG_ERROR, "The Setting type is not supported. [%d]", pSetting->type);
+ break;
+ }
+
+ MSG_DEBUG("Sim index: (%d)", simIndex);
+
+ /* SIM presence was already checked in framework layer */
+
try {
- SmsPluginSetting::instance()->getConfigData(pSetting);
+ TapiHandle *tHandle = SmsPluginDSHandler::instance()->getTelHandle(simIndex);
+ if (SmsPluginDSHandler::instance()->getHandleType(tHandle) == SmsPluginDSHandler::HandleType::H_3GPP) {
+ Sms3gppSetting::instance()->getConfigData(pSetting);
+ } else {
+ Sms3gpp2Setting::instance()->getConfigData(pSetting);
+ }
} catch (MsgException& e) {
MSG_FATAL("%s", e.what());
return MSG_ERR_PLUGIN_SETTING;
return MSG_ERR_PLUGIN_SETTING;
}
+ MSG_END();
return MSG_SUCCESS;
}
-
msg_error_t SmsPlgAddMessage(MSG_MESSAGE_INFO_S *pMsgInfo, MSG_SENDINGOPT_INFO_S* pSendOptInfo, char* pFileData)
{
+ MSG_BEGIN();
+
+ TapiHandle *tHandle = SmsPluginDSHandler::instance()->getTelHandle(pMsgInfo->sim_idx);
+ if (SmsPluginDSHandler::instance()->getHandleType(tHandle) == SmsPluginDSHandler::HandleType::H_3GPP2) {
+ MSG_WARN("CDMA does not support sim card operations.");
+ return MSG_SUCCESS;
+ }
+
int *simIdList = (int*)pFileData;
try {
SmsPluginStorage::instance()->addSmsSendOption(pMsgInfo, pSendOptInfo);
- if (simIdList)
- SmsPluginStorage::instance()->addSimMessage(pMsgInfo, simIdList);
+ if (simIdList) {
+ Sms3gppStorage::instance()->addSimMessage(pMsgInfo, simIdList);
+ }
} catch (MsgException& e) {
MSG_FATAL("%s", e.what());
return MSG_ERR_PLUGIN_SETTING;
return MSG_ERR_PLUGIN_SETTING;
}
+ MSG_END();
return MSG_SUCCESS;
}
-
msg_error_t SmsPlgGetDefaultNetworkSimId(int *simId)
{
+ MSG_BEGIN();
+
try {
SmsPluginDSHandler::instance()->getDefaultNetworkSimId(simId);
} catch (MsgException& e) {
return MSG_ERR_PLUGIN_SETTING;
}
+ MSG_END();
return MSG_SUCCESS;
}
-
static void on_change_received(GDBusConnection *connection, const gchar *sender_name,
const gchar *object_path, const gchar *interface_name, const gchar *signal_name,
GVariant *parameters, gpointer user_data)
MSG_DEBUG("path = [%i] and str_val = [%s]", path , str_val);
if (path == TZ_SYS_USER && g_strcmp0(str_val, SIGNAL_VAL) == 0)
{
- int sim_count = SmsPluginDSHandler::instance()->getTelHandleCount();
-
- for (int i = 0; i < sim_count; i++) {
+ int handleCount = SmsPluginDSHandler::instance()->getTelHandleCount();
+ for (int i = 0; i < handleCount; i++) {
SmsPlgSetMemoryStatus(i, MSG_ERR_SIM_STORAGE_FULL);
}
}
}
MSG_END();
- return;
}
-
void MsgResourceMonitorDeinit(void)
{
MSG_BEGIN();
#include "MsgUtilFunction.h"
#include "MsgGconfWrapper.h"
#include "MsgNotificationWrapper.h"
+
+#include "SmsPluginTypes.h"
#include "SmsPluginMain.h"
-#include "SmsPluginSimMsg.h"
-#include "SmsPluginEventHandler.h"
#include "SmsPluginStorage.h"
-
+#include "Sms3gppStorage.h"
+#include "Sms3gppEventHandler.h"
/*==================================================================================================
- IMPLEMENTATION OF SmsPluginStorage - Member Functions
+ Variables
==================================================================================================*/
SmsPluginStorage* SmsPluginStorage::pInstance = NULL;
-
-SmsPluginStorage::SmsPluginStorage()
-{
- memset(&msgInfo, 0x00, sizeof(msgInfo));
- memset(&addrInfo, 0x00, sizeof(addrInfo));
-}
-
-
-SmsPluginStorage::~SmsPluginStorage()
-{
-}
-
-
+/*==================================================================================================
+ Methods of SmsPluginStorage
+==================================================================================================*/
SmsPluginStorage* SmsPluginStorage::instance()
{
if (!pInstance) {
}
-msg_error_t SmsPluginStorage::insertMsgRef(MSG_MESSAGE_INFO_S *pMsg, unsigned char msgRef, int index)
-{
- MSG_BEGIN();
-
- time_t curTime = time(NULL);
-
- MsgDbHandler *dbHandle = getDbHandle();
-
- char sqlQuery[MAX_QUERY_LEN+1];
- char *normalNum = NULL;
-
- memset(sqlQuery, 0x00, sizeof(sqlQuery));
-
- normalNum = msg_normalize_number(pMsg->addressList[index].addressVal);
-
- MSG_SEC_DEBUG("Insert MsgID=[%d], Address=[%s], MsgRef=[%d], Time=[%d]", \
- pMsg->msgId, normalNum, (int)msgRef, (int)curTime);
-
- snprintf(sqlQuery, sizeof(sqlQuery), "INSERT INTO %s VALUES (%d, %s, %d, 0, -1, %d);",
- MSGFW_SMS_REPORT_TABLE_NAME, pMsg->msgId, normalNum, (int)msgRef, (int)curTime);
-
- if (dbHandle->execQuery(sqlQuery) != MSG_SUCCESS) {
- MSG_DEBUG("MsgExecQuery() : [%s]", sqlQuery);
- return MSG_ERR_DB_EXEC;
- }
-
- MSG_END();
-
- return MSG_SUCCESS;
-}
-
-
-msg_error_t SmsPluginStorage::updateMsgDeliverStatus(MSG_MESSAGE_INFO_S *pMsgInfo, unsigned char msgRef)
-{
- MSG_BEGIN();
-
- MsgDbHandler *dbHandle = getDbHandle();
-
- char sqlQuery[MAX_QUERY_LEN+1];
-
- msg_message_id_t msgId = 0;
- int rowCnt = 0;
- char *normalNum = NULL;
-
- normalNum = msg_normalize_number(pMsgInfo->addressList[0].addressVal);
-
- memset(sqlQuery, 0x00, sizeof(sqlQuery));
- snprintf(sqlQuery, sizeof(sqlQuery), "SELECT MSG_ID FROM %s WHERE ADDRESS_VAL = %s AND MSG_REF > 0 ORDER BY TIME ASC;",
- MSGFW_SMS_REPORT_TABLE_NAME, normalNum);
- MSG_DEBUG("[SQL Query] %s", sqlQuery);
-
- if (dbHandle->prepareQuery(sqlQuery) != MSG_SUCCESS)
- return MSG_ERR_DB_PREPARE;
-
- if (dbHandle->stepQuery() == MSG_ERR_DB_ROW)
- msgId = dbHandle->columnInt(0);
-
- dbHandle->finalizeQuery();
-
- pMsgInfo->msgId = msgId;
-
- /** Update Status - MSG_MESSAGE_TABLE */
- memset(sqlQuery, 0x00, sizeof(sqlQuery));
- snprintf(sqlQuery, sizeof(sqlQuery), "SELECT * FROM %s WHERE MSG_ID = %d AND MSG_REF > 0;",
- MSGFW_SMS_REPORT_TABLE_NAME, msgId);
-
- if (dbHandle->getTable(sqlQuery, &rowCnt, NULL) != MSG_SUCCESS) {
- dbHandle->freeTable();
- return MSG_ERR_DB_GETTABLE;
- }
-
- dbHandle->freeTable();
-
- MSG_DEBUG("Selected row count = [%d]", rowCnt);
-
- if (rowCnt == 1 && pMsgInfo->networkStatus == MSG_NETWORK_DELIVER_SUCCESS) {
- memset(sqlQuery, 0x00, sizeof(sqlQuery));
- snprintf(sqlQuery, sizeof(sqlQuery), "UPDATE %s SET NETWORK_STATUS = %d WHERE MSG_ID = %d;",
- MSGFW_MESSAGE_TABLE_NAME, (int)pMsgInfo->networkStatus, msgId);
- MSG_DEBUG("[SQL Query] %s", sqlQuery);
-
- if (dbHandle->execQuery(sqlQuery) != MSG_SUCCESS) {
- MSG_DEBUG("Query Failed : [%s]", sqlQuery);
- return MSG_ERR_DB_EXEC;
- }
- }
-
- /** Update Status - MSG_REPORT_TABLE */
- if (pMsgInfo->networkStatus == MSG_NETWORK_DELIVER_SUCCESS) {
- memset(sqlQuery, 0x00, sizeof(sqlQuery));
- snprintf(sqlQuery, sizeof(sqlQuery), "UPDATE %s SET MSG_REF = -1, STATUS = %d, TIME = %d WHERE MSG_ID = %d and ADDRESS_VAL = '%s';",
- MSGFW_SMS_REPORT_TABLE_NAME, 1, (int)pMsgInfo->displayTime, msgId, normalNum);
- MSG_DEBUG("[SQL Query] %s", sqlQuery);
-
- if (dbHandle->execQuery(sqlQuery) != MSG_SUCCESS) {
- MSG_DEBUG("Query Failed : [%s]", sqlQuery);
- return MSG_ERR_DB_EXEC;
- }
- } else if (pMsgInfo->networkStatus == MSG_NETWORK_DELIVER_EXPIRED) {
- memset(sqlQuery, 0x00, sizeof(sqlQuery));
- snprintf(sqlQuery, sizeof(sqlQuery), "UPDATE %s SET MSG_REF = -1, STATUS = %d, TIME = %d WHERE MSG_ID = %d and ADDRESS_VAL = '%s';",
- MSGFW_SMS_REPORT_TABLE_NAME, 0, (int)pMsgInfo->displayTime, msgId, normalNum);
- MSG_DEBUG("[SQL Query] %s", sqlQuery);
-
- if (dbHandle->execQuery(sqlQuery) != MSG_SUCCESS) {
- MSG_DEBUG("Query Failed : [%s]", sqlQuery);
- return MSG_ERR_DB_EXEC;
- }
- } else if (pMsgInfo->networkStatus == MSG_NETWORK_DELIVER_PENDING) {
- memset(sqlQuery, 0x00, sizeof(sqlQuery));
- snprintf(sqlQuery, sizeof(sqlQuery), "UPDATE %s SET MSG_REF = -1, STATUS = %d, TIME = %d WHERE MSG_ID = %d and ADDRESS_VAL = '%s';",
- MSGFW_SMS_REPORT_TABLE_NAME, 3, (int)pMsgInfo->displayTime, msgId, normalNum);
- MSG_DEBUG("[SQL Query] %s", sqlQuery);
-
- if (dbHandle->execQuery(sqlQuery) != MSG_SUCCESS) {
- MSG_DEBUG("Query Failed : [%s]", sqlQuery);
- return MSG_ERR_DB_EXEC;
- }
- } else if (pMsgInfo->networkStatus == MSG_NETWORK_DELIVER_FAIL) {
- memset(sqlQuery, 0x00, sizeof(sqlQuery));
- snprintf(sqlQuery, sizeof(sqlQuery), "UPDATE %s SET MSG_REF = -1, STATUS = %d, TIME = %d WHERE MSG_ID = %d and ADDRESS_VAL = '%s';",
- MSGFW_SMS_REPORT_TABLE_NAME, 8, (int)pMsgInfo->displayTime, msgId, normalNum);
- MSG_DEBUG("[SQL Query] %s", sqlQuery);
-
- if (dbHandle->execQuery(sqlQuery) != MSG_SUCCESS) {
- MSG_DEBUG("Query Failed : [%s]", sqlQuery);
- return MSG_ERR_DB_EXEC;
- }
- }
-
- MSG_END();
-
- return MSG_SUCCESS;
-}
-
-
msg_error_t SmsPluginStorage::updateSentMsg(MSG_MESSAGE_INFO_S *pMsgInfo, msg_network_status_t status)
{
MSG_BEGIN();
- if (!pMsgInfo || (pMsgInfo && pMsgInfo->msgId <= 0)) {
- MSG_DEBUG("Invalid message id");
- return MSG_ERR_INVALID_MESSAGE_ID;
- }
+ MSG_ERR_RET_VM(!pMsgInfo, MSG_ERR_INVALID_MESSAGE_ID, "Invalid parameter: pMsgInfo is NULL!");
+ MSG_ERR_RET_VM(pMsgInfo->msgId <= 0, MSG_ERR_INVALID_MESSAGE_ID, "Invalid parameter: msgId: (%d)", pMsgInfo->msgId);
-/*** Comment below line to not save the time value after sent status (it could be used later.)
- time_t curTime = time(NULL);
-***/
MsgDbHandler *dbHandle = getDbHandle();
-
char sqlQuery[MAX_QUERY_LEN+1];
memset(sqlQuery, 0x00, sizeof(sqlQuery));
MSG_DEBUG("Update Msg ID : [%d], Network Status : [%d] ", pMsgInfo->msgId, status);
- /** Move Msg to SENTBOX */
+ /* Move Msg to SENTBOX */
if (status == MSG_NETWORK_SEND_SUCCESS) {
snprintf(sqlQuery, sizeof(sqlQuery), "UPDATE %s SET NETWORK_STATUS = %d, FOLDER_ID = %d WHERE MSG_ID = %d;",
MSGFW_MESSAGE_TABLE_NAME, status, MSG_SENTBOX_ID, pMsgInfo->msgId);
}
if (dbHandle->execQuery(sqlQuery) != MSG_SUCCESS) {
- MSG_DEBUG("MsgExecQuery() : [%s]", sqlQuery);
+ MSG_ERR("MsgExecQuery() : [%s]", sqlQuery);
return MSG_ERR_DB_EXEC;
}
}
#endif /* MSG_CONTACTS_SERVICE_NOT_SUPPORTED */
MSG_END();
-
return MSG_SUCCESS;
}
-#ifdef SMS_REPORT_OPERATION
-msg_error_t SmsPluginStorage::updateMsgRef(msg_message_id_t MsgId, unsigned char MsgRef)
-{
- MSG_BEGIN();
- MsgDbHandler *dbHandle = getDbHandle();
-
- char sqlQuery[MAX_QUERY_LEN+1];
-
- memset(sqlQuery, 0x00, sizeof(sqlQuery));
-
- snprintf(sqlQuery, sizeof(sqlQuery), "UPDATE %s SET MSG_REF = %d WHERE MSG_ID = %d;",
- MSGFW_REPORT_TABLE_NAME, (int)MsgRef, MsgId);
-
- if (dbHandle->execQuery(sqlQuery) != MSG_SUCCESS) {
- MSG_DEBUG("Query Failed : [%s]", sqlQuery);
- return MSG_ERR_DB_EXEC;
- }
-
- /** Set Message Reference for updating report table */
- tmpMsgRef = MsgRef;
-
- MSG_DEBUG("MsgRef : %d", MsgRef);
-
- MSG_END();
-
- return MSG_SUCCESS;
-}
-
-
-msg_error_t SmsPluginStorage::updateStatusReport(unsigned char MsgRef, msg_delivery_report_status_t Status, time_t DeliveryTime)
-{
- MSG_BEGIN();
-
- MSG_DEBUG("tmpMsgRef : %d", tmpMsgRef);
-
- MsgDbHandler *dbHandle = getDbHandle();
-
- char sqlQuery[MAX_QUERY_LEN+1];
-
- /** Get Msg Id for Quickpanel Noti */
- msg_message_id_t msgId = 0;
-
- memset(sqlQuery, 0x00, sizeof(sqlQuery));
- snprintf(sqlQuery, sizeof(sqlQuery), "SELECT MSG_ID FROM %s WHERE MSG_REF = %d;",
- MSGFW_REPORT_TABLE_NAME, (int)tmpMsgRef);
-
- if (dbHandle->prepareQuery(sqlQuery) != MSG_SUCCESS)
- return MSG_ERR_DB_PREPARE;
-
- if (dbHandle->stepQuery() == MSG_ERR_DB_ROW)
- msgId = dbHandle->columnInt(0);
-
- dbHandle->finalizeQuery();
-
- /** Update Status */
- memset(sqlQuery, 0x00, sizeof(sqlQuery));
- snprintf(sqlQuery, sizeof(sqlQuery), "UPDATE %s SET MSG_REF = -1, DELIVERY_REPORT_STATUS = %d, DELIVERY_REPORT_TIME = %lu WHERE MSG_REF = %d;",
- MSGFW_REPORT_TABLE_NAME, Status, DeliveryTime, (int)tmpMsgRef);
-
- if (dbHandle->execQuery(sqlQuery) != MSG_SUCCESS) {
- MSG_DEBUG("Query Failed : [%s]", sqlQuery);
- return MSG_ERR_DB_EXEC;
- }
-
- /** Insert Quickpanel Noti */
- msg_error_t ret = MSG_SUCCESS;
-
- ret = MsgInsertSmsNotiToQuickpanel(dbHandle, msgId, Status);
-
- if (ret != MSG_SUCCESS) {
- MSG_DEBUG("MsgInsertSmsNotiToQuickpanel() Failed : [%d]", ret);
- return ret;
- }
-
- MSG_END();
-
- return MSG_SUCCESS;
-}
-#endif
-
-msg_error_t SmsPluginStorage::addSimMessage(MSG_MESSAGE_INFO_S *pSimMsgInfo, int *simIdList)
+msg_error_t SmsPluginStorage::addSmsMessage(MSG_MESSAGE_INFO_S *pMsgInfo)
{
msg_error_t err = MSG_SUCCESS;
+ unsigned int rowId = 0;
+ msg_thread_id_t convId = 0;
- unsigned int simId = 0;
MsgDbHandler *dbHandle = getDbHandle();
+ dbHandle->beginTrans();
- char sqlQuery[MAX_QUERY_LEN+1];
-
- if (simIdList) {
- MSG_DEBUG("simIdList exist.");
- for (int i = 0; i < MAX_SIM_SMS_NUM; ++i) {
- if (simIdList[i]) {
- simId = simIdList[i] - 1;
- memset(sqlQuery, 0x00, sizeof(sqlQuery));
- snprintf(sqlQuery, sizeof(sqlQuery), "INSERT INTO %s VALUES (%d, %d);",
- MSGFW_SIM_MSG_TABLE_NAME, simId, pSimMsgInfo->msgId);
-
- MSG_DEBUG("QUERY : %s", sqlQuery);
-
- if (dbHandle->execQuery(sqlQuery) != MSG_SUCCESS) {
- return MSG_ERR_DB_EXEC;
- }
- } else {
- break;
- }
+ if (pMsgInfo->nAddressCnt > 0) {
+ err = MsgStoAddAddress(dbHandle, pMsgInfo, &convId);
+ if (err != MSG_SUCCESS) {
+ MSG_ERR("MsgStoAddAddress() failed: (%d)", err);
+ dbHandle->endTrans(false);
+ return err;
}
- }
-
- return err;
-}
-
-
-msg_error_t SmsPluginStorage::insertSimMessage(int simId, int msgId)
-{
- MSG_BEGIN();
-
- MsgDbHandler *dbHandle = getDbHandle();
- char sqlQuery[MAX_QUERY_LEN+1];
-
- dbHandle->beginTrans();
-
- /** Insert Message into msg_sim table */
- memset(sqlQuery, 0x00, sizeof(sqlQuery));
- snprintf(sqlQuery, sizeof(sqlQuery), "INSERT INTO %s VALUES (%d, %d);", MSGFW_SIM_MSG_TABLE_NAME, simId, msgId);
- if (dbHandle->execQuery(sqlQuery) != MSG_SUCCESS) {
- dbHandle->endTrans(false);
- return MSG_ERR_DB_EXEC;
+ pMsgInfo->threadId = convId;
}
- dbHandle->endTrans(true);
-
- return MSG_SUCCESS;
-}
-
-
-msg_error_t SmsPluginStorage::deleteSimMessage(int sim_idx, int simId)
-{
- MSG_BEGIN();
-
- MsgDbHandler *dbHandle = getDbHandle();
-
- char sqlQuery[MAX_QUERY_LEN+1];
-
- dbHandle->beginTrans();
-
- /** Delete Message from msg_sim table */
- memset(sqlQuery, 0x00, sizeof(sqlQuery));
- snprintf(sqlQuery, sizeof(sqlQuery), "DELETE FROM %s WHERE SIM_ID = %d AND SIM_SLOT_ID = %d;", MSGFW_SIM_MSG_TABLE_NAME, simId, sim_idx);
- if (dbHandle->execQuery(sqlQuery) != MSG_SUCCESS) {
+ /** Add Message Table */
+ rowId = MsgStoAddMessageTable(dbHandle, pMsgInfo);
+ if (rowId <= 0) {
+ MSG_ERR("MsgStoAddMessageTable() failed: rowId:(%d)", rowId);
dbHandle->endTrans(false);
- return MSG_ERR_DB_EXEC;
+ return MSG_ERR_DB_ROW;
}
- dbHandle->endTrans(true);
-
- return MSG_SUCCESS;
-}
-
-
-msg_error_t SmsPluginStorage::checkMessage(MSG_MESSAGE_INFO_S *pMsgInfo)
-{
- MSG_BEGIN();
-
- msg_error_t err = MSG_SUCCESS;
-
- /** Check whether storage is full or not */
- err = checkStorageStatus(pMsgInfo);
-
+ /** Update conversation table */
+ err = MsgStoUpdateConversation(dbHandle, convId);
if (err != MSG_SUCCESS) {
- if (pMsgInfo->msgType.classType == MSG_CLASS_0) {
- pMsgInfo->folderId = 0;
- err = MSG_SUCCESS;
- } else if (pMsgInfo->msgType.classType == MSG_CLASS_2 &&
- (pMsgInfo->msgType.subType == MSG_NORMAL_SMS || pMsgInfo->msgType.subType == MSG_REJECT_SMS)) {
- err = addClass2Message(pMsgInfo);
- } else if (pMsgInfo->msgType.subType == MSG_NOTIFICATIONIND_MMS) {
- err = MSG_SUCCESS;
- }
+ MSG_ERR("MsgStoUpdateConversation() failed: (%d)", err);
+ dbHandle->endTrans(false);
return err;
}
- /** Amend message information for type **/
- if (pMsgInfo->msgType.subType == MSG_NORMAL_SMS || pMsgInfo->msgType.subType == MSG_REJECT_SMS) {
- MSG_DEBUG("Normal SMS");
-
- if (pMsgInfo->msgType.classType == MSG_CLASS_2) {
- err = addClass2Message(pMsgInfo);
- } else if (pMsgInfo->msgType.classType == MSG_CLASS_0) {
- /** Class 0 Msg should be saved in hidden folder */
- pMsgInfo->folderId = 0;
- }
-
- } else if ((pMsgInfo->msgType.subType >= MSG_REPLACE_TYPE1_SMS) && (pMsgInfo->msgType.subType <= MSG_REPLACE_TYPE7_SMS)) {
- MSG_DEBUG("Replace SM Type [%d]", pMsgInfo->msgType.subType-3);
-
- if (pMsgInfo->msgType.classType == MSG_CLASS_2) {
- err = addClass2Message(pMsgInfo);
- } else if (pMsgInfo->msgType.classType == MSG_CLASS_0) {
- /** Class 0 Msg should be saved in hidden folder */
- pMsgInfo->folderId = 0;
- pMsgInfo->msgType.subType = MSG_NORMAL_SMS;
- }
-
- } else if ((pMsgInfo->msgType.subType >= MSG_MWI_VOICE_SMS) && (pMsgInfo->msgType.subType <= MSG_MWI_OTHER_SMS)) {
- if (pMsgInfo->bStore == true) {
- MSG_DEBUG("MWI Message");
-
- if (pMsgInfo->msgType.classType == MSG_CLASS_2) {
- err = addClass2Message(pMsgInfo);
- }
- }
- } else {
- MSG_DEBUG("No matching type [%d]", pMsgInfo->msgType.subType);
+ err = dbHandle->endTrans(true);
+ if (err != MSG_SUCCESS) {
+ MSG_ERR("endTrans() failed: (%d)", err);
+ return err;
}
- if (err == MSG_SUCCESS) {
- MSG_DEBUG("Success to check message !!");
- } else {
- MSG_DEBUG("fail to check message !! : [%d]", err);
- }
+ pMsgInfo->msgId = (msg_message_id_t)rowId;
- return err;
+ MSG_END();
+ return MSG_SUCCESS;
}
-msg_error_t SmsPluginStorage::addSmsMessage(MSG_MESSAGE_INFO_S *pMsgInfo)
+msg_error_t SmsPluginStorage::updateSmsMessage(MSG_MESSAGE_INFO_S *pMsgInfo)
{
- msg_error_t err = MSG_SUCCESS;
-
- unsigned int rowId = 0;
- msg_thread_id_t convId = 0;
-
+ MSG_BEGIN();
MsgDbHandler *dbHandle = getDbHandle();
+ char sqlQuery[MAX_QUERY_LEN+1] = {0, };
+ msg_thread_id_t convId = 0;
dbHandle->beginTrans();
if (pMsgInfo->nAddressCnt > 0) {
- err = MsgStoAddAddress(dbHandle, pMsgInfo, &convId);
+ pMsgInfo->threadId = 0;
+ msg_error_t err = MsgStoAddAddress(dbHandle, pMsgInfo, &convId);
if (err != MSG_SUCCESS) {
dbHandle->endTrans(false);
return err;
}
-
- pMsgInfo->threadId = convId;
}
- /** Add Message Table */
- rowId = MsgStoAddMessageTable(dbHandle, pMsgInfo);
+ int fileSize = 0;
- if (rowId <= 0) {
- dbHandle->endTrans(false);
- return MSG_ERR_DB_ROW;
+ char *pFileData = NULL;
+ unique_ptr<char*, void(*)(char**)> buf(&pFileData, unique_ptr_deleter);
+
+ /* Get File Data */
+ if (pMsgInfo->bTextSms == false) {
+ if (MsgOpenAndReadFile(pMsgInfo->msgData, &pFileData, &fileSize) == false) {
+ dbHandle->endTrans(false);
+ return MSG_ERR_STORAGE_ERROR;
+ }
}
- /** Update conversation table */
- err = MsgStoUpdateConversation(dbHandle, convId);
+ snprintf(sqlQuery, sizeof(sqlQuery), "UPDATE %s SET CONV_ID = %d, FOLDER_ID = %d, STORAGE_ID = %d, MAIN_TYPE = %d, SUB_TYPE = %d, \
+ DISPLAY_TIME = %lu, DATA_SIZE = %zu, NETWORK_STATUS = %d, READ_STATUS = %d, PROTECTED = %d, PRIORITY = %d, MSG_DIRECTION = %d, \
+ BACKUP = %d, SUBJECT = ?, MSG_TEXT = ?, SIM_INDEX = %d \
+ WHERE MSG_ID = %d;",
+ MSGFW_MESSAGE_TABLE_NAME, convId, pMsgInfo->folderId, pMsgInfo->storageId, pMsgInfo->msgType.mainType, pMsgInfo->msgType.subType, pMsgInfo->displayTime, pMsgInfo->dataSize,
+ pMsgInfo->networkStatus, pMsgInfo->bRead, pMsgInfo->bProtected, pMsgInfo->priority, pMsgInfo->direction, pMsgInfo->bBackup, pMsgInfo->sim_idx, pMsgInfo->msgId);
- if (err != MSG_SUCCESS) {
+ if (dbHandle->prepareQuery(sqlQuery) != MSG_SUCCESS) {
dbHandle->endTrans(false);
- return err;
+ return MSG_ERR_DB_EXEC;
}
- err = dbHandle->endTrans(true);
- if (err != MSG_SUCCESS) {
- return err;
+ dbHandle->bindText(pMsgInfo->subject, 1);
+
+ if (pMsgInfo->bTextSms == false)
+ dbHandle->bindText(pFileData, 2);
+ else
+ dbHandle->bindText(pMsgInfo->msgText, 2);
+
+ MSG_DEBUG("%s", sqlQuery);
+
+ if (dbHandle->stepQuery() != MSG_ERR_DB_DONE) {
+ dbHandle->finalizeQuery();
+ dbHandle->endTrans(false);
+ return MSG_ERR_DB_EXEC;
}
- pMsgInfo->msgId = (msg_message_id_t)rowId;
+ dbHandle->finalizeQuery();
+ dbHandle->endTrans(true);
MSG_END();
-
return MSG_SUCCESS;
}
MSG_BEGIN();
MsgDbHandler *dbHandle = getDbHandle();
-
char sqlQuery[MAX_QUERY_LEN+1];
- /** Get SUB_TYPE, STORAGE_ID */
+ /* Get SUB_TYPE, STORAGE_ID */
memset(sqlQuery, 0x00, sizeof(sqlQuery));
snprintf(sqlQuery, sizeof(sqlQuery), "SELECT MAIN_TYPE, SUB_TYPE, FOLDER_ID, CONV_ID, SIM_INDEX \
FROM %s WHERE MSG_ID = %d;",
MSGFW_MESSAGE_TABLE_NAME, msgId);
- if (dbHandle->prepareQuery(sqlQuery) != MSG_SUCCESS)
+ if (dbHandle->prepareQuery(sqlQuery) != MSG_SUCCESS) {
return MSG_ERR_DB_PREPARE;
+ }
MSG_MESSAGE_TYPE_S msgType;
msg_folder_id_t folderId;
MSG_DEBUG("Main Type:[%d] SubType:[%d] FolderId:[%d] ConversationId:[%d]", msgType.mainType, msgType.subType, folderId, convId);
} else {
- MSG_DEBUG("MsgStepQuery() Error [%s]", sqlQuery);
+ MSG_ERR("MsgStepQuery() Failed [%s]", sqlQuery);
dbHandle->finalizeQuery();
return MSG_ERR_DB_STEP;
}
memset(sqlQuery, 0x00, sizeof(sqlQuery));
snprintf(sqlQuery, sizeof(sqlQuery), "DELETE FROM %s WHERE MSG_ID = %d;", MSGFW_SMS_SENDOPT_TABLE_NAME, msgId);
- /** Delete SMS Send Option */
+ /* Delete SMS Send Option */
if (dbHandle->execQuery(sqlQuery) != MSG_SUCCESS) {
dbHandle->endTrans(false);
return MSG_ERR_DB_EXEC;
memset(sqlQuery, 0x00, sizeof(sqlQuery));
snprintf(sqlQuery, sizeof(sqlQuery), "DELETE FROM %s WHERE MSG_ID = %d;", MSGFW_CB_MSG_TABLE_NAME, msgId);
- /** Delete Push Message from push table */
+ /* Delete Push Message from push table */
if (dbHandle->execQuery(sqlQuery) != MSG_SUCCESS) {
dbHandle->endTrans(false);
return MSG_ERR_DB_EXEC;
memset(sqlQuery, 0x00, sizeof(sqlQuery));
snprintf(sqlQuery, sizeof(sqlQuery), "DELETE FROM %s WHERE MSG_ID = %d;", MSGFW_PUSH_MSG_TABLE_NAME, msgId);
- /** Delete Push Message from push table */
+ /* Delete Push Message from push table */
if (dbHandle->execQuery(sqlQuery) != MSG_SUCCESS) {
dbHandle->endTrans(false);
return MSG_ERR_DB_EXEC;
memset(sqlQuery, 0x00, sizeof(sqlQuery));
snprintf(sqlQuery, sizeof(sqlQuery), "DELETE FROM %s WHERE MSG_ID = %d;", MSGFW_SYNCML_MSG_TABLE_NAME, msgId);
- /** Delete SyncML Message from syncML table */
+ /* Delete SyncML Message from syncML table */
if (dbHandle->execQuery(sqlQuery) != MSG_SUCCESS) {
dbHandle->endTrans(false);
return MSG_ERR_DB_EXEC;
}
}
- /** Delete Message from msg table */
+ /* Delete Message from msg table */
memset(sqlQuery, 0x00, sizeof(sqlQuery));
snprintf(sqlQuery, sizeof(sqlQuery), "DELETE FROM %s WHERE MSG_ID = %d;", MSGFW_MESSAGE_TABLE_NAME, msgId);
if (dbHandle->execQuery(sqlQuery) != MSG_SUCCESS) {
return MSG_ERR_DB_EXEC;
}
- /** Delete Message from msg_report table */
+ /* Delete Message from msg_report table */
memset(sqlQuery, 0x00, sizeof(sqlQuery));
snprintf(sqlQuery, sizeof(sqlQuery), "DELETE FROM %s WHERE MSG_ID = %d;", MSGFW_SMS_REPORT_TABLE_NAME, msgId);
if (dbHandle->execQuery(sqlQuery) != MSG_SUCCESS) {
return MSG_ERR_DB_EXEC;
}
- /** Delete Message from msg_sim table */
+ /* Delete Message from msg_sim table */
memset(sqlQuery, 0x00, sizeof(sqlQuery));
snprintf(sqlQuery, sizeof(sqlQuery), "DELETE FROM %s WHERE MSG_ID = %d;", MSGFW_SIM_MSG_TABLE_NAME, msgId);
if (dbHandle->execQuery(sqlQuery) != MSG_SUCCESS) {
return MSG_ERR_DB_EXEC;
}
- /** Clear Conversation table */
+ /* Clear Conversation table */
if (MsgStoClearConversationTable(dbHandle) != MSG_SUCCESS) {
dbHandle->endTrans(false);
return MSG_ERR_DB_EXEC;
}
- /** Update conversation table.*/
+ /* Update conversation table.*/
if (MsgStoUpdateConversation(dbHandle, convId) != MSG_SUCCESS) {
dbHandle->endTrans(false);
return MSG_ERR_STORAGE_ERROR;
memset(sqlQuery, 0x00, sizeof(sqlQuery));
snprintf(sqlQuery, sizeof(sqlQuery), "SELECT CONV_ID FROM %s WHERE CONV_ID = %d;", MSGFW_CONVERSATION_TABLE_NAME, convId);
- if (dbHandle->prepareQuery(sqlQuery) != MSG_SUCCESS)
+ if (dbHandle->prepareQuery(sqlQuery) != MSG_SUCCESS) {
return MSG_ERR_DB_PREPARE;
+ }
- if (dbHandle->stepQuery() == MSG_ERR_DB_ROW)
- SmsPluginEventHandler::instance()->callbackThreadChange(MSG_STORAGE_CHANGE_UPDATE, convId);
- else
- SmsPluginEventHandler::instance()->callbackThreadChange(MSG_STORAGE_CHANGE_DELETE, convId);
+ if (dbHandle->stepQuery() == MSG_ERR_DB_ROW) {
+ Sms3gppEventHandler::instance()->callbackThreadChange(MSG_STORAGE_CHANGE_UPDATE, convId);
+ } else {
+ Sms3gppEventHandler::instance()->callbackThreadChange(MSG_STORAGE_CHANGE_DELETE, convId);
+ }
dbHandle->finalizeQuery();
if (folder_id == MSG_INBOX_ID) {
msgType.classType = MSG_CLASS_NONE;
- /** Set memory status in SIM */
+ /* Set memory status in SIM */
if (MsgStoCheckMsgCntFull(dbHandle, &msgType, folderId) == MSG_SUCCESS) {
MSG_DEBUG("Set Memory Status");
SmsPlgSetMemoryStatus(simIndex, MSG_SUCCESS);
}
-msg_error_t SmsPluginStorage::addClass2Message(MSG_MESSAGE_INFO_S *pMsgInfo)
+msg_error_t SmsPluginStorage::addSmsSendOption(MSG_MESSAGE_INFO_S *pMsg, MSG_SENDINGOPT_INFO_S *pSendOptInfo)
{
- MSG_BEGIN();
-
msg_error_t err = MSG_SUCCESS;
- bool bSimSst = true;
-
- char keyName[MAX_VCONFKEY_NAME_LEN];
- memset(keyName, 0x00, sizeof(keyName));
- snprintf(keyName, sizeof(keyName), "%s/%d", MSG_SIM_SERVICE_TABLE, pMsgInfo->sim_idx);
-
- if (MsgSettingGetBool(keyName, &bSimSst) != MSG_SUCCESS) {
- MSG_ERR("MsgSettingGetBool [%s] failed", keyName);
- }
-
- if (bSimSst == false) {
- return MSG_ERR_SIM_STORAGE_FULL;
- }
- pthread_t thd;
- memset(&msgInfo, 0, sizeof(MSG_MESSAGE_INFO_S));
- memset(&addrInfo, 0, sizeof(MSG_ADDRESS_INFO_S));
- memcpy(&msgInfo, pMsgInfo, sizeof(MSG_MESSAGE_INFO_S));
- memcpy(&addrInfo, pMsgInfo->addressList, sizeof(MSG_ADDRESS_INFO_S));
- msgInfo.addressList = &addrInfo;
-
- if (pthread_create(&thd, NULL, &class2_thread, (void *)&msgInfo) < 0)
- MSG_DEBUG("pthread_create() error");
- else
- pthread_detach(thd);
-
-#if 0
- err = SmsPluginSimMsg::instance()->saveClass2Message(pMsgInfo);
-
-
- if (err == MSG_SUCCESS) {
- MSG_DEBUG("Success to saveClass2Message.");
- } else {
- MSG_DEBUG("Fail to saveClass2Message : [%d]", err);
- }
-#endif
-
- MSG_END();
-
- return err;
-}
-void* SmsPluginStorage::class2_thread(void *data)
-{
- MSG_BEGIN();
+ if (pSendOptInfo->bSetting == false) {
+ if (MsgSettingGetBool(SMS_SEND_DELIVERY_REPORT, &pSendOptInfo->bDeliverReq) != MSG_SUCCESS) {
+ MSG_INFO("MsgSettingGetBool() is failed");
+ }
- msg_error_t err = MSG_SUCCESS;
- MSG_MESSAGE_INFO_S *pMsgInfo = (MSG_MESSAGE_INFO_S *)data;
+ if (MsgSettingGetBool(SMS_SEND_REPLY_PATH, &pSendOptInfo->option.smsSendOptInfo.bReplyPath) != MSG_SUCCESS) {
+ MSG_INFO("MsgSettingGetBool() is failed");
+ }
- err = SmsPluginSimMsg::instance()->saveClass2Message(pMsgInfo);
- if (err == MSG_SUCCESS) {
- MSG_DEBUG("Success to saveClass2Message.");
- } else {
- MSG_ERR("Fail to saveClass2Message : [%d]", err);
+ if (MsgSettingGetBool(MSG_KEEP_COPY, &pSendOptInfo->bKeepCopy) != MSG_SUCCESS) {
+ MSG_INFO("MsgSettingGetBool() is failed");
+ }
}
- MSG_END();
- return NULL;
-}
-
-
-msg_error_t SmsPluginStorage::getReplaceSimMsg(const MSG_MESSAGE_INFO_S *pMsg, int *pMsgId, int *pSimId)
-{
- MSG_BEGIN();
-
MsgDbHandler *dbHandle = getDbHandle();
-
char sqlQuery[MAX_QUERY_LEN+1];
- msg_thread_id_t convId = 0;
- msg_message_id_t msgId = 0;
dbHandle->beginTrans();
- if (MsgExistAddress(dbHandle, pMsg, &convId) == true) {
- MSG_DEBUG("Address Info. exists [%d]", convId);
-
- /** Find Replace Type Msg : Same Replace Type, Same Origin Address, Same Storage ID */
- memset(sqlQuery, 0x00, sizeof(sqlQuery));
- snprintf(sqlQuery, sizeof(sqlQuery), "SELECT MSG_ID FROM %s \
- WHERE CONV_ID = %d AND SUB_TYPE = %d AND STORAGE_ID = %d \
- ORDER BY DISPLAY_TIME ASC;",
- MSGFW_MESSAGE_TABLE_NAME, (int)convId, pMsg->msgType.subType, MSG_STORAGE_SIM);
-
- MSG_DEBUG("Query=[%s]", sqlQuery);
- if (dbHandle->prepareQuery(sqlQuery) != MSG_SUCCESS) {
- dbHandle->endTrans(false);
- return MSG_ERR_DB_PREPARE;
- }
-
- if (dbHandle->stepQuery() == MSG_ERR_DB_ROW) {
- *pMsgId = dbHandle->columnInt(0);
- } else {
- dbHandle->finalizeQuery();
- dbHandle->endTrans(false);
- return MSG_ERR_DB_STEP;
- }
-
- dbHandle->finalizeQuery();
-
- } else {
- dbHandle->endTrans(false);
- return MSG_ERR_DB_NORECORD;
- }
-
memset(sqlQuery, 0x00, sizeof(sqlQuery));
+ snprintf(sqlQuery, sizeof(sqlQuery), "INSERT INTO %s VALUES (%d, %d, %d, %d, %d);",
+ MSGFW_SMS_SENDOPT_TABLE_NAME, pMsg->msgId, pSendOptInfo->bDeliverReq,
+ pSendOptInfo->bKeepCopy, pSendOptInfo->option.smsSendOptInfo.bReplyPath, pMsg->encodeType);
- snprintf(sqlQuery, sizeof(sqlQuery), "SELECT SIM_ID FROM %s \
- WHERE MSG_ID = %d;",
- MSGFW_SIM_MSG_TABLE_NAME, *pMsgId);
-
- if (dbHandle->prepareQuery(sqlQuery) != MSG_SUCCESS) {
- dbHandle->endTrans(false);
- return MSG_ERR_DB_PREPARE;
- }
+ MSG_DEBUG("Query = [%s]", sqlQuery);
- if (dbHandle->stepQuery() == MSG_ERR_DB_ROW) {
- *pSimId = dbHandle->columnInt(0);
- } else {
- dbHandle->finalizeQuery();
+ if (dbHandle->execQuery(sqlQuery) != MSG_SUCCESS) {
+ MSG_ERR("execQuery() is failed");
dbHandle->endTrans(false);
- return MSG_ERR_DB_STEP;
+ return MSG_ERR_DB_EXEC;
}
- MSG_DEBUG("Replace Msg Id=[%d], Sim Id=[%d]", *pMsgId, *pSimId);
-
- dbHandle->finalizeQuery();
-
dbHandle->endTrans(true);
MSG_END();
- return msgId;
+ return err;
}
-msg_error_t SmsPluginStorage::addSmsSendOption(MSG_MESSAGE_INFO_S *pMsg, MSG_SENDINGOPT_INFO_S *pSendOptInfo)
+
+msg_error_t SmsPluginStorage::checkMessage(MSG_MESSAGE_INFO_S *pMsgInfo)
{
MSG_BEGIN();
msg_error_t err = MSG_SUCCESS;
- if (pSendOptInfo->bSetting == false) {
- if (MsgSettingGetBool(SMS_SEND_DELIVERY_REPORT, &pSendOptInfo->bDeliverReq) != MSG_SUCCESS)
- MSG_INFO("MsgSettingGetBool() is failed");
+ /* Check whether storage is full or not */
+ err = checkStorageStatus(pMsgInfo);
- if (MsgSettingGetBool(SMS_SEND_REPLY_PATH, &pSendOptInfo->option.smsSendOptInfo.bReplyPath) != MSG_SUCCESS)
- MSG_INFO("MsgSettingGetBool() is failed");
+ if (err != MSG_SUCCESS) {
+ if (pMsgInfo->msgType.classType == MSG_CLASS_0) {
+ pMsgInfo->folderId = 0;
+ err = MSG_SUCCESS;
+ } else if (pMsgInfo->msgType.classType == MSG_CLASS_2 &&
+ (pMsgInfo->msgType.subType == MSG_NORMAL_SMS || pMsgInfo->msgType.subType == MSG_REJECT_SMS)) {
+ err = Sms3gppStorage::instance()->addClass2Message(pMsgInfo);
+ } else if (pMsgInfo->msgType.subType == MSG_NOTIFICATIONIND_MMS) {
+ err = MSG_SUCCESS;
+ }
- if (MsgSettingGetBool(MSG_KEEP_COPY, &pSendOptInfo->bKeepCopy) != MSG_SUCCESS)
- MSG_INFO("MsgSettingGetBool() is failed");
+ return err;
}
- MsgDbHandler *dbHandle = getDbHandle();
+ /** Amend message information for type **/
+ if (pMsgInfo->msgType.subType == MSG_NORMAL_SMS || pMsgInfo->msgType.subType == MSG_REJECT_SMS) {
+ MSG_DEBUG("Normal SMS");
- char sqlQuery[MAX_QUERY_LEN+1];
+ if (pMsgInfo->msgType.classType == MSG_CLASS_2) {
+ err = Sms3gppStorage::instance()->addClass2Message(pMsgInfo);
+ } else if (pMsgInfo->msgType.classType == MSG_CLASS_0) {
+ /* Class 0 Msg should be saved in hidden folder */
+ pMsgInfo->folderId = 0;
+ }
- dbHandle->beginTrans();
+ } else if ((pMsgInfo->msgType.subType >= MSG_REPLACE_TYPE1_SMS) && (pMsgInfo->msgType.subType <= MSG_REPLACE_TYPE7_SMS)) {
+ MSG_DEBUG("Replace SM Type [%d]", pMsgInfo->msgType.subType-3);
- memset(sqlQuery, 0x00, sizeof(sqlQuery));
- snprintf(sqlQuery, sizeof(sqlQuery), "INSERT INTO %s VALUES (%d, %d, %d, %d, %d);",
- MSGFW_SMS_SENDOPT_TABLE_NAME, pMsg->msgId, pSendOptInfo->bDeliverReq,
- pSendOptInfo->bKeepCopy, pSendOptInfo->option.smsSendOptInfo.bReplyPath, pMsg->encodeType);
+ if (pMsgInfo->msgType.classType == MSG_CLASS_2) {
+ err = Sms3gppStorage::instance()->addClass2Message(pMsgInfo);
+ } else if (pMsgInfo->msgType.classType == MSG_CLASS_0) {
+ /* Class 0 Msg should be saved in hidden folder */
+ pMsgInfo->folderId = 0;
+ pMsgInfo->msgType.subType = MSG_NORMAL_SMS;
+ }
- MSG_DEBUG("Query = [%s]", sqlQuery);
+ } else if ((pMsgInfo->msgType.subType >= MSG_MWI_VOICE_SMS) && (pMsgInfo->msgType.subType <= MSG_MWI_OTHER_SMS)) {
+ if (pMsgInfo->bStore == true) {
+ MSG_DEBUG("MWI Message");
- if (dbHandle->execQuery(sqlQuery) != MSG_SUCCESS) {
- MSG_ERR("execQuery() is failed");
- dbHandle->endTrans(false);
- return MSG_ERR_DB_EXEC;
+ if (pMsgInfo->msgType.classType == MSG_CLASS_2) {
+ err = Sms3gppStorage::instance()->addClass2Message(pMsgInfo);
+ }
+ }
+ } else {
+ MSG_INFO("No matching type [%d]", pMsgInfo->msgType.subType);
}
- dbHandle->endTrans(true);
+ if (err == MSG_SUCCESS) {
+ MSG_DEBUG("Success to check message !!");
+ } else {
+ MSG_ERR("fail to check message !! : [%d]", err);
+ }
MSG_END();
-
return err;
}
}
-#if 0
-
-msg_error_t SmsPluginStorage::isReceivedCBMessage(SMS_CBMSG_PAGE_S CbPage)
-{
- msg_error_t err = MSG_SUCCESS;
-
- int rowCnt = 0;
-
- MsgDbHandler *dbHandle = getDbHandle();
-
- char sqlQuery[MAX_QUERY_LEN+1] = {0, };
-
- memset(sqlQuery, 0x00, sizeof(sqlQuery));
-
- snprintf(sqlQuery, sizeof(sqlQuery), "SELECT * FROM %s WHERE GEO_SCOPE = %d AND MSG_CODE = %d AND MESSAGE_ID = %d AND UPDATE_NUM = %d",
- MSGFW_RECEIVED_CB_MSG_TABLE_NAME, CbPage.pageHeader.serialNum.geoScope,
- CbPage.pageHeader.serialNum.msgCode, CbPage.pageHeader.msgId, CbPage.pageHeader.serialNum.updateNum);
-
- err = dbHandle->getTable(sqlQuery, &rowCnt, NULL);
- MSG_DEBUG("rowCnt: %d", rowCnt);
-
- dbHandle->freeTable();
- return err;
-}
-
-msg_error_t SmsPluginStorage::insertReceivedCBMessage(SMS_CBMSG_PAGE_S CbPage)
-{
- msg_error_t err = MSG_SUCCESS;
-
- unsigned int rowId = 0;
-
- MsgDbHandler *dbHandle = getDbHandle();
-
- char sqlQuery[MAX_QUERY_LEN+1];
-
- err = dbHandle->getRowId(MSGFW_RECEIVED_CB_MSG_TABLE_NAME, &rowId);
-
- if (err != MSG_SUCCESS)
- return err;
-
- /* Add Folder */
- memset(sqlQuery, 0x00, sizeof(sqlQuery));
- snprintf(sqlQuery, sizeof(sqlQuery), "INSERT INTO %s VALUES (%d, %d, %d, %d, %d);",
- MSGFW_RECEIVED_CB_MSG_TABLE_NAME, rowId, CbPage.pageHeader.serialNum.geoScope,
- CbPage.pageHeader.serialNum.msgCode, CbPage.pageHeader.msgId, CbPage.pageHeader.serialNum.updateNum);
-
- if (dbHandle->execQuery(sqlQuery) != MSG_SUCCESS)
- return MSG_ERR_DB_EXEC;
-
- return MSG_SUCCESS;
-}
-
-#endif
-
msg_error_t SmsPluginStorage::getRegisteredPushEvent(char* pPushHeader, int *count, char *application_id, int app_id_len, char *content_type, int content_type_len)
{
msg_error_t err = MSG_SUCCESS;
char *_content_type = NULL, *_app_id = NULL;
*count = 0;
-
for (int i = 0; i < rowCnt; i++) {
memset(contentType, 0, MAX_WAPPUSH_CONTENT_TYPE_LEN);
memset(appId, 0, MAX_WAPPUSH_ID_LEN);
}
-msg_error_t SmsPluginStorage::updateSmsMessage(MSG_MESSAGE_INFO_S *pMsgInfo)
-{
- MSG_BEGIN();
- MsgDbHandler *dbHandle = getDbHandle();
- char sqlQuery[MAX_QUERY_LEN+1] = {0, };
- msg_thread_id_t convId = 0;
-
- dbHandle->beginTrans();
-
- if (pMsgInfo->nAddressCnt > 0) {
- pMsgInfo->threadId = 0;
- msg_error_t err = MsgStoAddAddress(dbHandle, pMsgInfo, &convId);
-
- if (err != MSG_SUCCESS) {
- dbHandle->endTrans(false);
- return err;
- }
- }
-
- int fileSize = 0;
-
- char *pFileData = NULL;
- unique_ptr<char*, void(*)(char**)> buf(&pFileData, unique_ptr_deleter);
-
- /* Get File Data */
- if (pMsgInfo->bTextSms == false) {
- if (MsgOpenAndReadFile(pMsgInfo->msgData, &pFileData, &fileSize) == false) {
- dbHandle->endTrans(false);
- return MSG_ERR_STORAGE_ERROR;
- }
- }
-
- snprintf(sqlQuery, sizeof(sqlQuery), "UPDATE %s SET CONV_ID = %d, FOLDER_ID = %d, STORAGE_ID = %d, MAIN_TYPE = %d, SUB_TYPE = %d, \
- DISPLAY_TIME = %lu, DATA_SIZE = %zu, NETWORK_STATUS = %d, READ_STATUS = %d, PROTECTED = %d, PRIORITY = %d, MSG_DIRECTION = %d, \
- BACKUP = %d, SUBJECT = ?, MSG_TEXT = ?, SIM_INDEX = %d \
- WHERE MSG_ID = %d;",
- MSGFW_MESSAGE_TABLE_NAME, convId, pMsgInfo->folderId, pMsgInfo->storageId, pMsgInfo->msgType.mainType, pMsgInfo->msgType.subType, pMsgInfo->displayTime, pMsgInfo->dataSize,
- pMsgInfo->networkStatus, pMsgInfo->bRead, pMsgInfo->bProtected, pMsgInfo->priority, pMsgInfo->direction, pMsgInfo->bBackup, pMsgInfo->sim_idx, pMsgInfo->msgId);
-
- if (dbHandle->prepareQuery(sqlQuery) != MSG_SUCCESS) {
- dbHandle->endTrans(false);
- return MSG_ERR_DB_EXEC;
- }
-
- dbHandle->bindText(pMsgInfo->subject, 1);
-
- if (pMsgInfo->bTextSms == false)
- dbHandle->bindText(pFileData, 2);
- else
- dbHandle->bindText(pMsgInfo->msgText, 2);
-
- MSG_DEBUG("%s", sqlQuery);
-
- if (dbHandle->stepQuery() != MSG_ERR_DB_DONE) {
- dbHandle->finalizeQuery();
- dbHandle->endTrans(false);
- return MSG_ERR_DB_EXEC;
- }
-
- dbHandle->finalizeQuery();
- dbHandle->endTrans(true);
-
- MSG_END();
- return MSG_SUCCESS;
-}
-
-
bool SmsPluginStorage::isDuplicatedCBMsg(MSG_MESSAGE_INFO_S *pMsgInfo)
{
msg_error_t err = MSG_SUCCESS;
#ifndef SMS_PLUGIN_CALLBACK_H
#define SMS_PLUGIN_CALLBACK_H
-
/*==================================================================================================
INCLUDE FILES
==================================================================================================*/
-#include <map>
-#include <vector>
-
-extern "C"
-{
- #include <tapi_common.h>
- #include <TelSms.h>
- #include <TelSim.h>
- #include <TapiUtility.h>
- #include <ITapiNetText.h>
- #include <ITapiNetwork.h>
-}
-
-/*==================================================================================================
- FUNCTION PROTOTYPES
-==================================================================================================*/
-void TapiEventDeviceReady(TapiHandle *handle, const char *noti_id, void *data, void *user_data);
-
-void TapiEventSentStatus(TapiHandle *handle, int result, void *data, void *user_data);
-void TapiEventSatSmsSentStatus(TapiHandle *handle, int result, void *data, void *user_data);
-void TapiEventMsgIncoming(TapiHandle *handle, const char *noti_id, void *data, void *user_data);
-void TapiEventCbMsgIncoming(TapiHandle *handle, const char *noti_id, void *data, void *user_data);
-void TapiEventEtwsMsgIncoming(TapiHandle *handle, const char *noti_id, void *data, void *user_data);
-void TapiEventDeliveryReportCNF(TapiHandle *handle, int result, void *data, void *user_data);
-
-void TapiEventGetSimMsgCnt(TapiHandle *handle, int result, void *data, void *user_data);
-void TapiEventGetSimMsg(TapiHandle *handle, int result, void *data, void *user_data);
-void TapiEventSaveSimMsg(TapiHandle *handle, int result, void *data, void *user_data);
-void TapiEventSaveClass2Msg(TapiHandle *handle, int result, void *data, void *user_data);
-void TapiEventDeleteSimMsg(TapiHandle *handle, int result, void *data, void *user_data);
-
-void TapiEventSetConfigData(TapiHandle *handle, int result, void *data, void *user_data);
-
-void TapiEventSetSmscInfo(TapiHandle *handle, int result, void *data, void *user_data);
-
-void TapiEventGetCBConfig(TapiHandle *handle, int result, void *data, void *user_data);
-
-void TapiEventSetMailboxInfo(TapiHandle *handle, int result, void *data, void *user_data);
-void TapiEventGetMailboxInfo(TapiHandle *handle, int result, void *data, void *user_data);
+#include <tapi_common.h>
-void TapiEventSetMwiInfo(TapiHandle *handle, int result, void *data, void *user_data);
-void TapiEventGetMwiInfo(TapiHandle *handle, int result, void *data, void *user_data);
-
-void TapiEventGetMsisdnInfo(TapiHandle *handle, int result, void *data, void *user_data);
-
-void TapiEventGetSimServiceTable(TapiHandle *handle, int result, void *data, void *user_data);
-
-void TapiEventGetParamCnt(TapiHandle *handle, int result, void *data, void *user_data);
-void TapiEventGetParam(TapiHandle *handle, int result, void *data, void *user_data);
-
-void TapiEventSatSmsRefresh(TapiHandle *handle, int result, void *data, void *user_data);
-void TapiEventSatSendSms(TapiHandle *handle, int result, void *data, void *user_data);
-void TapiEventSatMoSmsCtrl(TapiHandle *handle, int result, void *data, void *user_data);
-
-void TapiEventSimFileInfo(TapiHandle *handle, int result, void *data, void *user_data);
-void TapiEventSimReadFile(TapiHandle *handle, int result, void *data, void *user_data);
-void TapiEventMemoryStatus(TapiHandle *handle, int result, void *data, void *user_data);
-
-void TapiEventSetMsgStatus(TapiHandle *handle, int result, void *data, void *user_data);
-
-void TapiEventGetMeImei(TapiHandle *handle, int result, void *data, void *user_data);
-
-void TapiEventSimStatusChange(TapiHandle *handle, const char *noti_id, void *data, void *user_data);
-
-void TapiEventNetworkStatusChange(TapiHandle *handle, const char *noti_id, void *data, void *user_data);
-
-void TapiEventSimRefreshed(TapiHandle *handle, const char *noti_id, void *data, void *user_data);
-
-SMS_NETWORK_STATUS_T convertTapiRespToSmsPlugin(int result);
+#include "SmsPluginTypes.h"
/*==================================================================================================
CLASS DEFINITIONS
==================================================================================================*/
-class SmsPluginCallback
+class SmsPluginCallbacks
{
public:
- static SmsPluginCallback* instance();
+ static void registerEvents();
+ static void deRegisterEvents();
+
+ static void tapiNotiSmsIncomMsg(TapiHandle *handle, const char *noti_id, void *data, void *user_data);
+ static void tapiNotiSmsCbIncomMsg(TapiHandle *handle, const char *noti_id, void *data, void *user_data);
+ static void tapiNotiSmsEtwsIncomMsg(TapiHandle *handle, const char *noti_id, void *data, void *user_data);
- void registerEvent();
- void deRegisterEvent();
+ static void tapiNotiSatSendSms(TapiHandle *handle, const char *noti_id, void *data, void *user_data);
+ static void tapiNotiSatMoSmControlResult(TapiHandle *handle, const char *noti_id, void *data, void *user_data);
+ static void tapiNotiSimStatus(TapiHandle *handle, const char *noti_id, void *data, void *user_data);
+ static void tapiNotiSimRefreshed(TapiHandle *handle, const char *noti_id, void *data, void *user_data);
-private:
- SmsPluginCallback();
- ~SmsPluginCallback();
+ static void tapiNotiSmsDeviceReady(TapiHandle *handle, const char *noti_id, void *data, void *user_data);
+ static void tapiNotiNetworkRegistrationStatus(TapiHandle *handle, const char *noti_id, void *data, void *user_data);
- static SmsPluginCallback* pInstance;
+ static void tapiNotiSmsMemoryStatus(TapiHandle *handle, const char *noti_id, void *data, void *user_data);
+ static void vconfDnetStateChanged(keynode_t *key, void* data);
};
#endif /* SMS_PLUGIN_CALLBACK_H */
#ifndef SMS_PLUGIN_DS_HANDLER_H
#define SMS_PLUGIN_DS_HANDLER_H
-
/*==================================================================================================
INCLUDE FILES
==================================================================================================*/
-#include "SmsPluginTypes.h"
+#include <map>
+#include <vector>
+#include <tapi_common.h>
+#include "SmsPluginTypes.h"
/*==================================================================================================
CLASS DEFINITIONS
class SmsPluginDSHandler
{
public:
+ enum HandleType {
+ H_3GPP,
+ H_3GPP2
+ };
+
static SmsPluginDSHandler* instance();
+
int initTelHandle();
void deinitTelHandle();
- TapiHandle *getTelHandle(int sim_idx);
+
+ TapiHandle *getTelHandle(int simIndex);
+ int getSimIndex(TapiHandle *handle);
int getTelHandleCount();
int getActiveSimCount();
- int getSimIndex(TapiHandle *handle);
- void getDefaultNetworkSimId(int *simId);
+ void getDefaultNetworkSimId(int *simIndex);
+ msg_error_t getSubscriberId(int simIndex, char **subscriber_id);
+
+
+ int getSmsFormat(TapiHandle *handle);
+ void setSmsFormat(TapiHandle *handle, int smsFormat);
- int getSubscriberId(unsigned int simIndex, char **subscriber_id);
+ bool getNeedToInitializeSim(TapiHandle *handle);
+ void setNeedToInitializeSim(TapiHandle *handle, bool needToInitialize);
+
+ HandleType getHandleType(TapiHandle *handle);
private:
+ SmsPluginDSHandler() = default;
+ ~SmsPluginDSHandler() = default;
+
static SmsPluginDSHandler* pInstance;
- SmsPluginDSHandler();
- virtual ~SmsPluginDSHandler();
- char **cp_list;
- SMS_TELEPHONY_HANDLE_LIST_S handle_list;
+ std::vector<std::pair<TapiHandle *, HandleType>> tapiHandles;
+ std::map<TapiHandle *, int> smsFormatInfo;
+ std::map<TapiHandle *, bool> _needToInitializeSim;
};
#endif /* SMS_PLUGIN_DS_HANDLER_H */
-
#ifndef SMS_PLUGIN_MAIN_H
#define SMS_PLUGIN_MAIN_H
-
/*==================================================================================================
INCLUDE FILES
==================================================================================================*/
-#include "SmsPluginTypes.h"
#include "MsgPluginInterface.h"
-
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-
/*==================================================================================================
FUNCTION PROTOTYPES
==================================================================================================*/
msg_error_t SmsPlgInitialize();
-
msg_error_t SmsPlgFinalize();
-
msg_error_t SmsPlgRegisterListener(MSG_PLUGIN_LISTENER_S *pListener);
-
msg_error_t SmsPlgSubmitRequest(MSG_REQUEST_INFO_S *pReqInfo);
-
msg_error_t SmsPlgSaveSimMessage(const MSG_MESSAGE_INFO_S *pMsgInfo, SMS_SIM_ID_LIST_S *pSimIdList);
-
-msg_error_t SmsPlgDeleteSimMessage(msg_sim_slot_id_t sim_idx, msg_sim_id_t SimMsgId);
-
-msg_error_t SmsPlgSetReadStatus(msg_sim_slot_id_t sim_idx, msg_sim_id_t SimMsgId);
-
+msg_error_t SmsPlgDeleteSimMessage(msg_sim_slot_id_t simIndex, msg_sim_id_t SimMsgId);
+msg_error_t SmsPlgSetReadStatus(msg_sim_slot_id_t simIndex, msg_sim_id_t SimMsgId);
msg_error_t SmsPlgSetMemoryStatus(msg_sim_slot_id_t simIndex, msg_error_t Error);
-
msg_error_t SmsPlgSetConfigData(const MSG_SETTING_S *pSetting);
-
msg_error_t SmsPlgGetConfigData(MSG_SETTING_S *pSetting);
-
msg_error_t SmsPlgAddMessage(MSG_MESSAGE_INFO_S *pMsgInfo, MSG_SENDINGOPT_INFO_S* pSendOptInfo, char* pFileData);
-
msg_error_t SmsPlgGetDefaultNetworkSimId(int *simId);
-#ifdef __cplusplus
-}
-#endif
-
#endif /* SMS_PLUGIN_MAIN_H */
-
#ifndef SMS_PLUGIN_STORAGE_H
#define SMS_PLUGIN_STORAGE_H
-
/*==================================================================================================
INCLUDE FILES
==================================================================================================*/
-#include "MsgMutex.h"
+#include <list>
#include "MsgStorageTypes.h"
-#include "SmsPluginTypes.h"
#include "MsgInternalTypes.h"
#include "MsgSqliteWrapper.h"
-#include <list>
-extern "C"
-{
- #include <tapi_common.h>
- #include <TelSms.h>
- #include <TapiUtility.h>
- #include <ITapiNetText.h>
-}
/*==================================================================================================
CLASS DEFINITIONS
public:
static SmsPluginStorage* instance();
- msg_error_t insertMsgRef(MSG_MESSAGE_INFO_S *pMsg, unsigned char msgRef, int index);
- msg_error_t updateMsgDeliverStatus(MSG_MESSAGE_INFO_S *pMsgInfo, unsigned char msgRef);
-
msg_error_t updateSentMsg(MSG_MESSAGE_INFO_S *pMsgInfo, msg_network_status_t Status);
-/* msg_error_t updateMsgRef(msg_message_id_t MsgId, unsigned char MsgRef); */
-/* msg_error_t updateStatusReport(unsigned char MsgRef, msg_delivery_report_status_t Status, time_t DeliveryTime); */
-
- msg_error_t addSimMessage(MSG_MESSAGE_INFO_S *pSimMsgInfo, int *simIdList);
- msg_error_t insertSimMessage(int simId, int msgId);
- msg_error_t deleteSimMessage(int sim_idx, int simId);
- msg_error_t checkMessage(MSG_MESSAGE_INFO_S *pMsgInfo);
msg_error_t addSmsMessage(MSG_MESSAGE_INFO_S *pMsgInfo);
+ msg_error_t updateSmsMessage(MSG_MESSAGE_INFO_S *pMsgInfo);
msg_error_t deleteSmsMessage(msg_message_id_t msgId);
-#if 0
- msg_error_t isReceivedCBMessage(SMS_CBMSG_PAGE_S CbPage);
- msg_error_t insertReceivedCBMessage(SMS_CBMSG_PAGE_S CbPage);
-#endif
msg_error_t addSmsSendOption(MSG_MESSAGE_INFO_S *pMsg, MSG_SENDINGOPT_INFO_S *pSendOptInfo);
- msg_error_t getReplaceSimMsg(const MSG_MESSAGE_INFO_S *pMsg, int *pMsgId, int *pSimId);
-
+ msg_error_t checkMessage(MSG_MESSAGE_INFO_S *pMsgInfo);
msg_error_t checkStorageStatus(MSG_MESSAGE_INFO_S *pMsgInfo);
+
+ msg_error_t deleteFailedIndex(MsgDbHandler *pDbHandle, msg_message_id_t msgId);
+ msg_error_t setFailedIndex(MsgDbHandler *pDbHandle, msg_message_id_t msgId, int failedIndex);
+ int getFailedIndex(MsgDbHandler *pDbHandle, msg_message_id_t msgId);
+ bool isDuplicatedCBMsg(MSG_MESSAGE_INFO_S *pMsgInfo);
+
msg_error_t getRegisteredPushEvent(char* pPushHeader, int *count, char *app_id, int app_id_len, char *content_type, int content_type_len);
msg_error_t getnthPushEvent(int index, int *appcode);
msg_error_t releasePushEvent();
- msg_error_t updateSmsMessage(MSG_MESSAGE_INFO_S *pMsgInfo);
- bool isDuplicatedCBMsg(MSG_MESSAGE_INFO_S *pMsgInfo);
- msg_error_t setFailedIndex(MsgDbHandler *pDbHandle, msg_message_id_t msgId, int failedIndex);
- int getFailedIndex(MsgDbHandler *pDbHandle, msg_message_id_t msgId);
- msg_error_t deleteFailedIndex(MsgDbHandler *pDbHandle, msg_message_id_t msgId);
private:
- SmsPluginStorage();
- ~SmsPluginStorage();
-
- msg_error_t addClass2Message(MSG_MESSAGE_INFO_S *pMsgInfo);
+ SmsPluginStorage() = default;
+ ~SmsPluginStorage() = default;
static SmsPluginStorage* pInstance;
- static void* class2_thread(void *data);
-
- MSG_MESSAGE_INFO_S msgInfo;
- MSG_ADDRESS_INFO_S addrInfo;
-
std::list<PUSH_APPLICATION_INFO_S> pushAppInfoList;
- /* unsigned char tmpMsgRef; */
};
#endif /* SMS_PLUGIN_STORAGE_H */
-
#ifndef SMS_PLUGIN_TYPES_H
#define SMS_PLUGIN_TYPES_H
-
/*==================================================================================================
INCLUDE FILES
==================================================================================================*/
#include "MsgStorageTypes.h"
#include "MsgSettingTypes.h"
-extern "C"
-{
- #include <tapi_common.h>
-}
-
/*==================================================================================================
DEFINES
==================================================================================================*/
-#define MAX_ADDRESS_LEN 21 /* including '+' */
-#define MAX_USER_DATA_LEN 160
-#define MAX_GSM_7BIT_DATA_LEN 160
-#define MAX_UCS2_DATA_LEN 140
-/* #define MAX_TPDU_DATA_LEN 165 */
-#define MAX_TPDU_DATA_LEN 255
-#define MAX_SMS_SEND_RETRY 4
-#define MAX_SMSC_LEN 20
-#define MAX_ADD_PARAM_LEN 12
-#define MAX_DCS_PARAM_LEN 1
-#define MAX_ABS_TIME_PARAM_LEN 7
-#define MAX_REL_TIME_PARAM_LEN 1
-#define MAX_UD_HEADER_NUM 7
-#define MAX_SAT_TPDU_LEN 175
-#define MAX_CBMSG_PAGE_SIZE 82
-#define MAX_CBMSG_TOTAL_PAGE_SIZE 1252 /* 6 + 1 + (MAX_CBMSG_PAGE_SIZE + 1) * MAX_CBMSG_PAGE_NUM = 1252 */
-#define MAX_ETWS_SIZE 56
-#define MAX_CBMSG_PAGE_NUM 15
-#define MAX_SIM_SMS_NUM 255
-#define MAX_SIM_IMSI_NUM 20
-#define MAX_SIM_MSP_CNT 2
-
-#define SMS_PUSH_XML_HREF_TAG "href"
-#define SMS_PUSH_XML_SI_ID_TAG "si-id"
-#define SMS_PUSH_XML_CREATED_TAG "created"
-#define SMS_PUSH_XML_EXPIRES_TAG "si-expires"
-#define SMS_PUSH_XML_ACTION_TAG "action"
-
-#define SMS_PUSH_XML_INVAL_OBJ "invalidate-object"
-#define SMS_PUSH_XML_INVAL_SVC "invalidate-service"
-#define SMS_PUSH_XML_CO_URI "uri"
+#define MAX_SMS_SEND_RETRY 4
+#define MAX_SMS_SEND_RETRY_FOR_3GPP2 2
/*==================================================================================================
TYPES
==================================================================================================*/
-typedef unsigned char SMS_TPDU_TYPE_T; /* _SMS_TPDU_TYPE_E */
-
-typedef unsigned char SMS_VPF_T; /* _SMS_VPF_E */
-
-typedef unsigned char SMS_TON_T; /* _SMS_TON_E */
-
-typedef unsigned char SMS_NPI_T; /* _SMS_NPI_E */
-
-typedef unsigned char SMS_PID_T; /* _SMS_PID_E */
-
-typedef unsigned char SMS_MSG_CLASS_T; /* _SMS_MSG_CLASS_E */
-
-typedef unsigned char SMS_CODING_SCHEME_T; /* _SMS_CODING_SCHEME_E */
-
-typedef unsigned char SMS_CODING_GROUP_T; /* _SMS_CODING_GROUP_E */
-
-typedef unsigned char SMS_INDICATOR_TYPE_T; /* _SMS_INDICATOR_TYPE_E */
-
-typedef unsigned char SMS_TIME_FORMAT_T; /* _SMS_TIME_FORMAT_E */
-
-typedef unsigned char SMS_FAIL_CAUSE_T; /* _SMS_FAIL_CAUSE_E */
-
-typedef unsigned char SMS_STATUS_T; /* _SMS_STATUS_E */
-
-typedef unsigned char SMS_REF_NUMBER_T; /* _SMS_REF_NUMBER_E */
-
-typedef unsigned char SMS_REPORT_TYPE_T; /* _SMS_REPORT_TYPE_E */
-
-typedef unsigned char SMS_UDH_TYPE_T; /* _SMS_UDH_TYPE_E */
-
-typedef unsigned char SMS_WAP_APP_CODE_T; /* _SMS_WAP_APP_CODE_E */
-
-typedef unsigned char SMS_CB_NETWORK_TYPE_T; /* _SMS_CB_NETWORK_TYPE_E */
-
-typedef unsigned char SMS_CBMSG_TYPE_T; /* _SMS_CBMSG_TYPE_E */
-
-typedef unsigned char SMS_CBMSG_LANG_TYPE_T; /* _SMS_CBMSG_LANG_TYPE_E */
-
-typedef unsigned char SMS_CBMSG_CODING_GROUP_T; /* _SMS_CBMSG_CODING_GROUP_E */
-
-typedef unsigned char SMS_SAT_CMD_TYPE_T; /* _SMS_SAT_CMD_TYPE_E */
-
-typedef unsigned short SMS_SIM_EFILE_NAME_T; /* _SMS_SIM_EFILE_NAME_E */
-
-typedef unsigned char SMS_SIM_MAILBOX_TYPE_T; /* _SMS_SIM_MAILBOX_TYPE_E */
-
-typedef unsigned char SMS_NETWORK_STATUS_T; /* _SMS_NETWORK_STATUS_E */
-
/*==================================================================================================
ENUMS
==================================================================================================*/
-enum _SMS_TPDU_TYPE_E {
- SMS_TPDU_SUBMIT,
- SMS_TPDU_DELIVER,
- SMS_TPDU_DELIVER_REP,
- SMS_TPDU_STATUS_REP,
-};
-
-
-enum _SMS_VPF_E {
- SMS_VPF_NOT_PRESENT = 0,
- SMS_VPF_ENHANCED,
- SMS_VPF_RELATIVE,
- SMS_VPF_ABSOLUTE,
-};
-
-
-enum _SMS_TON_E {
- SMS_TON_UNKNOWN = 0, /* unknown */
- SMS_TON_INTERNATIONAL, /* international */
- SMS_TON_NATIONAL, /* national */
- SMS_TON_NETWORK, /* network */
- SMS_TON_SUBSCRIBER, /* subscriber */
- SMS_TON_ALPHANUMERIC, /* alpha numberic */
- SMS_TON_ABBREVIATED, /* abbreviated */
- SMS_TON_RESERVE, /* reserve */
-};
-
-
-enum _SMS_NPI_E {
- SMS_NPI_UNKNOWN = 0, /* unknown */
- SMS_NPI_ISDN = 1, /* idsn */
- SMS_NPI_DATA = 3, /* data */
- SMS_NPI_TELEX = 4, /* telex */
- SMS_NPI_SMSC = 5, /* smsc */
- SMS_NPI_NATIONAL = 8, /* national */
- SMS_NPI_PRIVATE = 9, /* private */
- SMS_NPI_ERMES = 10, /* ermes */
-};
-
-
-enum _SMS_PID_E {
- SMS_PID_NORMAL = 0x00,
-
- SMS_PID_TELEX = 0x21,
- SMS_PID_GROUP3_TELEX = 0x22,
- SMS_PID_GROUP4_TELEX = 0x23,
- SMS_PID_VOICE = 0x24,
- SMS_PID_ERMES = 0x25,
- SMS_PID_NPS = 0x26,
- SMS_PID_VIDEO = 0x27,
- SMS_PID_TELETEX_UNSPEC = 0x28,
- SMS_PID_TELETEX_PSPDN = 0x29,
- SMS_PID_TELETEX_CSPDN = 0x2A,
- SMS_PID_TELETEX_PSTN = 0x2B,
- SMS_PID_TELETEX_ISDN = 0x2C,
- SMS_PID_UCI = 0x2D,
- SMS_PID_x400 = 0x31,
- SMS_PID_EMAIL = 0x32,
-
- SMS_PID_TYPE0 = 0x40,
- SMS_PID_REPLACE_TYPE1 = 0x41,
- SMS_PID_REPLACE_TYPE2 = 0x42,
- SMS_PID_REPLACE_TYPE3 = 0x43,
- SMS_PID_REPLACE_TYPE4 = 0x44,
- SMS_PID_REPLACE_TYPE5 = 0x45,
- SMS_PID_REPLACE_TYPE6 = 0x46,
- SMS_PID_REPLACE_TYPE7 = 0x47,
-
- SMS_PID_RETURN_CALL = 0x5F,
-};
-
-
-enum _SMS_MSG_CLASS_E {
- SMS_MSG_CLASS_0 = 0,
- SMS_MSG_CLASS_1,
- SMS_MSG_CLASS_2,
- SMS_MSG_CLASS_3,
- SMS_MSG_CLASS_NONE,
-};
-
-
-enum _SMS_CODING_SCHEME_E {
- SMS_CHARSET_7BIT = 0,
- SMS_CHARSET_8BIT,
- SMS_CHARSET_UCS2,
- SMS_CHARSET_AUTO,
- SMS_CHARSET_EUCKR,
-};
-
-
-enum _SMS_CODING_GROUP_E {
- SMS_GROUP_GENERAL = 0,
- SMS_GROUP_CODING_CLASS,
- SMS_GROUP_DELETION,
- SMS_GROUP_DISCARD,
- SMS_GROUP_STORE,
- SMS_GROUP_UNKNOWN,
-};
-
-
-enum _SMS_INDICATOR_TYPE_E {
- SMS_VOICE_INDICATOR = 0,
- SMS_VOICE2_INDICATOR, /* Only for CPSH */
- SMS_FAX_INDICATOR,
- SMS_EMAIL_INDICATOR,
- SMS_OTHER_INDICATOR,
-};
-
-
-enum _SMS_TIME_FORMAT_E {
- SMS_TIME_RELATIVE = 0,
- SMS_TIME_ABSOLUTE
-};
-
-
-enum _SMS_FAIL_CAUSE_E {
- SMS_FC_MSG_TYPE0_NOT_SUPPORTED = 0x81,
- SMS_FC_SM_CANNOT_BE_REPLACED = 0x82,
- SMS_FC_UNSPEC_PID_ERROR = 0x8F,
- SMS_FC_MSG_CLASS_NOT_SUPPORTED = 0x91,
- SMS_FC_UNSPEC_DCS_ERROR = 0x9F,
- SMS_FC_TPDU_NOT_SUPPORTED = 0xB0,
- SMS_FC_SIM_STORAGE_FULL = 0xD0,
- SMS_FC_NO_STORAGE_IN_SIM = 0xD1,
- SMS_FC_ERROR_IN_MS = 0xD2,
- SMS_FC_MSG_CAPA_EXCEEDED = 0xD3,
- SMS_FC_SAT_BUSY = 0xD4,
- SMS_FC_SIM_DOWNLOAD_ERROR = 0xD5,
- SMS_FC_UNSPEC_ERROR = 0xFF,
-};
-
-
-enum _SMS_STATUS_E {
- SMS_STATUS_RECEIVE_SUCCESS = 0x00,
- SMS_STATUS_UNABLE_TO_CONFIRM_DELIVER = 0x01,
- SMS_STATUS_REPLACED = 0x02,
- SMS_STATUS_SMSC_SPECIFIC_LAST = 0x1F,
-
- SMS_STATUS_TRY_CONGESTION = 0x20,
- SMS_STATUS_TRY_SME_BUSY = 0x21,
- SMS_STATUS_TRY_NO_RESPONSE = 0x22,
- SMS_STATUS_TRY_SERVICE_REJECTED = 0x23,
- SMS_STATUS_TRY_QOS_NOT_AVAILABLE = 0x24,
- SMS_STATUS_TRY_REQUEST_PENDING = 0x30,
-
- SMS_STATUS_PERM_REMOTE_ERROR = 0x40,
- SMS_STATUS_PERM_IMCOMPATIBLE_DEST = 0x41,
- SMS_STATUS_PERM_CONNECTION_REJECTED = 0x42,
- SMS_STATUS_PERM_NOT_OBTAINABLE = 0x43,
- SMS_STATUS_PERM_QOS_NOT_AVAILABLE = 0x44,
- SMS_STATUS_PERM_NO_INTERWORK_AVAILABLE = 0x45,
- SMS_STATUS_PERM_MSG_VAL_PERIOD_EXPIRED = 0x46,
- SMS_STATUS_PERM_MSG_DEL_BY_ORIGIN_SME = 0x47,
- SMS_STATUS_PERM_MSG_DEL_BY_SMSC_ADMIN = 0x48,
- SMS_STATUS_PERM_MSG_NOT_EXIST = 0x49,
-
- SMS_STATUS_TEMP_CONGESTION = 0x60,
- SMS_STATUS_TEMP_SME_BUSY = 0x61,
- SMS_STATUS_TEMP_NO_RESPONSE = 0x62,
- SMS_STATUS_TEMP_SERVICE_REJECTED = 0x63,
- SMS_STATUS_TEMP_QOS_NOT_AVAILABLE = 0x64,
- SMS_STATUS_TEMP_ERROR_IN_SME = 0x65,
-};
-
-
-enum _SMS_REF_NUMBER_E {
- SMS_REF_NUM_8BIT = 0,
- SMS_REF_NUM_16BIT
-};
-
-
-enum _SMS_REPORT_TYPE_E {
- SMS_REPORT_POSITIVE = 0,
- SMS_REPORT_NEGATIVE
-};
-
-
-enum _SMS_UDH_TYPE_E {
- SMS_UDH_CONCAT_8BIT = 0x00,
- SMS_UDH_SPECIAL_SMS = 0x01,
- /* 0x02, 0x03 - Reserved */
- SMS_UDH_APP_PORT_8BIT = 0x04,
- SMS_UDH_APP_PORT_16BIT = 0x05,
- SMS_UDH_SC_CONTROL = 0x06,
- SMS_UDH_SRC_IND = 0x07,
- SMS_UDH_CONCAT_16BIT = 0x08,
- SMS_UDH_WCMP = 0x09,
- SMS_UDH_EMS_FIRST = 0x0a,
- SMS_UDH_EMS_LAST = 0x1f,
- SMS_UDH_ALTERNATE_REPLY_ADDRESS = 0x22,
- SMS_UDH_SINGLE_SHIFT = 0x24,
- SMS_UDH_LOCKING_SHIFT = 0x25,
- SMS_UDH_NONE = 0xFF,
-};
+typedef enum {
+ SMS_NETWORK_SEND_SUCCESS = 0x00,
+ SMS_NETWORK_SENDING,
+ SMS_NETWORK_SEND_PENDING,
+ SMS_NETWORK_SEND_FAIL,
+ SMS_NETWORK_SEND_FAIL_TIMEOUT,
+ SMS_NETWORK_SEND_FAIL_MANDATORY_INFO_MISSING,
+ SMS_NETWORK_SEND_FAIL_TEMPORARY,
+ SMS_NETWORK_SEND_FAIL_BY_MO_CONTROL_WITH_MOD,
+ SMS_NETWORK_SEND_FAIL_BY_MO_CONTROL_NOT_ALLOWED,
+ SMS_NETWORK_SEND_FAIL_FDN_RESTRICED,
+ SMS_NETWORK_SEND_FAIL_NO_ROUTING,
+ SMS_NETWORK_SEND_FAIL_UNKNOWN_SUBSCRIBER,
+ SMS_NETWORK_SEND_FAIL_MS_DISABLED,
+ SMS_NETWORK_SEND_FAIL_NETWORK_NOT_READY,
+} SMS_NETWORK_STATUS_T;
-enum _SMS_WAP_APP_CODE_E {
+typedef enum {
SMS_WAP_APPLICATION_DEFAULT = 0x00,
SMS_WAP_APPLICATION_PUSH_SI,
SMS_OMA_APPLICATION_DLOTA_UA,
SMS_WAP_APPLICATION_LBS,
-};
-
-
-enum _SMS_CB_NETWORK_TYPE_E {
- SMS_CB_NETWORK_TYPE_2G_GSM = 1,
- SMS_CB_NETWORK_TYPE_3G_UMTS,
-};
-
-
-enum _SMS_CBMSG_TYPE_E {
- SMS_CBMSG_TYPE_CBS = 1, /**< CBS */
- SMS_CBMSG_TYPE_SCHEDULE, /**< Schedule */
- SMS_CBMSG_TYPE_CBS41, /**< CBS41 */
- SMS_CBMSG_TYPE_JAVACBS, /**< JAVA-CB Message*/
- SMS_CBMSG_TYPE_ETWS,
-};
-
-
-enum _SMS_CBMSG_LANG_TYPE_E {
- SMS_CBMSG_LANG_GERMAN = 0x00,
- SMS_CBMSG_LANG_ENGLISH = 0x01,
- SMS_CBMSG_LANG_ITALIAN = 0x02,
- SMS_CBMSG_LANG_FRENCH = 0x03,
- SMS_CBMSG_LANG_SPANISH = 0x04,
- SMS_CBMSG_LANG_DUTCH = 0x05,
- SMS_CBMSG_LANG_SWEDISH = 0x06,
- SMS_CBMSG_LANG_DANISH = 0x07,
- SMS_CBMSG_LANG_PORTUGUESE = 0x08,
- SMS_CBMSG_LANG_FINNISH = 0x09,
- SMS_CBMSG_LANG_NORWEGIAN = 0x0a,
- SMS_CBMSG_LANG_GREEK = 0x0b,
- SMS_CBMSG_LANG_TURKISH = 0x0c,
- SMS_CBMSG_LANG_HUNGARIAN = 0x0d,
- SMS_CBMSG_LANG_POLISH = 0x0e,
- SMS_CBMSG_LANG_UNSPECIFIED = 0x0f,
-
- SMS_CBMSG_LANG_ISO639 = 0x10,
-
- SMS_CBMSG_LANG_CZECH = 0x20,
- SMS_CBMSG_LANG_HEBREW = 0x21,
- SMS_CBMSG_LANG_ARABIC = 0x22,
- SMS_CBMSG_LANG_RUSSIAN = 0x23,
- SMS_CBMSG_LANG_ICELANDIC = 0x24,
- SMS_CBMSG_LANG_RESERVED_25 = 0x25,
- SMS_CBMSG_LANG_RESERVED_26 = 0x26,
- SMS_CBMSG_LANG_RESERVED_27 = 0x27,
- SMS_CBMSG_LANG_RESERVED_28 = 0x28,
- SMS_CBMSG_LANG_RESERVED_29 = 0x29,
- SMS_CBMSG_LANG_RESERVED_2A = 0x2a,
- SMS_CBMSG_LANG_RESERVED_2B = 0x2b,
- SMS_CBMSG_LANG_RESERVED_2C = 0x2c,
- SMS_CBMSG_LANG_RESERVED_2D = 0x2d,
- SMS_CBMSG_LANG_RESERVED_2E = 0x2e,
- SMS_CBMSG_LANG_RESERVED_2F = 0x2f,
-
- SMS_CBMSG_LANG_DUMMY = 0xFF
-};
-
-
-enum _SMS_CBMSG_CODING_GROUP_E {
- SMS_CBMSG_CODGRP_GENERAL_DCS, /**< Bits 7..4 00xx */
- SMS_CBMSG_CODGRP_WAP, /**< 1110 Cell Broadcast */
- SMS_CBMSG_CODGRP_CLASS_CODING, /**< 1111 Cell Broadcast */
-};
-
-
-enum _SMS_SAT_CMD_TYPE_E {
- SMS_SAT_CMD_REFRESH,
- SMS_SAT_CMD_SEND_SMS,
- SMS_SAT_CMD_SMS_CTRL,
-};
-
-
-enum _SMS_SIM_EFILE_NAME_E {
- SMS_SIM_EFILE_USIM_SMS = 0x6A3C, /** < USIM Short Messages file */
- SMS_SIM_EFILE_USIM_SMSP = 0x6A42, /** < USIM SMS parameter */
- SMS_SIM_EFILE_USIM_SMSS = 0x6A43, /** < USIM SMS status */
- SMS_SIM_EFILE_USIM_CBMI = 0x6A45, /** < USIM Cell Broadcast Message Identifier */
- SMS_SIM_EFILE_USIM_MBDN = 0x6FC7, /** < USIM Mail Box Dialing Number */
- SMS_SIM_EFILE_SMS = 0x6F3C, /** < Short Messages file */
- SMS_SIM_EFILE_SMSP = 0x6F42, /** < SMS Parameter */
- SMS_SIM_EFILE_SMSS = 0x6F43, /** < SMS Status */
- SMS_SIM_EFILE_CBMI = 0x6F45, /** < Cell Broadcast Message Identifier */
- SMS_SIM_EFILE_MBDN = 0x6FC7, /** < Mail Box Dialing Number */
-};
-
-
-enum _SMS_SIM_MAILBOX_TYPE_E {
- SMS_SIM_MAILBOX_VOICE = 0x01,
- SMS_SIM_MAILBOX_VOICE2 = 0x02,
- SMS_SIM_MAILBOX_FAX = 0x03,
- SMS_SIM_MAILBOX_DATA = 0x04,
- SMS_SIM_MAILBOX_EMAIL = 0x05,
- SMS_SIM_MAILBOX_OTHER = 0x06,
-};
-
-
-enum _SMS_NETWORK_STATUS_E {
- SMS_NETWORK_SEND_SUCCESS = 0x00,
- SMS_NETWORK_SENDING,
- SMS_NETWORK_SEND_FAIL,
- SMS_NETWORK_SEND_FAIL_TIMEOUT,
- SMS_NETWORK_SEND_FAIL_MANDATORY_INFO_MISSING,
- SMS_NETWORK_SEND_FAIL_TEMPORARY,
- SMS_NETWORK_SEND_FAIL_BY_MO_CONTROL_WITH_MOD,
- SMS_NETWORK_SEND_FAIL_BY_MO_CONTROL_NOT_ALLOWED,
- SMS_NETWORK_SEND_FAIL_FDN_RESTRICED,
- SMS_NETWORK_SEND_FAIL_NO_ROUTING,
- SMS_NETWORK_SEND_PENDING,
-};
+} SMS_WAP_APP_CODE_T;
/*==================================================================================================
STRUCTURES
==================================================================================================*/
-typedef struct _SMS_ADDRESS_S {
- SMS_TON_T ton;
- SMS_NPI_T npi;
- char address[MAX_ADDRESS_LEN+1]; /* < null terminated string */
-} SMS_ADDRESS_S;
-
-
-typedef struct _SMS_DCS_S {
- bool bCompressed;
- bool bMWI;
- bool bIndActive;
- SMS_MSG_CLASS_T msgClass;
- SMS_CODING_SCHEME_T codingScheme;
- SMS_CODING_GROUP_T codingGroup;
- SMS_INDICATOR_TYPE_T indType;
-} SMS_DCS_S;
-
-
-typedef struct _SMS_TIME_REL_S {
- unsigned char time;
-} SMS_TIME_REL_S;
-
-
-typedef struct _SMS_TIME_ABS_S {
- unsigned char year;
- unsigned char month;
- unsigned char day;
- unsigned char hour;
- unsigned char minute;
- unsigned char second;
- int timeZone;
-} SMS_TIME_ABS_S;
-
-
-typedef struct _SMS_TIMESTAMP_S {
- SMS_TIME_FORMAT_T format;
-
- union {
- SMS_TIME_REL_S relative;
- SMS_TIME_ABS_S absolute;
- } time;
-} SMS_TIMESTAMP_S;
-
-
-typedef struct _SMS_CONCAT_8BIT_S {
- unsigned char msgRef;
- unsigned char totalSeg;
- unsigned char seqNum;
-} SMS_CONCAT_8BIT_S;
-
-
-typedef struct _SMS_CONCAT_16BIT_S {
- unsigned short msgRef;
- unsigned char totalSeg;
- unsigned char seqNum;
-} SMS_CONCAT_16BIT_S;
-
-
-typedef struct _SMS_APP_PORT_8BIT_S {
- unsigned char destPort;
- unsigned char originPort;
-} SMS_APP_PORT_8BIT_S;
-
-
-typedef struct _SMS_APP_PORT_16BIT_S {
- unsigned short destPort;
- unsigned short originPort;
-} SMS_APP_PORT_16BIT_S;
-
-
-typedef struct _SMS_SPECIAL_INDICATION_S {
- bool bStore;
- unsigned short msgInd;
- unsigned short waitMsgNum;
-} SMS_SPECIAL_INDICATION_S;
-
-
-typedef struct _SMS_UDH_S {
- SMS_UDH_TYPE_T udhType;
-
- union {
- SMS_CONCAT_8BIT_S concat8bit;
- SMS_CONCAT_16BIT_S concat16bit;
- SMS_APP_PORT_8BIT_S appPort8bit;
- SMS_APP_PORT_16BIT_S appPort16bit;
- SMS_SPECIAL_INDICATION_S specialInd;
- MSG_SINGLE_SHIFT_S singleShift;
- MSG_LOCKING_SHIFT_S lockingShift;
- SMS_ADDRESS_S alternateAddress;
- } udh;
-} SMS_UDH_S;
-
-
-typedef struct _SMS_USERDATA_S {
- int headerCnt;
- SMS_UDH_S header[MAX_UD_HEADER_NUM];
- int length;
- char data[MAX_USER_DATA_LEN+1];
-} SMS_USERDATA_S;
-
-
-typedef struct _SMS_TPUD_S {
- int udl;
- char ud[MAX_USER_DATA_LEN+1];
-} SMS_TPUD_S;
-
-
-typedef struct _SMS_SUBMIT_S {
- bool bRejectDup;
- bool bStatusReport;
- bool bHeaderInd;
- bool bReplyPath;
- unsigned char msgRef;
- SMS_VPF_T vpf;
- SMS_ADDRESS_S destAddress;
- SMS_PID_T pid;
- SMS_DCS_S dcs;
- SMS_TIMESTAMP_S validityPeriod;
- SMS_USERDATA_S userData;
-} SMS_SUBMIT_S;
-
-
-typedef struct _SMS_SUBMIT_DATA_S {
- SMS_ADDRESS_S destAddress;
- unsigned int segCount;
- SMS_USERDATA_S userData[MAX_SEGMENT_NUM];
-} SMS_SUBMIT_DATA_S;
-
-
-typedef struct _SMS_DELIVER_S {
- bool bMoreMsg;
- bool bStatusReport;
- bool bHeaderInd;
- bool bReplyPath;
- SMS_ADDRESS_S originAddress;
- SMS_PID_T pid;
- SMS_DCS_S dcs;
- SMS_TIMESTAMP_S timeStamp;
- SMS_USERDATA_S userData;
- SMS_TPUD_S udData;
-} SMS_DELIVER_S;
-
-
-typedef struct _SMS_DELIVER_REPORT_S {
- SMS_REPORT_TYPE_T reportType;
- bool bHeaderInd;
- SMS_FAIL_CAUSE_T failCause;
- unsigned char paramInd;
- SMS_PID_T pid;
- SMS_DCS_S dcs;
- SMS_USERDATA_S userData;
-} SMS_DELIVER_REPORT_S;
-
-
-typedef struct _SMS_STATUS_REPORT_S {
- bool bMoreMsg;
- bool bStatusReport;
- bool bHeaderInd;
- unsigned char msgRef;
- SMS_ADDRESS_S recipAddress;
- SMS_TIMESTAMP_S timeStamp;
- SMS_TIMESTAMP_S dischargeTime;
- SMS_STATUS_T status;
- unsigned char paramInd;
- SMS_PID_T pid;
- SMS_DCS_S dcs;
- SMS_USERDATA_S userData;
-} SMS_STATUS_REPORT_S;
-
-
-typedef struct _SMS_TPDU_S {
- SMS_TPDU_TYPE_T tpduType;
-
- union {
- SMS_SUBMIT_S submit;
- SMS_DELIVER_S deliver;
- SMS_DELIVER_REPORT_S deliverRep;
- SMS_STATUS_REPORT_S statusRep;
- } data;
-} SMS_TPDU_S;
-
-
-typedef struct {
- msg_request_id_t reqId; /**< Indicates the request ID, which is unique. When applications submit a request to the framework, this value will be set by the framework. */
- MSG_MESSAGE_INFO_S msgInfo; /**< Indicates the message structure to be sent by applications. */
- MSG_SENDINGOPT_INFO_S sendOptInfo;
-} SMS_REQUEST_INFO_S;
-
-
-typedef struct _SMS_SENT_INFO_S {
- SMS_REQUEST_INFO_S reqInfo; /**< Indicates the corresponding request structure. */
- bool bLast;
-} SMS_SENT_INFO_S;
-
-
-typedef struct _SMS_PUSH_APP_INFO_S {
- char* pContentType;
- char* pAppId;
- SMS_WAP_APP_CODE_T appCode;
-} SMS_PUSH_APP_INFO_S;
-
-
-typedef struct _SMS_CBMSG_SERIAL_NUM_S {
- unsigned char geoScope;
- unsigned char updateNum;
- unsigned short msgCode;
-} SMS_CBMSG_SERIAL_NUM_S;
-
-
-typedef struct _SMS_CBMSG_DCS_S {
- SMS_CBMSG_CODING_GROUP_T codingGroup; /**< Coding group, GSM 03.38 */
- SMS_MSG_CLASS_T classType; /**< The message class */
- bool bCompressed; /**< if text is compressed this is TRUE */
- SMS_CODING_SCHEME_T codingScheme; /**< How to encode a message. */
- SMS_CBMSG_LANG_TYPE_T langType;
- unsigned char iso639Lang[3]; /* 2 GSM chars and a CR char */
- bool bUDH;
- unsigned char rawData;
-} SMS_CBMSG_DCS_S;
-
-
-typedef struct _SMS_CBMSG_HEADER_S {
- SMS_CBMSG_SERIAL_NUM_S serialNum; /**< Cell Broadcast Serial number */
- unsigned short msgId; /**< Message identifier code */
- MSG_CB_LANGUAGE_TYPE_T langType; /**< Languages in CB Messages */
- SMS_CBMSG_DCS_S dcs; /**< Data coding scheme */
- unsigned char page; /**< current page number */
- unsigned char totalPages; /**< Total number of pages in this messages */
- time_t recvTime; /**< Msg Recv Time */
-} SMS_CBMSG_HEADER_S;
-
-
-typedef struct _SMS_CBMSG_PAGE_S {
- SMS_CBMSG_TYPE_T cbMsgType; /*CBS Msg or SCHEDULE Msg or CBS41 Msg */
- SMS_CBMSG_HEADER_S pageHeader; /**< CB Message Header */
- int pageLength; /**< message string length */
- char pageData[MAX_CBMSG_TOTAL_PAGE_SIZE*8/7+1]; /**< user data */
-} SMS_CBMSG_PAGE_S;
-
-
-typedef struct _SMS_CBMSG_S {
- SMS_CBMSG_TYPE_T cbMsgType; /*CBS Msg or SCHEDULE Msg or CBS41 Msg */
- unsigned short msgId; /**< Message identifier code */
- unsigned short serialNum; /* Serial number */
- SMS_MSG_CLASS_T classType; /**< The message class */
- SMS_CODING_SCHEME_T codingScheme; /**< How to encode a message. */
- time_t recvTime; /**< Msg Recv Time */
- int msgLength; /**< message string length */
- char msgData[MAX_CBMSG_TOTAL_PAGE_SIZE*8/7+1]; /**< user data */
-} SMS_CBMSG_S;
-
-typedef struct _SMS_ETWS_PRIMARY_S {
- time_t recvTime;
- SMS_CBMSG_SERIAL_NUM_S serialNum;
- unsigned short msgId;
- unsigned short warningType;
- unsigned char warningSecurityInfo[MAX_ETWS_SIZE-6];
-} SMS_ETWS_PRIMARY_S;
-
-
-typedef struct _SMS_WSP_CONTENTS_TYPE_S {
- char* contentsTypeName;
- unsigned char contentsTypeCode;
-} SMS_WSP_CONTENTS_TYPE_S;
-
-
-typedef struct _SMS_WSP_CHARSET_S {
- char* charsetName;
- unsigned short charsetCode;
-} SMS_WSP_CHARSET_S;
-
-
-typedef struct _SMS_WAP_UNREGISTER_CONTENTS_TYPE_S {
- char* contentsTypeName;
- unsigned short contentsTypeCode;
-} SMS_WAP_UNREGISTER_CONTENTS_TYPE_S;
-
-
-typedef struct _SMS_WSP_LANGUAGE_S {
- char* languageName;
- unsigned char languageCode;
-} SMS_WSP_LANGUAGE_S;
-
-
-typedef struct _SMS_WSP_HEADER_PARAMETER_S {
- char* parameterToken;
- unsigned int parameterCode;
-} SMS_WSP_HEADER_PARAMETER_S;
-
-
-typedef struct _SMS_WSP_METHOD_TYPE_S {
- char* methodName;
- unsigned char methodCode;
-} SMS_WSP_METHOD_TYPE_S;
-
-
-typedef struct _SMS_WSP_SECURITY_TYPE_S {
- char* SecurityTypeName;
- unsigned char SecurityTypeCode;
-} SMS_WSP_SECURITY_TYPE_S;
-
-
-/**
- * @brief Represents SIM count information.
- */
-typedef struct {
- unsigned int totalCount; /**< The total number of SIM */
- int usedCount; /**< The used number of SIM */
- int indexList[MAX_SIM_SMS_NUM]; /**< The SIM index list */
-} MSG_SIM_COUNT_S;
-
-
-/**
- * @brief Represents Concat SIM Msg information.
- */
-typedef struct {
- unsigned int simIdCnt; /**< The total number of SIM Msg ID*/
- msg_sim_id_t simIdList[MAX_SEGMENT_NUM]; /**< The SIM Msg ID List */
- char msgData[(MAX_MSG_DATA_LEN*MAX_SEGMENT_NUM)+1]; /**< user data */
-} SMS_CONCAT_SIM_MSG_S;
-
-
-/**
- * @brief Represents Sim Mailbox information
- */
-typedef struct {
- int b_cphs;
- int rec_index; /**< index which stands for the location where record is saved in SIM*/
- int profile_num; /**< SIM profile index*/
- SMS_SIM_MAILBOX_TYPE_T mb_type;
- int alpha_id_max_len; /**< alpha max length in SIM - READ ONLY*/
- char alpha_id[MAX_SIM_XDN_ALPHA_ID_LEN + 1]; /**< Alpha Identifier */
- MSG_SMS_TON_T ton; /**< Type Of Number */
- MSG_SMS_NPI_T npi; /**< Number Plan Identity */
- char num[MAX_PHONE_NUMBER_LEN + 1]; /**< Dialing Number/SSC String */
- unsigned char cc_id; /**< Capability/Configuration Identifier */
- unsigned char ext1_id; /**< Extensiion1 Record Identifier */
- int num_len; /**< Length of the original number read from SIM*/
-} SMS_SIM_MAILBOX_INFO_S;
-
-
-/**
- * @brief Represents Sim Mailbox list
- */
-typedef struct {
- int count;
- SMS_SIM_MAILBOX_INFO_S list[MAX_SIM_MSP_CNT*5]; /* max is 10 */
-} SMS_SIM_MAILBOX_LIST_S;
-
-
-/**
- * @brief Represents Message Waiting Indication
- */
-typedef struct {
- int rec_index;
- unsigned char indicator_status; /**< Indicator Type*/
- int voice_count; /**< VoiceMail Count*/
- int fax_count; /**< FAX Count*/
- int email_count; /**< Email Count*/
- int other_count; /**< Other Count*/
- int video_count; /**< VideoMail Count*/
-} SMS_SIM_MWI_NORMAL_INFO_S;
-
-
-/**
- * @brief Represents Message Waiting Indication list
- */
-typedef struct {
- int profile_count;
- SMS_SIM_MWI_NORMAL_INFO_S mw_info[MAX_SIM_MSP_CNT];
-} SMS_SIM_MWI_LIST_S;
-
-
-/**
- * @brief Represents Message Waiting Indication for CPHS
- */
-typedef struct {
- int b_voice1; /**< VoiceMsgLine1 message waiting flag */
- int b_voice2; /**< VoiceMsgLine2 message waiting flag */
- int b_fax; /**< FAX message waiting flag */
- int b_data; /**< Data message waiting flag */
-} SMS_SIM_MWI_CPHS_INFO_S;
-
-
-/**
- * @brief Represents Message Waiting Indication Information
- */
-typedef struct {
- int b_cphs;
- SMS_SIM_MWI_LIST_S mwi_list;
- SMS_SIM_MWI_CPHS_INFO_S cphs_mwi;
-} SMS_SIM_MWI_INFO_S;
-
-/**
- * @brief Represents SIM MSISDN Information
- */
-typedef struct {
- char simMsisdn[MAX_SIM_MSISDN_LEN + 1];
- int sim_index;
-} SMS_SIM_MSISDN_INFO_S;
-
-
-/**
- * @brief Represents Message Data Information from Telephony.
- */
-typedef struct {
- unsigned char sca[MAX_ADDRESS_LEN]; /**< Service Center address */
- int msgLength; /**< Size of array szData (which is actual TPDU message) */
- unsigned char szData[MAX_TPDU_DATA_LEN + 1]; /**< SMS TPDU message */
- int totalSegment; /** total segment count of TPDU message */
-} SMS_DATA_INFO_S;
-
-
-/**
- * @brief Represents Telephony Handle from Telephony.
- */
-typedef struct {
- int count;
- struct tapi_handle *handle[MAX_TELEPHONY_HANDLE_CNT]; /* max is 3 */
-} SMS_TELEPHONY_HANDLE_LIST_S;
#endif /* SMS_PLUGIN_TYPES_H */
return "MSG_CMD_UPDATE_IMSI";
case MSG_CMD_SET_TEMP_ADDRESS_TABLE:
return "MSG_CMD_SET_TEMP_ADDRESS_TABLE";
-
-#ifdef FEATURE_SMS_CDMA
+/* 85 */
case MSG_CMD_PLG_CHECK_UNIQUENESS:
return "MSG_CMD_PLG_CHECK_UNIQUENESS";
-#endif
case MSG_CMD_ALLOW_TCS_MESSAGE:
return "MSG_CMD_ALLOW_TCS_MESSAGE";
case MSG_CMD_CHECK_PERMISSION:
return "MSG_EVENT_UPDATE_IMSI";
case MSG_EVENT_SET_TEMP_ADDRESS_TABLE:
return "MSG_EVENT_SET_TEMP_ADDRESS_TABLE";
-
-#ifdef FEATURE_SMS_CDMA
+/* 85 */
case MSG_EVENT_PLG_CHECK_UNIQUENESS:
return "MSG_EVENT_PLG_CHECK_UNIQUENESS";
-#endif
case MSG_EVENT_ALLOW_TCS_MESSAGE:
return "MSG_EVENT_ALLOW_TCS_MESSAGE";
case MSG_EVENT_CHECK_PERMISSION:
}
-int MsgTextConvert::convertUTF8ToAuto(OUT unsigned char *pDestText, IN int maxLength, IN const unsigned char *pSrcText, IN int srcTextLen, OUT msg_encode_type_t *pCharType)
+int MsgTextConvert::convertUTF8ToAuto(OUT unsigned char *pDestText, IN int maxLength, IN const unsigned char *pSrcText, IN int srcTextLen, IN msg_encode_type_t defaultEncodingType, OUT msg_encode_type_t *pCharType)
{
int utf8Length = 0;
int gsm7bitLength = 0;
ucs2Length = convertUTF8ToUCS2((unsigned char*)pUCS2Text, maxUCS2Length * sizeof(WCHAR), pSrcText, srcTextLen);
- if(ucs2Length < 0) {
+ if (ucs2Length < 0) {
*pCharType = MSG_ENCODE_8BIT;
if (srcTextLen <= maxLength) {
return maxLength;
}
} else {
-#ifndef FEATURE_SMS_CDMA
- gsm7bitLength = convertUCS2ToGSM7bitAuto(pDestText, maxLength, (unsigned char*)pUCS2Text, ucs2Length, &bUnknown);
-#else
- gsm7bitLength = convertUCS2ToASCII(pDestText, maxLength, (unsigned char*)pUCS2Text, ucs2Length, &bUnknown);
-#endif
+ if (defaultEncodingType == MSG_ENCODE_ASCII7BIT) {
+ gsm7bitLength = convertUCS2ToASCII(pDestText, maxLength, (unsigned char*)pUCS2Text, ucs2Length, &bUnknown);
+ *pCharType = MSG_ENCODE_ASCII7BIT;
+ } else {
+ gsm7bitLength = convertUCS2ToGSM7bitAuto(pDestText, maxLength, (unsigned char*)pUCS2Text, ucs2Length, &bUnknown);
+ *pCharType = MSG_ENCODE_GSM7BIT;
+ }
if (bUnknown == true) {
*pCharType = MSG_ENCODE_UCS2;
return maxLength;
}
}
- } else {
-#ifndef FEATURE_SMS_CDMA
- *pCharType = MSG_ENCODE_GSM7BIT;
-#else
- *pCharType = MSG_ENCODE_ASCII7BIT;
-#endif
}
return gsm7bitLength;
return outTextLen;
}
-#ifndef FEATURE_SMS_CDMA
int MsgTextConvert::convertUCS2ToGSM7bitAuto(OUT unsigned char *pDestText, IN int maxLength, IN const unsigned char *pSrcText, IN int srcTextLen, OUT bool *pUnknown)
{
/* for UNICODE */
return outTextLen;
}
-#else
+
int MsgTextConvert::convertUCS2ToASCII(OUT unsigned char *pDestText, IN int maxLength, IN const unsigned char *pSrcText, IN int srcTextLen, OUT bool *pUnknown)
{
/* for UNICODE */
return outTextLen;
}
-#endif
+
/**
args :
#include "MsgUtilStorage.h"
#include "MsgException.h"
-
static int msgCntLimit[MSG_COUNT_LIMIT_MAILBOX_TYPE_MAX][MSG_COUNT_LIMIT_MSG_TYPE_MAX] = {{10, 10, 0, 10, 10}, {5, 10, 0, 0, 0}, {10, 10, 0, 0, 0}, {10, 10, 0, 0, 0}, {0, 0, 10, 0, 0}};
using namespace std;
msg_error_t MsgStoAddCBChannelInfo(MsgDbHandler *pDbHandle, MSG_CB_CHANNEL_S *pCBChannel, msg_sim_slot_id_t simIndex)
{
-#ifndef FEATURE_SMS_CDMA
MSG_BEGIN();
char sqlQuery[MAX_QUERY_LEN] = {0, };
MSG_END();
return MSG_SUCCESS;
-#else /* TODO: Add multisim for CDMA */
- MSG_BEGIN();
-
- char sqlQuery[MAX_QUERY_LEN] = {0, };
-
- pDbHandle->beginTrans();
-
- memset(sqlQuery, 0x00, sizeof(sqlQuery));
- snprintf(sqlQuery, sizeof(sqlQuery), "DELETE FROM %s;", MSGFW_CDMA_CB_CHANNEL_INFO_TABLE_NAME);
-
- if (pDbHandle->execQuery(sqlQuery) != MSG_SUCCESS) {
- pDbHandle->endTrans(false);
- return MSG_ERR_DB_EXEC;
- }
-
- for (int i = 0; i < pCBChannel->channelCnt; i++) {
- memset(sqlQuery, 0x00, sizeof(sqlQuery));
- snprintf(sqlQuery, sizeof(sqlQuery), "INSERT INTO %s VALUES (%d, %d, %d, %d, '%s');", MSGFW_CDMA_CB_CHANNEL_INFO_TABLE_NAME,
- i, pCBChannel->channelInfo[i].bActivate, pCBChannel->channelInfo[i].ctg,
- pCBChannel->channelInfo[i].lang, pCBChannel->channelInfo[i].name);
-
- if (pDbHandle->execQuery(sqlQuery) != MSG_SUCCESS) {
- pDbHandle->endTrans(false);
- return MSG_ERR_DB_EXEC;
- }
- }
-
- pDbHandle->endTrans(true);
-
- MSG_END();
-
- return MSG_SUCCESS;
-#endif
}
msg_error_t MsgStoGetCBChannelInfo(MsgDbHandler *pDbHandle, MSG_CB_CHANNEL_S *pCBChannel, msg_sim_slot_id_t simIndex)
{
-#ifndef FEATURE_SMS_CDMA
MSG_BEGIN();
int rowCnt = 0, index = 0;
MSG_END();
return MSG_SUCCESS;
-#else /* TODO: Add multisim for CDMA */
+}
+
+
+msg_error_t MsgStoAddCBChannelInfo(MsgDbHandler *pDbHandle, MSG_CB_CHANNEL_S *pCBChannel)
+{
+ MSG_BEGIN();
+
+ char sqlQuery[MAX_QUERY_LEN] = {0,};
+
+ pDbHandle->beginTrans();
+
+ memset(sqlQuery, 0x00, sizeof(sqlQuery));
+ snprintf(sqlQuery, sizeof(sqlQuery), "DELETE FROM %s;", MSGFW_CDMA_CB_CHANNEL_INFO_TABLE_NAME);
+
+ if (pDbHandle->execQuery(sqlQuery) != MSG_SUCCESS) {
+ pDbHandle->endTrans(false);
+ return MSG_ERR_DB_EXEC;
+ }
+
+ for (int i = 0; i < pCBChannel->channelCnt; i++) {
+ memset(sqlQuery, 0x00, sizeof(sqlQuery));
+ snprintf(sqlQuery, sizeof(sqlQuery), "INSERT INTO %s VALUES (%d, %d, %d, %d, '%s');", MSGFW_CDMA_CB_CHANNEL_INFO_TABLE_NAME,
+ i, pCBChannel->channelInfo[i].bActivate, pCBChannel->channelInfo[i].ctg,
+ pCBChannel->channelInfo[i].lang, pCBChannel->channelInfo[i].name);
+
+ if (pDbHandle->execQuery(sqlQuery) != MSG_SUCCESS) {
+ pDbHandle->endTrans(false);
+ return MSG_ERR_DB_EXEC;
+ }
+ }
+
+ pDbHandle->endTrans(true);
+
+ MSG_END();
+
+ return MSG_SUCCESS;
+}
+
+
+msg_error_t MsgStoGetCBChannelInfo(MsgDbHandler *pDbHandle, MSG_CB_CHANNEL_S *pCBChannel)
+{
MSG_BEGIN();
int rowCnt = 0, index = 0;
pDbHandle->freeTable();
return MSG_ERR_DB_NORECORD;
} else if (err != MSG_SUCCESS) {
- MSG_DEBUG("Fail to getTable().");
+ MSG_ERR("Fail to getTable().");
pDbHandle->freeTable();
return MSG_ERR_DB_GETTABLE;
}
pCBChannel->channelInfo[i].lang = pDbHandle->getColumnToInt(index++);
pDbHandle->getColumnToString(index++, CB_CHANNEL_NAME_MAX, pCBChannel->channelInfo[i].name);
- MSG_DEBUG("CH_ACT = %d", pCBChannel->channelInfo[i].bActivate);
- MSG_DEBUG("CH_CTG = %d", pCBChannel->channelInfo[i].ctg);
- MSG_DEBUG("CH_LANG = %d", pCBChannel->channelInfo[i].lang);
- MSG_DEBUG("CH_NAME = %s", pCBChannel->channelInfo[i].name);
+ MSG_DEBUG("CH_ACT: [%d], CH_CTG: [%d], CH_LANG: [%d], CH_NAME: [%s]",
+ pCBChannel->channelInfo[i].bActivate, pCBChannel->channelInfo[i].ctg, pCBChannel->channelInfo[i].lang, pCBChannel->channelInfo[i].name);
}
pDbHandle->freeTable();
MSG_END();
return MSG_SUCCESS;
-#endif
}
+
+
msg_error_t MsgStoGetThreadViewList(const MSG_SORT_RULE_S *pSortRule, msg_struct_list_s *pThreadViewList)
{
MsgDbHandler *dbHandle = getDbHandle();
}
-#ifdef FEATURE_SMS_CDMA
msg_error_t MsgStoClearUniquenessTable()
{
MSG_BEGIN();
return err;
}
-#endif
+
+
+msg_error_t MsgStoGetSimIndexByMsgId(msg_message_id_t msgId, int* simIndex)
+{
+ MSG_BEGIN();
+
+ msg_error_t err = MSG_SUCCESS;
+
+ MsgDbHandler *dbHandle = getDbHandle();
+
+ char sqlQuery[MAX_QUERY_LEN+1];
+ memset(sqlQuery, 0x00, sizeof(sqlQuery));
+ snprintf(sqlQuery, sizeof(sqlQuery), "SELECT SIM_INDEX FROM %s WHERE MSG_ID = %d;", MSGFW_MESSAGE_TABLE_NAME, msgId);
+
+ if (dbHandle->prepareQuery(sqlQuery) != MSG_SUCCESS) {
+ return MSG_ERR_DB_PREPARE;
+ }
+
+ if (dbHandle->stepQuery() == MSG_ERR_DB_ROW) {
+ *simIndex = dbHandle->columnInt(0);
+ dbHandle->finalizeQuery();
+ } else {
+ MSG_DEBUG("MsgStepQuery() Error [%s]", sqlQuery);
+ dbHandle->finalizeQuery();
+ err = MSG_ERR_DB_STEP;
+ }
+
+ MSG_END();
+
+ return err;
+}
+
+
+msg_error_t MsgStoGetNetworkStatusByMsgId(msg_message_id_t msgId, int *networkStatus)
+{
+ char sqlQuery[MAX_QUERY_LEN + 1] = {0,};
+ MsgDbHandler *dbHandle = getDbHandle();
+
+ snprintf(sqlQuery, sizeof(sqlQuery), "SELECT NETWORK_STATUS FROM %s WHERE MSG_ID = %d;",
+ MSGFW_MESSAGE_TABLE_NAME, msgId);
+
+ if (dbHandle->prepareQuery(sqlQuery) != MSG_SUCCESS) {
+ return MSG_ERR_DB_PREPARE;
+ }
+
+ if (dbHandle->stepQuery() != MSG_ERR_DB_ROW) {
+ dbHandle->finalizeQuery();
+ return MSG_ERR_STORAGE_ERROR;
+ }
+
+ *networkStatus = dbHandle->columnInt(0);
+ dbHandle->finalizeQuery();
+
+ return MSG_SUCCESS;
+}