1 // Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies). |
1 // Copyright (c) 2006-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". |
68 to prevent an early switch back into a low power mode. |
68 to prevent an early switch back into a low power mode. |
69 **/ |
69 **/ |
70 { |
70 { |
71 public: |
71 public: |
72 static CArbitrationDelayTimer* NewL(CPhysicalLink* aParent); |
72 static CArbitrationDelayTimer* NewL(CPhysicalLink* aParent); |
73 void Start(TBool aLocalPriority=EFalse); |
73 TInt Start(TBool aImmediate, TBool aLocalPriority); |
74 |
74 void Restart(); |
|
75 |
75 private: |
76 private: |
76 CArbitrationDelayTimer(CPhysicalLink* aParent); |
77 CArbitrationDelayTimer(CPhysicalLink* aParent); |
77 void ConstructL(); |
78 void ConstructL(); |
78 void RunL(); |
79 void RunL(); |
79 void DoCancel(); |
80 void DoCancel(); |
80 |
81 TInt DoArbitrate(); |
81 private: |
82 void CancelButPreserveLocalPriority(); |
82 CPhysicalLink* iParent; |
83 |
83 TBool iLocalPriority; |
84 private: |
|
85 CPhysicalLink* iParent; |
|
86 TBool iLocalPriority; |
84 }; |
87 }; |
85 |
88 |
86 |
89 |
87 NONSHARABLE_STRUCT(TLogicalLinkListener) |
90 NONSHARABLE_STRUCT(TLogicalLinkListener) |
88 { |
91 { |
294 inline TBool IsConnected() const; |
297 inline TBool IsConnected() const; |
295 inline TBool IsListening() const; |
298 inline TBool IsListening() const; |
296 inline TBTBasebandRole Role() const; |
299 inline TBTBasebandRole Role() const; |
297 void SetDeviceNamePending(TBool aBool); |
300 void SetDeviceNamePending(TBool aBool); |
298 TInt GetOption(TUint aLevel,TUint aName,TDes8& aOption) const; |
301 TInt GetOption(TUint aLevel,TUint aName,TDes8& aOption) const; |
299 TInt Connect(TBasebandPageTimePolicy aPolicy=EPagingNormal); |
302 void Connect(TBasebandPageTimePolicy aPolicy=EPagingNormal); |
300 TInt SCOConnect(); |
303 TInt SCOConnect(); |
301 TInt SCOConnect(const TUint16 aUserHVPacketTypes); |
304 TInt SCOConnect(const TUint16 aUserHVPacketTypes); |
302 TInt SynchronousConnect(TUint aTransmitBandwidth, TUint aReceiveBandwidth, |
305 TInt SynchronousConnect(TUint aTransmitBandwidth, TUint aReceiveBandwidth, |
303 TUint16 aMaxLatency, TUint16 aVoiceSettings, |
306 TUint16 aMaxLatency, TUint16 aVoiceSettings, |
304 TUint8 aRetransmissionEffort, const TBTSyncPacketTypes aUserPacketTypes); |
307 TUint8 aRetransmissionEffort, const TBTSyncPacketTypes aUserPacketTypes); |
305 TInt PassiveOpen(); |
308 TInt Arbitrate(TBool aImmediately=EFalse, TBool aLocalPriority=EFalse); |
306 TInt Arbitrate(TBool aImmediately=EFalse, TBool aLocalPriority=EFalse); |
309 TInt DoArbitrate(TBool aLocalPriority); |
307 TInt DoArbitrate(TBool aLocalPriority); |
|
308 void SetPassKey(const TDesC8& aPassKey); |
310 void SetPassKey(const TDesC8& aPassKey); |
309 const TBTPinCode& PassKey() const; |
311 const TBTPinCode& PassKey() const; |
310 |
312 |
311 void StartArbitrationTimer() const; |
313 void StartArbitrationTimer() const; |
312 |
314 |
372 virtual void ModeChange(THCIErrorCode aErr, THCIConnHandle aConnH, TBTLinkMode aMode, TBasebandTime aInterval); |
374 virtual void ModeChange(THCIErrorCode aErr, THCIConnHandle aConnH, TBTLinkMode aMode, TBasebandTime aInterval); |
373 virtual void WriteLinkPolicySettingsCompleteEvent(THCIErrorCode aErr, THCIConnHandle aConnH); |
375 virtual void WriteLinkPolicySettingsCompleteEvent(THCIErrorCode aErr, THCIConnHandle aConnH); |
374 virtual void RoleChange(THCIErrorCode aErr, const TBTDevAddr& aAddr, TBTBasebandRole aRole); |
376 virtual void RoleChange(THCIErrorCode aErr, const TBTDevAddr& aAddr, TBTBasebandRole aRole); |
375 virtual void ClockOffset(THCIErrorCode aErr, THCIConnHandle aConnH, TBasebandTime aClockOffset); |
377 virtual void ClockOffset(THCIErrorCode aErr, THCIConnHandle aConnH, TBasebandTime aClockOffset); |
376 virtual void RemoteName(THCIErrorCode aErr, const TBTDevAddr& aAddr, const TBTDeviceName8& aName); |
378 virtual void RemoteName(THCIErrorCode aErr, const TBTDevAddr& aAddr, const TBTDeviceName8& aName); |
|
379 |
|
380 void ConnectionComplete(TInt aResult, const TBTConnect& aConn); |
377 |
381 |
378 TBool LinkKeyRequestPending(); |
382 TBool LinkKeyRequestPending(); |
379 void SetAuthenticationPending(TUint8 aFlag); |
383 void SetAuthenticationPending(TUint8 aFlag); |
380 virtual void AuthenticationComplete(TUint8 aFlag); |
384 virtual void AuthenticationComplete(TUint8 aFlag); |
381 |
385 |
|
386 TBool IsAuthenticationRequestPending() const; |
|
387 |
|
388 |
382 static TInt OverrideLPMTimeoutCallback(TAny* aCPhysicalLink);// async callback |
389 static TInt OverrideLPMTimeoutCallback(TAny* aCPhysicalLink);// async callback |
383 static TInt TerminateCallback(TAny* aCPhysicalLink);// async callback |
390 static TInt TerminateCallback(TAny* aCPhysicalLink);// async callback |
384 TInt Terminate(THCIErrorCode aReason); |
391 TInt Terminate(THCIErrorCode aReason); |
385 |
392 |
386 TInt AttachLogicalLink(TLinkType aLink, CBTBasebandSAP& aSAP); |
393 TInt AttachLogicalLink(TLinkType aLink, CBTBasebandSAP& aSAP); |
548 TDeltaTimerEntry iIdleTimerEntry; |
555 TDeltaTimerEntry iIdleTimerEntry; |
549 TBool iIdleTimerQueued; |
556 TBool iIdleTimerQueued; |
550 TDeltaTimerEntry iOverrideLPMTimerEntry; |
557 TDeltaTimerEntry iOverrideLPMTimerEntry; |
551 |
558 |
552 TLinkPolicy iLinkPolicy; |
559 TLinkPolicy iLinkPolicy; |
553 TUint8 iPreviousRequestedModeMask; |
560 TUint16 iPreviousRequestedModeMask; |
554 TBool iOverrideParkRequests; //for maybe temporary unpark |
561 TBool iOverrideParkRequests; //for maybe temporary unpark |
555 TBool iOverrideLPMRequests; //for maybe temporary force active |
562 TBool iOverrideLPMRequests; //for maybe temporary force active |
556 TBool iLPMOverrideTimerQueued; |
563 TBool iLPMOverrideTimerQueued; |
557 TBool iConnectionPacketTypeChanged; //for triggering h/w |
564 TBool iConnectionPacketTypeChanged; //for triggering h/w |
558 |
565 |