252 } |
252 } |
253 |
253 |
254 TInt TAVStreamState::AddSession(CAVStream& /*aStream*/, |
254 TInt TAVStreamState::AddSession(CAVStream& /*aStream*/, |
255 TAvdtpTransportSessionType /*aType*/, |
255 TAvdtpTransportSessionType /*aType*/, |
256 CUserPlaneTransportSession& /*aSession*/, |
256 CUserPlaneTransportSession& /*aSession*/, |
257 CTransportChannel*& /*aTransportChannel*/) const |
257 CTransportChannel*& /*aTransportChannel*/, |
|
258 TL2CapConfig::TChannelPriority /*aPriority*/) const |
258 { |
259 { |
259 LOG_FUNC |
260 LOG_FUNC |
260 DEBUGPANICINSTATE(EAvdtpUnexpectedAddSessionEvent); |
261 DEBUGPANICINSTATE(EAvdtpUnexpectedAddSessionEvent); |
261 return KErrNotReady; |
262 return KErrNotReady; |
262 } |
263 } |
488 Once all the required sessions are added the stream tries to open the remote |
489 Once all the required sessions are added the stream tries to open the remote |
489 */ |
490 */ |
490 TInt TAVStreamStateINTConfigured::AddSession(CAVStream& aStream, |
491 TInt TAVStreamStateINTConfigured::AddSession(CAVStream& aStream, |
491 TAvdtpTransportSessionType aType, |
492 TAvdtpTransportSessionType aType, |
492 CUserPlaneTransportSession& aSession, |
493 CUserPlaneTransportSession& aSession, |
493 CTransportChannel*& aChannel) const |
494 CTransportChannel*& aChannel, |
|
495 TL2CapConfig::TChannelPriority aPriority) const |
494 { |
496 { |
495 LOG_FUNC |
497 LOG_FUNC |
496 TInt ret = KErrNone; |
498 TInt ret = KErrNone; |
497 // check GAVDP isn't being naughty and asking for an unconfigured session |
499 // check GAVDP isn't being naughty and asking for an unconfigured session |
498 if ((aType==EReporting && !aStream.CheckConfigured(EServiceCategoryReporting)) |
500 if ((aType==EReporting && !aStream.CheckConfigured(EServiceCategoryReporting)) |
511 aChannel = aStream.iProtocol.GetTransportChannel(aStream.iRemoteAddress, useMux); |
513 aChannel = aStream.iProtocol.GetTransportChannel(aStream.iRemoteAddress, useMux); |
512 |
514 |
513 if (aChannel) |
515 if (aChannel) |
514 { |
516 { |
515 // bind session to channel |
517 // bind session to channel |
516 ret = aChannel->AttachTransportSession(aSession, aType); |
518 ret = aChannel->AttachTransportSession(aSession, aType, aPriority); |
517 if (ret==KErrNone) |
519 if (ret==KErrNone) |
518 { |
520 { |
519 // keep a copy of this binding |
521 // keep a copy of this binding |
520 TTransportBinding binding; |
522 TTransportBinding binding; |
521 binding.iSession = &aSession; |
523 binding.iSession = &aSession; |
772 } |
774 } |
773 |
775 |
774 TInt TAVStreamStateACPConfigured::AddSession(CAVStream& /*aStream*/, |
776 TInt TAVStreamStateACPConfigured::AddSession(CAVStream& /*aStream*/, |
775 TAvdtpTransportSessionType /*aType*/, |
777 TAvdtpTransportSessionType /*aType*/, |
776 CUserPlaneTransportSession& /*aSession*/, |
778 CUserPlaneTransportSession& /*aSession*/, |
777 CTransportChannel*& /*aTransportChannel*/) const |
779 CTransportChannel*& /*aTransportChannel*/, |
|
780 TL2CapConfig::TChannelPriority /*aPriority*/) const |
778 { |
781 { |
779 LOG_FUNC |
782 LOG_FUNC |
780 return KErrNotReady; |
783 return KErrNotReady; |
781 } |
784 } |
782 |
785 |
826 } |
829 } |
827 |
830 |
828 TInt TAVStreamStateReady::AddSession(CAVStream& /*aStream*/, |
831 TInt TAVStreamStateReady::AddSession(CAVStream& /*aStream*/, |
829 TAvdtpTransportSessionType /*aType*/, |
832 TAvdtpTransportSessionType /*aType*/, |
830 CUserPlaneTransportSession& /*aSession*/, |
833 CUserPlaneTransportSession& /*aSession*/, |
831 CTransportChannel*& /*aTransportChannel*/) const |
834 CTransportChannel*& /*aTransportChannel*/, |
|
835 TL2CapConfig::TChannelPriority /*aPriority*/) const |
832 { |
836 { |
833 LOG_FUNC |
837 LOG_FUNC |
834 #ifdef _DEBUG |
838 #ifdef _DEBUG |
835 return KErrPanicAvdtpOpenInBadState; |
839 return KErrPanicAvdtpOpenInBadState; |
836 #else |
840 #else |
917 if (sigch) |
921 if (sigch) |
918 { |
922 { |
919 sigch->SendAbort(aStream, aStream.RemoteSEID()); |
923 sigch->SendAbort(aStream, aStream.RemoteSEID()); |
920 } |
924 } |
921 |
925 |
922 // no need to tell signalling session as Opening is not available to RGavdp |
|
923 // Opening is performed when the necessary sockets are created and connected in a stream |
926 // Opening is performed when the necessary sockets are created and connected in a stream |
924 aStream.NotifyUserPlaneTransportSessionsError(NULL, aResult); |
927 aStream.NotifyUserPlaneTransportSessionsError(NULL, aResult); |
925 } |
928 } |
926 else |
929 else |
927 { |
930 { |
1192 to come in and connect to the TCs. The sessions do so at the behest of GAVDP |
1195 to come in and connect to the TCs. The sessions do so at the behest of GAVDP |
1193 */ |
1196 */ |
1194 TInt TAVStreamStateWaitForSessions::AddSession(CAVStream& aStream, |
1197 TInt TAVStreamStateWaitForSessions::AddSession(CAVStream& aStream, |
1195 TAvdtpTransportSessionType aType, |
1198 TAvdtpTransportSessionType aType, |
1196 CUserPlaneTransportSession& aSession, |
1199 CUserPlaneTransportSession& aSession, |
1197 CTransportChannel*& aChannel) const |
1200 CTransportChannel*& aChannel, |
|
1201 TL2CapConfig::TChannelPriority aPriority) const |
1198 { |
1202 { |
1199 LOG_FUNC |
1203 LOG_FUNC |
1200 TInt ret = KErrNone; |
1204 TInt ret = KErrNone; |
1201 |
1205 |
1202 // bind session to channel - the channel is there, we'd have been told if it had gone |
1206 // bind session to channel - the channel is there, we'd have been told if it had gone |
1235 PanicInState(EAvdtpBadSessionAttachingToStream); |
1239 PanicInState(EAvdtpBadSessionAttachingToStream); |
1236 } |
1240 } |
1237 |
1241 |
1238 if (ret == KErrNone) |
1242 if (ret == KErrNone) |
1239 { |
1243 { |
1240 ret = b->iChannel->AttachTransportSession(aSession, aType); |
1244 ret = b->iChannel->AttachTransportSession(aSession, aType, aPriority); |
1241 if (ret==KErrNone) |
1245 if (ret==KErrNone) |
1242 { |
1246 { |
1243 // stream needs to remember binding |
1247 // stream needs to remember binding |
1244 b->iSession = &aSession; |
1248 b->iSession = &aSession; |
1245 // and session need to know channel |
1249 // and session need to know channel |
1275 stored in the CAVStream object will be used to pass a start indication to GAVDP. |
1279 stored in the CAVStream object will be used to pass a start indication to GAVDP. |
1276 */ |
1280 */ |
1277 TInt TAVStreamStateWaitForSessionsStartReceived::AddSession(CAVStream& aStream, |
1281 TInt TAVStreamStateWaitForSessionsStartReceived::AddSession(CAVStream& aStream, |
1278 TAvdtpTransportSessionType aType, |
1282 TAvdtpTransportSessionType aType, |
1279 CUserPlaneTransportSession& aSession, |
1283 CUserPlaneTransportSession& aSession, |
1280 CTransportChannel*& aChannel) const |
1284 CTransportChannel*& aChannel, |
|
1285 TL2CapConfig::TChannelPriority aPriority) const |
1281 { |
1286 { |
1282 LOG_FUNC |
1287 LOG_FUNC |
1283 // Call the function from the parent class to bind the session |
1288 // Call the function from the parent class to bind the session |
1284 TInt ret = TAVStreamStateWaitForSessions::AddSession(aStream,aType,aSession,aChannel); |
1289 TInt ret = TAVStreamStateWaitForSessions::AddSession(aStream,aType,aSession,aChannel, aPriority); |
1285 |
1290 |
1286 // if that worked, and all the channels are bound, we can now issue the delayed start |
1291 // if that worked, and all the channels are bound, we can now issue the delayed start |
1287 if((ret == KErrNone) && (!aStream.iNumSessionsRequired)) |
1292 if((ret == KErrNone) && (!aStream.iNumSessionsRequired)) |
1288 { |
1293 { |
1289 aStream.ReadyForStartIndication(); |
1294 aStream.ReadyForStartIndication(); |