|
1 // Copyright (c) 2008-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 |
|
18 /** |
|
19 @file |
|
20 @internalComponent |
|
21 @released |
|
22 */ |
|
23 |
|
24 #ifndef BULKBEARER_H |
|
25 #define BULKBEARER_H |
|
26 |
|
27 #include <e32base.h> |
|
28 #include <remcon/remconbearerbulkinterface.h> |
|
29 |
|
30 #include "remconcommandinterface.h" |
|
31 |
|
32 class CBrowseCommand; |
|
33 class CRcpBrowsingCommandHandler; |
|
34 class TBTDevAddr; |
|
35 class TRemConAddress; |
|
36 |
|
37 NONSHARABLE_CLASS(CAvrcpBulkBearer) : public CBase, public MRemConBearerBulkInterface, |
|
38 public MAvrcpBearer, public MRemConBulkCommandInterface |
|
39 { |
|
40 public: |
|
41 static CAvrcpBulkBearer* NewL(RAvctp& aAvctp, CAvrcpPlayerInfoManager& aPlayerInfoManager); |
|
42 ~CAvrcpBulkBearer(); |
|
43 |
|
44 private: // Interface to command handlers, from MRemConCommandInterface |
|
45 void MrcciNewCommand(CAvrcpCommand& aCommand); |
|
46 void MrcciNewCommand(CAvrcpCommand& aCommand,const TRemConClientId& aClientId); |
|
47 |
|
48 TUint MrcciNewTransactionId(); |
|
49 |
|
50 TInt MrcbciSetAddressedClient(const TRemConAddress& aAddr, const TRemConClientId& aClient); |
|
51 void MrcbciRemoveAddressing(const TRemConAddress& aAddr); |
|
52 |
|
53 private: // Interface to router, from MAvrcpBearer |
|
54 MIncomingCommandHandler* IncomingHandler(const TBTDevAddr& aAddr); |
|
55 MOutgoingCommandHandler* OutgoingHandler(const TBTDevAddr& aAddr); |
|
56 |
|
57 void ConnectIndicate(const TBTDevAddr& aBTDevice); |
|
58 void ConnectConfirm(const TBTDevAddr& aBTDevice, TInt aError); |
|
59 void DisconnectIndicate(const TBTDevAddr& aBTDevice); |
|
60 void DisconnectConfirm(const TBTDevAddr& aBTDevice, TInt aError); |
|
61 |
|
62 private: // interface to RemCon, from MRemConBulkBearerInterface |
|
63 virtual TInt MrcbbiGetCommand(TUid& aInterfaceUid, |
|
64 TUint& aTransactionId, |
|
65 TUint& aOperationId, |
|
66 RBuf8& aData, |
|
67 TRemConAddress& aAddr); |
|
68 |
|
69 virtual TInt MrcbbiSendResponse(TUid aInterfaceUid, |
|
70 TUint aOperationId, |
|
71 TUint aTransactionId, |
|
72 RBuf8& aData, |
|
73 const TRemConAddress& aAddr); |
|
74 |
|
75 virtual void MrcbbiSendReject(TUid aInterfaceUid, |
|
76 TUint aOperationId, |
|
77 TUint aTransactionId, |
|
78 const TRemConAddress& aAddr); |
|
79 |
|
80 virtual TInt MrcbbiStartBulk(MRemConBearerBulkObserver& aObserver); |
|
81 virtual void MrcbbiStopBulk(); |
|
82 |
|
83 virtual void MrcbbiBulkClientAvailable(const TRemConClientId& aId); |
|
84 virtual void MrcbbiBulkClientNotAvailable(const TRemConClientId& aId); |
|
85 |
|
86 private: |
|
87 explicit CAvrcpBulkBearer(CAvrcpPlayerInfoManager& aPlayerInfoManager, RAvctp& aAvctp); |
|
88 |
|
89 // utility functions |
|
90 TBool Operational() const; |
|
91 void DoConnectIndicateL(const TBTDevAddr& aBTDevice); |
|
92 void DoStartBulkL(); |
|
93 static TBool CompareBrowsingCommandHandlerByBDAddr(const TBTDevAddr* aKey, const CRcpBrowsingCommandHandler& aHandler); |
|
94 void DoNewCommand(CAvrcpCommand& aCommand, const TRemConClientId& aClientId); |
|
95 private: // unowned |
|
96 MRemConBearerBulkObserver* iObserver; |
|
97 CAvrcpPlayerInfoManager& iPlayerInfoManager; |
|
98 RAvctp& iAvctp; |
|
99 MIncomingCommandHandler* iInternalHandler; |
|
100 |
|
101 TDblQue<CAvrcpCommand> iReadyBrowseCommands; |
|
102 |
|
103 private: // owned |
|
104 CBulkRouter* iRouter; |
|
105 RPointerArray<CRcpBrowsingCommandHandler> iBrowseHandlers; |
|
106 |
|
107 }; |
|
108 |
|
109 #endif //BULKBEARER_H |