Modify flora license version.
[platform/core/messaging/msg-service.git] / plugin / sms_plugin / include / SmsPluginParamCodec.h
1 /*
2 * Copyright 2012-2013  Samsung Electronics Co., Ltd
3 *
4 * Licensed under the Flora License, Version 1.1 (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://floralicense.org/license/
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_PARAMCODEC_H
18 #define SMS_PLUGIN_PARAMCODEC_H
19
20
21 /*==================================================================================================
22                                          INCLUDE FILES
23 ==================================================================================================*/
24 #include "SmsPluginTypes.h"
25
26
27 /*==================================================================================================
28                                      CLASS DEFINITIONS
29 ==================================================================================================*/
30 class SmsPluginParamCodec
31 {
32 public:
33         SmsPluginParamCodec();
34         virtual ~SmsPluginParamCodec();
35
36         static int encodeAddress(const SMS_ADDRESS_S *pAddress, char **ppParam);
37         static int encodeTime(const SMS_TIMESTAMP_S *pTimeStamp, char **ppParam);
38         static int encodeDCS(const SMS_DCS_S *pDCS, char **ppParam);
39         static int encodeSMSC(const char *pAddress, unsigned char *pEncodeAddr);
40         static int encodeSMSC(const SMS_ADDRESS_S *pAddress, unsigned char *pSMSC);
41
42         static int decodeAddress(const unsigned char *pTpdu, SMS_ADDRESS_S *pAddress);
43         static int decodeTime(const unsigned char *pTpdu, SMS_TIMESTAMP_S *pTimeStamp);
44         static int decodeDCS(const unsigned char *pTpdu, SMS_DCS_S *pDCS);
45         static void decodeSMSC(unsigned char* pAddress, int AddrLen, MSG_SMS_TON_T ton, char *pDecodeAddr);
46
47 private:
48         static int convertDigitToBcd(char *pDigit, int DigitLen, unsigned char *pBcd);
49         static int convertBcdToDigit(const unsigned char *pBcd, int BcdLen, char *pDigit);
50 };
51
52 #endif //SMS_PLUGIN_PARAMCODEC_H