1 // Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). |
1 // Copyright (c) 2005-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". |
18 // |
18 // |
19 |
19 |
20 |
20 |
21 |
21 |
22 //INCLUDES |
22 //INCLUDES |
|
23 |
|
24 #include "OstTraceDefinitions.h" |
|
25 #ifdef OST_TRACE_COMPILER_IN_USE |
|
26 #include "CSatNotifyOpenChannelTraces.h" |
|
27 #endif |
|
28 |
23 #include <satcs.h> // Etel SAT IPC definitions |
29 #include <satcs.h> // Etel SAT IPC definitions |
24 #include "CSatTsy.h" // Tsy class header |
30 #include "CSatTsy.h" // Tsy class header |
25 #include "CSatNotifyOpenChannel.h" // Class header |
31 #include "CSatNotifyOpenChannel.h" // Class header |
26 #include "CSatNotificationsTsy.h" // Tsy class header |
32 #include "CSatNotificationsTsy.h" // Tsy class header |
27 #include "CBerTlv.h" // Ber Tlv data handling |
33 #include "CBerTlv.h" // Ber Tlv data handling |
28 #include "TTlv.h" // TTlv class |
34 #include "TTlv.h" // TTlv class |
29 #include "CSatDataPackage.h" // Parameter packing |
35 #include "CSatDataPackage.h" // Parameter packing |
30 #include "TfLogger.h" // For TFLOGSTRING |
|
31 #include "TSatUtility.h" // Utilities |
36 #include "TSatUtility.h" // Utilities |
32 #include "CSatTsyReqHandleStore.h" // Request handle class |
37 #include "CSatTsyReqHandleStore.h" // Request handle class |
33 #include "cmmmessagemanagerbase.h" // Message manager class for forwarding req. |
38 #include "cmmmessagemanagerbase.h" // Message manager class for forwarding req. |
34 |
39 |
35 // ----------------------------------------------------------------------------- |
40 // ----------------------------------------------------------------------------- |
40 CSatNotifyOpenChannel* CSatNotifyOpenChannel::NewL |
45 CSatNotifyOpenChannel* CSatNotifyOpenChannel::NewL |
41 ( |
46 ( |
42 CSatNotificationsTsy* aNotificationsTsy |
47 CSatNotificationsTsy* aNotificationsTsy |
43 ) |
48 ) |
44 { |
49 { |
45 TFLOGSTRING("CSAT: CSatNotifyOpenChannel::NewL"); |
50 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYOPENCHANNEL_NEWL_1, "CSAT: CSatNotifyOpenChannel::NewL"); |
46 CSatNotifyOpenChannel* const satNotifyOpenChannel = |
51 CSatNotifyOpenChannel* const satNotifyOpenChannel = |
47 new ( ELeave ) CSatNotifyOpenChannel( aNotificationsTsy ); |
52 new ( ELeave ) CSatNotifyOpenChannel( aNotificationsTsy ); |
48 CleanupStack::PushL( satNotifyOpenChannel ); |
53 CleanupStack::PushL( satNotifyOpenChannel ); |
49 satNotifyOpenChannel->ConstructL(); |
54 satNotifyOpenChannel->ConstructL(); |
50 CleanupStack::Pop( satNotifyOpenChannel ); |
55 CleanupStack::Pop( satNotifyOpenChannel ); |
51 TFLOGSTRING("CSAT: CSatNotifyOpenChannel::NewL, end of method"); |
56 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYOPENCHANNEL_NEWL_2, "CSAT: CSatNotifyOpenChannel::NewL, end of method"); |
52 return satNotifyOpenChannel; |
57 return satNotifyOpenChannel; |
53 } |
58 } |
54 |
59 |
55 // ----------------------------------------------------------------------------- |
60 // ----------------------------------------------------------------------------- |
56 // CSatNotifyOpenChannel::~CSatNotifyOpenChannel |
61 // CSatNotifyOpenChannel::~CSatNotifyOpenChannel |
60 CSatNotifyOpenChannel::~CSatNotifyOpenChannel |
65 CSatNotifyOpenChannel::~CSatNotifyOpenChannel |
61 ( |
66 ( |
62 // None |
67 // None |
63 ) |
68 ) |
64 { |
69 { |
65 TFLOGSTRING("CSAT: CSatNotifyOpenChannel::~CSatNotifyOpenChannel"); |
70 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYOPENCHANNEL_DTOR_1, "CSAT: CSatNotifyOpenChannel::~CSatNotifyOpenChannel"); |
66 } |
71 } |
67 |
72 |
68 // ----------------------------------------------------------------------------- |
73 // ----------------------------------------------------------------------------- |
69 // CSatNotifyOpenChannel::CSatNotifyOpenChannel |
74 // CSatNotifyOpenChannel::CSatNotifyOpenChannel |
70 // Default C++ constructor |
75 // Default C++ constructor |
87 void CSatNotifyOpenChannel::ConstructL |
92 void CSatNotifyOpenChannel::ConstructL |
88 ( |
93 ( |
89 // None |
94 // None |
90 ) |
95 ) |
91 { |
96 { |
92 TFLOGSTRING("CSAT: CSatNotifyOpenChannel::ConstructL"); |
97 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYOPENCHANNEL_CONSTRUCTL_1, "CSAT: CSatNotifyOpenChannel::ConstructL"); |
93 } |
98 } |
94 |
99 |
95 // ----------------------------------------------------------------------------- |
100 // ----------------------------------------------------------------------------- |
96 // CSatNotifyOpenChannel::Notify |
101 // CSatNotifyOpenChannel::Notify |
97 // This request allows a client to be notified of a OPEN CHANNEL proactive |
102 // This request allows a client to be notified of a OPEN CHANNEL proactive |
102 ( |
107 ( |
103 const TTsyReqHandle aTsyReqHandle, |
108 const TTsyReqHandle aTsyReqHandle, |
104 const TDataPackage& aPackage |
109 const TDataPackage& aPackage |
105 ) |
110 ) |
106 { |
111 { |
107 TFLOGSTRING("CSAT: CSatNotifyOpenChannel::Notify"); |
112 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYOPENCHANNEL_NOTIFY_1, "CSAT: CSatNotifyOpenChannel::Notify"); |
108 // Save data pointers to client side for completion |
113 // Save data pointers to client side for completion |
109 iOpenBaseChannelV2Pckg = reinterpret_cast<RSat::TOpenChannelBaseV2Pckg*>( |
114 iOpenBaseChannelV2Pckg = reinterpret_cast<RSat::TOpenChannelBaseV2Pckg*>( |
110 aPackage.Des1n() ); |
115 aPackage.Des1n() ); |
111 iOpenCsChannelV2Pckg = reinterpret_cast<RSat::TOpenCsChannelV2Pckg*>( |
116 iOpenCsChannelV2Pckg = reinterpret_cast<RSat::TOpenCsChannelV2Pckg*>( |
112 aPackage.Des1n() ); |
117 aPackage.Des1n() ); |
132 TInt CSatNotifyOpenChannel::CancelNotification |
137 TInt CSatNotifyOpenChannel::CancelNotification |
133 ( |
138 ( |
134 const TTsyReqHandle aTsyReqHandle |
139 const TTsyReqHandle aTsyReqHandle |
135 ) |
140 ) |
136 { |
141 { |
137 TFLOGSTRING("CSAT: CSatNotifyOpenChannel::CancelNotification"); |
142 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYOPENCHANNEL_CANCELNOTIFICATION_1, "CSAT: CSatNotifyOpenChannel::CancelNotification"); |
138 |
143 |
139 // Reset the request handle |
144 // Reset the request handle |
140 TTsyReqHandle reqHandle = iNotificationsTsy->iSatReqHandleStore-> |
145 TTsyReqHandle reqHandle = iNotificationsTsy->iSatReqHandleStore-> |
141 ResetTsyReqHandle( CSatTsy::ESatNotifyOpenChannelPCmdReqType ); |
146 ResetTsyReqHandle( CSatTsy::ESatNotifyOpenChannelPCmdReqType ); |
142 // Reset the data pointers |
147 // Reset the data pointers |
159 ( |
164 ( |
160 CSatDataPackage* aDataPackage, |
165 CSatDataPackage* aDataPackage, |
161 TInt aErrorCode |
166 TInt aErrorCode |
162 ) |
167 ) |
163 { |
168 { |
164 TFLOGSTRING("CSAT: CSatNotifyOpenChannel::CompleteNotifyL"); |
169 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYOPENCHANNEL_COMPLETENOTIFYL_1, "CSAT: CSatNotifyOpenChannel::CompleteNotifyL"); |
165 |
170 |
166 TInt ret( KErrNone ); |
171 TInt ret( KErrNone ); |
167 // Unpack parameters |
172 // Unpack parameters |
168 TPtrC8* data; |
173 TPtrC8* data; |
169 aDataPackage->UnPackData( &data ); |
174 aDataPackage->UnPackData( &data ); |
202 // Switch according to bearer |
207 // Switch according to bearer |
203 switch ( bearerDescription.GetShortInfo( ETLV_BearerType ) ) |
208 switch ( bearerDescription.GetShortInfo( ETLV_BearerType ) ) |
204 { |
209 { |
205 case KBipCsdBearer: |
210 case KBipCsdBearer: |
206 { |
211 { |
207 TFLOGSTRING("CSAT: CSatNotifyOpenChannel::\ |
212 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYOPENCHANNEL_COMPLETENOTIFYL_2, "CSAT: CSatNotifyOpenChannel::CompleteNotifyL, Command not supported: Csd Bearer"); |
208 CompleteNotifyL, Command not supported: \ |
|
209 Csd Bearer"); |
|
210 // Buffer size |
213 // Buffer size |
211 iBufferSize = bufferSize.GetLongInfo( |
214 iBufferSize = bufferSize.GetLongInfo( |
212 ETLV_BufferSize ); |
215 ETLV_BufferSize ); |
213 // Bearer description |
216 // Bearer description |
214 iBearerType = RSat::ECSDBearer; |
217 iBearerType = RSat::ECSDBearer; |
215 iBearer = bearerDescription.GetData( |
218 iBearer = bearerDescription.GetData( |
216 ETLV_BearerParameters ); |
219 ETLV_BearerParameters ); |
217 TFLOGSTRING("CSAT: CSatNotifyOpenChannel::\ |
220 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYOPENCHANNEL_COMPLETENOTIFYL_3, "CSAT: CSatNotifyOpenChannel::CompleteNotifyL, BipCsdBearer "); |
218 CompleteNotifyL, BipCsdBearer "); |
|
219 CreateTerminalRespL( pCmdNumber, |
221 CreateTerminalRespL( pCmdNumber, |
220 RSat::KCmdBeyondMeCapabilities, KNullDesC16 ); |
222 RSat::KCmdBeyondMeCapabilities, KNullDesC16 ); |
221 ret = KErrCorrupt; |
223 ret = KErrCorrupt; |
222 break; |
224 break; |
223 } |
225 } |
270 } |
272 } |
271 case KBipLocalLinkBearer: |
273 case KBipLocalLinkBearer: |
272 default: |
274 default: |
273 { |
275 { |
274 // Bearer not supported (RFU) |
276 // Bearer not supported (RFU) |
275 TFLOGSTRING("CSAT: CSatNotifyOpenChannel::\ |
277 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYOPENCHANNEL_COMPLETENOTIFYL_4, "CSAT: CSatNotifyOpenChannel::CompleteNotifyL, Bearer not supported"); |
276 CompleteNotifyL, Bearer not supported"); |
|
277 // Required values missing |
278 // Required values missing |
278 iBearer.FillZ( 1 ); |
279 iBearer.FillZ( 1 ); |
279 iBufferSize = 0; |
280 iBufferSize = 0; |
280 iBearerType = static_cast<TUint8>( |
281 iBearerType = static_cast<TUint8>( |
281 RSat::EBearerTypeNotSet ); |
282 RSat::EBearerTypeNotSet ); |
286 } |
287 } |
287 } |
288 } |
288 } |
289 } |
289 else |
290 else |
290 { |
291 { |
291 TFLOGSTRING("CSAT: CSatNotifyOpenChannel::CompleteNotifyL,\ |
292 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYOPENCHANNEL_COMPLETENOTIFYL_5, "CSAT: CSatNotifyOpenChannel::CompleteNotifyL, required values missing"); |
292 required values missing"); |
|
293 // Required values missing |
293 // Required values missing |
294 iBearer.FillZ( 1 ); |
294 iBearer.FillZ( 1 ); |
295 iBufferSize = 0; |
295 iBufferSize = 0; |
296 iBearerType = static_cast<TUint8>( RSat::EBearerTypeNotSet ); |
296 iBearerType = static_cast<TUint8>( RSat::EBearerTypeNotSet ); |
297 CreateTerminalRespL( pCmdNumber, |
297 CreateTerminalRespL( pCmdNumber, |
356 // Set alpha id status |
356 // Set alpha id status |
357 openChannelV2->iAlphaId.iStatus = RSat::EAlphaIdProvided; |
357 openChannelV2->iAlphaId.iStatus = RSat::EAlphaIdProvided; |
358 } |
358 } |
359 else |
359 else |
360 { |
360 { |
361 TFLOGSTRING("CSAT: CSatNotifyOpenChannel::\ |
361 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYOPENCHANNEL_COMPLETENOTIFYL_6, "CSAT: CSatNotifyOpenChannel::CompleteNotifyL, Alpha ID is NULL"); |
362 CompleteNotifyL, Alpha ID is NULL"); |
|
363 openChannelV2->iAlphaId.iStatus = RSat::EAlphaIdNull; |
362 openChannelV2->iAlphaId.iStatus = RSat::EAlphaIdNull; |
364 } |
363 } |
365 } |
364 } |
366 // Alpha id not present |
365 // Alpha id not present |
367 else |
366 else |
368 { |
367 { |
369 TFLOGSTRING("CSAT: CSatNotifyOpenChannel::CompleteNotifyL,\ |
368 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYOPENCHANNEL_COMPLETENOTIFYL_7, "CSAT: CSatNotifyOpenChannel::CompleteNotifyL, Alpha ID not present"); |
370 Alpha ID not present"); |
|
371 openChannelV2->iAlphaId.iStatus = RSat::EAlphaIdNotPresent; |
369 openChannelV2->iAlphaId.iStatus = RSat::EAlphaIdNotPresent; |
372 } |
370 } |
373 |
371 |
374 |
372 |
375 // Iconid (optional) |
373 // Iconid (optional) |
409 } |
407 } |
410 } |
408 } |
411 } |
409 } |
412 else |
410 else |
413 { |
411 { |
414 TFLOGSTRING("CSAT: CSatNotifyOpenChannel::CompleteNotifyL,\ |
412 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYOPENCHANNEL_COMPLETENOTIFYL_8, "CSAT: CSatNotifyOpenChannel::CompleteNotifyL, Protocol not present"); |
415 Protocol not present"); |
|
416 openChannelV2->iSimMeInterface.iTransportProto = |
413 openChannelV2->iSimMeInterface.iTransportProto = |
417 RSat::EProtocolNotPresent; |
414 RSat::EProtocolNotPresent; |
418 } |
415 } |
419 |
416 |
420 // Data destination address |
417 // Data destination address |
485 RSat::EIPv6Address; |
482 RSat::EIPv6Address; |
486 break; |
483 break; |
487 } |
484 } |
488 default: |
485 default: |
489 { |
486 { |
490 TFLOGSTRING("CSAT: CSatNotifyOpenChannel::\ |
487 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYOPENCHANNEL_COMPLETENOTIFYL_9, "CSAT: CSatNotifyOpenChannel::CompleteNotifyL, Address not set"); |
491 CompleteNotifyL, Address not set"); |
|
492 openChannelV2->iDestinationAddress.iType = |
488 openChannelV2->iDestinationAddress.iType = |
493 RSat::EAddressNotSet; |
489 RSat::EAddressNotSet; |
494 break; |
490 break; |
495 } |
491 } |
496 } |
492 } |
556 openCsChannelV2.iLocalAddress.iAddress = |
550 openCsChannelV2.iLocalAddress.iAddress = |
557 localAddressTlv->GetData( ETLV_Address ); |
551 localAddressTlv->GetData( ETLV_Address ); |
558 } |
552 } |
559 else |
553 else |
560 { |
554 { |
561 TFLOGSTRING("CSAT: CSatNotifyOpenChannel::\ |
555 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYOPENCHANNEL_COMPLETENOTIFYL_11, "CSAT: CSatNotifyOpenChannel::CompleteNotifyL, Address not present"); |
562 CompleteNotifyL, Address not present"); |
|
563 openCsChannelV2.iLocalAddress.iType = |
556 openCsChannelV2.iLocalAddress.iType = |
564 RSat::EAddressNotPresent; |
557 RSat::EAddressNotPresent; |
565 } |
558 } |
566 |
559 |
567 break; |
560 break; |
606 localAddressTlv->GetData( |
597 localAddressTlv->GetData( |
607 ETLV_Address ); |
598 ETLV_Address ); |
608 } |
599 } |
609 else |
600 else |
610 { |
601 { |
611 TFLOGSTRING("CSAT: CSatNotifyOpenChannel::\ |
602 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYOPENCHANNEL_COMPLETENOTIFYL_13, "CSAT: CSatNotifyOpenChannel::CompleteNotifyL, Address not present"); |
612 CompleteNotifyL, Address not present"); |
|
613 openGprsChannelV4.iLocalAddress.iType = |
603 openGprsChannelV4.iLocalAddress.iType = |
614 RSat::EAddressNotPresent; |
604 RSat::EAddressNotPresent; |
615 } |
605 } |
616 |
606 |
617 break; |
607 break; |
618 } |
608 } |
619 default: |
609 default: |
620 { |
610 { |
621 TFLOGSTRING("CSAT: CSatNotifyOpenChannel::\ |
611 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYOPENCHANNEL_COMPLETENOTIFYL_14, "CSAT: CSatNotifyOpenChannel::CompleteNotifyL, Unknown Bearer type"); |
622 CompleteNotifyL, Unknown Bearer type"); |
|
623 break; |
612 break; |
624 } |
613 } |
625 |
614 |
626 } // Switch-case |
615 } // Switch-case |
627 } // If bearer description tag exists |
616 } // If bearer description tag exists |
628 } // if ( localAddressTlv ) |
617 } // if ( localAddressTlv ) |
629 } // if ( KErrNone == ret ) |
618 } // if ( KErrNone == ret ) |
630 else |
619 else |
631 { |
620 { |
632 TFLOGSTRING("CSAT: CSatNotifyOpenChannel::CompleteNotifyL,\ |
621 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYOPENCHANNEL_COMPLETENOTIFYL_15, "CSAT: CSatNotifyOpenChannel::CompleteNotifyL, Error when parsing Bearer data"); |
633 Error when parsing Bearer data"); |
|
634 } |
622 } |
635 } // if ( KErrNone == aErrorCode ) |
623 } // if ( KErrNone == aErrorCode ) |
636 else |
624 else |
637 { |
625 { |
638 ret = aErrorCode; |
626 ret = aErrorCode; |
641 iNotificationsTsy->iSatTsy->ReqCompleted( reqHandle, ret ); |
629 iNotificationsTsy->iSatTsy->ReqCompleted( reqHandle, ret ); |
642 } // if ( CSatTsy::ESatReqHandleUnknown != reqHandle ) |
630 } // if ( CSatTsy::ESatReqHandleUnknown != reqHandle ) |
643 else |
631 else |
644 { |
632 { |
645 // Request not on, returning response immediately |
633 // Request not on, returning response immediately |
646 TFLOGSTRING("CSAT: CSatNotifyOpenChannel::CompleteNotifyL, \ |
634 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYOPENCHANNEL_COMPLETENOTIFYL_16, "CSAT: CSatNotifyOpenChannel::CompleteNotifyL, Request not ongoing"); |
647 Request not ongoing"); |
|
648 // additional info must be provided with KMeUnableToProcessCmd |
635 // additional info must be provided with KMeUnableToProcessCmd |
649 TBuf16<1> additionalInfo; |
636 TBuf16<1> additionalInfo; |
650 additionalInfo.Append( RSat::KNoSpecificMeProblem ); |
637 additionalInfo.Append( RSat::KNoSpecificMeProblem ); |
651 iBearer.FillZ( 1 ); |
638 iBearer.FillZ( 1 ); |
652 iBufferSize = 0; |
639 iBufferSize = 0; |
665 TInt CSatNotifyOpenChannel::TerminalResponseL |
652 TInt CSatNotifyOpenChannel::TerminalResponseL |
666 ( |
653 ( |
667 TDes8* aRsp |
654 TDes8* aRsp |
668 ) |
655 ) |
669 { |
656 { |
670 TFLOGSTRING("CSAT: CSatNotifyOpenChannel::TerminalResponseL"); |
657 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYOPENCHANNEL_TERMINALRESPONSEL_1, "CSAT: CSatNotifyOpenChannel::TerminalResponseL"); |
671 |
658 |
672 TInt ret( KErrNone ); |
659 TInt ret( KErrNone ); |
673 |
660 |
674 TBuf16<RSat::KAdditionalInfoMaxSize> additionalInfo; |
661 TBuf16<RSat::KAdditionalInfoMaxSize> additionalInfo; |
675 |
662 |
677 REINTERPRET_CAST( RSat::TOpenChannelRspV2Pckg*, aRsp); |
664 REINTERPRET_CAST( RSat::TOpenChannelRspV2Pckg*, aRsp); |
678 RSat::TOpenChannelRspV2& rspV2 = ( *aRspPckg ) (); |
665 RSat::TOpenChannelRspV2& rspV2 = ( *aRspPckg ) (); |
679 |
666 |
680 TUint8 pCmdNumber( rspV2.PCmdNumber() ); |
667 TUint8 pCmdNumber( rspV2.PCmdNumber() ); |
681 |
668 |
682 TFLOGSTRING2("CSAT: CSatNotifyOpenChannel::TerminalResponseL, \ |
669 OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYOPENCHANNEL_TERMINALRESPONSEL_2, "CSAT: CSatNotifyOpenChannel::TerminalResponseL, General result: %d", rspV2.iGeneralResult); |
683 General result: %d", rspV2.iGeneralResult); |
|
684 |
670 |
685 // Check that general result value is valid |
671 // Check that general result value is valid |
686 if ( ( RSat::KSuccess != rspV2.iGeneralResult ) |
672 if ( ( RSat::KSuccess != rspV2.iGeneralResult ) |
687 && ( RSat::KPartialComprehension != rspV2.iGeneralResult ) |
673 && ( RSat::KPartialComprehension != rspV2.iGeneralResult ) |
688 && ( RSat::KMissingInformation != rspV2.iGeneralResult ) |
674 && ( RSat::KMissingInformation != rspV2.iGeneralResult ) |
701 && ( RSat::KErrorRequiredValuesMissing != rspV2.iGeneralResult ) |
687 && ( RSat::KErrorRequiredValuesMissing != rspV2.iGeneralResult ) |
702 && ( RSat::KBearerIndepProtocolError != rspV2.iGeneralResult ) |
688 && ( RSat::KBearerIndepProtocolError != rspV2.iGeneralResult ) |
703 && ( RSat::KAccessTechUnableProcessCmd != rspV2.iGeneralResult ) |
689 && ( RSat::KAccessTechUnableProcessCmd != rspV2.iGeneralResult ) |
704 && ( RSat::KFramesError != rspV2.iGeneralResult ) ) |
690 && ( RSat::KFramesError != rspV2.iGeneralResult ) ) |
705 { |
691 { |
706 TFLOGSTRING("CSAT: CSatNotifyOpenChannel::TerminalResponseL, \ |
692 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYOPENCHANNEL_TERMINALRESPONSEL_3, "CSAT: CSatNotifyOpenChannel::TerminalResponseL, Invalid General Result"); |
707 Invalid General Result"); |
|
708 // Invalid general result |
693 // Invalid general result |
709 ret = KErrCorrupt; |
694 ret = KErrCorrupt; |
710 } |
695 } |
711 |
696 |
712 // Check for additional info type |
697 // Check for additional info type |
716 ( RSat::KChannelStatusInfo == rspV2.iInfoType ) ) |
701 ( RSat::KChannelStatusInfo == rspV2.iInfoType ) ) |
717 { |
702 { |
718 // Check the length of additional info |
703 // Check the length of additional info |
719 if ( rspV2.iAdditionalInfo.Length() <= 0 ) |
704 if ( rspV2.iAdditionalInfo.Length() <= 0 ) |
720 { |
705 { |
721 TFLOGSTRING("CSAT: CSatNotifyOpenChannel::TerminalResponseL, \ |
706 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYOPENCHANNEL_TERMINALRESPONSEL_4, "CSAT: CSatNotifyOpenChannel::TerminalResponseL, Invalid Additional Info"); |
722 Invalid Additional Info"); |
|
723 // Invalid additional info field |
707 // Invalid additional info field |
724 ret = KErrCorrupt; |
708 ret = KErrCorrupt; |
725 } |
709 } |
726 else |
710 else |
727 { |
711 { |
740 { |
724 { |
741 // Do nothing |
725 // Do nothing |
742 } |
726 } |
743 else |
727 else |
744 { |
728 { |
745 TFLOGSTRING("CSAT: CSatNotifyOpenChannel::TerminalResponseL, \ |
729 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYOPENCHANNEL_TERMINALRESPONSEL_5, "CSAT: CSatNotifyOpenChannel::TerminalResponseL, Invalid Additional Info type"); |
746 Invalid Additional Info type"); |
|
747 ret = KErrCorrupt; |
730 ret = KErrCorrupt; |
748 } |
731 } |
749 |
732 |
750 iBearerType = static_cast<TUint8>(rspV2.iBearer.iType); |
733 iBearerType = static_cast<TUint8>(rspV2.iBearer.iType); |
751 iBearer.Copy( rspV2.iBearer.iParams ); |
734 iBearer.Copy( rspV2.iBearer.iParams ); |
771 TUint8 aPCmdNumber, |
754 TUint8 aPCmdNumber, |
772 TUint8 aGeneralResult, |
755 TUint8 aGeneralResult, |
773 const TDesC16& aAdditionalInfo |
756 const TDesC16& aAdditionalInfo |
774 ) |
757 ) |
775 { |
758 { |
776 TFLOGSTRING("CSAT: CSatMessHandler::CreateTerminalRespL"); |
759 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYOPENCHANNEL_CREATETERMINALRESPL_1, "CSAT: CSatMessHandler::CreateTerminalRespL"); |
777 // Create and append response data |
760 // Create and append response data |
778 TTlv tlvSpecificData; |
761 TTlv tlvSpecificData; |
779 // Create General Result TLV here |
762 // Create General Result TLV here |
780 tlvSpecificData.AddTag( KTlvResultTag ); |
763 tlvSpecificData.AddTag( KTlvResultTag ); |
781 // General result |
764 // General result |
798 else |
781 else |
799 { |
782 { |
800 // Successful result: could/must provide an additional info byte |
783 // Successful result: could/must provide an additional info byte |
801 if ( aAdditionalInfo.Length() > 0 ) |
784 if ( aAdditionalInfo.Length() > 0 ) |
802 { |
785 { |
803 TFLOGSTRING2("CSAT: CSatMessHandler::CreateTerminalRespL,\ |
786 OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYOPENCHANNEL_CREATETERMINALRESPL_2, "CSAT: CSatMessHandler::CreateTerminalRespL, Unsuccessful result: aAddtionalInfo: %d", aAdditionalInfo[0]); |
804 Unsuccessful result: aAddtionalInfo: %d", aAdditionalInfo[0]); |
|
805 tlvSpecificData.AddByte( static_cast<TUint8>( aAdditionalInfo[0] ) ); |
787 tlvSpecificData.AddByte( static_cast<TUint8>( aAdditionalInfo[0] ) ); |
806 } |
788 } |
807 } |
789 } |
808 |
790 |
809 // For any result: Append Bearer Description data |
791 // For any result: Append Bearer Description data |
813 tlvSpecificData.AddByte( iBearerType ); |
795 tlvSpecificData.AddByte( iBearerType ); |
814 tlvSpecificData.AddData( iBearer ); |
796 tlvSpecificData.AddData( iBearer ); |
815 } |
797 } |
816 else |
798 else |
817 { |
799 { |
818 TFLOGSTRING("CSAT: CSatMessHandler::CreateTerminalRespL: \ |
800 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYOPENCHANNEL_CREATETERMINALRESPL_3, "CSAT: CSatMessHandler::CreateTerminalRespL: No Bearer Description data available"); |
819 No Bearer Description data available"); |
|
820 } |
801 } |
821 |
802 |
822 // Append Buffer Size |
803 // Append Buffer Size |
823 tlvSpecificData.AddTag( KTlvBufferSizeTag ); |
804 tlvSpecificData.AddTag( KTlvBufferSizeTag ); |
824 tlvSpecificData.AddByte( TUint8( ( iBufferSize & 0xFF00 ) >> 8 ) ); |
805 tlvSpecificData.AddByte( TUint8( ( iBufferSize & 0xFF00 ) >> 8 ) ); |