bluetooth/btstack/linkmgr/linkmuxer.h
changeset 32 f72906e669b4
parent 0 29b1cd4cb562
equal deleted inserted replaced
31:b9d1744dc449 32:f72906e669b4
     1 // Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
     1 // Copyright (c) 2001-2010 Nokia Corporation and/or its subsidiary(-ies).
     2 // All rights reserved.
     2 // All rights reserved.
     3 // This component and the accompanying materials are made available
     3 // This component and the accompanying materials are made available
     4 // under the terms of "Eclipse Public License v1.0"
     4 // under the terms of "Eclipse Public License v1.0"
     5 // which accompanies this distribution, and is available
     5 // which accompanies this distribution, and is available
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
    29 class CACLDataQController;
    29 class CACLDataQController;
    30 class CLinkMgrProtocol;
    30 class CLinkMgrProtocol;
    31 class CHCICmdQController;
    31 class CHCICmdQController;
    32 
    32 
    33 /**
    33 /**
    34 	Regulates the issuing  of buffers send down the same channel.
    34 	Regulates the issuing of buffers sent down the same channel.
    35 
    35 
    36 	The mux decides and notifies the appropriate Q to send data when the wire
    36 	The mux decides and notifies the appropriate Q to send data when the wire
    37 	is free. The mux will need to be fed with 'the wire is free' events and 
    37 	is free. The mux will need to be fed with 'the wire is free' events and 
    38 	trigger events that will indicate reception of events (external) 
    38 	trigger events that will indicate reception of events (external) 
    39 	corresponding to the different Qs -(like NumCompletedPackets, Write 
    39 	corresponding to the different Qs -(like NumCompletedPackets, Write 
    41 */
    41 */
    42 NONSHARABLE_CLASS(CLinkMuxer) : public CBase
    42 NONSHARABLE_CLASS(CLinkMuxer) : public CBase
    43 	{
    43 	{
    44 public:
    44 public:
    45 	static CLinkMuxer* NewL(CLinkMgrProtocol& aLinkMgrProtocol, CHCIFacade& aHCIFacade);
    45 	static CLinkMuxer* NewL(CLinkMgrProtocol& aLinkMgrProtocol, CHCIFacade& aHCIFacade);
    46 	void ObtainHostControllerBufferSizeL();
    46 	
    47 	void RecordHostControllerToHostFlowControl(TBool aFlowFlag);
    47 	void RecordHostControllerToHostFlowControl(TBool aFlowFlag);
    48 	CACLDataQController* HandleLocalReadBufferSizeResult(TUint16 aAclMaxLen,
    48 	CACLDataQController* HandleLocalReadBufferSizeResult(TUint16 aAclMaxLen, TUint8 /*aScoMaxLen*/, 
    49       TUint8 /*aScoMaxLen*/,TUint16 aNoACL,TUint16 /*aNoSCO*/);
    49 														TUint16 aNoACL, TUint16 /*aNoSCO*/);
    50 	TInt ACLPacketMTU() const;
    50 	TInt ACLPacketMTU() const;
    51 
    51 
    52 	CACLDataQController& DataQController() const {return *iDataController;};
    52 	CACLDataQController& DataQController() const {return *iDataController;}
       
    53 	
    53 	void ChannelsFree(THCITransportChannel aChannel); // notification of free channels
    54 	void ChannelsFree(THCITransportChannel aChannel); // notification of free channels
    54 	void ChannelsClosed(THCITransportChannel aChannel); // notification of closed channels
    55 	void ChannelsClosed(THCITransportChannel aChannel); // notification of closed channels
    55 	static TInt TryToSendCallBackStatic(TAny* aCLinkMuxer);
    56 	
    56 	void TryToSend();	// request to send on certain channels
    57 	void TryToSend();	// request to send on certain channels
       
    58 	
       
    59 	TFlowControlMode FlowControlMode() const {return iFlowControlMode;}
       
    60 	void ResetFlowControlMode();
       
    61 	
    57 #ifdef STACK_SCO_DATA
    62 #ifdef STACK_SCO_DATA
    58 	TBool CanWriteSCOData();
    63 	TBool CanWriteSCOData();
    59 #endif
    64 #endif
    60 	~CLinkMuxer();
    65 	~CLinkMuxer();
    61 
    66 
    63 	void DataTrigger();
    68 	void DataTrigger();
    64 	void CommandTrigger();
    69 	void CommandTrigger();
    65 	void ConstructL();
    70 	void ConstructL();
    66 	CLinkMuxer(CLinkMgrProtocol& aLinkMgrProtocol, CHCIFacade& aHCIFacade);
    71 	CLinkMuxer(CLinkMgrProtocol& aLinkMgrProtocol, CHCIFacade& aHCIFacade);
    67 	void DoSend(/*THCITransportChannel aChannel*/);	// request to send on certain channels
    72 	void DoSend(/*THCITransportChannel aChannel*/);	// request to send on certain channels
       
    73 	static TInt TryToSendCallBackStatic(TAny* aCLinkMuxer);
       
    74 	
    68 private:
    75 private:
    69 // owned resources
    76 // owned resources
    70 	CHCICmdQController*	iCommandController;
    77 	CHCICmdQController*	iCommandController;
    71 	CACLDataQController* iDataController;
    78 	CACLDataQController* iDataController;
    72 	CAsyncCallBack*			iSendCallBack;
    79 	CAsyncCallBack*			iSendCallBack;
    73 // non-owned resources
    80 // non-owned resources
    74 	CHCIFacade&				iHCIFacade;
    81 	CHCIFacade&				iHCIFacade;
    75 	THCITransportChannel	iChannelsFree;
    82 	THCITransportChannel	iChannelsFree;
    76     TFlowControlMode		iFlowControlMode;
    83 	TFlowControlMode		iFlowControlMode;
       
    84 	TBool					iCtrlerToHostSet;
    77 	CLinkMgrProtocol&		iLinkMgrProtocol;
    85 	CLinkMgrProtocol&		iLinkMgrProtocol;
    78 	TInt					iACLPacketMTU;
    86 	TInt					iACLPacketMTU;
    79 	};
    87 	};
    80 
    88 
    81 #endif
    89 #endif