|
1 /* |
|
2 * Copyright (c) 2005-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: The RFCOMM connected state declaration |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef C_BTMSRFCOMM_H |
|
20 #define C_BTMSRFCOMM_H |
|
21 |
|
22 #include "btmsinuse.h" |
|
23 #include "btmactiveobserver.h" |
|
24 #include "btmdefs.h" |
|
25 |
|
26 class CBtmActive; |
|
27 |
|
28 /** |
|
29 * Connect state |
|
30 * |
|
31 * This state is responsible to establish RFComm connection with a BT device |
|
32 * |
|
33 * @since S60 v3.1 |
|
34 */ |
|
35 class CBtmsRfcomm : public CBtmsInuse |
|
36 { |
|
37 public: |
|
38 |
|
39 /** |
|
40 * @param aParent the state machine |
|
41 * @param aStatus the request from client of btmac if not null |
|
42 * @param aRfcomm the rfcomm connection |
|
43 * @param aRequestCat the category of the client request |
|
44 */ |
|
45 static CBtmsRfcomm* NewL( |
|
46 CBtmMan& aParent, |
|
47 TRequestStatus* aStatus, |
|
48 CBtmRfcommSock* aRfcomm, |
|
49 TRequestCategory aRequestCat = ERequestNone); |
|
50 |
|
51 virtual ~CBtmsRfcomm(); |
|
52 |
|
53 private: |
|
54 |
|
55 // From base class CBtmState |
|
56 |
|
57 /** |
|
58 * From CBtmState |
|
59 * Entry of this state. |
|
60 * |
|
61 * @since S60 v3.1 |
|
62 */ |
|
63 void EnterL(); |
|
64 |
|
65 void CancelConnectL(); |
|
66 |
|
67 void DisconnectL(const TBTDevAddr& aAddr, TRequestStatus& aStatus); |
|
68 |
|
69 /** |
|
70 * From CBtmState |
|
71 * Open audio link (synchronous) to the connected accessory |
|
72 * |
|
73 * @since S60 v3.1 |
|
74 * @param aAddr the BD address of the accessory |
|
75 * @param aStatus On completion, will contain an error code |
|
76 */ |
|
77 void OpenAudioLinkL(const TBTDevAddr& aAddr, TRequestStatus& aStatus); |
|
78 |
|
79 void CancelOpenAudioLinkL(const TBTDevAddr& aAddr); |
|
80 |
|
81 // From base class CBtmsInuse |
|
82 |
|
83 /** |
|
84 * The interface for subclasses to handle RFComm error situations. |
|
85 * |
|
86 * @since S60 v3.1 |
|
87 * @param aErr the completion error code |
|
88 */ |
|
89 void RfcommErrorL(TInt aErr); |
|
90 |
|
91 // From base class CBtmsInuse |
|
92 |
|
93 /** |
|
94 * |
|
95 * |
|
96 * @since S60 v3.1 |
|
97 * @param |
|
98 */ |
|
99 void SlcIndicateL(TBool aSlc); |
|
100 |
|
101 TBool CanDisableNrec(); |
|
102 |
|
103 private: |
|
104 |
|
105 CBtmsRfcomm(CBtmMan& aParent, |
|
106 TRequestStatus* aStatus, |
|
107 CBtmRfcommSock* aRfcomm, |
|
108 TRequestCategory aRequestCat); |
|
109 |
|
110 void ConstructL(); |
|
111 |
|
112 private: |
|
113 |
|
114 TRequestCategory iRequestCat; |
|
115 }; |
|
116 |
|
117 #endif // C_BTMSRFCOMM_H |
|
118 |