|
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 @internalComponent |
|
19 */ |
|
20 |
|
21 //defined for testing purposes only |
|
22 //#define TEST_CLIENT_CHANGES_ITS_MIND_ABOUT_CHALLENGE |
|
23 |
|
24 #ifndef __OBEXUTIL_H |
|
25 #define __OBEXUTIL_H |
|
26 |
|
27 #include <obexconstants.h> |
|
28 #include "obexconstantsinternal.h" |
|
29 #include "obexfaults.h" |
|
30 |
|
31 class TObexTransportInfo; |
|
32 |
|
33 //this macro traps the leave and if an error has occured it calls the function defined by _trap |
|
34 #define OBEX_TRAP(_trap, _stmt) TRAPD(_code, _stmt);if(_code != KErrNone) _trap (_code) |
|
35 |
|
36 inline TInt ObexHeaderType(TUint8 aHI) |
|
37 { |
|
38 return ((aHI & KObexHeaderTypeMask) >> KObexHeaderTypeOffset); |
|
39 } |
|
40 |
|
41 NONSHARABLE_CLASS(IrOBEXUtil) |
|
42 { |
|
43 public: |
|
44 static void Panic(TObexPanicCode aCode); |
|
45 static void Fault(TObexFaultCode aCode); |
|
46 static TInt EpocError(TUint8 aResp); |
|
47 static TObexResponse ObexResponse(TInt aErr,TObexResponse aDefault); |
|
48 static TObexTransportInfo* CreateTransportInfoL(TObexProtocolInfo& aObexProtocolInfoPtr, TObexProtocolPolicy& aObexProtocolPolicy); |
|
49 }; |
|
50 |
|
51 #endif // __OBEXUTIL_H |