|
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 #if (!defined __T_BLUETOOTH_PHYSICAL_LINKS_DATA_H__) |
|
20 #define __T_BLUETOOTH_PHYSICAL_LINKS_DATA_H__ |
|
21 |
|
22 // User Includes |
|
23 #include "DataWrapperBase.h" |
|
24 |
|
25 // EPOC includes |
|
26 #include <bt_sock.h> |
|
27 #include <bttypes.h> |
|
28 |
|
29 class CT_BluetoothPhysicalLinksData : public CDataWrapperBase, private MBluetoothPhysicalLinksNotifier |
|
30 { |
|
31 public: |
|
32 /** |
|
33 * Public destructor |
|
34 */ |
|
35 ~CT_BluetoothPhysicalLinksData(); |
|
36 |
|
37 /** |
|
38 * Two phase constructor |
|
39 */ |
|
40 static CT_BluetoothPhysicalLinksData* NewL(); |
|
41 |
|
42 /** |
|
43 * Process a command read from the ini file |
|
44 * |
|
45 * @param aCommand The command to process |
|
46 * @param aSection The section in the ini containing data for the command |
|
47 * @param aAsyncErrorIndex Command index for async calls to return errors to |
|
48 * |
|
49 * @return ETrue if the command is processed |
|
50 * |
|
51 * @leave System wide error |
|
52 */ |
|
53 virtual TBool DoCommandL(const TTEFFunction& aCommand, const TTEFSectionName& aSection, const TInt aAsyncErrorIndex); |
|
54 |
|
55 /** |
|
56 * Return a pointer to the object that the data wraps |
|
57 * |
|
58 * @return pointer to the object that the data wraps |
|
59 */ |
|
60 virtual TAny* GetObject(); |
|
61 |
|
62 /** |
|
63 * Set the object that the data wraps |
|
64 * |
|
65 * @param aObject object that the wrapper is testing |
|
66 * |
|
67 * @leave KErrNotSupported if the the function is not supported |
|
68 */ |
|
69 virtual void SetObjectL(TAny* aObject); |
|
70 |
|
71 /** |
|
72 * The object will no longer be owned by this |
|
73 * |
|
74 * @leave KErrNotSupported if the the function is not supported |
|
75 */ |
|
76 virtual void DisownObjectL(); |
|
77 |
|
78 inline virtual TCleanupOperation CleanupOperation(); |
|
79 |
|
80 protected: |
|
81 CT_BluetoothPhysicalLinksData(); |
|
82 void ConstructL(); |
|
83 |
|
84 private: |
|
85 void DestroyData(); |
|
86 |
|
87 // MBluetoothPhysicalLinksNotifier implementation |
|
88 virtual void HandleCreateConnectionCompleteL(TInt aErr); |
|
89 virtual void HandleDisconnectCompleteL(TInt aErr); |
|
90 virtual void HandleDisconnectAllCompleteL(TInt aErr); |
|
91 |
|
92 // Implementation of DoCommandL for each of the commands |
|
93 inline void DoCmdNewL(const TDesC& aSection); |
|
94 inline void DoCmdNewLC(const TDesC& aSection); |
|
95 inline void DoCmdCreateConnection(const TDesC& aSection, const TInt aAsyncErrorIndex); |
|
96 inline void DoCmdCancelCreateConnection(); |
|
97 inline void DoCmdDisconnect(const TDesC& aSection, const TInt aAsyncErrorIndex); |
|
98 inline void DoCmdDisconnectAll(const TDesC& aSection, const TInt aAsyncErrorIndex); |
|
99 inline void DoCmdBroadcast(const TDesC& aSection); |
|
100 inline void DoCmdReadRaw(const TDesC& aSection); |
|
101 inline void DoCmdEnumerate(const TDesC& aSection); |
|
102 inline void DoCmdDestructor(); |
|
103 inline void DoCmdMBPLN_ExtensionInterfaceL(const TDesC& aSection); |
|
104 |
|
105 static void CleanupOperation(TAny* aAny); |
|
106 |
|
107 private: |
|
108 CBluetoothPhysicalLinks* iData; |
|
109 TInt iErrForCreateConnection; |
|
110 TInt iErrForDisconnect; |
|
111 TInt iErrForDisconnectAll; |
|
112 TInt iDelayAfterCreateConnection; |
|
113 TBTDevAddr iBTDeveAddr; |
|
114 TInt iCreateIndex; |
|
115 TInt iDisconnectIndex; |
|
116 TInt iDisconnectAllIndex; |
|
117 }; |
|
118 |
|
119 #endif /* __T_BLUETOOTH_PHYSICAL_LINKS_DATA_H__*/ |