smsprotocols/smsstack/gsmu/src/gsmunonieoperations.cpp
branchRCL_3
changeset 65 630d2f34d719
parent 0 3553901f7fa8
child 66 07a122eea281
equal deleted inserted replaced
61:17af172ffa5f 65:630d2f34d719
     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".
    11 // Contributors:
    11 // Contributors:
    12 //
    12 //
    13 // Description:
    13 // Description:
    14 //
    14 //
    15 
    15 
       
    16 
       
    17 #include "OstTraceDefinitions.h"
       
    18 #ifdef OST_TRACE_COMPILER_IN_USE
       
    19 #include "gsmunonieoperationsTraces.h"
       
    20 #endif
       
    21 
    16 #include "Gsmumain.h" 
    22 #include "Gsmumain.h" 
    17 #include "gsmunonieoperations.h" 
    23 #include "gsmunonieoperations.h" 
    18 #include "Gsmumsg.h"
    24 #include "Gsmumsg.h"
    19 #include "gsmumsgadditionalattributes.h"
    25 #include "gsmumsgadditionalattributes.h"
    20 #include "Gsmuelem.h"
    26 #include "Gsmuelem.h"
    99  */
   105  */
   100 void CSmsNonIEOperation::operator=(const CSmsNonIEOperation&)
   106 void CSmsNonIEOperation::operator=(const CSmsNonIEOperation&)
   101     {
   107     {
   102     // Ignore in code coverage - not intended to be used
   108     // Ignore in code coverage - not intended to be used
   103     BULLSEYE_OFF    
   109     BULLSEYE_OFF    
   104     LOGGSMU1("CSmsNonIEOperation::operator=");
   110     OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSNONIEOPERATION_OPERATOR_1, "CSmsNonIEOperation::operator=");
   105     Panic(KGsmuPanicMethodBodyNotImplemented1);
   111     Panic(KGsmuPanicMethodBodyNotImplemented1);
   106     BULLSEYE_RESTORE
   112     BULLSEYE_RESTORE
   107     }
   113     }
   108 
   114 
   109 /**
   115 /**
   116  */
   122  */
   117 TBool CSmsNonIEOperation::operator==(const CSmsNonIEOperation&)
   123 TBool CSmsNonIEOperation::operator==(const CSmsNonIEOperation&)
   118     {
   124     {
   119     // Ignore in code coverage - not intended to be used
   125     // Ignore in code coverage - not intended to be used
   120     BULLSEYE_OFF    
   126     BULLSEYE_OFF    
   121     LOGGSMU1("CSmsNonIEOperation::operator==");
   127     OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSNONIEOPERATION_OPERATOR1_1, "CSmsNonIEOperation::operator==");
   122     Panic(KGsmuPanicMethodBodyNotImplemented1);
   128     Panic(KGsmuPanicMethodBodyNotImplemented1);
   123     return EFalse;
   129     return EFalse;
   124     BULLSEYE_RESTORE
   130     BULLSEYE_RESTORE
   125     }
   131     }
   126 
   132 
   134  */
   140  */
   135 void CSmsCtrlNonIEOperation::operator=(const CSmsCtrlNonIEOperation&)
   141 void CSmsCtrlNonIEOperation::operator=(const CSmsCtrlNonIEOperation&)
   136     {
   142     {
   137     // Ignore in code coverage - not intended to be used
   143     // Ignore in code coverage - not intended to be used
   138     BULLSEYE_OFF    
   144     BULLSEYE_OFF    
   139     LOGGSMU1("CSmsCtrlNonIEOperation::operator=");
   145     OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSCTRLNONIEOPERATION_OPERATOR_1, "CSmsCtrlNonIEOperation::operator=");
   140     Panic(KGsmuPanicMethodBodyNotImplemented1);
   146     Panic(KGsmuPanicMethodBodyNotImplemented1);
   141     BULLSEYE_RESTORE
   147     BULLSEYE_RESTORE
   142     }
   148     }
   143 
   149 
   144 /**
   150 /**
   151  */
   157  */
   152 TBool CSmsCtrlNonIEOperation::operator==(const CSmsCtrlNonIEOperation&)
   158 TBool CSmsCtrlNonIEOperation::operator==(const CSmsCtrlNonIEOperation&)
   153     {
   159     {
   154     // Ignore in code coverage - not intended to be used
   160     // Ignore in code coverage - not intended to be used
   155     BULLSEYE_OFF    
   161     BULLSEYE_OFF    
   156     LOGGSMU1("CSmsCtrlNonIEOperation::operator==");
   162     OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSCTRLNONIEOPERATION_OPERATOR1_1, "CSmsCtrlNonIEOperation::operator==");
   157     Panic(KGsmuPanicMethodBodyNotImplemented1);
   163     Panic(KGsmuPanicMethodBodyNotImplemented1);
   158     return EFalse;
   164     return EFalse;
   159     BULLSEYE_RESTORE
   165     BULLSEYE_RESTORE
   160     }
   166     }
   161 
   167 
   192  */
   198  */
   193 void CSmsTPSRROperations::operator=(const CSmsTPSRROperations&)
   199 void CSmsTPSRROperations::operator=(const CSmsTPSRROperations&)
   194     {
   200     {
   195     // Ignore in code coverage - not intended to be used
   201     // Ignore in code coverage - not intended to be used
   196     BULLSEYE_OFF    
   202     BULLSEYE_OFF    
   197     LOGGSMU1("CSmsTPSRROperations::operator=");
   203     OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSTPSRROPERATIONS_OPERATOR_1, "CSmsTPSRROperations::operator=");
   198     Panic(KGsmuPanicMethodBodyNotImplemented1);
   204     Panic(KGsmuPanicMethodBodyNotImplemented1);
   199     BULLSEYE_RESTORE
   205     BULLSEYE_RESTORE
   200     }
   206     }
   201 
   207 
   202 /**
   208 /**
   209  */       
   215  */       
   210 TBool CSmsTPSRROperations::operator==(const CSmsTPSRROperations&)
   216 TBool CSmsTPSRROperations::operator==(const CSmsTPSRROperations&)
   211     {
   217     {
   212     // Ignore in code coverage - not intended to be used
   218     // Ignore in code coverage - not intended to be used
   213     BULLSEYE_OFF    
   219     BULLSEYE_OFF    
   214     LOGGSMU1("CSmsTPSRROperations::operator==");
   220     OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSTPSRROPERATIONS_OPERATOR1_1, "CSmsTPSRROperations::operator==");
   215     Panic(KGsmuPanicMethodBodyNotImplemented1);
   221     Panic(KGsmuPanicMethodBodyNotImplemented1);
   216     return EFalse;
   222     return EFalse;
   217     BULLSEYE_RESTORE
   223     BULLSEYE_RESTORE
   218     }
   224     }
   219 
   225 
   226  */
   232  */
   227 void CSmsTPSRROperations::ValidateOperationL() const
   233 void CSmsTPSRROperations::ValidateOperationL() const
   228 	{
   234 	{
   229 	if (iMessage.Version() < CSmsMessage::ESmsMessageV2)
   235 	if (iMessage.Version() < CSmsMessage::ESmsMessageV2)
   230 	    {
   236 	    {
   231 	    LOGGSMU2("CSmsTPSRROperations Operation not supported, Msg Version %d", iMessage.Version());
   237 	    OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSTPSRROPERATIONS_VALIDATEOPERATIONL_1, "CSmsTPSRROperations Operation not supported, Msg Version %d", iMessage.Version());
   232 	    User::Leave(KErrNotSupported); 
   238 	    User::Leave(KErrNotSupported); 
   233 	    }
   239 	    }
   234 
   240 
   235 	if (!MessageTypeSupported())
   241 	if (!MessageTypeSupported())
   236 	    {
   242 	    {
   237 	    LOGGSMU2("CSmsTPSRROperations Operation not supported by this PDU type, type = %d", iMessage.Type());
   243 	    OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSTPSRROPERATIONS_VALIDATEOPERATIONL_2, "CSmsTPSRROperations Operation not supported by this PDU type, type = %d", iMessage.Type());
   238 	    User::Leave(KErrNotSupported);
   244 	    User::Leave(KErrNotSupported);
   239 	    }
   245 	    }
   240 	}
   246 	}
   241 
   247 
   242 
   248 
   545  *      
   551  *      
   546  */
   552  */
   547 CIncompleteClass0MessageInfo::CIncompleteClass0MessageInfo(TSmsNonIEIdentifier aId, CSmsMessage& aMessage)
   553 CIncompleteClass0MessageInfo::CIncompleteClass0MessageInfo(TSmsNonIEIdentifier aId, CSmsMessage& aMessage)
   548 	: CSmsNonIEOperation(aId, aMessage)
   554 	: CSmsNonIEOperation(aId, aMessage)
   549 	{
   555 	{
   550 	LOGGSMU1("CIncompleteClass0MessageInfo constructor");
   556 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CINCOMPLETECLASS0MESSAGEINFO_CTOR_1, "CIncompleteClass0MessageInfo constructor");
   551 	}
   557 	}
   552 
   558 
   553 /** 
   559 /** 
   554  *  @publishedAll
   560  *  @publishedAll
   555  *      
   561  *      
   562  *			incomplete message for a particular concatenated message.
   568  *			incomplete message for a particular concatenated message.
   563  *  @capability None
   569  *  @capability None
   564  */			
   570  */			
   565 EXPORT_C void CIncompleteClass0MessageInfo::GetIncompleteMessageInfoL(TInt& aStartPos, TInt& aEndPos, TBool& aIsLastIncompleteMessage)
   571 EXPORT_C void CIncompleteClass0MessageInfo::GetIncompleteMessageInfoL(TInt& aStartPos, TInt& aEndPos, TBool& aIsLastIncompleteMessage)
   566 	{
   572 	{
   567 	LOGGSMU1("CIncompleteClass0MessageInfo::GetIncompleteMessageInfoL");
   573 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_BORDER, CINCOMPLETECLASS0MESSAGEINFO_GETINCOMPLETEMESSAGEINFOL_1, "CIncompleteClass0MessageInfo::GetIncompleteMessageInfoL");
   568 	ValidateOperationL();
   574 	ValidateOperationL();
   569 	aStartPos = iStartPos;
   575 	aStartPos = iStartPos;
   570 	aEndPos = iEndPos;
   576 	aEndPos = iEndPos;
   571 	aIsLastIncompleteMessage = iIsLastIncompleteMessage;	
   577 	aIsLastIncompleteMessage = iIsLastIncompleteMessage;	
   572 	}
   578 	}
   583  *			incomplete message for a particular concatenated message.
   589  *			incomplete message for a particular concatenated message.
   584  *  @capability None
   590  *  @capability None
   585  */
   591  */
   586 EXPORT_C void CIncompleteClass0MessageInfo::SetIncompleteMessageInfoL(TInt aStartPos, TInt aEndPos, TBool aIsLastIncompleteMessage)
   592 EXPORT_C void CIncompleteClass0MessageInfo::SetIncompleteMessageInfoL(TInt aStartPos, TInt aEndPos, TBool aIsLastIncompleteMessage)
   587 	{
   593 	{
   588 	LOGGSMU1("CIncompleteClass0MessageInfo::SetIncompleteMessageInfoL");
   594 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_BORDER, CINCOMPLETECLASS0MESSAGEINFO_SETINCOMPLETEMESSAGEINFOL_1, "CIncompleteClass0MessageInfo::SetIncompleteMessageInfoL");
   589 	ValidateOperationL();
   595 	ValidateOperationL();
   590 	iStartPos = aStartPos;
   596 	iStartPos = aStartPos;
   591 	iEndPos = aEndPos;
   597 	iEndPos = aEndPos;
   592 	iIsLastIncompleteMessage = aIsLastIncompleteMessage;
   598 	iIsLastIncompleteMessage = aIsLastIncompleteMessage;
   593 	}
   599 	}
   602  */
   608  */
   603 void CIncompleteClass0MessageInfo::operator=(const CIncompleteClass0MessageInfo&)
   609 void CIncompleteClass0MessageInfo::operator=(const CIncompleteClass0MessageInfo&)
   604     {
   610     {
   605     // Ignore in code coverage - not intended to be used
   611     // Ignore in code coverage - not intended to be used
   606     BULLSEYE_OFF    
   612     BULLSEYE_OFF    
   607     LOGGSMU1("CIncompleteClass0MessageInfo::operator=");
   613     OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CINCOMPLETECLASS0MESSAGEINFO_OPERATOR_1, "CIncompleteClass0MessageInfo::operator=");
   608     Panic(KGsmuPanicMethodBodyNotImplemented1);
   614     Panic(KGsmuPanicMethodBodyNotImplemented1);
   609     BULLSEYE_RESTORE
   615     BULLSEYE_RESTORE
   610     }
   616     }
   611 
   617 
   612 /**
   618 /**
   619  */
   625  */
   620 TBool CIncompleteClass0MessageInfo::operator==(const CIncompleteClass0MessageInfo&)
   626 TBool CIncompleteClass0MessageInfo::operator==(const CIncompleteClass0MessageInfo&)
   621     {
   627     {
   622     // Ignore in code coverage - not intended to be used
   628     // Ignore in code coverage - not intended to be used
   623     BULLSEYE_OFF    
   629     BULLSEYE_OFF    
   624     LOGGSMU1("CIncompleteClass0MessageInfo::operator==");
   630     OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CINCOMPLETECLASS0MESSAGEINFO_OPERATOR1_1, "CIncompleteClass0MessageInfo::operator==");
   625     Panic(KGsmuPanicMethodBodyNotImplemented1);
   631     Panic(KGsmuPanicMethodBodyNotImplemented1);
   626     return EFalse;
   632     return EFalse;
   627     BULLSEYE_RESTORE
   633     BULLSEYE_RESTORE
   628     }
   634     }
   629 
   635 
   634  *  
   640  *  
   635  *  @return True if the message type is supported. False otherwise.
   641  *  @return True if the message type is supported. False otherwise.
   636  */
   642  */
   637 TBool CIncompleteClass0MessageInfo::MessageTypeSupported() const
   643 TBool CIncompleteClass0MessageInfo::MessageTypeSupported() const
   638 	{
   644 	{
   639 	LOGGSMU1("CIncompleteClass0MessageInfo::MessageTypeSupported");
   645 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CINCOMPLETECLASS0MESSAGEINFO_MESSAGETYPESUPPORTED_1, "CIncompleteClass0MessageInfo::MessageTypeSupported");
   640 	CSmsPDU::TSmsPDUType type = iMessage.Type();
   646 	CSmsPDU::TSmsPDUType type = iMessage.Type();
   641 	return (type == CSmsPDU::ESmsDeliver);
   647 	return (type == CSmsPDU::ESmsDeliver);
   642 	}
   648 	}
   643 
   649 
   644 /** 
   650 /** 
   648  *  
   654  *  
   649  *  @leave If the message type or version does not support this operation.
   655  *  @leave If the message type or version does not support this operation.
   650  */
   656  */
   651 void CIncompleteClass0MessageInfo::ValidateOperationL() const
   657 void CIncompleteClass0MessageInfo::ValidateOperationL() const
   652 	{
   658 	{
   653 	LOGGSMU1("CIncompleteClass0MessageInfo::ValidateOperationL");
   659 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CINCOMPLETECLASS0MESSAGEINFO_VALIDATEOPERATIONL_1, "CIncompleteClass0MessageInfo::ValidateOperationL");
   654 
   660 
   655 	if (iMessage.Version() != CSmsMessage::ESmsIncompleteClass0MessageV)
   661 	if (iMessage.Version() != CSmsMessage::ESmsIncompleteClass0MessageV)
   656 		{
   662 		{
   657 		LOGGSMU2("CIncompleteClass0MessageInfo Operation not supported, Msg Version %d", iMessage.Version());
   663 		OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CINCOMPLETECLASS0MESSAGEINFO_VALIDATEOPERATIONL_2, "CIncompleteClass0MessageInfo Operation not supported, Msg Version %d", iMessage.Version());
   658 		User::Leave(KErrNotSupported); 
   664 		User::Leave(KErrNotSupported); 
   659 		}
   665 		}
   660 
   666 
   661 	if (!MessageTypeSupported())
   667 	if (!MessageTypeSupported())
   662 		{
   668 		{
   663 		LOGGSMU2("CIncompleteClass0MessageInfo Operation not supported by this PDU type, type = %d", iMessage.Type());
   669 		OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CINCOMPLETECLASS0MESSAGEINFO_VALIDATEOPERATIONL_3, "CIncompleteClass0MessageInfo Operation not supported by this PDU type, type = %d", iMessage.Type());
   664 		User::Leave(KErrNotSupported);
   670 		User::Leave(KErrNotSupported);
   665 		}
   671 		}
   666 	}
   672 	}
   667 
   673 
   668 /**
   674 /**
   673     {
   679     {
   674     // Ignore in code coverage - as there is only one version of this
   680     // Ignore in code coverage - as there is only one version of this
   675     // class, no need to check the version. Expected to be used if
   681     // class, no need to check the version. Expected to be used if
   676     // a new version of the class is added
   682     // a new version of the class is added
   677     BULLSEYE_OFF    
   683     BULLSEYE_OFF    
   678     LOGGSMU1("CIncompleteClass0MessageInfo::Version()");
   684     OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CINCOMPLETECLASS0MESSAGEINFO_VERSION_1, "CIncompleteClass0MessageInfo::Version()");
   679     return iVersion;
   685     return iVersion;
   680     BULLSEYE_RESTORE
   686     BULLSEYE_RESTORE
   681     }
   687     }
   682 
   688 
   683 /**
   689 /**
   687  *  @param aVersion version number to set.
   693  *  @param aVersion version number to set.
   688  *  @capability None
   694  *  @capability None
   689  */
   695  */
   690 void CIncompleteClass0MessageInfo::SetVersion(TInt aVersion)
   696 void CIncompleteClass0MessageInfo::SetVersion(TInt aVersion)
   691 	{
   697 	{
   692 	LOGGSMU2("CIncompleteClass0MessageInfo::SetVersion()", aVersion);
   698 	OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CINCOMPLETECLASS0MESSAGEINFO_SETVERSION_1, "CIncompleteClass0MessageInfo::SetVersion() version:%d", aVersion);
   693 
   699 
   694 	__ASSERT_DEBUG((aVersion<EMaxSmsIncompleteClass0MessageV),Panic(KGsmuPanicVersionNotSupported));
   700 	__ASSERT_DEBUG((aVersion<EMaxSmsIncompleteClass0MessageV),Panic(KGsmuPanicVersionNotSupported));
   695 
   701 
   696 	iVersion=aVersion;
   702 	iVersion=aVersion;
   697 	} // CSmsMessage::SetVersion
   703 	} // CSmsMessage::SetVersion
   702  *  @param aStream Stream to read from
   708  *  @param aStream Stream to read from
   703  *  @capability None
   709  *  @capability None
   704  */
   710  */
   705 void CIncompleteClass0MessageInfo::InternalizeL(RReadStream& aStream)
   711 void CIncompleteClass0MessageInfo::InternalizeL(RReadStream& aStream)
   706 	{
   712 	{
   707 	LOGGSMU1("CIncompleteClass0MessageInfo::InternalizeL()");
   713 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CINCOMPLETECLASS0MESSAGEINFO_INTERNALIZEL_1, "CIncompleteClass0MessageInfo::InternalizeL()");
   708 	iVersion = aStream.ReadInt32L();
   714 	iVersion = aStream.ReadInt32L();
   709 	iStartPos = aStream.ReadInt32L();
   715 	iStartPos = aStream.ReadInt32L();
   710 	iEndPos = aStream.ReadInt32L();
   716 	iEndPos = aStream.ReadInt32L();
   711 	iIsLastIncompleteMessage = aStream.ReadInt32L();
   717 	iIsLastIncompleteMessage = aStream.ReadInt32L();
   712 	}
   718 	}
   717  *  @param aStream Stream to write to
   723  *  @param aStream Stream to write to
   718  *  @capability None
   724  *  @capability None
   719  */
   725  */
   720 void CIncompleteClass0MessageInfo::ExternalizeL(RWriteStream& aStream) const
   726 void CIncompleteClass0MessageInfo::ExternalizeL(RWriteStream& aStream) const
   721 	{
   727 	{
   722 	LOGGSMU1("CIncompleteClass0MessageInfo::ExternalizeL()");
   728 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CINCOMPLETECLASS0MESSAGEINFO_EXTERNALIZEL_1, "CIncompleteClass0MessageInfo::ExternalizeL()");
   723 	aStream.WriteInt32L(iVersion);
   729 	aStream.WriteInt32L(iVersion);
   724 	aStream.WriteInt32L(iStartPos);
   730 	aStream.WriteInt32L(iStartPos);
   725 	aStream.WriteInt32L(iEndPos);
   731 	aStream.WriteInt32L(iEndPos);
   726 	aStream.WriteInt32L(iIsLastIncompleteMessage);
   732 	aStream.WriteInt32L(iIsLastIncompleteMessage);
   727 	}
   733 	}