|
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_BT_PHYSICAL_LINK_ADAPTER_DATA_H__) |
|
20 #define __T_BT_PHYSICAL_LINK_ADAPTER_DATA_H__ |
|
21 |
|
22 // User Includes |
|
23 #include "DataWrapperBase.h" |
|
24 |
|
25 // EPOC includes |
|
26 #include <bt_sock.h> |
|
27 |
|
28 class CT_BTPhysicalLinkAdapterData : public CDataWrapperBase |
|
29 { |
|
30 public: |
|
31 /** |
|
32 * Public destructor |
|
33 */ |
|
34 ~CT_BTPhysicalLinkAdapterData(); |
|
35 |
|
36 /** |
|
37 * Two phase constructor |
|
38 */ |
|
39 static CT_BTPhysicalLinkAdapterData* NewL(); |
|
40 |
|
41 /** |
|
42 * Process a command read from the ini file |
|
43 * |
|
44 * @param aCommand The command to process |
|
45 * @param aSection The section in the ini containing data for the command |
|
46 * @param aAsyncErrorIndex Command index for async calls to return errors to |
|
47 * |
|
48 * @return ETrue if the command is processed |
|
49 * |
|
50 * @leave System wide error |
|
51 */ |
|
52 virtual TBool DoCommandL(const TTEFFunction& aCommand, const TTEFSectionName& aSection, const TInt aAsyncErrorIndex); |
|
53 |
|
54 /** |
|
55 * Return a pointer to the object that the data wraps |
|
56 * |
|
57 * @return pointer to the object that the data wraps |
|
58 */ |
|
59 virtual TAny* GetObject(); |
|
60 |
|
61 /** |
|
62 * Set the object that the data wraps |
|
63 * |
|
64 * @param aObject object that the wrapper is testing |
|
65 * |
|
66 * @leave KErrNotSupported if the the function is not supported |
|
67 */ |
|
68 virtual void SetObjectL(TAny* aObject); |
|
69 |
|
70 /** |
|
71 * The object will no longer be owned by this |
|
72 * |
|
73 * @leave KErrNotSupported if the the function is not supported |
|
74 */ |
|
75 virtual void DisownObjectL(); |
|
76 |
|
77 inline virtual TCleanupOperation CleanupOperation(); |
|
78 |
|
79 protected: |
|
80 CT_BTPhysicalLinkAdapterData(); |
|
81 void ConstructL(); |
|
82 |
|
83 private: |
|
84 /** |
|
85 * Helper methods |
|
86 */ |
|
87 void DestroyData(); |
|
88 |
|
89 inline void DoCmdRBTPhysicalLinkAdapter(); |
|
90 inline void DoCmdOpen(const TDesC& aSection); |
|
91 inline void DoCmdIsOpen(const TDesC& aSection); |
|
92 inline void DoCmdClose(); |
|
93 inline void DoCmdPhysicalLinkState(const TDesC& aSection); |
|
94 inline void DoCmdPreventRoleSwitch(); |
|
95 inline void DoCmdAllowRoleSwitch(); |
|
96 inline void DoCmdRequestMasterRole(); |
|
97 inline void DoCmdRequestSlaveRole(); |
|
98 inline void DoCmdPreventLowPowerModes(const TDesC& aSection); |
|
99 inline void DoCmdAllowLowPowerModes(const TDesC& aSection); |
|
100 inline void DoCmdActivateSniffRequester(); |
|
101 inline void DoCmdActivateParkRequester(); |
|
102 inline void DoCmdActivateActiveRequester(); |
|
103 inline void DoCmdCancelLowPowerModeRequester(); |
|
104 inline void DoCmdRequestChangeSupportedPacketTypes(const TDesC& aSection); |
|
105 inline void DoCmdNotifyNextBasebandChangeEvent(const TDesC& aSection, const TInt aAsyncErrorIndex); |
|
106 inline void DoCmdCancelNextBasebandChangeEventNotifier(); |
|
107 inline void DoCmdAuthenticate(); |
|
108 inline void DoCmdDestructor(); |
|
109 |
|
110 static void CleanupOperation(TAny* aAny); |
|
111 |
|
112 // MActiveCallback implementation |
|
113 IMPORT_C virtual void RunL(CActive* aActive, TInt aIndex); |
|
114 IMPORT_C virtual void DoCancel(CActive* aActive, TInt aIndex); |
|
115 |
|
116 private: |
|
117 RBTPhysicalLinkAdapter* iData; |
|
118 CActiveCallback* iActive; |
|
119 TUint32 iEventType; |
|
120 TInt iExpectedEventType; |
|
121 TBTBasebandEvent iEventNotification; |
|
122 }; |
|
123 |
|
124 #endif /* __T_BT_PHYSICAL_LINK_ADAPTER_DATA_H__*/ |