|
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 "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 @publishedAll |
|
19 @released |
|
20 */ |
|
21 |
|
22 #ifndef REMCONSTATUSAPICONTROLLER_H |
|
23 #define REMCONSTATUSAPICONTROLLER_H |
|
24 |
|
25 #include <e32base.h> |
|
26 #include <remcon/remconinterfacebase.h> |
|
27 #include <remcon/remconinterfaceif.h> |
|
28 |
|
29 _LIT(KStatusApiPanicName, "Status Api Panic"); |
|
30 |
|
31 class MRemConStatusApiControllerObserver; |
|
32 class CRemConInterfaceSelector; |
|
33 |
|
34 /** |
|
35 A controller which sends Status API commands. |
|
36 @publishedAll |
|
37 @released |
|
38 */ |
|
39 NONSHARABLE_CLASS(CRemConStatusApiController) : public CRemConInterfaceBase, |
|
40 public MRemConInterfaceIf |
|
41 { |
|
42 private: |
|
43 enum TStatusApiPanic |
|
44 { |
|
45 EStatusApiCommandDataSectionTooLong, |
|
46 }; |
|
47 |
|
48 public: |
|
49 IMPORT_C static CRemConStatusApiController* NewL(CRemConInterfaceSelector& aInterfaceSelector, |
|
50 MRemConStatusApiControllerObserver& aObserver); |
|
51 IMPORT_C ~CRemConStatusApiController(); |
|
52 |
|
53 // Commands |
|
54 IMPORT_C void UnitInfo(TRequestStatus& aStatus, TUint& aNumRemotes); |
|
55 IMPORT_C void SubunitInfo(TRequestStatus& aStatus, TUint& aNumRemotes); |
|
56 |
|
57 private: |
|
58 CRemConStatusApiController(CRemConInterfaceSelector& aInterfaceSelector, |
|
59 MRemConStatusApiControllerObserver& aObserver); |
|
60 |
|
61 // from CRemConInterfaceBase |
|
62 void MrcibNewMessage(TUint aOperationId, const TDesC8& aData); |
|
63 TAny* GetInterfaceIf(TUid aUid); |
|
64 |
|
65 // Utility functions |
|
66 void SetUnitInfoResponseData(const TDesC8& aCommandData, |
|
67 TInt& aVendorId, |
|
68 TInt& aUnit, |
|
69 TInt& aUnitType, |
|
70 TInt& aExtendedUnitType); |
|
71 |
|
72 void SetSubunitInfoResponseData(const TDesC8& aCommandData, |
|
73 TInt& aPage, |
|
74 TInt& aExtension, |
|
75 TPtrC8& aPageData); |
|
76 |
|
77 void ReadCommandDataToInt(const TDesC8& aCommandData, |
|
78 TInt aOffset, |
|
79 TInt aLength, |
|
80 TInt& aValue); |
|
81 |
|
82 static void Panic(TStatusApiPanic aPanic); |
|
83 |
|
84 private: |
|
85 MRemConStatusApiControllerObserver& iObserver; |
|
86 RBuf8 iOutData; // There is no command data for any commands in this API |
|
87 }; |
|
88 |
|
89 #endif // REMCONSTATUSAPICONTROLLER_H |