RConnectionMonitor Class Reference

API published in: S60 2nd Ed FP 2

Link against: connmon.lib

Capability Information

Required Capabilities

None

Exceptions

ReadDeviceData to call

IMPORT_C void GetIntAttribute( const TUint aConnectionId, const TUint aSubConnectionId, const TUint aAttribute, TInt& aValue, TRequestStatus& aStatus );

IMPORT_C TInt SetIntAttribute( const TUint aConnectionId, const TUint aSubConnectionId, const TUint aAttribute, const TInt aValue ) const;

with aAttribute set to KProtocolType.

NetworkServices and NetworkControl to call

IMPORT_C void GetBoolAttribute( const TUint aConnectionId, const TUint aSubConnectionId, const TUint aAttribute, TBool& aValue, TRequestStatus& aStatus );

IMPORT_C TInt SetBoolAttribute( const TUint aConnectionId, const TUint aSubConnectionId, const TUint aAttribute, const TBool aValue ) const;

with aAttribute KConnectionStop or KConnectionStopAll.

ReadDeviceData to call

IMPORT_C void GetStringAttribute( const TUint aConnectionId, const TUint aSubConnectionId, const TUint aAttribute, TDes& aValue, TRequestStatus& aStatus ) const;

IMPORT_C TInt SetStringAttribute( const TUint aConnectionId, const TUint aSubConnectionId, const TUint aAttribute, const TDes& aValue ) const;

with aAttribute set to KAccessPointName or KNetworkName.

ReadUserData to call

IMPORT_C void GetStringAttribute( const TUint aConnectionId, const TUint aSubConnectionId, const TUint aAttribute, TDes& aValue, TRequestStatus& aStatus ) const;

IMPORT_C TInt SetStringAttribute( const TUint aConnectionId, const TUint aSubConnectionId, const TUint aAttribute, const TDes& aValue ) const;

with aAttribute set to KTelNumber.

NetworkControl to call

IMPORT_C void GetPckgAttribute( const TUint aConnectionId, const TUint aSubConnectionId, const TUint aAttribute, TDes8& aValue, TRequestStatus& aStatus ) const;

IMPORT_C TInt SetPckgAttribute( const TUint aConnectionId, const TUint aSubConnectionId, const TUint aAttribute, const TDes8& aValue ) const;

with aAttribute set to KClientInfo.


#include <rconnmon.h>

Detailed Description

RConnectionMonitor.

Public Member Functions

  RConnectionMonitor ()
IMPORT_C TInt  ConnectL ()
  Connects the client to the Connection Monitor Server.
IMPORT_C void  Close ()
  Closes the Connection Monitor session.
IMPORT_C void  GetConnectionCount (TUint &aConnectionCount, TRequestStatus &aStatus)
  Gathers information on currently active connections.
IMPORT_C TInt  GetConnectionInfo (const TUint aIndex, TUint &aConnectionId, TUint &aSubConnectionCount) const
  Gets the connection id and the count of the subconnections for the given index.
IMPORT_C TInt  GetSubConnectionInfo (const TUint aConnectionId, const TUint aIndex, TUint &aSubConnectionId) const
  Gets the subconnection id for the given index.
IMPORT_C void  GetIntAttribute (const TUint aConnectionId, const TUint aSubConnectionId, const TUint aAttribute, TInt &aValue, TRequestStatus &aStatus)
  Gets the value for a TInt attribute.
IMPORT_C void  GetUintAttribute (const TUint aConnectionId, const TUint aSubConnectionId, const TUint aAttribute, TUint &aValue, TRequestStatus &aStatus)
  Gets the value for a TUint attribute.
IMPORT_C void  GetBoolAttribute (const TUint aConnectionId, const TUint aSubConnectionId, const TUint aAttribute, TBool &aValue, TRequestStatus &aStatus)
  Gets the value for a TBool attribute.
IMPORT_C void  GetStringAttribute (const TUint aConnectionId, const TUint aSubConnectionId, const TUint aAttribute, TDes &aValue, TRequestStatus &aStatus) const
  Gets the value for a string attribute.
IMPORT_C void  GetPckgAttribute (const TUint aConnectionId, const TUint aSubConnectionId, const TUint aAttribute, TDes8 &aValue, TRequestStatus &aStatus) const
  Gets the value for a packaged attribute (TConnMonTimeBuf, TConnMonClientEnumBuf).
IMPORT_C void  GetPckgAttribute (const TUint aConnectionId, const TUint aSubConnectionId, const TUint aAttribute, TDes16 &aValue, TRequestStatus &aStatus) const
  Gets the value for a packaged attribute (TConnMonTimeBuf, TConnMonClientEnumBuf).
IMPORT_C TInt  SetIntAttribute (const TUint aConnectionId, const TUint aSubConnectionId, const TUint aAttribute, const TInt aValue) const
  Sets the value for a TInt attribute.
IMPORT_C TInt  SetUintAttribute (const TUint aConnectionId, const TUint aSubConnectionId, const TUint aAttribute, const TUint aValue) const
  Sets the value for a TUint attribute.
