|
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: BT Remote Control Controller class declaration. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 // INCLUDE FILES |
|
20 |
|
21 #include <btdevice.h> |
|
22 #include <e32property.h> |
|
23 #include <remconaddress.h> |
|
24 |
|
25 #include "btrccPlugin.h" |
|
26 #include "debug.h" |
|
27 #include "btrccLinker.h" |
|
28 |
|
29 // CONSTANTS |
|
30 |
|
31 #ifdef _DEBUG |
|
32 // Length of a BT hardware address (BD_ADDR) as a descriptor |
|
33 const TUint8 KBTRCCBTDevAddrDesLength = KBTDevAddrSize * 2; |
|
34 #endif |
|
35 |
|
36 // MODULE DATA STRUCTURES |
|
37 |
|
38 // ================= MEMBER FUNCTIONS ======================= |
|
39 |
|
40 // ----------------------------------------------------------------------------- |
|
41 // CBTRCCPlugin::NewL |
|
42 // ----------------------------------------------------------------------------- |
|
43 // |
|
44 CBTRCCPlugin* CBTRCCPlugin::NewL(TPluginParams& aParams) |
|
45 { |
|
46 CBTRCCPlugin* self = new (ELeave) CBTRCCPlugin(aParams); |
|
47 CleanupStack::PushL(self); |
|
48 self->ConstructL(); |
|
49 CleanupStack::Pop(self); |
|
50 return self; |
|
51 } |
|
52 |
|
53 // ----------------------------------------------------------------------------- |
|
54 // Destructor. |
|
55 // ----------------------------------------------------------------------------- |
|
56 // |
|
57 CBTRCCPlugin::~CBTRCCPlugin() |
|
58 { |
|
59 TRACE_FUNC |
|
60 delete iLinker; |
|
61 } |
|
62 |
|
63 // ----------------------------------------------------------------------------- |
|
64 // CBTRCCPlugin::CBTRCCPlugin |
|
65 // C++ default constructor. |
|
66 // ----------------------------------------------------------------------------- |
|
67 // |
|
68 CBTRCCPlugin::CBTRCCPlugin(TPluginParams& aParams) |
|
69 : CBTAccPlugin(aParams) |
|
70 { |
|
71 } |
|
72 |
|
73 // ----------------------------------------------------------------------------- |
|
74 // CBTRCCPlugin::ConstructL |
|
75 // Symbian 2nd phase constructor. |
|
76 // ----------------------------------------------------------------------------- |
|
77 // |
|
78 void CBTRCCPlugin::ConstructL() |
|
79 { |
|
80 TRACE_FUNC |
|
81 iLinker = CBTRCCLinker::NewL(Observer()); |
|
82 } |
|
83 |
|
84 // ----------------------------------------------------------------------------- |
|
85 // CBTRCCPlugin::ConnectToAccessory |
|
86 // ----------------------------------------------------------------------------- |
|
87 // |
|
88 void CBTRCCPlugin::ConnectToAccessory(const TBTDevAddr& aAddr, TRequestStatus& aStatus) |
|
89 { |
|
90 TRACE_FUNC |
|
91 iLinker->Connect(aAddr, aStatus); |
|
92 } |
|
93 |
|
94 // ----------------------------------------------------------------------------- |
|
95 // CBTRCCPlugin::CancelConnectToAccessory |
|
96 // ----------------------------------------------------------------------------- |
|
97 // |
|
98 void CBTRCCPlugin::CancelConnectToAccessory(const TBTDevAddr& aAddr) |
|
99 { |
|
100 TRACE_FUNC |
|
101 iLinker->CancelConnect(aAddr); |
|
102 } |
|
103 |
|
104 // ----------------------------------------------------------------------------- |
|
105 // CBTRCCPlugin::DisconnectAccessory |
|
106 // ----------------------------------------------------------------------------- |
|
107 // |
|
108 void CBTRCCPlugin::DisconnectAccessory(const TBTDevAddr& aAddr, TRequestStatus& aStatus) |
|
109 { |
|
110 TRACE_FUNC |
|
111 TRACE_INFO_SEG( |
|
112 {TBuf<KBTRCCBTDevAddrDesLength> buf; aAddr.GetReadable(buf); Trace(_L("BT Addr %S"), &buf);}) |
|
113 iLinker->Disconnect(aStatus, aAddr); |
|
114 } |
|
115 |
|
116 // ----------------------------------------------------------------------------- |
|
117 // CBTRCCPlugin::AccInUse |
|
118 // ----------------------------------------------------------------------------- |
|
119 // |
|
120 void CBTRCCPlugin::AccInUse() |
|
121 { |
|
122 TRACE_FUNC |
|
123 } |
|
124 |
|
125 // ----------------------------------------------------------------------------- |
|
126 // CBTRCCPlugin::PluginType |
|
127 // ----------------------------------------------------------------------------- |
|
128 // |
|
129 TProfiles CBTRCCPlugin::PluginType() |
|
130 { |
|
131 TRACE_FUNC |
|
132 return EAnyRemConProfiles; |
|
133 } |
|
134 |
|
135 // ----------------------------------------------------------------------------- |
|
136 // CBTRCCPlugin::ActivateRemoteVolumeControl |
|
137 // ----------------------------------------------------------------------------- |
|
138 // |
|
139 void CBTRCCPlugin::ActivateRemoteVolumeControl() |
|
140 { |
|
141 TRACE_FUNC |
|
142 iLinker->ActivateRemoteVolumeControl(); |
|
143 } |
|
144 |
|
145 // ----------------------------------------------------------------------------- |
|
146 // CBTRCCPlugin::PluginType |
|
147 // ----------------------------------------------------------------------------- |
|
148 // |
|
149 void CBTRCCPlugin::DeActivateRemoteVolumeControl() |
|
150 { |
|
151 TRACE_FUNC |
|
152 iLinker->DeActivateRemoteVolumeControl(); |
|
153 } |
|
154 |
|
155 // End of File |