Symbian
Symbian Developer Library

SYMBIAN OS V9.4

Feedback

[Index] [Previous] [Next]

#include <e32cmn.h>
Link against: euser.lib

Class RBusLogicalChannel

class RBusLogicalChannel : public RHandleBase;

Description

The user-side handle to a logical channel.

The class provides functions that are used to open a channel to a device driver, and to make requests. A device driver provides a derived class to give the user-side a tailored interface to the driver.

Derivation

Members

Defined in RBusLogicalChannel:

Inherited from RHandleBase:


Member functions


Open(RMessagePtr2,TInt,TOwnerType)

IMPORT_C TInt Open(RMessagePtr2 aMessage, TInt aParam, TOwnerType aType=EOwnerProcess);

Description

Opens a handle to a logical channel using a handle number sent by a client to a server.

This function is called by the server.

Parameters

RMessagePtr2 aMessage

The message pointer.

TInt aParam

An index specifying which of the four message arguments contains the handle number.

TOwnerType aType

An enumeration whose enumerators define the ownership of this logical channel handle. If not explicitly specified, EOwnerProcess is taken as default.

Return value

TInt

KErrNone, if successful; KErrArgument, if the value of aParam is outside the range 0-3; KErrBadHandle, if not a valid handle; otherwise one of the other system-wide error codes.


Open(TInt,TOwnerType)

IMPORT_C TInt Open(TInt aArgumentIndex, TOwnerType aType=EOwnerProcess);

Description

Opens a logical channel handle using a handle number passed as an environment data item to the child process during the creation of that child process.

Note that this function can only be called successfully once.

Parameters

TInt aArgumentIndex

An index that identifies the slot in the process environment data that contains the handle number. This is a value relative to zero, i.e. 0 is the first item/slot. This can range from 0 to 15.

TOwnerType aType

An enumeration whose enumerators define the ownership of this logical channel handle. If not explicitly specified, EOwnerProcess is taken as default.

Return value

TInt

KErrNone, if successful; KErrNotFound, if the slot indicated by aArgumentIndex is empty; KErrArgument, if the slot does not contain a logical channel handle; otherwise one of the other system-wide error codes.


DoCreate(const TDesC &,const TVersion &,TInt,const TDesC *,const TDesC8 *,TOwnerType,TBool)

protected: inline TInt DoCreate(const TDesC &aDevice, const TVersion &aVer, TInt aUnit, const TDesC *aDriver, const TDesC8 *anInfo, TOwnerType aType=EOwnerProcess, TBool aProtected=EFalse);

Description

Creates the logical channel.

Parameters

const TDesC16 &aDevice

The name of the logical device for which the channel is to be constructed. This is the name by which the LDD factory object, i.e. the instance of the DLogicalDevice derived class, is known.

const TVersion &aVer

The required version of the logical device. The driver normally checks this against the version of the logical channel, returning KErrNotSupported if the logical channel is not compatible.

TInt aUnit

A unit of the device. This argument only has meaning if the flag KDeviceAllowUnit is set in the iParseMask data member of the LDD factory object.

const TDesC16 *aDriver

A pointer to a descriptor containing the name of a physical device. This is the name by which the PDD factory object, i.e. the instance of the DPhysicalDevice derived class, is known. This is NULL, if no explicit name is to be supplied, or the logical device does not require an accompanying physical device.

const TDesC8 *anInfo

A pointer to an explicit 8-bit descriptor containing extra information for the physical device. This argument only has meaning if the KDeviceAllowInfo flag is set in the iParseMask data member of the LDD factory object.

TOwnerType aType

An enumeration whose enumerators define the ownership of this handle. If not explicitly specified, EOwnerProcess is taken as default.

TBool aProtected

If false, the channel is created as an object which is local/private to the current process. If true, the channel is an object which may be shared with other processes using the IPC mechanisms for handle passing.

Return value

TInt

KErrNone, if successful; otherwise one of the other system wide error codes.


DoCancel(TUint)

protected: IMPORT_C void DoCancel(TUint aReqMask);

Description

Cancels one or more outstanding asynchronous requests.

All outstanding requests complete with KErrCancel.

Parameters

TUint aReqMask

A set of bits identifying the requests to be cancelled. Each bit can be used to identify a separate outstanding request. It is up to the driver to define how the bits map to those outstanding requests.


