|
1 /* |
|
2 * Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef SIMPLEOBEXSERVER_H |
|
20 #define SIMPLEOBEXSERVER_H |
|
21 |
|
22 #include <e32base.h> |
|
23 #include <e32cons.h> |
|
24 #include <obex.h> |
|
25 #include <btsdp.h> |
|
26 #include "simpleObexApp.h" |
|
27 |
|
28 |
|
29 /** |
|
30 * CObexServerHandler is a wrapper class that is responsible for setting up |
|
31 * and managing an OBEX Server. It implements MObexServerNotify as an interface |
|
32 * as is required to start an OBEX server. |
|
33 * |
|
34 */ |
|
35 |
|
36 class CObexServerHandler : public CBase, private MObexServerNotify |
|
37 { |
|
38 public: |
|
39 static CObexServerHandler* NewL(CActiveConsole* aParent, TTransport aTransport); |
|
40 |
|
41 void Stop(); |
|
42 ~CObexServerHandler(); |
|
43 |
|
44 void EnableAuthenticationL(); |
|
45 void DisableAuthentication(); |
|
46 |
|
47 private: |
|
48 CObexServerHandler(CActiveConsole* aParent); |
|
49 void ConstructL(TTransport aTransport); |
|
50 |
|
51 // Implementation of MObexServerNotify interface |
|
52 virtual void ErrorIndication (TInt aError); |
|
53 virtual void TransportUpIndication (); |
|
54 virtual void TransportDownIndication (); |
|
55 virtual TInt ObexConnectIndication (const TObexConnectInfo& aRemoteInfo, const TDesC8& aInfo); |
|
56 virtual void ObexDisconnectIndication (const TDesC8& aInfo); |
|
57 virtual CObexBufObject* PutRequestIndication (); |
|
58 virtual TInt PutPacketIndication (); |
|
59 virtual TInt PutCompleteIndication (); |
|
60 virtual CObexBufObject* GetRequestIndication (CObexBaseObject *aRequestedObject); |
|
61 virtual TInt GetPacketIndication (); |
|
62 virtual TInt GetCompleteIndication (); |
|
63 virtual TInt SetPathIndication (const CObex::TSetPathInfo& aPathInfo, const TDesC8& aInfo); |
|
64 virtual void AbortIndication (); |
|
65 |
|
66 void SetUpGetObjectL(CObexBaseObject *aRequestedObject); |
|
67 |
|
68 public: |
|
69 TBuf<16> iChallengePassword; |
|
70 TBuf<16> iResponsePassword; |
|
71 TBool iAcceptPuts; |
|
72 |
|
73 |
|
74 private: |
|
75 CActiveConsole* iParent; |
|
76 CObexServer* iServer; |
|
77 CObexBufObject* iObject; |
|
78 CBufFlat *iBuf; |
|
79 TTransport iTransportLayer; |
|
80 TBuf<32> iSessionPath; |
|
81 |
|
82 RSdp iSdp; |
|
83 RSdpDatabase iSdpdb; |
|
84 CSdpAttrValueDES* iProtDescList; |
|
85 |
|
86 TBool iBuffering; |
|
87 TBool iUseRFile; |
|
88 RFs iFs; |
|
89 RFile iFile; |
|
90 TBool iIsAuthenticationEnabled; |
|
91 |
|
92 }; |
|
93 |
|
94 |
|
95 #endif // SIMPLEOBEXSEVER_H |