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". |
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 "CSatNotifyMoSmControlRequestTraces.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 "CSatNotifyMoSmControlRequest.h" // Class header |
31 #include "CSatNotifyMoSmControlRequest.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 "BerTlv_defs.h" // Ber Tlv specific definitions |
34 #include "BerTlv_defs.h" // Ber Tlv specific definitions |
29 #include "TTlv.h" // TTlv class |
35 #include "TTlv.h" // TTlv class |
30 #include "CSatDataPackage.h" // Parameter packing |
36 #include "CSatDataPackage.h" // Parameter packing |
31 #include "TfLogger.h" // For TFLOGSTRING |
|
32 #include "TSatUtility.h" // Utilities |
37 #include "TSatUtility.h" // Utilities |
33 #include "CSatTsyReqHandleStore.h" // Request handle class |
38 #include "CSatTsyReqHandleStore.h" // Request handle class |
34 #include "cmmmessagemanagerbase.h" // Message manager class for forwarding req. |
39 #include "cmmmessagemanagerbase.h" // Message manager class for forwarding req. |
35 #include "MSatTsy_IPCDefs.h" // Sat Tsy internal request types |
40 #include "MSatTsy_IPCDefs.h" // Sat Tsy internal request types |
36 |
41 |
42 CSatNotifyMoSmControlRequest* CSatNotifyMoSmControlRequest::NewL |
47 CSatNotifyMoSmControlRequest* CSatNotifyMoSmControlRequest::NewL |
43 ( |
48 ( |
44 CSatNotificationsTsy* aNotificationsTsy |
49 CSatNotificationsTsy* aNotificationsTsy |
45 ) |
50 ) |
46 { |
51 { |
47 TFLOGSTRING("CSAT: CSatNotifyMoSmControlRequest::NewL"); |
52 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYMOSMCONTROLREQUEST_NEWL_1, "CSAT: CSatNotifyMoSmControlRequest::NewL"); |
48 CSatNotifyMoSmControlRequest* const satNotifyMoSmControlRequest = |
53 CSatNotifyMoSmControlRequest* const satNotifyMoSmControlRequest = |
49 new ( ELeave ) CSatNotifyMoSmControlRequest( aNotificationsTsy ); |
54 new ( ELeave ) CSatNotifyMoSmControlRequest( aNotificationsTsy ); |
50 CleanupStack::PushL( satNotifyMoSmControlRequest ); |
55 CleanupStack::PushL( satNotifyMoSmControlRequest ); |
51 satNotifyMoSmControlRequest->ConstructL(); |
56 satNotifyMoSmControlRequest->ConstructL(); |
52 CleanupStack::Pop( satNotifyMoSmControlRequest ); |
57 CleanupStack::Pop( satNotifyMoSmControlRequest ); |
53 TFLOGSTRING("CSAT: CSatNotifyMoSmControlRequest::NewL, end of method"); |
58 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYMOSMCONTROLREQUEST_NEWL_2, "CSAT: CSatNotifyMoSmControlRequest::NewL, end of method"); |
54 return satNotifyMoSmControlRequest; |
59 return satNotifyMoSmControlRequest; |
55 } |
60 } |
56 |
61 |
57 // ----------------------------------------------------------------------------- |
62 // ----------------------------------------------------------------------------- |
58 // CSatNotifyMoSmControlRequest::~CSatNotifyMoSmControlRequest |
63 // CSatNotifyMoSmControlRequest::~CSatNotifyMoSmControlRequest |
62 CSatNotifyMoSmControlRequest::~CSatNotifyMoSmControlRequest |
67 CSatNotifyMoSmControlRequest::~CSatNotifyMoSmControlRequest |
63 ( |
68 ( |
64 // None |
69 // None |
65 ) |
70 ) |
66 { |
71 { |
67 TFLOGSTRING("CSAT: CSatNotifyMoSmControlRequest::\ |
72 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYMOSMCONTROLREQUEST_DTOR_1, "CSAT: CSatNotifyMoSmControlRequest::~CSatNotifyMoSmControlRequest"); |
68 ~CSatNotifyMoSmControlRequest"); |
|
69 } |
73 } |
70 |
74 |
71 // ----------------------------------------------------------------------------- |
75 // ----------------------------------------------------------------------------- |
72 // CSatNotifyMoSmControlRequest::CSatNotifyMoSmControlRequest |
76 // CSatNotifyMoSmControlRequest::CSatNotifyMoSmControlRequest |
73 // Default C++ constructor |
77 // Default C++ constructor |
89 void CSatNotifyMoSmControlRequest::ConstructL |
93 void CSatNotifyMoSmControlRequest::ConstructL |
90 ( |
94 ( |
91 // None |
95 // None |
92 ) |
96 ) |
93 { |
97 { |
94 TFLOGSTRING("CSAT: CSatNotifyMoSmControlRequest::ConstructL"); |
98 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYMOSMCONTROLREQUEST_CONSTRUCTL_1, "CSAT: CSatNotifyMoSmControlRequest::ConstructL"); |
95 // Checks if MO-SMS control should be activated |
99 // Checks if MO-SMS control should be activated |
96 iNotificationsTsy->iSatTsy->MessageManager()->HandleRequestL( |
100 iNotificationsTsy->iSatTsy->MessageManager()->HandleRequestL( |
97 ESatTsyMoSmsControlActivation ); |
101 ESatTsyMoSmsControlActivation ); |
98 // Initialize MO-SMS Control to deactivated |
102 // Initialize MO-SMS Control to deactivated |
99 iIsMoSmsCtrlActivated = EFalse; |
103 iIsMoSmsCtrlActivated = EFalse; |
100 TFLOGSTRING("CSAT: CSatNotifyMoSmControlRequest::ConstructL, \ |
104 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYMOSMCONTROLREQUEST_CONSTRUCTL_2, "CSAT: CSatNotifyMoSmControlRequest::ConstructL, end of method"); |
101 end of method"); |
|
102 } |
105 } |
103 |
106 |
104 // ----------------------------------------------------------------------------- |
107 // ----------------------------------------------------------------------------- |
105 // CSatNotifyMoSmControlRequest::Notify |
108 // CSatNotifyMoSmControlRequest::Notify |
106 // This request allows a client to be notified of a MO-SMS Control proactive |
109 // This request allows a client to be notified of a MO-SMS Control proactive |
111 ( |
114 ( |
112 const TTsyReqHandle aTsyReqHandle, |
115 const TTsyReqHandle aTsyReqHandle, |
113 const TDataPackage& aPackage |
116 const TDataPackage& aPackage |
114 ) |
117 ) |
115 { |
118 { |
116 TFLOGSTRING("CSAT: CSatNotifyMoSmControlRequest::Notify"); |
119 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYMOSMCONTROLREQUEST_NOTIFY_1, "CSAT: CSatNotifyMoSmControlRequest::Notify"); |
117 |
120 |
118 // Save data pointer to client side for completion |
121 // Save data pointer to client side for completion |
119 iMoSmControlV1Pckg = reinterpret_cast<RSat::TMoSmControlV1Pckg*>( |
122 iMoSmControlV1Pckg = reinterpret_cast<RSat::TMoSmControlV1Pckg*>( |
120 aPackage.Des1n() ); |
123 aPackage.Des1n() ); |
121 |
124 |
135 TInt CSatNotifyMoSmControlRequest::CancelNotification |
138 TInt CSatNotifyMoSmControlRequest::CancelNotification |
136 ( |
139 ( |
137 const TTsyReqHandle aTsyReqHandle |
140 const TTsyReqHandle aTsyReqHandle |
138 ) |
141 ) |
139 { |
142 { |
140 TFLOGSTRING("CSAT: CSatNotifyMoSmControlRequest::CancelNotification"); |
143 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYMOSMCONTROLREQUEST_CANCELNOTIFICATION_1, "CSAT: CSatNotifyMoSmControlRequest::CancelNotification"); |
141 |
144 |
142 // Reset the request handle |
145 // Reset the request handle |
143 TTsyReqHandle reqHandle = iNotificationsTsy->iSatReqHandleStore-> |
146 TTsyReqHandle reqHandle = iNotificationsTsy->iSatReqHandleStore-> |
144 ResetTsyReqHandle( CSatTsy::ESatNotifyMoSmControlRequestPCmdReqType ); |
147 ResetTsyReqHandle( CSatTsy::ESatNotifyMoSmControlRequestPCmdReqType ); |
145 // Reset the data pointer |
148 // Reset the data pointer |
160 ( |
163 ( |
161 CSatDataPackage* aDataPackage, |
164 CSatDataPackage* aDataPackage, |
162 TInt aErrorCode |
165 TInt aErrorCode |
163 ) |
166 ) |
164 { |
167 { |
165 TFLOGSTRING("CSAT: CSatNotifyMoSmControlRequest::CompleteNotifyL" ); |
168 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYMOSMCONTROLREQUEST_COMPLETENOTIFYL_1, "CSAT: CSatNotifyMoSmControlRequest::CompleteNotifyL" ); |
166 |
169 |
167 CSatNotificationsTsy::TMoSmCtrlData moSmCtrlData; |
170 CSatNotificationsTsy::TMoSmCtrlData moSmCtrlData; |
168 |
171 |
169 // Initialize parameters |
172 // Initialize parameters |
170 moSmCtrlData.iResult = KMoSmCtrlResultAllowed; |
173 moSmCtrlData.iResult = KMoSmCtrlResultAllowed; |
184 |
187 |
185 // Unpack parameters |
188 // Unpack parameters |
186 TDesC8* atkData = NULL; |
189 TDesC8* atkData = NULL; |
187 aDataPackage->UnPackData( &atkData ); |
190 aDataPackage->UnPackData( &atkData ); |
188 |
191 |
189 TFLOGSTRING2("CSAT: CSatNotifyMoSmControlRequest::CompleteNotifyL\ |
192 OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYMOSMCONTROLREQUEST_COMPLETENOTIFYL_2, "CSAT: CSatNotifyMoSmControlRequest::CompleteNotifyL Data length: %d", ( *atkData ).Length() ); |
190 Data length: %d", ( *atkData ).Length() ); |
|
191 |
193 |
192 if ( KTlvMaxSize < ( *atkData ).Length() ) |
194 if ( KTlvMaxSize < ( *atkData ).Length() ) |
193 { |
195 { |
194 TFLOGSTRING("CSAT: CSatNotifyMoSmControlRequest::CompleteNotifyL, \ |
196 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYMOSMCONTROLREQUEST_COMPLETENOTIFYL_3, "CSAT: CSatNotifyMoSmControlRequest::CompleteNotifyL, Data length exceeded" ); |
195 Data length exceeded" ); |
|
196 // Data not consistent, reject the call |
197 // Data not consistent, reject the call |
197 moSmCtrlData.iResult = KMoSmCtrlResultNotAllowed; |
198 moSmCtrlData.iResult = KMoSmCtrlResultNotAllowed; |
198 isDataOk = EFalse; |
199 isDataOk = EFalse; |
199 } |
200 } |
200 else if ( ( *atkData ).Length() ) |
201 else if ( ( *atkData ).Length() ) |
203 // have not been modified. |
204 // have not been modified. |
204 ParseNotification( *atkData, addr1, addr2, alphaId ); |
205 ParseNotification( *atkData, addr1, addr2, alphaId ); |
205 |
206 |
206 if ( KMoSmCtrlResultAllowedWithModifications == ( *atkData )[0] ) |
207 if ( KMoSmCtrlResultAllowedWithModifications == ( *atkData )[0] ) |
207 { |
208 { |
208 TFLOGSTRING3("CSAT: CSatNotifyMoSmControlRequest::CompleteNotifyL\ |
209 OstTraceDefExt2(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYMOSMCONTROLREQUEST_COMPLETENOTIFYL_4, "CSAT: CSatNotifyMoSmControlRequest::CompleteNotifyL Addr1: %s, Addr2: %s", addr1, addr2 ); |
209 Addr1: %s, Addr2: %s", &addr1, &addr2 ); |
|
210 simRespDataConsistent = VerifyNotificationData( addr1, addr2 ); |
210 simRespDataConsistent = VerifyNotificationData( addr1, addr2 ); |
211 } |
211 } |
212 |
212 |
213 if ( simRespDataConsistent ) |
213 if ( simRespDataConsistent ) |
214 { |
214 { |
215 // atkData[0] --> result |
215 // atkData[0] --> result |
216 moSmCtrlData.iResult = ( *atkData )[0]; |
216 moSmCtrlData.iResult = ( *atkData )[0]; |
217 } |
217 } |
218 else |
218 else |
219 { |
219 { |
220 TFLOGSTRING("CSAT: CSatNotifyMoSmControlRequest::CompleteNotifyL, \ |
220 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYMOSMCONTROLREQUEST_COMPLETENOTIFYL_5, "CSAT: CSatNotifyMoSmControlRequest::CompleteNotifyL, NAA response data not consistent" ); |
221 NAA response data not consistent" ); |
|
222 // Data not consistent, reject the sms |
221 // Data not consistent, reject the sms |
223 moSmCtrlData.iResult = KMoSmCtrlResultNotAllowed; |
222 moSmCtrlData.iResult = KMoSmCtrlResultNotAllowed; |
224 isDataOk = EFalse; |
223 isDataOk = EFalse; |
225 } |
224 } |
226 } |
225 } |
298 } // If Alpha ID or request handle |
297 } // If Alpha ID or request handle |
299 |
298 |
300 } // If MO SM Ctrl Activated and data ok |
299 } // If MO SM Ctrl Activated and data ok |
301 else |
300 else |
302 { |
301 { |
303 TFLOGSTRING3("LSAT: CSatMoSmsCtrlMessHandler::CompleteNotifyL, \ |
302 OstTraceDefExt2(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYMOSMCONTROLREQUEST_COMPLETENOTIFYL_6, "LSAT: CSatMoSmsCtrlMessHandler::CompleteNotifyL, iIsMoSmsCtrlActivated: %d, isDataOk: %d ", iIsMoSmsCtrlActivated, isDataOk); |
304 iIsMoSmsCtrlActivated: %d, isDataOk: %d ", |
|
305 iIsMoSmsCtrlActivated, isDataOk); |
|
306 } |
303 } |
307 } // if KErrNone |
304 } // if KErrNone |
308 else |
305 else |
309 { |
306 { |
310 TFLOGSTRING("LSAT: CSatMoSmsCtrlMessHandler::CompleteNotifyL, \ |
307 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYMOSMCONTROLREQUEST_COMPLETENOTIFYL_7, "LSAT: CSatMoSmsCtrlMessHandler::CompleteNotifyL, Error in notification "); |
311 Error in notification "); |
|
312 moSmCtrlData.iResult = KMoSmCtrlResultNotAllowed; |
308 moSmCtrlData.iResult = KMoSmCtrlResultNotAllowed; |
313 // Pack data and send response right away to NAA |
309 // Pack data and send response right away to NAA |
314 CSatDataPackage dataPackage; |
310 CSatDataPackage dataPackage; |
315 dataPackage.PackData( &moSmCtrlData ); |
311 dataPackage.PackData( &moSmCtrlData ); |
316 iNotificationsTsy->iSatTsy->MessageManager()->HandleRequestL( |
312 iNotificationsTsy->iSatTsy->MessageManager()->HandleRequestL( |
330 ( |
326 ( |
331 CSatDataPackage* aDataPackage, |
327 CSatDataPackage* aDataPackage, |
332 TInt /*aResult*/ |
328 TInt /*aResult*/ |
333 ) |
329 ) |
334 { |
330 { |
335 TFLOGSTRING("CSAT: CSatNotifyMoSmControlRequest::\ |
331 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYMOSMCONTROLREQUEST_CREATEMOSMSCTRLENVELOPEL_1, "CSAT: CSatNotifyMoSmControlRequest::CreateMoSmsCtrlEnvelopeL"); |
336 CreateMoSmsCtrlEnvelopeL"); |
|
337 // Check first if the MO-SMS is activated |
332 // Check first if the MO-SMS is activated |
338 if ( iIsMoSmsCtrlActivated ) |
333 if ( iIsMoSmsCtrlActivated ) |
339 { |
334 { |
340 TFLOGSTRING("CSAT: CSatNotifyMoSmControlRequest::\ |
335 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYMOSMCONTROLREQUEST_CREATEMOSMSCTRLENVELOPEL_2, "CSAT: CSatNotifyMoSmControlRequest::CreateMoSmsCtrlEnvelopeL, MO SM Ctrl Activated"); |
341 CreateMoSmsCtrlEnvelopeL, MO SM Ctrl Activated"); |
|
342 |
336 |
343 CSatNotificationsTsy::TAddressData* addressData; |
337 CSatNotificationsTsy::TAddressData* addressData; |
344 |
338 |
345 // Unpack data |
339 // Unpack data |
346 aDataPackage->UnPackData( &addressData ); |
340 aDataPackage->UnPackData( &addressData ); |
388 CSatDataPackage* aDataPackage |
382 CSatDataPackage* aDataPackage |
389 ) |
383 ) |
390 { |
384 { |
391 // Unpack data |
385 // Unpack data |
392 aDataPackage->UnPackData( iIsMoSmsCtrlActivated ); |
386 aDataPackage->UnPackData( iIsMoSmsCtrlActivated ); |
393 TFLOGSTRING2("CSAT: CSatNotifyMoSmControlRequest::SetActivationStatus, %d", |
387 OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYMOSMCONTROLREQUEST_SETACTIVATIONSTATUS_1, "CSAT: CSatNotifyMoSmControlRequest::SetActivationStatus, %d",iIsMoSmsCtrlActivated ); |
394 iIsMoSmsCtrlActivated ); |
|
395 } |
388 } |
396 |
389 |
397 // ----------------------------------------------------------------------------- |
390 // ----------------------------------------------------------------------------- |
398 // CSatNotifyMoSmControlRequest::ActivationStatus |
391 // CSatNotifyMoSmControlRequest::ActivationStatus |
399 // Returns ETrue if MO-SMS Control is activated |
392 // Returns ETrue if MO-SMS Control is activated |
402 TBool CSatNotifyMoSmControlRequest::ActivationStatus |
395 TBool CSatNotifyMoSmControlRequest::ActivationStatus |
403 ( |
396 ( |
404 void |
397 void |
405 ) |
398 ) |
406 { |
399 { |
407 TFLOGSTRING("CSAT: CSatNotifyMoSmControlRequest::ActivationStatus"); |
400 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYMOSMCONTROLREQUEST_ACTIVATIONSTATUS_1, "CSAT: CSatNotifyMoSmControlRequest::ActivationStatus"); |
408 return iIsMoSmsCtrlActivated; |
401 return iIsMoSmsCtrlActivated; |
409 } |
402 } |
410 |
403 |
411 // ----------------------------------------------------------------------------- |
404 // ----------------------------------------------------------------------------- |
412 // CSatNotifyMoSmControlRequest::CleanAddressData |
405 // CSatNotifyMoSmControlRequest::CleanAddressData |
417 void CSatNotifyMoSmControlRequest::CleanAddressData |
410 void CSatNotifyMoSmControlRequest::CleanAddressData |
418 ( |
411 ( |
419 TDes8& aAddr |
412 TDes8& aAddr |
420 ) |
413 ) |
421 { |
414 { |
422 TFLOGSTRING("CSAT: CSatNotifyMoSmControlRequest::CleanAddressData"); |
415 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYMOSMCONTROLREQUEST_CLEANADDRESSDATA_1, "CSAT: CSatNotifyMoSmControlRequest::CleanAddressData"); |
423 // Starts from index 1, since index 0 is for TON/NPI |
416 // Starts from index 1, since index 0 is for TON/NPI |
424 for ( TInt i=1; i < aAddr.Length(); i++ ) |
417 for ( TInt i=1; i < aAddr.Length(); i++ ) |
425 { |
418 { |
426 if ( 0xF0 == ( aAddr[i] & 0xF0 ) ) |
419 if ( 0xF0 == ( aAddr[i] & 0xF0 ) ) |
427 { |
420 { |
450 TDes8& aAddr1, |
443 TDes8& aAddr1, |
451 TDes8& aAddr2, |
444 TDes8& aAddr2, |
452 RSat::TAlphaId& aAlphaId |
445 RSat::TAlphaId& aAlphaId |
453 ) |
446 ) |
454 { |
447 { |
455 TFLOGSTRING("CSAT: CSatNotifyMoSmControlRequest::ParseNotification"); |
448 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYMOSMCONTROLREQUEST_PARSENOTIFICATION_1, "CSAT: CSatNotifyMoSmControlRequest::ParseNotification"); |
456 |
449 |
457 // Input data: |
450 // Input data: |
458 // aAtkData[0] : result |
451 // aAtkData[0] : result |
459 // aAtkData[1][2] : length of BER-TLV, set n=1 if aAtkData[1]=0x81 |
452 // aAtkData[1][2] : length of BER-TLV, set n=1 if aAtkData[1]=0x81 |
460 // aAtkData[2+n] : tag of first TLV |
453 // aAtkData[2+n] : tag of first TLV |
494 TInt lengthTlv( aAtkData[indexInBerTlv + nn + 1] ); |
487 TInt lengthTlv( aAtkData[indexInBerTlv + nn + 1] ); |
495 |
488 |
496 // Check which TLV is received |
489 // Check which TLV is received |
497 if ( ( KTlvAddressTag == tag ) && ( !address1_got ) ) |
490 if ( ( KTlvAddressTag == tag ) && ( !address1_got ) ) |
498 { |
491 { |
499 TFLOGSTRING("CSAT: CSatNotifyMoSmControlRequest::ParseNotification\ |
492 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYMOSMCONTROLREQUEST_PARSENOTIFICATION_2, "CSAT: CSatNotifyMoSmControlRequest::ParseNotification Address 1"); |
500 Address 1"); |
|
501 // RP address first |
493 // RP address first |
502 address1_got = ETrue; |
494 address1_got = ETrue; |
503 // Copy data to output variable |
495 // Copy data to output variable |
504 aAddr1.Copy( aAtkData.Mid( indexInBerTlv + nn + 2, lengthTlv ) ); |
496 aAddr1.Copy( aAtkData.Mid( indexInBerTlv + nn + 2, lengthTlv ) ); |
505 if ( KReservedTonNpi1 != aAddr1[0] && |
497 if ( KReservedTonNpi1 != aAddr1[0] && |
508 CleanAddressData( aAddr1 ); |
500 CleanAddressData( aAddr1 ); |
509 } |
501 } |
510 } |
502 } |
511 else if ( KTlvAddressTag == tag ) |
503 else if ( KTlvAddressTag == tag ) |
512 { |
504 { |
513 TFLOGSTRING("CSAT: CSatNotifyMoSmControlRequest::ParseNotification\ |
505 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYMOSMCONTROLREQUEST_PARSENOTIFICATION_3, "CSAT: CSatNotifyMoSmControlRequest::ParseNotification Address 2"); |
514 Address 2"); |
|
515 // TP address. Copy data to output variable |
506 // TP address. Copy data to output variable |
516 aAddr2.Copy( aAtkData.Mid( indexInBerTlv + nn + 2, lengthTlv ) ); |
507 aAddr2.Copy( aAtkData.Mid( indexInBerTlv + nn + 2, lengthTlv ) ); |
517 if ( KReservedTonNpi1 != aAddr2[0] && |
508 if ( KReservedTonNpi1 != aAddr2[0] && |
518 KReservedTonNpi2 != aAddr2[0] && ( 1 < lengthTlv ) ) |
509 KReservedTonNpi2 != aAddr2[0] && ( 1 < lengthTlv ) ) |
519 { |
510 { |
520 CleanAddressData( aAddr2 ); |
511 CleanAddressData( aAddr2 ); |
521 } |
512 } |
522 } |
513 } |
523 else if ( KTlvAlphaIdentifierTag == tag ) |
514 else if ( KTlvAlphaIdentifierTag == tag ) |
524 { |
515 { |
525 TFLOGSTRING("CSAT: CSatNotifyMoSmControlRequest::ParseNotification\ |
516 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYMOSMCONTROLREQUEST_PARSENOTIFICATION_4, "CSAT: CSatNotifyMoSmControlRequest::ParseNotification Alpha ID"); |
526 Alpha ID"); |
|
527 // Alpha id must be converted to TBuf16/unicode |
517 // Alpha id must be converted to TBuf16/unicode |
528 if ( lengthTlv ) |
518 if ( lengthTlv ) |
529 { |
519 { |
530 // Set Alpha id status |
520 // Set Alpha id status |
531 aAlphaId.iStatus = RSat::EAlphaIdProvided; |
521 aAlphaId.iStatus = RSat::EAlphaIdProvided; |
532 TSatUtility::SetAlphaId( aAtkData.Mid( indexInBerTlv + nn + 2, |
522 TSatUtility::SetAlphaId( aAtkData.Mid( indexInBerTlv + nn + 2, |
533 lengthTlv ), aAlphaId.iAlphaId ); |
523 lengthTlv ), aAlphaId.iAlphaId ); |
534 } |
524 } |
535 else |
525 else |
536 { |
526 { |
537 TFLOGSTRING("CSAT: CSatNotifyMoSmControlRequest:: \ |
527 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYMOSMCONTROLREQUEST_PARSENOTIFICATION_5, "CSAT: CSatNotifyMoSmControlRequest:: ParseNotification. Alpha ID is NULL"); |
538 ParseNotification. Alpha ID is NULL"); |
|
539 aAlphaId.iStatus = RSat::EAlphaIdNull; |
528 aAlphaId.iStatus = RSat::EAlphaIdNull; |
540 } |
529 } |
541 } |
530 } |
542 |
531 |
543 // Update length for the while loop |
532 // Update length for the while loop |
557 ( |
546 ( |
558 TDes8& aRPAddr, |
547 TDes8& aRPAddr, |
559 TDes8& aTPAddr |
548 TDes8& aTPAddr |
560 ) |
549 ) |
561 { |
550 { |
562 TFLOGSTRING("CSAT: CSatNotifyMoSmControlRequest::VerifyNotificationData"); |
551 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYMOSMCONTROLREQUEST_VERIFYNOTIFICATIONDATA_1, "CSAT: CSatNotifyMoSmControlRequest::VerifyNotificationData"); |
563 TBool ret( ETrue ); |
552 TBool ret( ETrue ); |
564 if ( ( 0 == aRPAddr.Length() && 0 == aTPAddr.Length() ) || |
553 if ( ( 0 == aRPAddr.Length() && 0 == aTPAddr.Length() ) || |
565 ( KMoSmCtrlMaxLengthAddr1Addr2 <= ( |
554 ( KMoSmCtrlMaxLengthAddr1Addr2 <= ( |
566 aRPAddr.Length() + aTPAddr.Length() ) ) ) |
555 aRPAddr.Length() + aTPAddr.Length() ) ) ) |
567 { |
556 { |