Symbian
Symbian OS Library

FAQ-0986 Is it possible to use Raw IR on Symbian OS devices?

[Index][spacer] [Previous] [Next]



 

Classification: C++ Category: Networking
Created: 02/23/2004 Modified: 03/04/2004
Number: FAQ-0986
Platform: Symbian OS v6.0, Symbian OS v6.1, Symbian OS v7.0, Symbian OS v7.0s

Question:
Is it possible to access the IR port to send and receive bytes through Raw
IR (Not IrDA) on Symbian OS devices?


Answer:
Yes, it is possible with an assumption that communication uses IrPhy(IrSIR) frames, which is most commonly used.

You can use the RComm class to open the IR Port.
You need to load the ECUART serial device driver directly instead of IRCOMM (which is usually used for IrComm) and enable SIR.

The code below explains an example usage of the API.


RCommServ server;

// Connect to the comm server
console->Printf(KStatus1);
server.Connect();

// Load the ECUART comm module
User::LeaveIfError(server.LoadCommModule(KECUART));

< snip : set ir portName >

// Open comm port
User::LeaveIfError(commPort.Open(server,portName,ECommExclusive));

// Set port configuration
TCommConfig config;
commPort.Config(config);
config().iHandshake=0;  // No early write completion.
config().iDataBits=EData8;
config().iStopBits=EStop1;
config().iParity=EParityNone;
config().iSIREnable=ESIREnable; // This enables SIR
  config().iSIRSettings=KConfigSIRPulseWidthMaximum;
config().iRate = EBps9600;
User::LeaveIfError(commPort.SetConfig(config));