|
1 /* |
|
2 * Copyright (c) 2004 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 * BTSap session definition. |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 #ifndef BT_SAP_SESSION_H |
|
21 #define BT_SAP_SESSION_H |
|
22 |
|
23 // INCLUDES |
|
24 #include <e32svr.h> |
|
25 |
|
26 // Opcodes used in message passing between client and server |
|
27 enum TBTSapRequest |
|
28 { |
|
29 EBTSapManageService, |
|
30 EBTSapAcceptSapConnection, |
|
31 EBTSapRejectSapConnection, |
|
32 EBTSapDisconnectSapConnection, |
|
33 EBTSapIsConnected, |
|
34 EBTSapGetRemoteBTAddress |
|
35 }; |
|
36 |
|
37 // FORWARD DECLARATIONS |
|
38 class CBTSapServer; |
|
39 |
|
40 // CLASS DECLARATION |
|
41 |
|
42 /** |
|
43 * CBTSapSession class represent session on server side |
|
44 * |
|
45 */ |
|
46 class CBTSapSession : public CSession2 |
|
47 { |
|
48 public: // Constructors and destructor |
|
49 |
|
50 /** |
|
51 * Constructor. |
|
52 */ |
|
53 static CBTSapSession* NewL(); |
|
54 |
|
55 // 2nd phase construct for sessions - called byb the CServer2 framework |
|
56 void CreateL(); |
|
57 |
|
58 /** |
|
59 * Destructor. |
|
60 */ |
|
61 ~CBTSapSession(); |
|
62 |
|
63 public: // Functions from base classes |
|
64 |
|
65 /** |
|
66 * From CSession ServiceL |
|
67 * Client-server framework calls this function |
|
68 * to handle messages from client. |
|
69 * @param aMessage received message class |
|
70 * @return None |
|
71 */ |
|
72 void ServiceL(const RMessage2 &aMessage); |
|
73 |
|
74 /** |
|
75 * From CSession DispatchMessageL |
|
76 * Dispatchs and calls appropriate methods to |
|
77 * handle messages. |
|
78 * @param aMessage received message class |
|
79 * @return None |
|
80 */ |
|
81 void DispatchMessageL(const RMessage2 &aMessage); |
|
82 |
|
83 /** |
|
84 * From CSession Server |
|
85 * Returns reference to server. |
|
86 * @param None |
|
87 * @return Reference to server |
|
88 */ |
|
89 CBTSapServer& Server(); |
|
90 |
|
91 private: |
|
92 |
|
93 /** |
|
94 * C++ default constructor. |
|
95 */ |
|
96 CBTSapSession(); |
|
97 |
|
98 |
|
99 }; |
|
100 |
|
101 #endif // BT_SAP_SESSION_H |
|
102 |
|
103 // End of File |