|
1 <?xml version="1.0" encoding="utf-8"?> |
|
2 <!-- Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies) All rights reserved. --> |
|
3 <!-- This component and the accompanying materials are made available under the terms of the License |
|
4 "Eclipse Public License v1.0" which accompanies this distribution, |
|
5 and is available at the URL "http://www.eclipse.org/legal/epl-v10.html". --> |
|
6 <!-- Initial Contributors: |
|
7 Nokia Corporation - initial contribution. |
|
8 Contributors: |
|
9 --> |
|
10 <!DOCTYPE task |
|
11 PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd"> |
|
12 <task id="GUID-934AEB9C-77EA-5F50-BB84-2446DDD432C8" xml:lang="en"><title>How |
|
13 to Send Data: Tutorial</title><shortdesc>This tutorial describes how to send and receive data with the Serial |
|
14 Communications Server.</shortdesc><prolog><metadata><keywords/></metadata></prolog><taskbody> |
|
15 <context><p>This tutorial follows the tutorial How to Open a Port: Tutorial<xref href="GUID-5D47DBF8-3DFE-5D0B-95B2-63302E91C423.dita">How to Open a Port: Tutorial</xref>. </p></context> |
|
16 <steps id="GUID-14170AC4-DD56-51C8-A7AD-CCE01EBBD398"> |
|
17 <step id="GUID-E372C9DD-1344-5452-ABFD-9EF5AA070906"><cmd/> |
|
18 <info>All data sent from the serial device is 8-bit even on a Unicode system. </info> |
|
19 <info>Create a <xref href="GUID-FB97E0A3-352A-316F-97C6-69E4741A8120.dita"><apiname>TDesC8</apiname></xref> Descriptor and fill the Descriptor |
|
20 with the data to send. </info> |
|
21 </step> |
|
22 <step id="GUID-74FDE5FB-22A4-509B-B52D-34F80BEA43EB"><cmd/> |
|
23 <info>Create a request object of type <xref href="GUID-E0B34F3E-D4C4-3232-B8B1-7DB35B454646.dita"><apiname>TRequestStatus</apiname></xref>. </info> |
|
24 </step> |
|
25 <step id="GUID-79A3BCD9-8ACB-54C4-BE42-A34B464FD002"><cmd/> |
|
26 <info>Call <xref href="GUID-3B4E8ED5-72F7-3E51-B188-3C1045526DDF.dita#GUID-3B4E8ED5-72F7-3E51-B188-3C1045526DDF/GUID-27B1F841-8478-33E0-A168-11DC468183C0"><apiname>RComm::Write()</apiname></xref> and set the <codeph>aDes</codeph> parameter |
|
27 as a reference to the Descriptor, and set the aStatus parameter to the request |
|
28 object. </info> |
|
29 <info>The RComm API does not allow another request to be made until the first |
|
30 request has completed. </info> |
|
31 </step> |
|
32 <step id="GUID-C66DC52F-6C68-5E82-A321-9646E20130B6"><cmd/> |
|
33 <info>The write request completes when the last character in the supplied |
|
34 buffer has been written to the serial hardware. There are three alternative |
|
35 ways the write request can complete: </info> |
|
36 <info><p><ol> |
|
37 <li id="GUID-4A9FF6B3-C625-4A3B-97E7-087F90CA3C93"><p>If the <codeph>aTimeOut</codeph> parameter |
|
38 was set with the <codeph>RComm::Write()</codeph> function then the request |
|
39 completes with <xref href="GUID-BAC2386E-8168-3CDB-9F9F-180319EF6920.dita"><apiname>KErrTimedOut</apiname></xref> if the Descriptor was not filled |
|
40 during the <codeph>aTimeOut</codeph> time. </p></li> |
|
41 <li id="GUID-3FED3BEA-C65E-4F0C-8046-9A0D2D9C072B"><p>If the write request |
|
42 is in progress, the write request can be cancelled by calling <xref href="GUID-0F0DE6EC-8525-3D7C-96A7-5328FB78A53C.dita"><apiname>WriteCancel()</apiname></xref>. </p></li> |
|
43 <li id="GUID-4AA18EA3-ACA6-4D03-A15E-16D30A905C7C"><p>A port can be configured |
|
44 to automatically terminate data transfer requests early when various error |
|
45 conditions occur. </p></li> |
|
46 </ol></p></info> |
|
47 </step> |
|
48 </steps> |
|
49 </taskbody></task> |