DoRequest(TInt,TRequestStatus &)

protected: IMPORT_C void DoRequest(TInt aReqNo, TRequestStatus &aStatus);

Description

Queues an asynchronous request for the device driver, taking no parameters.

The request is handled on the kernel-side by the logical channel's DLogicalChannelBase::Request(TInt,TAny *,TAny *).

Outstanding requests can be cancelled by calling RBusLogicalChannel::DoCancel(TUint).

Parameters

TInt aReqNo

A number identifying the request to the logical channel.

TRequestStatus &aStatus

The request status object for this request.


DoRequest(TInt,TRequestStatus &,TAny *)

protected: IMPORT_C void DoRequest(TInt aReqNo, TRequestStatus &aStatus, TAny *a1);

Description

Queues an asynchronous request for the device driver, taking one parameter.

The request is handled on the kernel-side by the logical channel's DLogicalChannelBase::Request(TInt,TAny *,TAny *).

Outstanding requests can be cancelled by calling RBusLogicalChannel::DoCancel(TUint).

Parameters

TInt aReqNo

A number identifying the request to the logical channel.

TRequestStatus &aStatus

The request status object for this request.

TAny *a1

A 32-bit value passed to the kernel-side. Its meaning depends on the device driver requirements.


DoRequest(TInt,TRequestStatus &,TAny *,TAny *)

protected: IMPORT_C void DoRequest(TInt aReqNo, TRequestStatus &aStatus, TAny *a1, TAny *a2);

Description

Queues an asynchronous request for the device driver, taking two parameters.

The request is handled on the kernel-side by the logical channel's DLogicalChannelBase::Request(TInt,TAny *,TAny *).

Outstanding requests can be cancelled by calling RBusLogicalChannel::DoCancel(TUint).

Parameters

TInt aReqNo

A number identifying the request to the logical channel.

TRequestStatus &aStatus

The request status object for this request.

TAny *a1

A 32-bit value passed to the kernel-side. Its meaning depends on the device driver requirements.

TAny *a2

A 32-bit value passed to the kernel-side. Its meaning depends on the device driver requirements.


DoControl(TInt)

protected: IMPORT_C TInt DoControl(TInt aFunction);

Description

Makes a synchronous request to the device driver, taking no parameters.

This function does not return until the request has completed, successfully or otherwise.

Parameters

TInt aFunction

A number identifying the request.

Return value

TInt

KErrNone, if successful; otherwise one of the other system-wide error codes. The value returned depends on the implementation of the device driver.


DoControl(TInt,TAny *)

protected: IMPORT_C TInt DoControl(TInt aFunction, TAny *a1);

Description

Makes a synchronous request to the device driver, taking one parameter.

This function does not return until the request has completed, successfully or otherwise.

Parameters

TInt aFunction

A number identifying the request.

TAny *a1

A 32-bit value passed to the kernel-side. Its meaning depends on the device driver requirements.

Return value

TInt

KErrNone, if successful; otherwise one of the other system-wide error codes. The value returned depends on the implementation of the device driver.


DoControl(TInt,TAny *,TAny *)

protected: IMPORT_C TInt DoControl(TInt aFunction, TAny *a1, TAny *a2);

Description

Makes a synchronous request to the device driver, taking two parameters.

This function does not return until the request has completed, successfully or otherwise.

Parameters

TInt aFunction

A number identifying the request.

TAny *a1

A 32-bit value passed to the kernel-side. Its meaning depends on the device driver requirements.

TAny *a2

A 32-bit value passed to the kernel-side. Its meaning depends on the device driver requirements.

Return value

TInt

KErrNone, if successful; otherwise one of the other system-wide error codes. The value returned depends on the implementation of the device driver.


DoSvControl(TInt)

protected: inline TInt DoSvControl(TInt aFunction);

Description

Parameters

TInt aFunction

Return value

TInt


DoSvControl(TInt,TAny *)

protected: inline TInt DoSvControl(TInt aFunction, TAny *a1);

Description

Parameters

TInt aFunction

TAny *a1

Return value

TInt


DoSvControl(TInt,TAny *,TAny *)

protected: inline TInt DoSvControl(TInt aFunction, TAny *a1, TAny *a2);

Description

Parameters

TInt aFunction

TAny *a1

TAny *a2

Return value

TInt