2 * Copyright (c) 2014 Samsung Electronics Co., Ltd. All rights reserved
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 #ifndef SMS_PLUGIN_SIMMSG_H
18 #define SMS_PLUGIN_SIMMSG_H
21 /*==================================================================================================
23 ==================================================================================================*/
26 #include "MsgStorageTypes.h"
27 #include "SmsPluginTypes.h"
28 #include "MsgInternalTypes.h"
32 #include <tapi_common.h>
34 #include <TapiUtility.h>
35 #include <ITapiNetText.h>
38 /*==================================================================================================
40 ==================================================================================================*/
44 static SmsPluginSimMsg* instance();
46 void initSimMessage(struct tapi_handle *handle);
47 msg_error_t saveSimMessage(const MSG_MESSAGE_INFO_S *pMsgInfo, SMS_SIM_ID_LIST_S *pSimIdList);
48 msg_error_t saveClass2Message(const MSG_MESSAGE_INFO_S *pMsgInfo);
49 void deleteSimMessage(msg_sim_slot_id_t sim_idx, msg_sim_id_t SimMsgId);
50 void setReadStatus(msg_sim_slot_id_t sim_idx, msg_sim_id_t SimMsgId);
51 bool checkSimMsgFull(msg_sim_slot_id_t sim_idx, unsigned int SegCnt);
53 void setSimMsgCntEvent(struct tapi_handle *handle, const MSG_SIM_COUNT_S *pSimMsgCnt);
54 void setSimMsgEvent(struct tapi_handle *handle, const MSG_MESSAGE_INFO_S *pMsgInfo, bool bSuccess);
55 void setSaveSimMsgEvent(struct tapi_handle *handle, int simId, int result);
56 void setSaveClass2MsgEvent(struct tapi_handle *handle, int simId, int result, MSG_MESSAGE_INFO_S *data);
57 void setSimEvent(msg_sim_id_t SimId, bool bResult);
58 void setUpdateSimEvent(int SimId, bool bResult);
59 void setDelSimEvent(int SimId, bool bResult);
61 void setSmsData(const char *sca, const char *szData, int msgLength);
62 void setSmsTpduTotalSegCount(int totalSeg);
68 void getSimMsgCount(struct tapi_handle *handle, MSG_SIM_COUNT_S *pSimMsgCnt);
69 bool getSimMsg(struct tapi_handle *handle, msg_sim_id_t SimMsgId, MSG_MESSAGE_INFO_S* pMsgInfo, int *simIdList);
71 void setSmsOptions(const MSG_MESSAGE_INFO_S* pMsgInfo, SMS_DELIVER_S *pDeliver);
72 void convertTimeStamp(const MSG_MESSAGE_INFO_S* pMsgInfo, SMS_DELIVER_S *pDeliver);
74 bool getSimMsgCntEvent(struct tapi_handle *handle, MSG_SIM_COUNT_S *pSimMsgCnt);
75 bool getSimMsgEvent(struct tapi_handle *handle, MSG_MESSAGE_INFO_S *pMsgInfo);
76 bool getSimEvent(msg_sim_id_t *pSimId);
77 bool getUpdateSimEvent();
78 bool getDelSimEvent(int *pSimId);
81 static SmsPluginSimMsg* pInstance;
83 msg_sim_id_t simMsgId;
85 int simIdList[MAX_SIM_SMS_NUM]; /** send total simIds to handleSimMsg **/
87 MSG_SIM_COUNT_S simMsgCnt;
89 MSG_MESSAGE_INFO_S simMsgInfo;
90 MSG_ADDRESS_INFO_S simAddrInfo;
97 SMS_DATA_INFO_S simMsgDataInfo;
103 #endif /* SMS_PLUGIN_SIMMSG_H */