IMPORT_C TInt  SetBoolAttribute (const TUint aConnectionId, const TUint aSubConnectionId, const TUint aAttribute, const TBool aValue) const
  Sets the value for a TBool attribute.
IMPORT_C TInt  SetStringAttribute (const TUint aConnectionId, const TUint aSubConnectionId, const TUint aAttribute, const TDes &aValue) const
  Sets the value for a string attribute.
IMPORT_C TInt  SetPckgAttribute (const TUint aConnectionId, const TUint aSubConnectionId, const TUint aAttribute, const TDes8 &aValue) const
  Sets the value for a packaged attribute.
IMPORT_C void  CancelAsyncRequest (TInt aReqToCancel)
  Cancels an asyncronous request.
IMPORT_C TInt  NotifyEventL (MConnectionMonitorObserver &aObserver)
  Registers an event observer to catch connection monitor events.
IMPORT_C void  CancelNotifications ()
  Cancels the notifications.

Friends

class  CConnMonEventHandler

Constructor & Destructor Documentation

RConnectionMonitor::RConnectionMonitor  )  [inline]
 

Member Function Documentation

IMPORT_C void RConnectionMonitor::CancelAsyncRequest TInt  aReqToCancel  ) 
 

Cancels an asyncronous request.

Parameters:
aReqToCancel  Identifies the request to be cancelled. Values are defined in TConnMonAsyncRequest.
Returns:
void.
IMPORT_C void RConnectionMonitor::CancelNotifications  ) 
 

Cancels the notifications.

Returns:
void.
IMPORT_C void RConnectionMonitor::Close  ) 
 

Closes the Connection Monitor session.

An opened RConnectionMonitor must be closed explicitily to prevent a resource (memory) leak.

Returns:
void
IMPORT_C TInt RConnectionMonitor::ConnectL  ) 
 

Connects the client to the Connection Monitor Server.

It must be called before any of other methods during the Connection Monitor session.

Returns:
KErrNone if successful, a system-wide error code if not.
IMPORT_C void RConnectionMonitor::GetBoolAttribute const TUint  aConnectionId,
const TUint  aSubConnectionId,
const TUint  aAttribute,
TBool &  aValue,
TRequestStatus &  aStatus
 

Gets the value for a TBool attribute.

Parameters:
aConnectionId  Connection id.
aSubConnectionId  Subconnection id. If set to 0, method applies to connection.
aAttribute  Identifies the attribute to be retrived.
aValue  On completion, contains the requested TBool attribute.
aStatus  KErrNone if successful, a system-wide error code if not.
Returns:
void.
IMPORT_C void RConnectionMonitor::GetConnectionCount TUint &  aConnectionCount,
TRequestStatus &  aStatus
 

Gathers information on currently active connections.

Parameters:
aConnectionCount  On completion, contains the number of active connections.
aStatus  KErrNone if successful, a system-wide error code if not.
Returns:
void
IMPORT_C TInt RConnectionMonitor::GetConnectionInfo const TUint  aIndex,
TUint &  aConnectionId,
TUint &  aSubConnectionCount
const
 

Gets the connection id and the count of the subconnections for the given index.

GetConnectionCount() must be called to gather the information on active connections before calling this method.

Parameters:
aIndex  Must be between 1 and the count returned by GetConnectionCount().
aConnectionId  On return, contains the connection id.
aSubConnectionCount  On return, contains the number of subconnections.
Returns:
void
IMPORT_C void RConnectionMonitor::GetIntAttribute const TUint  aConnectionId,
const TUint  aSubConnectionId,
const TUint  aAttribute,
TInt &  aValue,
TRequestStatus &  aStatus
 

Gets the value for a TInt attribute.

Parameters:
aConnectionId  Connection id.
aSubConnectionId  Subconnection id. If set to 0, method applies to connection.
aAttribute  Identifies the attribute to be retrived.
aValue  On completion, contains the requested TInt attribute.
aStatus  KErrNone if successful, a system-wide error code if not.
Returns:
void.
IMPORT_C void RConnectionMonitor::GetPckgAttribute const TUint  aConnectionId,
const TUint  aSubConnectionId,
const TUint  aAttribute,
TDes16 &  aValue,
TRequestStatus &  aStatus
const
 

Gets the value for a packaged attribute (TConnMonTimeBuf, TConnMonClientEnumBuf).

Parameters:
aConnectionId  Connection id.
aSubConnectionId  Subconnection id. If set to 0, method applies to connection.
aAttribute  Identifies the attribute to be retrived.
aValue  On completion, contains the requested packaged attribute.
aStatus  KErrNone if successful, a system-wide error code if not.
Returns:
void.
IMPORT_C void RConnectionMonitor::GetPckgAttribute const TUint  aConnectionId,
const TUint  aSubConnectionId,
const TUint  aAttribute,
TDes8 &  aValue,
TRequestStatus &  aStatus
const
 

Gets the value for a packaged attribute (TConnMonTimeBuf, TConnMonClientEnumBuf).

