telephonyprotocols/qosextnapi/src/sblpextn.cpp
branchRCL_3
changeset 17 1ac40e087278
parent 0 3553901f7fa8
child 19 630d2f34d719
equal deleted inserted replaced
15:8b9e023e329f 17:1ac40e087278
    68 	return iFlowIds[aIndex];
    68 	return iFlowIds[aIndex];
    69 	}
    69 	}
    70 
    70 
    71 EXPORT_C void CSblpParameters::SetFlowIds(const RArray<TFlowIdentifier> &aFlowIds)
    71 EXPORT_C void CSblpParameters::SetFlowIds(const RArray<TFlowIdentifier> &aFlowIds)
    72 	{
    72 	{
       
    73     //in case of low memory the function might not set all the ids
    73 	iFlowIds.Reset();
    74 	iFlowIds.Reset();
    74 	TInt i;
    75 	TInt i;
    75 	for(i=0; i<aFlowIds.Count();i++)
    76 	for(i=0; i<aFlowIds.Count();i++)
    76 		{
    77 		{
    77 		this->iFlowIds.Append(aFlowIds[i]);
    78 		TInt errorCode = this->iFlowIds.Append(aFlowIds[i]);
       
    79 		if (errorCode != KErrNone) 
       
    80 		    {
       
    81             LOG(Log::Printf(_L("CSblpParameters::SetFlowIds - Not Enough Memory!!!\n"));)
       
    82 		    }
    78 		}
    83 		}
    79 	}
    84 	}
    80 
    85 
    81 EXPORT_C TInt CSblpParameters::GetFlowIds(RArray<TFlowIdentifier>& aFlowIds)
    86 EXPORT_C TInt CSblpParameters::GetFlowIds(RArray<TFlowIdentifier>& aFlowIds)
    82 	{
    87 	{
       
    88     //in case of low memory the function might not get all the ids and returns an error code
    83 	aFlowIds.Reset();
    89 	aFlowIds.Reset();
    84 	TInt i;
    90 	TInt i;
       
    91 	TInt errorCode = KErrNone;
    85 	for(i=0; i<iFlowIds.Count();i++)
    92 	for(i=0; i<iFlowIds.Count();i++)
    86 		{
    93 		{
    87 		aFlowIds.Append(this->iFlowIds[i]);
    94         errorCode = aFlowIds.Append(this->iFlowIds[i]);
       
    95         if (errorCode != KErrNone) 
       
    96             {
       
    97             LOG(Log::Printf(_L("CSblpParameters::GetFlowIds - Not Enough Memory!!!\n"));)
       
    98             return errorCode;
       
    99             }
    88 		}
   100 		}
    89 	return KErrNone;
   101 	return KErrNone;
    90 	}
   102 	}
    91 
   103 
    92 EXPORT_C TInt CSblpParameters::NrOfFlowIds()
   104 EXPORT_C TInt CSblpParameters::NrOfFlowIds()
   232 	// following code is to create logs
   244 	// following code is to create logs
   233 	TAuthorizationToken authToken;
   245 	TAuthorizationToken authToken;
   234 	iSblp->GetMAT (authToken);
   246 	iSblp->GetMAT (authToken);
   235 	RArray<CSblpParameters::TFlowIdentifier> flowIds;
   247 	RArray<CSblpParameters::TFlowIdentifier> flowIds;
   236 	iSblp->GetFlowIds(flowIds);
   248 	iSblp->GetFlowIds(flowIds);
       
   249 	// 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
   237 	TBuf<KAuthorizationTokenSize> label;
   250 	TBuf<KAuthorizationTokenSize> label;
   238 	label.Copy(authToken);
   251 	label.Copy(authToken);
   239 		
   252 		
   240 	Log::Printf(_L("<------------------------------------------------\n"));
   253 	Log::Printf(_L("<------------------------------------------------\n"));
   241 	Log::Printf(_L("CSblpPolicy::SetSblpParameters"));
   254 	Log::Printf(_L("CSblpPolicy::SetSblpParameters"));