diff -r 43e37759235e -r 51a74ef9ed63 Symbian3/SDK/Source/GUID-922442FC-D9E0-53BD-B8AD-011A724C96FF.dita --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Symbian3/SDK/Source/GUID-922442FC-D9E0-53BD-B8AD-011A724C96FF.dita Wed Mar 31 11:11:55 2010 +0100 @@ -0,0 +1,80 @@ + + + + + +How +to Detect Infrared Capability and Enable Infrared Mode: TutorialThe Serial Communications Server API includes functionality to +detect and configure an Infrared port. +

These steps show the functionality of the Serial Communications +Server API for Infrared. At the end of these steps, the port is set to Infrared +mode. A port set to Infrared mode may still require further configuration +specific to the Infrared driver. This further configuration is not included +in this tutorial.

+ +Load the CSY and +open a port. + +Get the capabilities +of the port by calling RComm::Caps() + +Get the Infrared +capabilities by checking the bits in TCommCaps.iSIR with +the three bitmasks KCapsSIR115kbps, KCapsSIR2400bpsOnly, +and KCapsSIR4Mbps. +If any of the bitmasks show the bit as set, then the port has Infrared +capability. +The infra-red characteristic of the port can be determined from the +value TCommCapsV01.iSIRSettings. + +To use the port +as an Infrared port, follow these steps: + + +Create an object of type TCommConfigV01. + + +Call RComm::Config() with the aConfig parameter +set to the TCommConfigV01 object to get the port configuration. + + +Set the iSIREnable flag in the TCommConfigV01 object. + + +Call RComm::Config() with the TCommConfigV01 object +as the aConfig parameter. +The port is now set to Infrared mode. To use Infrared, the Infrared +protocol must be understood so refer to the Infrared plugin section IrDA Serial. + + + + +Example TCommCaps ourCapabilities; +User::LeaveIfError(commPort.Caps (ourCapabilities)); + + if ((ourCapabilities ().iSIR & KCapsSIR115kbps) || +(ourCapabilities ().iSIR & KCapsSIR2400bpsOnly) || +(ourCapabilities ().iSIR & KCapsSIR4Mbps)) +{ + // IR is supported, so enable it + TCommConfig portSettings; + User::LeaveIfError(commPort.Config (portSettings)); + + portSettings ().iSIREnable = ESIREnable; + User::LeaveIfError (commPort.SetConfig (portSettings)); +} +
+IrDA Serial + +GlassTerm +- glass teletype terminal +How to + Open a Port with the IrDA Protocol Module: Tutorial + +
\ No newline at end of file