51
|
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 |
void MrcciCommandExpired(TUint aTransactionId);
|
|
50 |
|
|
51 |
TInt MrcbciSetAddressedClient(const TRemConAddress& aAddr, const TRemConClientId& aClient);
|
|
52 |
void MrcbciRemoveAddressing(const TRemConAddress& aAddr);
|
|
53 |
|
|
54 |
private: // Interface to router, from MAvrcpBearer
|
|
55 |
MIncomingCommandHandler* IncomingHandler(const TBTDevAddr& aAddr);
|
|
56 |
MOutgoingCommandHandler* OutgoingHandler(const TBTDevAddr& aAddr);
|
|
57 |
|
|
58 |
void ConnectIndicate(const TBTDevAddr& aBTDevice);
|
|
59 |
void ConnectConfirm(const TBTDevAddr& aBTDevice, TInt aError);
|
|
60 |
void DisconnectIndicate(const TBTDevAddr& aBTDevice);
|
|
61 |
void DisconnectConfirm(const TBTDevAddr& aBTDevice, TInt aError);
|
|
62 |
|
|
63 |
private: // interface to RemCon, from MRemConBulkBearerInterface
|
|
64 |
virtual TInt MrcbbiGetCommand(TUid& aInterfaceUid,
|
|
65 |
TUint& aTransactionId,
|
|
66 |
TUint& aOperationId,
|
|
67 |
RBuf8& aData,
|
|
68 |
TRemConAddress& aAddr);
|
|
69 |
|
|
70 |
virtual TInt MrcbbiSendResponse(TUid aInterfaceUid,
|
|
71 |
TUint aOperationId,
|
|
72 |
TUint aTransactionId,
|
|
73 |
RBuf8& aData,
|
|
74 |
const TRemConAddress& aAddr);
|
|
75 |
|
|
76 |
virtual void MrcbbiSendReject(TUid aInterfaceUid,
|
|
77 |
TUint aOperationId,
|
|
78 |
TUint aTransactionId,
|
|
79 |
const TRemConAddress& aAddr);
|
|
80 |
|
|
81 |
virtual TInt MrcbbiStartBulk(MRemConBearerBulkObserver& aObserver);
|
|
82 |
virtual void MrcbbiStopBulk();
|
|
83 |
|
|
84 |
virtual void MrcbbiBulkClientAvailable(const TRemConClientId& aId);
|
|
85 |
virtual void MrcbbiBulkClientNotAvailable(const TRemConClientId& aId);
|
|
86 |
|
|
87 |
private:
|
|
88 |
explicit CAvrcpBulkBearer(CAvrcpPlayerInfoManager& aPlayerInfoManager, RAvctp& aAvctp);
|
|
89 |
|
|
90 |
// utility functions
|
|
91 |
TBool Operational() const;
|
|
92 |
void DoConnectIndicateL(const TBTDevAddr& aBTDevice);
|
|
93 |
void DoStartBulkL();
|
|
94 |
static TBool CompareBrowsingCommandHandlerByBDAddr(const TBTDevAddr* aKey, const CRcpBrowsingCommandHandler& aHandler);
|
|
95 |
void DoNewCommand(CAvrcpCommand& aCommand, const TRemConClientId& aClientId);
|
|
96 |
private: // unowned
|
|
97 |
MRemConBearerBulkObserver* iObserver;
|
|
98 |
CAvrcpPlayerInfoManager& iPlayerInfoManager;
|
|
99 |
RAvctp& iAvctp;
|
|
100 |
MIncomingCommandHandler* iInternalHandler;
|
|
101 |
|
|
102 |
TDblQue<CAvrcpCommand> iReadyBrowseCommands;
|
|
103 |
|
|
104 |
private: // owned
|
|
105 |
CBulkRouter* iRouter;
|
|
106 |
RPointerArray<CRcpBrowsingCommandHandler> iBrowseHandlers;
|
|
107 |
|
|
108 |
};
|
|
109 |
|
|
110 |
#endif //BULKBEARER_H
|