|
|
|
Location:
e32std.h
Link against: euser.lib
RDevice
Supported from 5.0
User side handle to a logical channel.
A channel handle is owned by the thread that opens that channel. The handle cannot be shared with other threads.
|
Defined in RBusLogicalChannel:
CheckBusStatus(), DoCancel(), DoCheckBusStatus(), DoControl(), DoCreate(), DoRequest(), DoSvControl()
Inherited from RHandleBase:
Close(),
Duplicate(),
Handle(),
SetHandle()
protected : TInt DoCreate(const TDesC& aDevice,const TVersion& aVer,const TDesC* aChan,TInt aUnit,const TDesC* aDriver,const TDesC8* anInfo,TOwnerType aType=EOwnerProcess);
Creates the logical channel for the current thread.
The logical channel is an instance of a DLogicalChannel derived class, a Kernel side object that is created on the Kernel heap and is associated with one, and only one thread.
The function checks whether asynchronous operations are needed before and/or after opening the logical channel. This is implemented as a Kernel Executive type call and results in every installed DPhysicalDevice object associated with this logical device being interrogated through a call to DPhysicalDevice::CheckForSlowOpening(). If needed, the function starts the asynchronous operation and waits for its completion before starting the process of creating the logical channel.
The function then makes a Kernel server call to implement the creation of the logical channel and this proceeds as follows:
the Kernel finds the LDD factory object, the instance of the DLogicalDevice derived class, by its full name
if the LDD factory object requires a PDD, i.e the KDeviceAllowPhysicalDevice flag is set in the iParseMask data member of the LDD factory object, then an attempt is made to create a physical channel for an appropriate physical device (or devices). This involves a call to the PDD factory object's DPhysicalDevice::CreateL()
the LDD factory object's DLogicalDevice::CreateL() is called to construct the logical channel, an instance of a DLogicalChannel derived class
the Kernel sets the name of the logical channel object to that supplied in the const TDesC* aChan argument
the owner of the logical channel object is set to either the current process or the current thread according to the value of the TOwnerType aType argument
the logical channel's DLogicalChannel::DoCreateL(), which, typically does any required secondary initialisation; for example, creating and registering a power handler
the Kernel adds the channel to its container of logical channels
the Kernel creates a handle to the channel, i.e. it adds the logical channel to the process's object index or the thread's object index. It is the handle number generated by this operation which is returned to the User side and is encapsulated by this RBusLogicalChannel object.
the Kernel then returns control to this function.
If necessary, after creating the logical channel, then the function starts another asynchronous operation and waits for its completion.
|
|
DLogicalDevice and DPhysicalDevice derived classes, which are created on the Kernel heap, have no owner. Their fullnames are, therefore, the same as their names.aUnit, the pointer to the extra information anInfo and the version aVer are all forwarded to the function which creates the physical channel, DPhysicalDevice::CreateL().protected : void DoRequest(TInt aReqNo,TRequestStatus& aStatus);
protected : void DoRequest(TInt aReqNo,TRequestStatus& aStatus,TAny* a1);
protected : void DoRequest(TInt aReqNo,TRequestStatus& aStatus,TAny* a1,TAny* a2);
Makes an asynchronous Kernel Executive type request to the logical channel.
Before handling the request, a Kernel Executive call is made to ensure that the device is still powered up. If it is not powered up, then the asynchronous operations performed before and/or after creation of the logical channel are done again.
On the Kernel side, the request is handled by the logical channel's DLogicalChannel::Request() function.
When the request completes, the request status object contains the completion status and the thread's request semaphore is signalled to indicate that the request is complete.
The logical channel can have up to KMaxRequests requests outstanding at any one time. Each request is identified by the value presented by the TInt aReqNo argument and must be associated with a different TRequestStatus object.
|
protected : void DoCancel(TUint aReqMask);
Cancels one or more outstanding asynchronous Kernel Executive type requests to the logical channel.
All outstanding requests complete with KErrCancel.
|
protected : TInt DoControl(TInt aFunction);
protected : TInt DoControl(TInt aFunction,TAny* a1);
protected : TInt DoControl(TInt aFunction,TAny* a1,TAny* a2);
Makes a synchronous Kernel Executive type request to the logical channel.
Before handling the request, a Kernel Executive call is made to ensure that the device is still powered up. If it is not powered up, then the asynchronous operations performed before and/or after creation of the logical channel are done again.
On the Kernel side, the request is handled by the logical channel's DLogicalChannel::Control() function.
|
|
protected : TInt DoSvControl(TInt aFunction);
protected : TInt DoSvControl(TInt aFunction,TAny *a1);
protected : TInt DoSvControl(TInt aFunction,TAny *a1,TAny *a2);
Makes a synchronous Kernel Server type request to the logical channel.
Before handling the request, a Kernel Executive call is made to ensure that the device is still powered up. If it is not powered up, then the asynchronous operations performed before and/or after creation of the logical channel are done again.
On the Kernel side, the request is handled by the logical channel's DLogicalChannel::Control() function which runs in the context of the Kernel Server.
|
|
private : TInt CheckBusStatus();
This is internal and is not intended for use.
|