24
|
1 |
// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
|
|
2 |
// All rights reserved.
|
|
3 |
// This component and the accompanying materials are made available
|
|
4 |
// under the terms of "Eclipse Public License v1.0"
|
|
5 |
// which accompanies this distribution, and is available
|
|
6 |
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
|
7 |
//
|
|
8 |
// Initial Contributors:
|
|
9 |
// Nokia Corporation - initial contribution.
|
|
10 |
//
|
|
11 |
// Contributors:
|
|
12 |
//
|
|
13 |
// Description:
|
|
14 |
//
|
|
15 |
|
|
16 |
/**
|
|
17 |
@file
|
|
18 |
@internalAll
|
|
19 |
*/
|
|
20 |
|
|
21 |
|
|
22 |
#ifndef __SIM_UTILS_H__
|
|
23 |
#define __SIM_UTILS_H__
|
|
24 |
|
|
25 |
#include <etel.h>
|
|
26 |
#include <et_phone.h>
|
|
27 |
#include <etelmm.h>
|
|
28 |
#include <etelpckt.h>
|
|
29 |
|
|
30 |
// This should always be used for calling the ReqCompleted() func when possible
|
|
31 |
#define SYMBIAN_EXTERR(aExtended, aBasic) ((aExtended << 16) | (aBasic & 0x0000FFFF))
|
|
32 |
#define SYMBIAN_REQEXTERR(aHandle, aExtended, aBasic) \
|
|
33 |
ReqCompleted(aHandle, SYMBIAN_EXTERR(aExtended, aBasic));
|
|
34 |
|
|
35 |
RCall::THookStatus ConvertStateToHook(RMobileCall::TMobileCallStatus aStatus);
|
|
36 |
RPhone::TMode ConvertStateToMode(RMobileCall::TMobileCallStatus aStatus);
|
|
37 |
TBool IsStateActive(RMobileCall::TMobileCallStatus aStatus);
|
|
38 |
void ConvertAsciiSms(const TDesC8& aAsciiPdu, TDes8& aOctetPdu);
|
|
39 |
void ConvertTextToBinary(const TDesC& aSrc, TDes8& aDst);
|
|
40 |
TInt AsciiToNum(const TPtrC8 aParam, TUint8& aVal);
|
|
41 |
TInt AsciiToNum(const TPtrC8 aParam, TUint16& aVal);
|
|
42 |
TInt AsciiToNum(const TPtrC8 aParam, TUint32& aVal);
|
|
43 |
TInt AsciiToNum(const TPtrC8 aParam, TInt32& aVal);
|
|
44 |
TInt ParseMixedBinaryAsciiDataL(TDes8& aTextToConvert);
|
|
45 |
TInt CharToSeptNumL(const TChar& aChar);
|
|
46 |
|
|
47 |
inline TInt AsciiHexToNum(const TPtrC8 aParam, TUint8& aVal);
|
|
48 |
|
|
49 |
// Most CSim Class will need this notification data.
|
|
50 |
struct TNotifyData
|
|
51 |
{
|
|
52 |
TBool iNotifyPending; //indicates if a notification is pending
|
|
53 |
TTsyReqHandle iNotifyHandle; //the TSY notification handle
|
|
54 |
TAny* iNotifyData; //Holds the data for the notification pending
|
|
55 |
};
|
|
56 |
|
|
57 |
/**
|
|
58 |
Used to specify format of the additional parameter in the config file that will
|
|
59 |
go into the PCO buffer.
|
|
60 |
*/
|
|
61 |
enum TConfigDataFormat
|
|
62 |
{
|
|
63 |
EConfigDataFormatAscii, // 0
|
|
64 |
EConfigDataFormatMixedBinaryAndAscii, // 1
|
|
65 |
EMaxConfigDataFormat
|
|
66 |
};
|
|
67 |
|
|
68 |
// Inline functions
|
|
69 |
|
|
70 |
inline TInt AsciiHexToNum(const TPtrC8 aParam, TUint8& aVal)
|
|
71 |
/**
|
|
72 |
* Converts a hexadecimal value stored in a TPtrC to its TUint value
|
|
73 |
*
|
|
74 |
* @param aParam TPtr pointing to the hexadecimal or number to convert
|
|
75 |
* @param aVal TUint reference to the val converted.
|
|
76 |
* @return TInt Standard error return.
|
|
77 |
*/
|
|
78 |
{
|
|
79 |
TLex8 lex(aParam.Left(2));
|
|
80 |
return lex.Val(aVal,EHex);
|
|
81 |
}
|
|
82 |
|
|
83 |
#endif // __SIM_UTILS_H__
|