diff -r 2473f5e227f9 -r 8b72faa1200f telephonyprotocols/qosextnapi/src/sblpextn.cpp --- a/telephonyprotocols/qosextnapi/src/sblpextn.cpp Mon May 24 18:38:31 2010 +0100 +++ b/telephonyprotocols/qosextnapi/src/sblpextn.cpp Tue Jun 22 11:02:32 2010 +0100 @@ -1,4 +1,4 @@ -// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). +// Copyright (c) 2005-2010 Nokia Corporation and/or its subsidiary(-ies). // All rights reserved. // This component and the accompanying materials are made available // under the terms of "Eclipse Public License v1.0" @@ -14,9 +14,14 @@ // sblpapi.cpp - SBLP QoS API // + +#include "OstTraceDefinitions.h" +#ifdef OST_TRACE_COMPILER_IN_USE +#include "sblpextnTraces.h" +#endif + #include "sblpextn.h" #include "qosextn_constants.h" -#include "qosextn_log.h" #include // Buffer size @@ -64,27 +69,39 @@ EXPORT_C CSblpParameters::TFlowIdentifier& CSblpParameters::GetFlowId(TInt aIndex) { - __ASSERT_DEBUG(aIndex &aFlowIds) { + //in case of low memory the function might not set all the ids iFlowIds.Reset(); TInt i; for(i=0; iiFlowIds.Append(aFlowIds[i]); + TInt errorCode = this->iFlowIds.Append(aFlowIds[i]); + if (errorCode != KErrNone) + { + OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_BORDER, CSBLPPARAMETERS_SETFLOWID, "Not Enough Memory"); + } } } EXPORT_C TInt CSblpParameters::GetFlowIds(RArray& aFlowIds) { + //in case of low memory the function might not get all the ids and returns an error code aFlowIds.Reset(); TInt i; + TInt errorCode = KErrNone; for(i=0; iiFlowIds[i]); + errorCode = aFlowIds.Append(this->iFlowIds[i]); + if (errorCode != KErrNone) + { + OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_BORDER, CSBLPPARAMETERS_GETFLOWID, "Not Enough Memory"); + return errorCode; + } } return KErrNone; } @@ -163,7 +180,7 @@ header.reserved = 0; header.protocol_id = 0; bufPtr.Append((TUint8*)&header, sizeof(pfqos_configure)); - + pfqos_extension extensionType; extensionType.pfqos_ext_len = 0; extensionType.pfqos_ext_type = EPfqosExtExtension; @@ -182,11 +199,11 @@ iSblp->GetMAT(authToken); SetStringBlockHeader(stringBlock,authToken,KDescSblpMediaAuthorizationToken); bufPtr.Append((TUint8*)&stringBlock, sizeof(pfqos_configblock)); + // put the string now authToken.ZeroTerminate(); bufPtr.Append((TUint8*)authToken.Ptr(),KAuthorizationTokenAdjustedStringLength); - // Flowids pfqos_configblock_int ext; TInt i; @@ -195,11 +212,13 @@ CSblpParameters::TFlowIdentifier& flowId = iSblp->GetFlowId(i); SetIntValue(ext,flowId.iMediaComponentNumber,KDescSblpMediaComponentNumber); bufPtr.Append((TUint8*)&ext, sizeof(pfqos_configblock_int)); + SetIntValue(ext,flowId.iIPFlowNumber,KDescSblpIPFlowNumber); bufPtr.Append((TUint8*)&ext, sizeof(pfqos_configblock_int)); } bufPtr.AppendFill(0, header.pfqos_configure_len * 8 - byte_len); + return *iData; } @@ -228,31 +247,32 @@ *iSblp = aSblp; - LOG( + // following code is to create logs TAuthorizationToken authToken; iSblp->GetMAT (authToken); - RArray flowIds; + RArray flowIds; iSblp->GetFlowIds(flowIds); + // in case of low memory GetFlowIds might return an error and flowIds might not have all the ids, but we still try to log as much as we can TBuf label; label.Copy(authToken); - Log::Printf(_L("<------------------------------------------------\n")); - Log::Printf(_L("CSblpPolicy::SetSblpParameters")); - Log::Printf(_L("\n")); - Log::Printf(_L("SBLP VALUES SUPPLIED BY CLIENT IS \n")); - Log::Printf(_L("\n")); - Log::Printf(_L("[MAT string : = %S]\n"),&label); + OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_BORDER, CSBLPPOLICY_SETSBLPPARAMETERS_1, "<------------------------------------------------\n"); + OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_BORDER, CSBLPPOLICY_SETSBLPPARAMETERS_2, "CSblpPolicy::SetSblpParameters"); + OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_BORDER, CSBLPPOLICY_SETSBLPPARAMETERS_3, "\n"); + OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_BORDER, CSBLPPOLICY_SETSBLPPARAMETERS_4, "SBLP VALUES SUPPLIED BY CLIENT IS \n"); + OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_BORDER, CSBLPPOLICY_SETSBLPPARAMETERS_5, "\n"); + OstTraceDefExt1(OST_TRACE_CATEGORY_DEBUG, TRACE_BORDER, CSBLPPOLICY_SETSBLPPARAMETERS_6, "[MAT string : = %S]\n",label); TInt i; for(i=0; i\n")); + OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_BORDER, CSBLPPOLICY_SETSBLPPARAMETERS_9, "------------------------------------------------>\n"); flowIds.Close(); - ) + }