1 /* |
1 /* |
2 * Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies). |
2 * Copyright (c) 2006-2010 Nokia Corporation and/or its subsidiary(-ies). |
3 * All rights reserved. |
3 * All rights reserved. |
4 * This component and the accompanying materials are made available |
4 * This component and the accompanying materials are made available |
5 * under the terms of "Eclipse Public License v1.0" |
5 * under the terms of "Eclipse Public License v1.0" |
6 * which accompanies this distribution, and is available |
6 * which accompanies this distribution, and is available |
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
649 |
649 |
650 // Get upstream and downstream |
650 // Get upstream and downstream |
651 CDunUpstream* upstream = channelData.iUpstreamRW; |
651 CDunUpstream* upstream = channelData.iUpstreamRW; |
652 CDunDownstream* downstream = channelData.iDownstreamRW; |
652 CDunDownstream* downstream = channelData.iDownstreamRW; |
653 |
653 |
654 // Set command notify endpoint readiness callbacks |
|
655 if ( aDirection == EDunReaderUpstream ) |
654 if ( aDirection == EDunReaderUpstream ) |
656 { |
655 { |
657 // Initialize stream for AT parsing (ignore errors) |
656 // Initialize stream for AT parsing (ignore errors) |
658 upstream->InitializeForAtParsing( downstream, |
657 upstream->InitializeForAtParsing( downstream, |
659 channelData.iChannelName, |
658 channelData.iChannelName, |
674 // If signal copy object(s) exist then add RunL error monitoring for them |
673 // If signal copy object(s) exist then add RunL error monitoring for them |
675 if ( channelData.iUpstreamSignalCopy ) // optional |
674 if ( channelData.iUpstreamSignalCopy ) // optional |
676 { |
675 { |
677 // Add callback (ignore errors) |
676 // Add callback (ignore errors) |
678 channelData.iUpstreamSignalCopy->AddCallback( aCallback ); |
677 channelData.iUpstreamSignalCopy->AddCallback( aCallback ); |
679 // Add endpoint readiness callback (ignore errors ) |
|
680 MDunEndpointReady* erHandler = downstream->EndpointReadyHandler(); |
|
681 channelData.iUpstreamSignalCopy->AddEndpointReadyCallback( erHandler ); |
|
682 } |
678 } |
683 } |
679 } |
684 else if ( streamType == EDunStreamTypeDownstream ) |
680 else if ( streamType == EDunStreamTypeDownstream ) |
685 { |
681 { |
686 // If signal copy object(s) exist then add RunL error monitoring for them |
682 // If signal copy object(s) exist then add RunL error monitoring for them |
687 if ( channelData.iDownstreamSignalCopy ) // optional |
683 if ( channelData.iDownstreamSignalCopy ) // optional |
688 { |
684 { |
689 // Add callback (ignore errors) |
685 // Add callback (ignore errors) |
690 channelData.iDownstreamSignalCopy->AddCallback( aCallback ); |
686 channelData.iDownstreamSignalCopy->AddCallback( aCallback ); |
691 // Note: Nokia's adaptation doesn't support full signals so don't |
|
692 // add the endpoint readiness callback here |
|
693 } |
687 } |
694 } |
688 } |
695 else |
689 else |
696 { |
690 { |
697 FTRACE(FPrint( _L("CDunTransUtils::DoAddConnMonCallback() (stream) not initialized!" ) )); |
691 FTRACE(FPrint( _L("CDunTransUtils::DoAddConnMonCallback() (stream) not initialized!" ) )); |
707 FTRACE(FPrint( _L("CDunTransUtils::DoAddConnMonCallback() (iSignalNotify) not initialized" ))); |
701 FTRACE(FPrint( _L("CDunTransUtils::DoAddConnMonCallback() (iSignalNotify) not initialized" ))); |
708 return KErrGeneral; |
702 return KErrGeneral; |
709 } |
703 } |
710 // Add callback (ignore errors) |
704 // Add callback (ignore errors) |
711 channelData.iSignalNotify->AddCallback( aCallback ); |
705 channelData.iSignalNotify->AddCallback( aCallback ); |
712 // Add endpoint readiness callback (ignore errors ) |
|
713 MDunEndpointReady* erHandler = downstream->EndpointReadyHandler(); |
|
714 channelData.iSignalNotify->AddEndpointReadyCallback( erHandler ); |
|
715 } |
706 } |
716 |
707 |
717 // Add callback (ignore errors) |
708 // Add callback (ignore errors) |
718 if ( streamType == EDunStreamTypeUpstream ) |
709 if ( streamType == EDunStreamTypeUpstream ) |
719 { |
710 { |