|
1 // Copyright (c) 2006-2009 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 #ifndef CONTROLLERINITIALISATIONPLUGINIMPL_H |
|
22 #define CONTROLLERINITIALISATIONPLUGINIMPL_H |
|
23 |
|
24 #include <bluetooth/hci/controllerinitialisationplugin.h> |
|
25 #include <bluetooth/hci/controllerinitialisationinterface.h> |
|
26 |
|
27 #include <bluetooth/hcicommandqueueclient.h> |
|
28 #include <bluetooth/logger.h> |
|
29 |
|
30 #include <BroadcomControllerInitialisor.h> |
|
31 |
|
32 #include <bluetooth/hci/hctlbcmconfiginterface.h> |
|
33 |
|
34 class TVendorDebugCompleteEvent; |
|
35 class MCoreHci; |
|
36 |
|
37 const TUint16 KHciVSUpdateUartHCIBaudRate = 0xFC18; |
|
38 const TUint16 KHciVSDownloadMiniDriver = 0xFC2E; //HCI_BRCM_DOWNLOAD_MINI_DRV |
|
39 const TUint16 KHciVSWriteRam = 0xFC4C; //HCI_BRCM_WRITE_RAM |
|
40 const TUint16 KHciVSLaunchRam = 0xFC4E; //HCI_BRCM_LAUNCH_RAM |
|
41 |
|
42 class CControllerInitialisationPluginImpl : public CControllerInitialisationPlugin, |
|
43 public MControllerInitialisationInterface, |
|
44 public MHCICommandQueueClient, |
|
45 public MConfigFileTimerEventObserver |
|
46 { |
|
47 |
|
48 private: |
|
49 enum TPatchRamFormat |
|
50 { |
|
51 EUnknownFileFormat, |
|
52 EHcdFileFormat, |
|
53 EBinFileFormat |
|
54 }; |
|
55 |
|
56 public: |
|
57 static CControllerInitialisationPluginImpl* NewL(); |
|
58 ~CControllerInitialisationPluginImpl(); |
|
59 virtual TAny* Interface(TUid aUid); |
|
60 |
|
61 protected: |
|
62 CControllerInitialisationPluginImpl(); |
|
63 |
|
64 private: |
|
65 void ConstructL(); |
|
66 |
|
67 // Static async CallBack methods. |
|
68 static TInt AsyncCallBackForPostReset(TAny* aInitPlugin); |
|
69 |
|
70 // MControllerInitialisationInterface |
|
71 virtual void MciiPreResetCommand(); |
|
72 virtual void MciiPostResetCommand(); |
|
73 virtual void MciiSetHCICommandQueue(MHCICommandQueue& aHCICommandQueue); |
|
74 virtual void MciiSetControllerInitialisationObserver(MControllerInitialisationObserver& aObserver); |
|
75 virtual void MciiSetCoreHci(MCoreHci& aCoreHci); |
|
76 |
|
77 // MHCICommandQueueClient |
|
78 virtual void MhcqcCommandEventReceived(const THCIEventBase& aEvent, |
|
79 const CHCICommandBase* aRelatedCommand); |
|
80 virtual void MhcqcCommandErrored(TInt aErrorCode,const CHCICommandBase* aCommand); |
|
81 virtual void ConfigFileTimerExpired(); |
|
82 void HandleVendorSpecificCompleteEvent(const TVendorDebugCompleteEvent& aEvent); |
|
83 void DoPostReset(); |
|
84 void InitialiseAndLoadMiniDriver(); |
|
85 // TInt MapBaudRate(TInt iMapfrom, TInt iMapTo); |
|
86 |
|
87 private: |
|
88 // Async Callback |
|
89 CAsyncCallBack* iAsyncCallBackForPostReset; |
|
90 TInitState iInitState; |
|
91 CConfigFileDownload* iCConfigFileDownload; |
|
92 MHCICommandQueue* iHCICommandQueue; |
|
93 MControllerInitialisationObserver* iControllerInitialisationObserver; |
|
94 MCoreHci* iCoreHci; |
|
95 TUint32 iDestRam; |
|
96 TUint16 iTxPatchLength; |
|
97 CConfigFileTimer* iMiniDrive2ConfigFileTimer; |
|
98 |
|
99 TPatchRamFormat iFileFormat ; |
|
100 }; |
|
101 |
|
102 |
|
103 |
|
104 #endif |