Parameters:
aConnectionId  Connection id.
aSubConnectionId  Subconnection id. If set to 0, method applies to connection.
aAttribute  Identifies the attribute to be retrived.
aValue  On completion, contains the requested packaged attribute.
aStatus  KErrNone if successful, a system-wide error code if not.
Returns:
void.
IMPORT_C void RConnectionMonitor::GetStringAttribute const TUint  aConnectionId,
const TUint  aSubConnectionId,
const TUint  aAttribute,
TDes &  aValue,
TRequestStatus &  aStatus
const
 

Gets the value for a string attribute.

Parameters:
aConnectionId  Connection id.
aSubConnectionId  Subconnection id. If set to 0, method applies to connection.
aAttribute  Identifies the attribute to be retrived.
aValue  On completion, contains the requested string. Use a 16-bit descriptor!
aStatus  KErrNone if successful, a system-wide error code if not.
Returns:
void.
IMPORT_C TInt RConnectionMonitor::GetSubConnectionInfo const TUint  aConnectionId,
const TUint  aIndex,
TUint &  aSubConnectionId
const
 

Gets the subconnection id for the given index.

Parameters:
aConnectionId  Connection id.
aIndex  Must be between 1 and the count returned by GetConnectionInfo().
aSubConnectionId  On return, contains the subconnection id.
Returns:
KErrNone if successful, a system-wide error code if not.
IMPORT_C void RConnectionMonitor::GetUintAttribute const TUint  aConnectionId,
const TUint  aSubConnectionId,
const TUint  aAttribute,
TUint &  aValue,
TRequestStatus &  aStatus
 

Gets the value for a TUint attribute.

Parameters:
aConnectionId  Connection id.
aSubConnectionId  Subconnection id. If set to 0, method applies to connection.
aAttribute  Identifies the attribute to be retrived.
aValue  On completion, contains the requested TUint attribute.
aStatus  KErrNone if successful, a system-wide error code if not.
Returns:
void.
IMPORT_C TInt RConnectionMonitor::NotifyEventL MConnectionMonitorObserver aObserver  ) 
 

Registers an event observer to catch connection monitor events.

Parameters:
aObserver  The event observer.
Returns:
KErrNone if successful, a system-wide error code if not.
IMPORT_C TInt RConnectionMonitor::SetBoolAttribute const TUint  aConnectionId,
const TUint  aSubConnectionId,
const TUint  aAttribute,
const TBool  aValue
const
 

Sets the value for a TBool attribute.

This method can be used to stop a connection (KConnectionStop).

Parameters:
aConnectionId  Connection id.
aSubConnectionId  Subconnection id. If set to 0, method applies to connection.
aAttribute  Identifies the attribute to be set.
aValue  The value to be set.
Returns:
KErrNone if successful, a system-wide error code if not.
IMPORT_C TInt RConnectionMonitor::SetIntAttribute const TUint  aConnectionId,
const TUint  aSubConnectionId,
const TUint  aAttribute,
const TInt  aValue
const
 

Sets the value for a TInt attribute.

Parameters:
aConnectionId  Connection id.
aSubConnectionId  Subconnection id. If set to 0, method applies to connection.
aAttribute  Identifies the attribute to be set.
aValue  The value to be set.
Returns:
KErrNone if successful, a system-wide error code if not.
IMPORT_C TInt RConnectionMonitor::SetPckgAttribute const TUint  aConnectionId,
const TUint  aSubConnectionId,
const TUint  aAttribute,
const TDes8 &  aValue
const
 

Sets the value for a packaged attribute.

Parameters:
aConnectionId  Connection id.
aSubConnectionId  Subconnection id. If set to 0, method applies to connection.
aAttribute  Identifies the attribute to be set.
aValue  The value to be set.
Returns:
KErrNone if successful, a system-wide error code if not.
IMPORT_C TInt RConnectionMonitor::SetStringAttribute const TUint  aConnectionId,
const TUint  aSubConnectionId,
const TUint  aAttribute,
const TDes &  aValue
const
 

Sets the value for a string attribute.

Parameters:
aConnectionId  Connection id.
aSubConnectionId  Subconnection id. If set to 0, method applies to connection.
aAttribute  Identifies the attribute to be set.
aValue  The string value to be set. Must be a 16-bit descriptor!.
Returns:
KErrNone if successful, a system-wide error code if not.
IMPORT_C TInt RConnectionMonitor::SetUintAttribute const TUint  aConnectionId,
const TUint  aSubConnectionId,
const TUint  aAttribute,
const TUint  aValue
const
 

Sets the value for a TUint attribute.

Parameters:
aConnectionId  Connection id.
aSubConnectionId  Subconnection id. If set to 0, method applies to connection.
aAttribute  Identifies the attribute to be set.
aValue  The value to be set.
Returns:
KErrNone if successful, a system-wide error code if not.

Friends And Related Function Documentation

friend class CConnMonEventHandler [friend]
 

The documentation for this class was generated from the following file:

Copyright © Nokia Corporation 2001-2008
Back to top