|
1 /* |
|
2 * |
|
3 * Copyright (c) <2010> Comarch S.A. and/or its subsidiary(-ies). |
|
4 * All rights reserved. |
|
5 * This component and the accompanying materials are made available |
|
6 * under the terms of the License "Eclipse Public License v1.0" |
|
7 * which accompanies this distribution, and is available |
|
8 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
9 * |
|
10 * Original Contributors: |
|
11 * Comarch S.A. - original contribution. |
|
12 * |
|
13 * Contributors: |
|
14 * |
|
15 * Description: |
|
16 * |
|
17 */ |
|
18 |
|
19 #ifndef HFPCONNECTIONMANAGEMENT_H |
|
20 #define HFPCONNECTIONMANAGEMENT_H |
|
21 |
|
22 #include "hfpfeaturecommons.h" |
|
23 |
|
24 class CHsHFPSettings; |
|
25 |
|
26 /** |
|
27 * @brief Represents "Connection management" feature |
|
28 */ |
|
29 class CHsHFPConnectionManagement : public CBase |
|
30 { |
|
31 public: |
|
32 |
|
33 /** |
|
34 * Two-phased constructor. |
|
35 * |
|
36 * @param aObserver feature observer |
|
37 * |
|
38 * @return instance of class |
|
39 */ |
|
40 static CHsHFPConnectionManagement* NewL( |
|
41 MHsHFPFeatureProviderObserver* aObserver); |
|
42 |
|
43 /** |
|
44 * Two-phased constructor. |
|
45 * |
|
46 * @param aObserver feature observer |
|
47 * |
|
48 * @return instance of class |
|
49 */ |
|
50 static CHsHFPConnectionManagement* NewLC( |
|
51 MHsHFPFeatureProviderObserver* aObserver); |
|
52 |
|
53 /** |
|
54 * Destructor. |
|
55 */ |
|
56 ~CHsHFPConnectionManagement(); |
|
57 |
|
58 public: |
|
59 |
|
60 /** |
|
61 * Establishes service level connection |
|
62 * |
|
63 * @param aInputCmd input AT command |
|
64 * @param aOutputCmd response |
|
65 * |
|
66 * @return KErrNone if successful, otherwise one of the system-wide error |
|
67 * codes |
|
68 */ |
|
69 TInt EstablishServiceLevelConnection(const CHsHFPCommand &aInputCmd, |
|
70 CHsHFPCommand &aOutputCmd); |
|
71 |
|
72 /** |
|
73 * Handles connection release after AG's disconnection |
|
74 * |
|
75 * @param aErr reason of connection release |
|
76 */ |
|
77 void HandleServiceLevelConnectionRelease(TInt aErr); |
|
78 |
|
79 private: |
|
80 |
|
81 /** |
|
82 * Constructor for performing 1st stage construction |
|
83 * |
|
84 * @param aObserver feature observer |
|
85 */ |
|
86 CHsHFPConnectionManagement(MHsHFPFeatureProviderObserver* aObserver); |
|
87 |
|
88 /** |
|
89 * Constructor for performing 2nd stage construction |
|
90 */ |
|
91 void ConstructL(); |
|
92 |
|
93 private: |
|
94 /** |
|
95 * Initializes settings array by retrieving the mapping between each |
|
96 * indicator supported by the AG and its corresponding order index. |
|
97 * |
|
98 * @param aCommand AT command |
|
99 */ |
|
100 void InitializeIndicatorsL(const CHsHFPCommand* aCommand); |
|
101 |
|
102 /** |
|
103 * Saves current status of the AG indicators. |
|
104 * |
|
105 * @param aCommand input AT command |
|
106 */ |
|
107 void SetupIndicatorsL(const CHsHFPCommand* aCommand); |
|
108 |
|
109 private: |
|
110 |
|
111 /** |
|
112 * Service level connection establishment state |
|
113 */ |
|
114 enum THsHFPServiceLevelEstablishmentState |
|
115 { |
|
116 EHFPNotConnected, |
|
117 EHFPWaitingForBrsfAndOk, |
|
118 EHFPWaitingForCindTestAndOk, |
|
119 EHFPWaitingForCindReadAndOk, |
|
120 EHFPWaitingForOk, |
|
121 EHFPConnected |
|
122 }; |
|
123 |
|
124 /** Current state of connection establishment */ |
|
125 THsHFPServiceLevelEstablishmentState iEstablishmentState; |
|
126 |
|
127 /** Pointer to observer */ |
|
128 MHsHFPFeatureProviderObserver* iObserver; |
|
129 |
|
130 /** Denotes if OK command is expected */ |
|
131 TBool iWaitingForOK; |
|
132 |
|
133 /** Profile setting */ |
|
134 CHsHFPSettings* iSettings; |
|
135 }; |
|
136 |
|
137 #endif // HFPCONNECTIONMANAGEMENT_H |