607f71fab37616b85246f9288a5450a555ca4909
[platform/core/messaging/msg-service.git] / plugin / sms_cdma_plugin / include / SmsCdmaPluginTransport.h
1 /*
2  * Copyright (c) 2015 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_CDMA_PLUGIN_TRANSPORT_H
18 #define SMS_CDMA_PLUGIN_TRANSPORT_H
19
20
21 /*==================================================================================================
22                                          INCLUDE FILES
23 ==================================================================================================*/
24 #include "MsgInternalTypes.h"
25 #include "MsgMutex.h"
26 #include "SmsCdmaPluginTypes.h"
27
28 extern "C"
29 {
30         #include <TelSat.h>
31 }
32
33 /*==================================================================================================
34                                      CLASS DEFINITIONS
35 ==================================================================================================*/
36 class SmsPluginTransport
37 {
38 public:
39         static SmsPluginTransport* instance();
40
41         void submitRequest(sms_request_info_s *pReqInfo);
42         void sendDeliverReport(msg_error_t err, sms_trans_p2p_msg_s *p_p2p_msg);
43
44         void setNetStatus(sms_network_status_t sentStatus);
45
46 private:
47         SmsPluginTransport();
48         ~SmsPluginTransport();
49
50         static SmsPluginTransport* pInstance;
51
52         unsigned char getMsgRef();
53         unsigned char getSeqNum();
54         unsigned char getSubmitMsgId();
55
56         sms_network_status_t getNetStatus();
57
58         void convertMsgInfoToTelesvcMsg(const MSG_MESSAGE_INFO_S *pMsgInfo, sms_trans_msg_s *pMsg);
59         void convertMsgInfoToPtp(const MSG_MESSAGE_INFO_S *pMsgInfo, sms_trans_p2p_msg_s *pPtpMsg);
60         void convertMsgInfoToSubmit(const MSG_MESSAGE_INFO_S *pMsgInfo, sms_telesvc_submit_s *pSubmit);
61
62         unsigned char           msgRef;
63         unsigned char           msgSeqNum;
64         unsigned char           msgSubmitId;
65
66         unsigned char           msgRef8bit;
67         unsigned short          msgRef16bit;
68
69         sms_network_status_t    curStatus;
70
71         Mutex mx;
72         CndVar cv;
73 };
74
75 #endif /* SMS_PLUGIN_TRANSPORT_H */