diff -r 89d6a7a84779 -r 25a17d01db0c Symbian3/PDK/Source/GUID-31E9F790-8A47-588C-A515-D2C8CD367ADE.dita --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Symbian3/PDK/Source/GUID-31E9F790-8A47-588C-A515-D2C8CD367ADE.dita Fri Jan 22 18:26:19 2010 +0000 @@ -0,0 +1,53 @@ + + + + + +How +to Terminate Read Requests Early: TutorialThis tutorial explains how to terminate a read request. topic. +

This tutorial assumes a knowledge of the How +to transfer data: Tutorial topic.

An application that must respond +quickly can set termination charactes that are expected in the data. The +read requests complete if any termination characters appear in the data.

If +an application needs to respond quickly to the content of the data that is +received, the application can set termination characters. If any termination +characters are set, the Serial Communications Server inspects the data during +a read request. If the Serial Communications Server detects a termination +character during a read request, the Serial Communicatoins Server completes +the request with the data.

For example, an application that is reading +lines of text can set the termination character to the line end character.

+ + +Create an object of type TCommConfig. + +Call RComm::Config() with +the aConfig parameter set to the TCommConfig object. +The TCommConfig object now contains the port settings. + + +Set the iTerminator array in the TCommconfig object +to the terminator characters. The iTerminator array can contain +four characters. If less than four characters are required, set the characters +from index 0 of the array. + + +Set the iTerminatorCount field in the TCommconfig object +to the number of characters set in the iTerminator array. + +Call RComm::SetConfig() with +the aConfig parameter set to the TCommConfig object. + + +Example TCommConfig portSettings; +commPort.Config (portSettings); +portSettings ().iTerminator[0] = 10; // LF char +portSettings ().iTerminatorCount = 1; // so that we terminate a read when each line feed arrives +User::LeaveIfError (commPort.SetConfig(portSettings)); + +
\ No newline at end of file