d703456004c60ecd0081de5e2e0751076db8eee2
[platform/core/messaging/msg-service.git] / plugin / sms_plugin / include / SmsPluginSatHandler.h
1 /*
2  * Copyright (c) 2014 Samsung Electronics Co., Ltd. All rights reserved
3  *
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
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
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.
15 */
16
17 #ifndef SMS_PLUGIN_SAT_HANDLER_H
18 #define SMS_PLUGIN_SAT_HANDLER_H
19
20
21 /*==================================================================================================
22                                          INCLUDE FILES
23 ==================================================================================================*/
24 #include "SmsPluginTypes.h"
25 #include "MsgMutex.h"
26
27 extern "C"
28 {
29         #include <TelSat.h>
30 }
31
32 /*==================================================================================================
33                                      CLASS DEFINITIONS
34 ==================================================================================================*/
35 class SmsPluginSatHandler
36 {
37 public:
38         static SmsPluginSatHandler* instance();
39
40         void refreshSms(TapiHandle *handle, void *pData);
41         void sendSms(TapiHandle *handle, void *pData);
42         void ctrlSms(TapiHandle *handle, void *pData);
43         void ctrlSms(TapiHandle *handle, SMS_NETWORK_STATUS_T netStatus);
44
45         void finishSimMsgInit(msg_error_t Err);
46
47 private:
48         SmsPluginSatHandler();
49         virtual ~SmsPluginSatHandler();
50
51         void initSim();
52
53         void    initSMSCList();
54         void    initCBConfig();
55
56         int handleSatTpdu(unsigned char *pTpdu, unsigned char TpduLen, int bIsPackingRequired);
57
58         void sendResult(TapiHandle *handle, SMS_SAT_CMD_TYPE_T CmdType, int ResultType);
59
60         static SmsPluginSatHandler* pInstance;
61
62         int commandId;
63
64         bool bInitSim;
65         bool bSMSPChanged;
66         bool bCBMIChanged;
67
68         Mutex mx;
69         CndVar cv;
70 };
71
72 #endif /* SMS_PLUGIN_SAT_HANDLER_H */
73