2 * Copyright 2012-2013 Samsung Electronics Co., Ltd
4 * Licensed under the Flora License, Version 1.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://floralicense.org
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_PARAMCODEC_H
18 #define SMS_PLUGIN_PARAMCODEC_H
21 /*==================================================================================================
23 ==================================================================================================*/
24 #include "SmsPluginTypes.h"
27 /*==================================================================================================
29 ==================================================================================================*/
30 class SmsPluginParamCodec
33 SmsPluginParamCodec();
34 virtual ~SmsPluginParamCodec();
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);
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);
48 static int convertDigitToBcd(char *pDigit, int DigitLen, unsigned char *pBcd);
49 static int convertBcdToDigit(const unsigned char *pBcd, int BcdLen, char *pDigit);
52 #endif //SMS_PLUGIN_PARAMCODEC_H