|
1 /* |
|
2 * Copyright (c) 2006 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: state Configured declaration. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef C_BTSACCONFIGURED_H |
|
20 #define C_BTSACCONFIGURED_H |
|
21 |
|
22 #include "btsacState.h" |
|
23 |
|
24 /** |
|
25 * The state Configured |
|
26 * |
|
27 * |
|
28 * @since S60 v3.1 |
|
29 */ |
|
30 class CBtsacConfigured : public CBtsacState, public MBtsacActiveObserver |
|
31 { |
|
32 |
|
33 public: |
|
34 |
|
35 static CBtsacConfigured* NewL(CBTSAController& aParent, RSocket aNewSocket, TAudioOpenedBy aAudioOpenedBy, TStreamConfiguredBy aStreamConfiguredBy); |
|
36 |
|
37 virtual ~CBtsacConfigured(); |
|
38 |
|
39 private: |
|
40 |
|
41 // From base class CBtsacState |
|
42 |
|
43 /** |
|
44 * From CBtsacState |
|
45 * Entry of this state. |
|
46 */ |
|
47 void EnterL(); |
|
48 |
|
49 /** |
|
50 * disconnect the connected accessory |
|
51 * |
|
52 * @since S60 v3.1 |
|
53 * @param aStatus On completion, will contain an error code |
|
54 */ |
|
55 void DisconnectL(); |
|
56 |
|
57 /** |
|
58 * From CBtsacState |
|
59 * Open audio link to BT accessory |
|
60 * |
|
61 * @since S60 v3.1 |
|
62 * @param aAddr the BD address of the accessory |
|
63 * @param aStatus On completion, will contain an error code |
|
64 */ |
|
65 void OpenAudioLinkL(const TBTDevAddr& aAddr); |
|
66 |
|
67 /** |
|
68 * From CBtsacState |
|
69 * Cancels Open audio link request |
|
70 * |
|
71 * @since S60 v3.1 |
|
72 */ |
|
73 void CancelOpenAudioLinkL(); |
|
74 |
|
75 /** |
|
76 * From CBtsacState |
|
77 * Cancel the outstanding connecting operation |
|
78 * |
|
79 * @since S60 v3.1 |
|
80 */ |
|
81 void CancelConnectL(); |
|
82 |
|
83 // From class MInternalGavdpUser |
|
84 void GAVDP_StartStreamsConfirm(); |
|
85 TInt GAVDP_StartIndication(TSEID aSEID); |
|
86 |
|
87 /** |
|
88 * Handles the request completion event. |
|
89 * |
|
90 * @since S60 v3.1 |
|
91 * @param aActive the Active Object to which the request is assigned to. |
|
92 */ |
|
93 void RequestCompletedL(CBtsacActive& aActive); |
|
94 |
|
95 /** |
|
96 * Handles the cancellation of an outstanding request. |
|
97 * |
|
98 * @since S60 v3.1 |
|
99 * @param aActive the Active Object to which the request is assigned to. |
|
100 */ |
|
101 virtual void CancelRequest(CBtsacActive& aActive); |
|
102 |
|
103 void StartTimer(TTimeIntervalMicroSeconds32 aTimeout); |
|
104 void StopTimer(); |
|
105 |
|
106 void CancelActionL(TInt aError, TBTSACGavdpResetReason aGavdpReset); |
|
107 void HandleGavdpErrorL(TInt aError); |
|
108 |
|
109 private: |
|
110 |
|
111 CBtsacConfigured(CBTSAController& aParent, RSocket aNewSocket, TAudioOpenedBy aAudioOpenedBy, TStreamConfiguredBy aStreamConfiguredBy); |
|
112 void ConstructL(); |
|
113 |
|
114 private: |
|
115 enum TStartStreamStatus |
|
116 { |
|
117 EStartNone, |
|
118 EStartSendBySrc, |
|
119 EStartCollision |
|
120 }; |
|
121 /** |
|
122 * AO for configuration timer. |
|
123 */ |
|
124 CBtsacActive* iTimerActive; |
|
125 |
|
126 /** |
|
127 * Configuration timer |
|
128 */ |
|
129 RTimer iTimer; |
|
130 |
|
131 TAudioOpenedBy iAudioOpenedBy; |
|
132 TStreamConfiguredBy iStreamConfiguredBy; |
|
133 TStartStreamStatus iStartStreamStatus; |
|
134 }; |
|
135 |
|
136 #endif // C_BTSACCONFIGURED_H |
|
137 |