|
1 // Copyright (c) 2004-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 the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.symbianfoundation.org/legal/licencesv10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // |
|
15 |
|
16 |
|
17 |
|
18 /** |
|
19 @file |
|
20 @publishedAll |
|
21 @released |
|
22 */ |
|
23 |
|
24 #ifndef REMCONSTATUSAPICONTROLLER_H |
|
25 #define REMCONSTATUSAPICONTROLLER_H |
|
26 |
|
27 #include <e32base.h> |
|
28 #include <remcon/remconinterfacebase.h> |
|
29 #include <remcon/remconinterfaceif.h> |
|
30 #include <remconstatusapi.h> |
|
31 |
|
32 _LIT(KStatusApiPanicName, "Status Api Panic"); |
|
33 |
|
34 class MRemConStatusApiControllerObserver; |
|
35 class CRemConInterfaceSelector; |
|
36 |
|
37 /** |
|
38 A controller which sends Status API commands. |
|
39 @publishedAll |
|
40 @released |
|
41 */ |
|
42 NONSHARABLE_CLASS(CRemConStatusApiController) : public CRemConInterfaceBase, |
|
43 public MRemConInterfaceIf |
|
44 { |
|
45 private: |
|
46 enum TStatusApiPanic |
|
47 { |
|
48 EStatusApiCommandDataSectionTooLong, |
|
49 }; |
|
50 |
|
51 public: |
|
52 IMPORT_C static CRemConStatusApiController* NewL(CRemConInterfaceSelector& aInterfaceSelector, |
|
53 MRemConStatusApiControllerObserver& aObserver); |
|
54 IMPORT_C ~CRemConStatusApiController(); |
|
55 |
|
56 // Commands |
|
57 IMPORT_C void UnitInfo(TRequestStatus& aStatus, TUint& aNumRemotes); |
|
58 IMPORT_C void SubunitInfo(TRequestStatus& aStatus, TUint& aNumRemotes); |
|
59 |
|
60 private: |
|
61 CRemConStatusApiController(CRemConInterfaceSelector& aInterfaceSelector, |
|
62 MRemConStatusApiControllerObserver& aObserver); |
|
63 |
|
64 // from CRemConInterfaceBase |
|
65 void MrcibNewMessage(TUint aOperationId, const TDesC8& aData); |
|
66 TAny* GetInterfaceIf(TUid aUid); |
|
67 |
|
68 // Utility functions |
|
69 void SetUnitInfoResponseData(const TDesC8& aCommandData, |
|
70 TInt& aVendorId, |
|
71 TInt& aUnit, |
|
72 TInt& aUnitType, |
|
73 TInt& aExtendedUnitType); |
|
74 |
|
75 void SetSubunitInfoResponseData(const TDesC8& aCommandData, |
|
76 TInt& aPage, |
|
77 TInt& aExtension, |
|
78 TPtrC8& aPageData); |
|
79 |
|
80 void ReadCommandDataToInt(const TDesC8& aCommandData, |
|
81 TInt aOffset, |
|
82 TInt aLength, |
|
83 TInt& aValue); |
|
84 |
|
85 static void Panic(TStatusApiPanic aPanic); |
|
86 |
|
87 private: |
|
88 MRemConStatusApiControllerObserver& iObserver; |
|
89 TBuf8<KRemConStatusApiMaxOperationSpecificDataSize> iOutData; |
|
90 }; |
|
91 |
|
92 #endif // REMCONSTATUSAPICONTROLLER_H |