connectionmonitoring/connmon/dataconnectionlogger/src/dcl.cpp
changeset 73 70ee5458c95d
parent 72 0c32cf868819
equal deleted inserted replaced
72:0c32cf868819 73:70ee5458c95d
     1 /*
     1 /*
     2 * Copyright (c) 2003-2004 Nokia Corporation and/or its subsidiary(-ies).
     2 * Copyright (c) 2003-2010 Nokia Corporation and/or its subsidiary(-ies).
     3 * All rights reserved.
     3 * All rights reserved.
     4 * This component and the accompanying materials are made available
     4 * This component and the accompanying materials are made available
     5 * under the terms of "Eclipse Public License v1.0"
     5 * under the terms of "Eclipse Public License v1.0"
     6 * which accompanies this distribution, and is available
     6 * which accompanies this distribution, and is available
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
  1659             // Connection has closed
  1659             // Connection has closed
  1660             return;
  1660             return;
  1661             }
  1661             }
  1662         }
  1662         }
  1663 
  1663 
  1664     iConnectionMonitor.SetUintAttribute(
  1664     TInt err = iConnectionMonitor.SetUintAttribute(
  1665             aConnectionId,
  1665             aConnectionId,
  1666             KSubConnectionId,
  1666             KSubConnectionId,
  1667             KDownlinkDataThreshold,
  1667             KDownlinkDataThreshold,
  1668             threshold );
  1668             threshold );
  1669 
  1669     if ( err )
  1670     iConnectionMonitor.SetUintAttribute(
  1670         {
       
  1671         LOGIT1("FAILED to set KDownlinkDataThreshold to ConnMon <%d>", err)
       
  1672         }
       
  1673 
       
  1674     err = iConnectionMonitor.SetUintAttribute(
  1671             aConnectionId,
  1675             aConnectionId,
  1672             KSubConnectionId,
  1676             KSubConnectionId,
  1673             KUplinkDataThreshold,
  1677             KUplinkDataThreshold,
  1674             threshold );
  1678             threshold );
       
  1679     if ( err )
       
  1680         {
       
  1681         LOGIT1("FAILED to set KUplinkDataThreshold to ConnMon <%d>", err)
       
  1682         }
  1675 
  1683 
  1676     LOGIT1("Switched to threshold mode, id %d", aConnectionId)
  1684     LOGIT1("Switched to threshold mode, id %d", aConnectionId)
  1677 
  1685 
  1678     LOGEXITFN("CEngine::SwitchToThresholdMode()")
  1686     LOGEXITFN("CEngine::SwitchToThresholdMode()")
  1679     }
  1687     }
  1685 void CEngine::SwitchToTimerMode( const TUint aConnectionId )
  1693 void CEngine::SwitchToTimerMode( const TUint aConnectionId )
  1686     {
  1694     {
  1687     LOGENTRFN("CEngine::SwitchToTimerMode()")
  1695     LOGENTRFN("CEngine::SwitchToTimerMode()")
  1688     if ( iDclTimerAO != 0 )
  1696     if ( iDclTimerAO != 0 )
  1689         {
  1697         {
  1690         // Set thresholds to zero.
  1698         TInt err = iDclTimerAO->Add( aConnectionId );
  1691         iConnectionMonitor.SetUintAttribute(
  1699         if ( !err )
  1692                 aConnectionId,
  1700             {
  1693                 KSubConnectionId,
  1701             // Set thresholds to zero.
  1694                 KDownlinkDataThreshold,
  1702             err = iConnectionMonitor.SetUintAttribute(
  1695                 0 );
  1703                     aConnectionId,
  1696 
  1704                     KSubConnectionId,
  1697         iConnectionMonitor.SetUintAttribute(
  1705                     KDownlinkDataThreshold,
  1698                 aConnectionId,
  1706                     0 );
  1699                 KSubConnectionId,
  1707             if ( err )
  1700                 KUplinkDataThreshold,
  1708                 {
  1701                 0 );
  1709                 LOGIT1("FAILED to set KDownlinkDataThreshold to ConnMon <%d>", err)
  1702 
  1710                 }
  1703         iDclTimerAO->Add( aConnectionId );
  1711 
  1704 
  1712             err = iConnectionMonitor.SetUintAttribute(
  1705         LOGIT1("Switched to timer mode, id %d", aConnectionId)
  1713                     aConnectionId,
       
  1714                     KSubConnectionId,
       
  1715                     KUplinkDataThreshold,
       
  1716                     0 );
       
  1717             if ( err )
       
  1718                 {
       
  1719                 LOGIT1("FAILED to set KUplinkDataThreshold to ConnMon <%d>", err)
       
  1720                 }
       
  1721 
       
  1722             LOGIT1("Switched to timer mode, id %d", aConnectionId)
       
  1723             }
       
  1724         else
       
  1725             {
       
  1726             LOGIT1("Error, RArray::Append failed: %d", err)
       
  1727             }
  1706         }
  1728         }
  1707     LOGEXITFN("CEngine::SwitchToTimerMode()")
  1729     LOGEXITFN("CEngine::SwitchToTimerMode()")
  1708     }
  1730     }
  1709 
  1731 
  1710 // -----------------------------------------------------------------------------
  1732 // -----------------------------------------------------------------------------