53
|
1 |
// Copyright (c) 2006-2010 Nokia Corporation and/or its subsidiary(-ies).
|
|
2 |
// All rights reserved.
|
|
3 |
// This component and the accompanying materials are made available
|
|
4 |
// under the terms of "Eclipse Public License v1.0"
|
|
5 |
// which accompanies this distribution, and is available
|
|
6 |
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
|
7 |
//
|
|
8 |
// Initial Contributors:
|
|
9 |
// Nokia Corporation - initial contribution.
|
|
10 |
//
|
|
11 |
// Contributors:
|
|
12 |
//
|
|
13 |
// Description:
|
|
14 |
//
|
|
15 |
|
|
16 |
/**
|
|
17 |
@file
|
|
18 |
@internalComponent
|
|
19 |
*/
|
|
20 |
|
|
21 |
#include "HciCorePluginImpl.h"
|
|
22 |
#include "hciserver.h"
|
|
23 |
#include "hciserverrequestmgr.h"
|
|
24 |
#include "corehciutil.h"
|
|
25 |
|
|
26 |
#include <bluetooth/hci/hctlbase.h>
|
|
27 |
#include <bluetooth/hci/hctlinterface.h>
|
|
28 |
#include <bluetooth/hci/controllerinitialisationplugin.h>
|
|
29 |
#include <bluetooth/hci/controllerinitialisationinterface.h>
|
|
30 |
#include <bluetooth/hci/hctlpowerinterface.h>
|
|
31 |
#include <bluetooth/hci/hciframe.h>
|
|
32 |
#include <bluetooth/hci/aclpacketconsts.h>
|
|
33 |
#include <bluetooth/hci/hcidataobserver.h>
|
|
34 |
#include <bluetooth/hci/hciutil.h>
|
|
35 |
#include <bluetooth/hci/hciipc.h>
|
|
36 |
#include <bluetooth/hci/event.h>
|
|
37 |
|
|
38 |
#include <bluetooth/hcicommandqueue.h>
|
|
39 |
#include <bluetooth/logger.h>
|
|
40 |
|
|
41 |
#ifdef __FLOG_ACTIVE
|
|
42 |
_LIT8(KLogComponent, LOG_COMPONENT_COREHCI_SYMBIAN);
|
|
43 |
#endif
|
|
44 |
|
|
45 |
_LIT(KHciUtilComponentName, "corehci_symbian");
|
|
46 |
|
|
47 |
/*static*/ CCoreHCIPluginImpl* CCoreHCIPluginImpl::NewL()
|
|
48 |
{
|
|
49 |
LOG_STATIC_FUNC
|
|
50 |
|
|
51 |
CCoreHCIPluginImpl* p = new(ELeave) CCoreHCIPluginImpl;
|
|
52 |
CleanupStack::PushL(p);
|
|
53 |
p->ConstructL();
|
|
54 |
CleanupStack::Pop();
|
|
55 |
return p;
|
|
56 |
}
|
|
57 |
|
|
58 |
void CCoreHCIPluginImpl::ConstructL()
|
|
59 |
/*
|
|
60 |
Start up the HCTL plugin, then the initialisation plugin.
|
|
61 |
*/
|
|
62 |
{
|
|
63 |
LOG_FUNC
|
|
64 |
|
|
65 |
// Create HCI Utility library
|
|
66 |
iHciUtil = CHciUtil::NewL(KHciUtilComponentName);
|
|
67 |
|
|
68 |
// If we can't open the ini file then this will be treated in the same way
|
|
69 |
// as not reading a valid UID from the ini file.
|
|
70 |
TRAP_IGNORE(iHciUtil->OpenIniFileL());
|
|
71 |
|
|
72 |
// Create Core HCI plugin
|
|
73 |
_LIT(KSection, "Plugins");
|
|
74 |
_LIT(KHCTLUid, "hctl_uid");
|
|
75 |
|
|
76 |
TUid hctlImplUid = TUid::Null();
|
|
77 |
TRAPD(err, hctlImplUid = iHciUtil->GetUidFromFileL(KSection, KHCTLUid));
|
|
78 |
|
|
79 |
if (err == KErrNone)
|
|
80 |
{
|
|
81 |
// Valid UID found, load it
|
|
82 |
iHCTLPlugin = CHCTLBase::NewL(hctlImplUid);
|
|
83 |
}
|
|
84 |
else
|
|
85 |
{
|
|
86 |
// No UID found in ini file, attempt to load single instance of
|
|
87 |
// implementation
|
|
88 |
iHCTLPlugin = CHCTLBase::NewL();
|
|
89 |
}
|
|
90 |
|
|
91 |
// Add this as the event observer.
|
|
92 |
MHCTLInterface* hctl = static_cast<MHCTLInterface*>(iHCTLPlugin->Interface(TUid::Uid(KHCTLInterfaceUid)));
|
|
93 |
__ASSERT_ALWAYS(hctl, PANIC(KCoreHciPanicCat, EUninitialisedInterface));
|
|
94 |
|
|
95 |
iHCTLHardResetPerformer = static_cast<MHardResetInitiator*>(iHCTLPlugin->Interface(TUid::Uid(KHCHardResetUid)));
|
|
96 |
__ASSERT_ALWAYS(iHCTLHardResetPerformer, PANIC(KCoreHciPanicCat, EUninitialisedInterface));
|
|
97 |
|
|
98 |
// Setup observers on the HCTL.
|
|
99 |
hctl->MhiSetEventObserver(*this);
|
|
100 |
hctl->MhiSetChannelObserver(*this);
|
|
101 |
hctl->MhiSetDataObserver(*this);
|
|
102 |
hctl->MhiSetControllerStateObserver(*this);
|
|
103 |
|
|
104 |
// Create the initialisor. The initialisor is optional so don't worry if
|
|
105 |
// we can't load it.
|
|
106 |
_LIT(KInitialisorUid, "initialisation_uid");
|
|
107 |
|
|
108 |
TUid initImplUid = TUid::Null();
|
|
109 |
TRAP(err, initImplUid = iHciUtil->GetUidFromFileL(KSection, KInitialisorUid));
|
|
110 |
|
|
111 |
if (err == KErrNone)
|
|
112 |
{
|
|
113 |
// Valid UID found, load it
|
|
114 |
iInitialisationPlugin = CControllerInitialisationPlugin::NewL(initImplUid);
|
|
115 |
}
|
|
116 |
else
|
|
117 |
{
|
|
118 |
// No UID found in ini file, attempt to load single instance of
|
|
119 |
// implementation
|
|
120 |
TRAP_IGNORE(iInitialisationPlugin = CControllerInitialisationPlugin::NewL());
|
|
121 |
}
|
|
122 |
|
|
123 |
if(iInitialisationPlugin)
|
|
124 |
{
|
|
125 |
MControllerInitialisationInterface* initialisor =
|
|
126 |
static_cast<MControllerInitialisationInterface*>
|
|
127 |
(iInitialisationPlugin->Interface(TUid::Uid(KControllerInitialisationInterfaceUid)));
|
|
128 |
|
|
129 |
__ASSERT_ALWAYS(initialisor, PANIC(KCoreHciPanicCat, EUninitialisedInterface));
|
|
130 |
|
|
131 |
initialisor->MciiSetCoreHci(*this);
|
|
132 |
}
|
|
133 |
|
|
134 |
iHCIServer = CHCIServer::NewL(*this);
|
|
135 |
|
|
136 |
// The power interface is not required so iHCTLPowerInterface can be NULL after
|
|
137 |
// the following call. Check for NULL before using iHCTLPowerInterface elsewhere.
|
|
138 |
iHCTLPowerInterface = static_cast<MHCTLPowerInterface*>(iHCTLPlugin->Interface(TUid::Uid(KHCTLPowerInterfaceUid)));
|
|
139 |
|
|
140 |
// Get the HCTL specific frame header and trailer octet sizes.
|
|
141 |
hctl->MhiGetCommandTransportOverhead(iHCTLCommandHeaderSize, iHCTLCommandTrailerSize);
|
|
142 |
hctl->MhiGetAclDataTransportOverhead(iHCTLACLHeaderSize, iHCTLACLTrailerSize);
|
|
143 |
hctl->MhiGetSynchronousDataTransportOverhead(iHCTLSyncDataHeaderSize, iHCTLSyncDataTrailerSize);
|
|
144 |
}
|
|
145 |
|
|
146 |
CCoreHCIPluginImpl::~CCoreHCIPluginImpl()
|
|
147 |
{
|
|
148 |
LOG_FUNC
|
|
149 |
|
|
150 |
//delete in the correct order
|
|
151 |
delete iInitialisationPlugin;
|
|
152 |
delete iHCTLPlugin;
|
|
153 |
delete iHCIServer;
|
|
154 |
delete iHciUtil;
|
|
155 |
}
|
|
156 |
|
|
157 |
//Request hard reset from the stack - stack will do all the required preparation - such as notify QDP and so on, and call us back via MHardResetInitiator interface
|
|
158 |
void CCoreHCIPluginImpl::RequestHardResetFromStack()
|
|
159 |
{
|
|
160 |
LOG_FUNC
|
|
161 |
__ASSERT_ALWAYS(iStackHardResetRequester, PANIC(KCoreHciPanicCat, EUninitialisedInterface));
|
|
162 |
iStackHardResetRequester->MhriStartHardReset();
|
|
163 |
}
|
|
164 |
|
|
165 |
// Set Power received from the HCI server
|
|
166 |
TInt CCoreHCIPluginImpl::SetPower(TBTPowerState aState, TDesC8* /*aBuf*/)
|
|
167 |
{
|
|
168 |
LOG_FUNC
|
|
169 |
|
|
170 |
if(iHCTLPowerInterface)
|
|
171 |
{
|
|
172 |
return iHCTLPowerInterface->MhpiSetPower(aState);
|
|
173 |
}
|
|
174 |
else
|
|
175 |
{
|
|
176 |
return KErrNotSupported;
|
|
177 |
}
|
|
178 |
}
|
|
179 |
|
|
180 |
// Get Power received from the HCI server
|
|
181 |
TInt CCoreHCIPluginImpl::GetPower(TBTPowerState& aState, TDesC8* /*aBuf*/)
|
|
182 |
{
|
|
183 |
LOG_FUNC
|
|
184 |
|
|
185 |
if(iHCTLPowerInterface)
|
|
186 |
{
|
|
187 |
return iHCTLPowerInterface->MhpiGetPower(aState);
|
|
188 |
}
|
|
189 |
else
|
|
190 |
{
|
|
191 |
return KErrNotSupported;
|
|
192 |
}
|
|
193 |
}
|
|
194 |
|
|
195 |
TAny* CCoreHCIPluginImpl::Interface(TUid aUid)
|
|
196 |
{
|
|
197 |
LOG_FUNC
|
|
198 |
|
|
199 |
TAny* ret = NULL;
|
|
200 |
|
|
201 |
switch(aUid.iUid)
|
|
202 |
{
|
|
203 |
case KCoreHciInterfaceUid:
|
|
204 |
{
|
|
205 |
ret = reinterpret_cast<TAny*>(static_cast<MCoreHci*>(this));
|
|
206 |
break;
|
|
207 |
}
|
|
208 |
|
|
209 |
case KHCIDataFramerInterfaceUid:
|
|
210 |
{
|
|
211 |
ret = reinterpret_cast<TAny*>(static_cast<MHCIDataFramer*>(this));
|
|
212 |
break;
|
|
213 |
}
|
|
214 |
|
|
215 |
case KHCICommandAllocatorInterfaceUid:
|
|
216 |
{
|
|
217 |
ret = reinterpret_cast<TAny*>(static_cast<MHCICommandAllocator*>(this));
|
|
218 |
break;
|
|
219 |
}
|
|
220 |
|
|
221 |
case KHCHardResetUid:
|
|
222 |
{
|
|
223 |
ret = reinterpret_cast<TAny*>(static_cast<MHardResetInitiator*>(this));
|
|
224 |
break;
|
|
225 |
}
|
|
226 |
|
|
227 |
case KHCTLInterfaceUid:
|
|
228 |
{
|
|
229 |
ret = iHCTLPlugin->Interface(aUid);
|
|
230 |
break;
|
|
231 |
}
|
|
232 |
|
|
233 |
case KControllerInitialisationInterfaceUid:
|
|
234 |
{
|
|
235 |
if (iInitialisationPlugin != NULL)
|
|
236 |
{
|
|
237 |
ret = iInitialisationPlugin->Interface(aUid);
|
|
238 |
}
|
|
239 |
break;
|
|
240 |
}
|
|
241 |
|
|
242 |
case KHCIClientUsageCallbackUid:
|
|
243 |
{
|
|
244 |
ret = reinterpret_cast<TAny*>(static_cast<MHCIClientUsageCallback*>(this));
|
|
245 |
break;
|
|
246 |
}
|
|
247 |
|
|
248 |
default:
|
|
249 |
break;
|
|
250 |
}
|
|
251 |
|
|
252 |
return ret;
|
|
253 |
}
|
|
254 |
|
|
255 |
void CCoreHCIPluginImpl::MhriStartHardReset()
|
|
256 |
{
|
|
257 |
LOG_FUNC
|
|
258 |
|
|
259 |
iHCTLHardResetPerformer->MhriStartHardReset();
|
|
260 |
}
|
|
261 |
|
|
262 |
CHctlCommandFrame* CCoreHCIPluginImpl::MhcaNewFrameL()
|
|
263 |
{
|
|
264 |
LOG_FUNC
|
|
265 |
|
|
266 |
return (CHctlCommandFrame::NewL(iHCTLCommandHeaderSize, iHCTLCommandTrailerSize));
|
|
267 |
}
|
|
268 |
|
|
269 |
|
|
270 |
CHctlAclDataFrame* CCoreHCIPluginImpl::MhdfNewAclDataFrameL(TUint16 aSize)
|
|
271 |
{
|
|
272 |
LOG_FUNC
|
|
273 |
|
|
274 |
return CHctlAclDataFrame::NewL(aSize, iHCTLACLHeaderSize, iHCTLACLTrailerSize);
|
|
275 |
}
|
|
276 |
|
|
277 |
CHctlSynchronousDataFrame* CCoreHCIPluginImpl::MhdfNewSynchronousDataFrameL(TUint8 aSize)
|
|
278 |
{
|
|
279 |
LOG_FUNC
|
|
280 |
|
|
281 |
return CHctlSynchronousDataFrame::NewL(aSize, iHCTLSyncDataHeaderSize, iHCTLSyncDataTrailerSize);
|
|
282 |
}
|
|
283 |
|
|
284 |
/*virtual*/ void CCoreHCIPluginImpl::MhdfFormatAclData(CHctlAclDataFrame& aFrame, THCIConnHandle aConnH,
|
|
285 |
TAclPacketBoundaryFlag aBoundaryFlag, TAclPacketBroadcastFlag aBroadcastFlag,
|
|
286 |
const TDesC8& aData)
|
|
287 |
{
|
|
288 |
LOG_FUNC
|
|
289 |
|
|
290 |
THCIConnHandle handle = aConnH;
|
|
291 |
|
|
292 |
if(aBroadcastFlag != EPointToPointOnly)
|
|
293 |
{
|
|
294 |
handle = 0xbca; //TODO KHCIBroadcastHandle;
|
|
295 |
}
|
|
296 |
|
|
297 |
aFrame.SetConnectionHandle(handle);
|
|
298 |
aFrame.SetFlags(aBoundaryFlag, aBroadcastFlag);
|
|
299 |
aFrame.SetDataPayload(aData); // also sets DataLength
|
|
300 |
}
|
|
301 |
|
|
302 |
void CCoreHCIPluginImpl::MhdfFormatSynchronousData(CHctlSynchronousDataFrame& aFrame,
|
|
303 |
THCIConnHandle aConnH, const TDesC8& aData)
|
|
304 |
{
|
|
305 |
LOG_FUNC
|
|
306 |
|
|
307 |
THCIConnHandle handle = aConnH;
|
|
308 |
aFrame.SetConnectionHandle(handle);
|
|
309 |
aFrame.SetDataPayload(aData); // also sets DataLength
|
|
310 |
}
|
|
311 |
|
|
312 |
void CCoreHCIPluginImpl::MhdoProcessAclData(const TDesC8& aData)
|
|
313 |
{
|
|
314 |
LOG_FUNC
|
|
315 |
|
|
316 |
TAclPacketBoundaryFlag pbFlag = CHctlAclDataFrame::PacketBoundaryFlag(aData);
|
|
317 |
TAclPacketBroadcastFlag bcFlag = CHctlAclDataFrame::PacketBroadcastFlag(aData);
|
|
318 |
THCIConnHandle handle = CHctlDataFrameBase::ConnectionHandle(aData);
|
|
319 |
iHCIDataObserver->MhdoProcessAclData(handle, pbFlag, bcFlag,
|
|
320 |
aData.Right(aData.Length() - CHctlAclDataFrame::KHCIACLDataPacketHeaderLength));
|
|
321 |
}
|
|
322 |
|
|
323 |
void CCoreHCIPluginImpl::MhdoProcessSynchronousData(const TDesC8& aData)
|
|
324 |
{
|
|
325 |
LOG_FUNC
|
|
326 |
|
|
327 |
THCIConnHandle handle = CHctlDataFrameBase::ConnectionHandle(aData);
|
|
328 |
iHCIDataObserver->MhdoProcessSynchronousData(handle, 0,
|
|
329 |
aData.Right(aData.Length() - CHctlSynchronousDataFrame::KHCISynchronousDataPacketHeaderLength));
|
|
330 |
}
|
|
331 |
|
|
332 |
void CCoreHCIPluginImpl::MheoProcessEvent(const TDesC8& aEvent)
|
|
333 |
{
|
|
334 |
LOG_FUNC
|
|
335 |
|
|
336 |
if (THCIEventBase::CreateAndSendEvent(aEvent, *iCommandEventObserver, *iDataEventObserver) != KErrNone)
|
|
337 |
{
|
|
338 |
// If we got an error processing the event, reset the controller
|
|
339 |
RequestHardResetFromStack();
|
|
340 |
}
|
|
341 |
}
|
|
342 |
|
|
343 |
void CCoreHCIPluginImpl::McsoProcessPowerChange(TInt aError, TControllerChangeType aChangeType,
|
|
344 |
TBTPowerState aState)
|
|
345 |
{
|
|
346 |
LOG_FUNC
|
|
347 |
|
|
348 |
iHCIServer->PowerControlManager().CompleteRequest(aError);
|
|
349 |
iControllerStateObserver->McsoProcessPowerChange(aError, aChangeType, aState); //pass on up
|
|
350 |
}
|
|
351 |
|
|
352 |
void CCoreHCIPluginImpl::McsoProcessHardResetPhaseChange(TInt aError, TControllerChangeType aChangeType,
|
|
353 |
TBTHardResetState aState)
|
|
354 |
{
|
|
355 |
LOG_FUNC
|
|
356 |
|
|
357 |
iControllerStateObserver->McsoProcessHardResetPhaseChange(aError, aChangeType, aState); //pass on up
|
|
358 |
}
|
|
359 |
|
|
360 |
TAny* CCoreHCIPluginImpl::MqpifQdpPluginInterface(const TUid aUid)
|
|
361 |
{
|
|
362 |
LOG_FUNC
|
|
363 |
|
|
364 |
if(iHCICommandQueue)
|
|
365 |
{
|
|
366 |
return (iHCICommandQueue->MhcqQdpPluginInterface(aUid));
|
|
367 |
}
|
|
368 |
|
|
369 |
return NULL;
|
|
370 |
}
|
|
371 |
|
|
372 |
TInt CCoreHCIPluginImpl::MchSetOption(TUint /*aName*/, const TDesC8& /*aData*/)
|
|
373 |
{
|
|
374 |
LOG_FUNC
|
|
375 |
|
|
376 |
return KErrNotSupported;
|
|
377 |
}
|
|
378 |
|
|
379 |
TInt CCoreHCIPluginImpl::MchGetOption(TUint /*aName*/, TDes8& /*aData*/)
|
|
380 |
{
|
|
381 |
LOG_FUNC
|
|
382 |
|
|
383 |
return KErrNotSupported;
|
|
384 |
}
|
|
385 |
|
|
386 |
void CCoreHCIPluginImpl::MchIoctl(TUint /*aLevel*/,TUint /*aName*/, TDes8* /*aOption*/, TAny* /*aStackSAP*/)
|
|
387 |
{
|
|
388 |
LOG_FUNC
|
|
389 |
}
|
|
390 |
|
|
391 |
void CCoreHCIPluginImpl::MchCancelIoctl(TUint /*aLevel*/,TUint /*aName*/, TAny* /*aStackSAP*/)
|
|
392 |
{
|
|
393 |
LOG_FUNC
|
|
394 |
}
|
|
395 |
|
|
396 |
void CCoreHCIPluginImpl::MchSetHCICommandQueue(MHCICommandQueue& aHCICommandQueue)
|
|
397 |
{
|
|
398 |
LOG_FUNC
|
|
399 |
__ASSERT_DEBUG(!iHCICommandQueue, PANIC(KCoreHciPanicCat, EInterfaceAlreadyInitialised));
|
|
400 |
|
|
401 |
iHCICommandQueue = &aHCICommandQueue;
|
|
402 |
iHCIServer->DirectAccessManager().SetHCICommandQueue(*iHCICommandQueue);
|
|
403 |
}
|
|
404 |
|
|
405 |
void CCoreHCIPluginImpl::MchSetPhysicalLinksState(MPhysicalLinksState& aPhysicalLinksState)
|
|
406 |
{
|
|
407 |
LOG_FUNC
|
|
408 |
__ASSERT_DEBUG(!iPhysicalLinksState, PANIC(KCoreHciPanicCat, EInterfaceAlreadyInitialised));
|
|
409 |
|
|
410 |
iPhysicalLinksState = &aPhysicalLinksState;
|
|
411 |
}
|
|
412 |
|
|
413 |
void CCoreHCIPluginImpl::MchSetHardResetInitiator(MHardResetInitiator& aHardResetInitiator)
|
|
414 |
{
|
|
415 |
LOG_FUNC
|
|
416 |
__ASSERT_DEBUG(!iStackHardResetRequester, PANIC(KCoreHciPanicCat, EInterfaceAlreadyInitialised));
|
|
417 |
|
|
418 |
iStackHardResetRequester = &aHardResetInitiator;
|
|
419 |
}
|
|
420 |
|
|
421 |
void CCoreHCIPluginImpl::MchSetDataEventObserver(MHCIDataEventObserver& aHCIDataEventObserver)
|
|
422 |
{
|
|
423 |
LOG_FUNC
|
|
424 |
__ASSERT_DEBUG(!iDataEventObserver, PANIC(KCoreHciPanicCat, EInterfaceAlreadyInitialised));
|
|
425 |
|
|
426 |
iDataEventObserver = &aHCIDataEventObserver;
|
|
427 |
}
|
|
428 |
|
|
429 |
void CCoreHCIPluginImpl::MchSetDataObserver(MHCIDataObserver& aHCIDataObserver)
|
|
430 |
{
|
|
431 |
LOG_FUNC
|
|
432 |
__ASSERT_DEBUG(!iHCIDataObserver, PANIC(KCoreHciPanicCat, EInterfaceAlreadyInitialised));
|
|
433 |
|
|
434 |
iHCIDataObserver = &aHCIDataObserver;
|
|
435 |
}
|
|
436 |
|
|
437 |
void CCoreHCIPluginImpl::MchSetCommandEventObserver(MHCICommandEventObserver& aHCICommandEventObserver)
|
|
438 |
{
|
|
439 |
LOG_FUNC
|
|
440 |
__ASSERT_DEBUG(!iCommandEventObserver, PANIC(KCoreHciPanicCat, EInterfaceAlreadyInitialised));
|
|
441 |
|
|
442 |
iCommandEventObserver = &aHCICommandEventObserver;
|
|
443 |
}
|
|
444 |
|
|
445 |
void CCoreHCIPluginImpl::MchSetChannelObserver(MHCTLChannelObserver& aHCIChannelObserver)
|
|
446 |
{
|
|
447 |
LOG_FUNC
|
|
448 |
__ASSERT_DEBUG(!iHCTLChannelObserver, PANIC(KCoreHciPanicCat, EInterfaceAlreadyInitialised));
|
|
449 |
|
|
450 |
iHCTLChannelObserver = &aHCIChannelObserver;
|
|
451 |
// Inform observer of current state (if one is ready).
|
|
452 |
if(iHCTLChannelState)
|
|
453 |
{
|
|
454 |
iHCTLChannelObserver->MhcoChannelOpen(iHCTLChannelState);
|
|
455 |
}
|
|
456 |
}
|
|
457 |
|
|
458 |
void CCoreHCIPluginImpl::MchSetControllerStateObserver(MControllerStateObserver& aControllerStateObserver)
|
|
459 |
{
|
|
460 |
LOG_FUNC
|
|
461 |
__ASSERT_DEBUG(!iControllerStateObserver, PANIC(KCoreHciPanicCat, EInterfaceAlreadyInitialised));
|
|
462 |
|
|
463 |
iControllerStateObserver = &aControllerStateObserver;
|
|
464 |
}
|
|
465 |
|
|
466 |
TAny* CCoreHCIPluginImpl::MchHctlPluginInterface(const TUid aUid)
|
|
467 |
{
|
|
468 |
LOG_FUNC
|
|
469 |
|
|
470 |
return iHCTLPlugin->Interface(aUid);
|
|
471 |
}
|
|
472 |
|
|
473 |
void CCoreHCIPluginImpl::MhcoChannelOpen(THCITransportChannel aChannels)
|
|
474 |
{
|
|
475 |
LOG_FUNC
|
|
476 |
|
|
477 |
iHCTLChannelState |= aChannels;
|
|
478 |
LOG1(_L("\tiHCTLChannelObserver = 0x%08x"), iHCTLChannelObserver)
|
|
479 |
if(iHCTLChannelObserver)
|
|
480 |
{
|
|
481 |
iHCTLChannelObserver->MhcoChannelOpen(aChannels);
|
|
482 |
}
|
|
483 |
|
|
484 |
}
|
|
485 |
|
|
486 |
void CCoreHCIPluginImpl::MhcoChannelClosed(THCITransportChannel aChannels)
|
|
487 |
{
|
|
488 |
LOG_FUNC
|
|
489 |
|
|
490 |
iHCTLChannelState &= ~aChannels;
|
|
491 |
LOG1(_L("\tiHCTLChannelObserver = 0x%08x"), iHCTLChannelObserver)
|
|
492 |
if(iHCTLChannelObserver)
|
|
493 |
{
|
|
494 |
iHCTLChannelObserver->MhcoChannelClosed(aChannels);
|
|
495 |
}
|
|
496 |
}
|
|
497 |
|
|
498 |
void CCoreHCIPluginImpl::MhcucSetClientUsage(MHCIClientUsage& aClientUsage)
|
|
499 |
{
|
|
500 |
LOG_FUNC
|
|
501 |
__ASSERT_DEBUG(!iClientUsage, PANIC(KCoreHciPanicCat, EInterfaceAlreadyInitialised));
|
|
502 |
|
|
503 |
iClientUsage = &aClientUsage;
|
|
504 |
}
|
|
505 |
|
|
506 |
void CCoreHCIPluginImpl::OpenClientReference()
|
|
507 |
{
|
|
508 |
LOG_FUNC
|
|
509 |
__ASSERT_DEBUG(iClientUsage, PANIC(KCoreHciPanicCat, EUninitialisedInterface));
|
|
510 |
|
|
511 |
if (iClientUsage)
|
|
512 |
{
|
|
513 |
iClientUsage->MhcuOpenClientReference();
|
|
514 |
}
|
|
515 |
}
|
|
516 |
|
|
517 |
void CCoreHCIPluginImpl::CloseClientReference()
|
|
518 |
{
|
|
519 |
LOG_FUNC
|
|
520 |
__ASSERT_DEBUG(iClientUsage, PANIC(KCoreHciPanicCat, EUninitialisedInterface));
|
|
521 |
|
|
522 |
if (iClientUsage)
|
|
523 |
{
|
|
524 |
iClientUsage->MhcuCloseClientReference();
|
|
525 |
}
|
|
526 |
}
|
|
527 |
|
|
528 |
// EOF
|
|
529 |
|