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