diff -r 578be2adaf3e -r 307f4279f433 Adaptation/GUID-0E93319A-439E-49D8-BF38-C809FEE4BB74.dita --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Adaptation/GUID-0E93319A-439E-49D8-BF38-C809FEE4BB74.dita Fri Oct 15 14:32:18 2010 +0100 @@ -0,0 +1,47 @@ + + + + + +User-side +CreationThis document describes user-side creation of asynchronous requests. +

Asynchronous requests are commonly initiated by a call to RBusLogicalChannel::DoRequest(). +The user making an asynchronous request creates a TRequestStatus object +and passes it along with the request type to the DoRequest() call. +The request status is changed to KRequestPending by the +Kernel before sending the message to the driver. The user may then either +wait on the request using User::WaitForRequest(), or it +may queue one or more requests and then wait. It may have an active object +handler to receive the request complete notifications.

+// Request status object for transmit. This object will be used to +// read the status of asynchronous requests after the notification of +// request completion +// + TRequestStatus txStatus; + +// Call the LDD interface TransmitData() API with test data descriptor +// and TRequestStatus object as parameters. Here TransmitData() is a +// wrapper over a DoRequest() call. +// +r = ldd.TransmitData(txStatus, KTestSendData); +test(r==KErrNone); + +// Wait till the request is complete on txStatus. The user thread is +// blocked with this call, till it is notified about the request +// completion. +// +User::WaitForRequest(txStatus); + +// txStatus holds the request completion. TRequestStatus::Int() +// returns the completion code. It will be KErrNone in case of +// successful completion. +// +r = txStatus.Int(); +test(r==KErrNone); +
\ No newline at end of file