×

Discussion Board

Page 1 of 3 123 LastLast
Results 1 to 15 of 43
  1. #1
    Registered User
    Join Date
    Sep 2007
    Posts
    17

    Raw/IrSIR in Symbian OS v9.1 solution anyone?

    Hi,
    The solution described to get serial infrared access (without using IrDA stack as the remote machine doesnt have any IrCOMM service, it comunicates via IrSIR i.e. HP-SIR, the device is a glucometer called Accu chek Active by Roche Diagnostics) has been described for Symbian OSv7.0 in the tech tip on symbian developer network site:
    http://www3.symbiandevnet.com/faq.ns...4?OpenDocument
    It recommends using RComm class to open the IR Port after loading load the ECUART serial device driver directly instead of IRCOMM (which is usually used for IrComm) and enable SIR.
    But when i try to do this on OS 9.1 (running on nokia E61i) the program halts at this line:

    ret = commPort.Open(commServ,_L("IrCOMM::0"),ECommExclusive);
    User::LeaveIfError(ret);

    It exits with the error "unable to to execute file for security reason", I have Local Services capability enabled. Why does that happen? Does it require CommDD or NetworkControl?
    Isnt there anyway in OS 9.1 to connect the IR port to the ECUART module (to pipe RS232 data to the infrared port)?
    Is there any undocumented way to open the IR port (the portname that the lowest level the of IrDA stack talks to) without using the IrDA stack and output the serial data?
    If not how can one force the IrDA stack to work in only a Serial infrared mode, with no device discovery, no protocol like TinyTP, just plain RS232 data?
    John G.

  2. #2
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,167

    Re: Raw/IrSIR in Symbian OS v9.1 solution anyone?

    I think that there might be some serious problems on utilizing the IR that way, basically PsiLoc haven't updated their Ir -Remote (http://shop.psiloc.com/en/Applicatio...siloc+irRemote) for 3rd edition yet, and I would assume that if it has an easy solution, it would have been made already.

    Anyway, you could always try your luck on pro-support, it costs money, but might save time on finding the solution, or some kind of reason for no-go-situation.

    yucca

  3. #3
    Registered User
    Join Date
    Sep 2007
    Posts
    18

    Re: Raw/IrSIR in Symbian OS v9.1 solution anyone?

    I am also trying to do this (on UIQ3).
    There is another example, for symbian 6.0 : http://newlc.com/Programming-IrComm3-wire-raw.html
    However, while trying, i discovered I am not able to send any data on IrDA, not even stacked (with serial IrCOMM).
    When trying to open the port IrCOMM::0 it always give me error -21 (Access Denied). This happens even with supplied example IRPrinting.
    I have searched EVERYWHERE, I even sent a feedback to UIQ development. It seems no one knows.
    The bottom line, does anyone have a working example on Symbian 9.1 that at least opens the IR port ?
    Then we can try to enable SIR.

    It's true, Psiloc did not port IrRemote and no other infrared remote application is available for 9.1. But they only ported 2 of their many applications, so we can hope that there is another reason why there is no IrRemote for 9.1 or UIQ3.

  4. #4
    Registered User
    Join Date
    Sep 2007
    Posts
    17

    Smile Re: Raw/IrSIR in Symbian OS v9.1 solution anyone?

    I suspect the problem is a combination of 2 problems, firstly platform security cos to open a port the OS checks the CSY module's CSerial::PortPlatSecCapability() function to read the capabilities required by a port. The server passes the port as a parameter. This returns a TSecurityPolicy containing the capabilities. The capabilities are normally hard-coded into the CSY, but this is the choice of the CSY implementer. This mentioned here http://developer.uiq.com/devlib/uiq_...migration.html
    So probably ECUART.CSY doesnt allow opening the IrCOMM::0 port unlike previous OS versions (currently only if the IrCOMM.CSY module is loaded can you open the IR port).
    On a side note even though GetPortInfo returns only COMM:0 for the ECUART module (which is always reserved by the system and can't be opened) you can actually open the COMM::2 port but ESIREnable will not work for it on my Nokia E61i. Wonder what that port is internally used for? Don't try to open COMM::1 it will cause a freeze non responsiveness and reboot, what a mess heh!
    The second reason maybe the newer OMAP processors like OMAP 1710 have implemented the IrDA port code (framing of IrDA incoming & outgoing data frames with checksums etc at IrPHY level) in hardware see here http://focus.ti.com/general/docs/wtb...contentId=4670
    and do not allow raw access to it. Even then it maybe possible if we write our own device driver class see here http://freepatentsonline.com/7047326.html
    The base class RDevFir class seems to be the underlying device driver class which probably would give us access at a low level, a DevKit is required for this. We may have to write our own CSY module to get things working...

  5. #5
    Registered User
    Join Date
    Sep 2007
    Posts
    18

    Re: Raw/IrSIR in Symbian OS v9.1 solution anyone?

    I still can not open IR port. How can I load ircomm.csy ?
    IRPrinting defines the following as device drivers :
    Code:
    	#if defined (__WINS__)
    	_LIT(PDD_NAME,"ECDRV");
    	_LIT(LDD_NAME,"ECOMM");
    	#else
    	_LIT(PDD_NAME,"EUART1");
    	_LIT(LDD_NAME,"ECOMM");
    	#endif
    And these for comm module and port :
    Code:
    	_LIT(KIrCOMM,"IrCOMM");
    	_LIT(KIrCOMM0,"IrCOMM::0");
    What do I need to change ?
    As far as I can see ircomm.csy is loaded (as comm module), and still I can not open IrCOMM::0

    In the document describing OMAP1710 it is stated that the chip implements FIR. There is some confusion because SIR is also used as Slow IR that is a speed like MIR and FIR. However SIR also means Serial IR that is the physical layer of IR. Physical layer is different for Slow IR (SIR) and Fast IR (FIR), but a device capable of FIR modulation should also modulate SIR.

    I do not think the chip implements the full IrDA stack in hardware as that would be an expensive alternative to using the ARM processor. Usually devices implement in hardware only the physical layer (IrPHY) that can be SIR, MIR or FIR or any combination of them (some chips add leading and trailing bytes and even CRC's, i.e. an IrPHY frame, this may be a problem depending on what you want to do). And the protocol stack (IrLAP, IrMUX, TinyTP, IrCOMM, IrOBEX etc.) in software. However it is not mandatory for the device driver to allow sending/receiving of IrPHY frames or bytes.

    EDIT:
    Ironically the only port I can open is COMM::0 on ecuart.csy module. Writing to it does not write anything to IR port however. On any other port i tried , i get errors -21 (Access Denied), -5 (Not Supported) or -46 (Permission Denied). Capability in mmp is set to "All -TCB".
    Last edited by senoctar; 2007-09-18 at 13:23.

  6. #6
    Registered User
    Join Date
    Sep 2007
    Posts
    17

    Re: Raw/IrSIR in Symbian OS v9.1 solution anyone?

    senoctar try this code:

    you should have the includes:
    #include <c32comm.h>
    and link against c32.lib
    mmp file should have the line:
    CAPABILITY LocalServices

    The code:


    // Device driver names
    _LIT(KLddName, "ECOMM");

    //Physical driver names
    _LIT(KPddName, "EUART1");

    //Load Physical Device driver
    TInt errDev = User::LoadPhysicalDevice(KPddName);


    //Load Logical Device driver
    errDev = User::LoadLogicalDevice(KLddName);


    TInt r = StartC32();

    if ( r != KErrNone && r != KErrAlreadyExists )
    {
    User::Leave ( r );
    }

    _LIT(KIrDA, "IRCOMM");
    _LIT(KIrDAPort, "IrCOMM::0");


    RCommServ commServ;
    commServ.Connect();

    TInt ret;
    ret = commServ.LoadCommModule(KIrDA);
    User::LeaveIfError(ret);


    //Open infrared port
    RComm commPort;
    ret = commPort.Open(commServ,KIrDAPort,ECommExclusive);
    User::LeaveIfError(ret);

    Thats it your infrared port will get activated and the IR icon starts blinking.
    You can also check if the ports in your system (what is your phone model?) are named differently, iterate through your ports:

    TInt numPorts;
    ret = commServ.NumPorts (numPorts);
    User::LeaveIfError (ret);
    TBuf16<12> infoname;
    infoname.Format(_L("ports are %d"), numPorts);
    CEikonEnv::InfoWinL(_L("The number of"),infoname);

    TSerialInfo portInfo;
    TBuf16 <12> moduleName;

    for (TInt index=0 ; index < numPorts ; index++)
    {
    ret = commServ.GetPortInfo (index, moduleName, portInfo);
    infoname.Copy(moduleName);
    CEikonEnv::InfoWinL(_L("The module"),infoname);
    infoname.Copy(portInfo.iDescription);
    CEikonEnv::InfoWinL(_L("The description"),infoname);
    infoname.Copy(portInfo.iName);
    CEikonEnv::InfoWinL(_L("The portname"),infoname);
    infoname.Format(_L("is %d"), portInfo.iLowUnit);
    CEikonEnv::InfoWinL(_L("The Lowunit"),infoname);
    infoname.Format(_L("is %d"), portInfo.iHighUnit);
    CEikonEnv::InfoWinL(_L("The Highunit"),infoname);
    }

    In my system the IR port is at index = 2; you can do a GetPortInfo directly for that index number too and check

  7. #7
    Registered User
    Join Date
    Sep 2007
    Posts
    18

    Re: Raw/IrSIR in Symbian OS v9.1 solution anyone?

    I am using UIQ 3.0 emulator to simulate P990i.
    Now it seems like it's my problem, i can't be sure.
    The first time I tested your code it did not work, then I placed a breakpoint and it worked (although loading of physical devices returnes -1 "KErrNotFound" because I use it in an emulator) . I then added code to write to the port (at the end, not changing anything until opening the port) and again I get Access Denied.
    I do not know how and why did it work then, i did not mange to open the port again, not even by pressing undo till i had the same code that worked.

    There's also the least probable possibility that it's a mistake when UIQ3 was integrated with symbian 9.1

    The thing is that I changed my network, and I have to unlock my P990i before I can try this on the real device.

    Thank You, I will keep trying.

    About IrPHY, it should be possible, I think ircomm.csy is just a driver that implements IrCOMM standard protocol and it may still use ecuart.csy. If we had the source code for these drivers .... but we don't.

  8. #8
    Registered User
    Join Date
    Sep 2007
    Posts
    17

    Re: Raw/IrSIR in Symbian OS v9.1 solution anyone?

    that code is meant to be run on the device and not the emulator (in which case you have to replace EUART1 with ECDRV, also there won't be a port called IrCOMM::0 on the emulator, you have to enable the IrDA device in the emulator to say COM1 of the pc, when u call RComm::Open you should try to open COMM::2 cos in the emulator COMM::2 maps to the PC COM1 port)

  9. #9
    Registered User
    Join Date
    Sep 2007
    Posts
    18

    Re: Raw/IrSIR in Symbian OS v9.1 solution anyone?

    I think I just have to wait until I can test something on the real device.
    For the emulator I use a virtual port, and connect to it using HyperTerm. Other apps like contacts manager are able to open the IR port (i.e. when i try to send a contact through IR, i can see data received in the terminal).
    The IRPrinting example seams to be written so it would work on both the emulator and the device.
    All applications use IrDA sockets rather than IrCOMM to send data, as far as I can see from imports.

    About IrPHY, as shown in the following diagram : http://developer.uiq.com/devlib/uiq_...2eintroduction
    IrCOMM is implemented over TinyTP and the task of communicating with ecuart.csy falls to sockets server. Indeed, after disassembling ircomm.csy i found only imports from irda.dll and esock.dll. There are also imports from c32, but from what I can see, only members of CSerial and CPort classes (symbian OS documentation describes these as base classes for defining serial ports).

    Upon disassembling irda.dll, I could only find imports from esock.dll. Also there is a member of TIrdaSockAddr called GetIrlapVersion(), and IrLAP is the lowest layer of IrDA exept IrPHY.

    In the diagram irda sockets are shown to communicate with IrPHY hardware through ecuart.csy but I could not find any references to it.
    So i thought of something stupid, i deleted ecuart.csy, and ... yep, no data on the port, no application could send any data over IR.
    This kind of gets me where I started, ircomm.csy does not use ecuart.csy instead it uses irda.dll, but at the end ecuart.csy is still the device driver.

  10. #10
    Registered User
    Join Date
    Sep 2007
    Posts
    17

    Re: Raw/IrSIR in Symbian OS v9.1 solution anyone?

    Ya its true IrCOMM is just serial emulation for legacy applications that need to talk to a serial port, the actual process as you mentioned being serial data piped over an IPC boundary to comms server module then to IrDA stack dll then to a socket server finally to SIR driver Comms Server module ECUART.CSY. This is mentioned in the documentation http://developer.uiq.com/devlib/uiq_...2dintroduction
    So to access SIR (bypassing the IrDA stack dll) we have to directly use the ECUART module, but that is not working due to some unknown reason....

  11. #11
    Registered User
    Join Date
    Sep 2007
    Posts
    17

    Re: Raw/IrSIR in Symbian OS v9.1 solution anyone?

    It would be useful if we could know what the hardware is, for example is it a Vishay infrared transceiver interfaced directly to a processor port? http://www.vishay.com/docs/82606/remote.pdf newer IrDA transceivers even support working in remote control mode with FIR transcievers having acceptable ranges like even 12m. If so all it would take is for the S60 OS to support these in their device drivers and allow developers acces to its API (ironically with platform security, symbian signing and restricted access to low level driver code, true open source development for individuals is virtually discouraged, they seem to send the message that only SMBs or corporate clients matter.)

  12. #12
    Registered User
    Join Date
    Sep 2007
    Posts
    17

    Re: Raw/IrSIR in Symbian OS v9.1 solution anyone?

    senoctar, I managed to open the IR port for raw access! apparently the port name is COMM::2 on my device and it returns a SIR capability on checking! below is my rough code(there are some debug info messages in the code just to see if we cud execute a line while running the code on the phone: But unfortunately i cant't write to the port ??!! it justs exits from the write statement without an error code wonder whats going on??

    TInt errDev;

    // Device driver names
    _LIT(KLddName, "ECOMM");

    //Physical driver names
    _LIT(KPddName, "EUART1");

    //Load Physical Device driver
    errDev = User::LoadPhysicalDevice(KPddName);
    //if ((errDev != KErrNone) && (errDev != KErrAlreadyExists)) User::Leave (errDev);

    //Load Logical Device driver
    errDev = User::LoadLogicalDevice(KLddName);
    //if ((errDev != KErrNone) && (errDev != KErrAlreadyExists)) User::Leave (errDev);

    TInt r = StartC32();
    if ( r != KErrNone && r != KErrAlreadyExists )
    {
    User::Leave ( r );
    }

    _LIT(KRS232, "ECUART");
    _LIT(KCommPort, "COMM::2");


    RCommServ commServ;
    commServ.Connect();

    TInt ret;
    ret = commServ.LoadCommModule(KRS232);
    User::LeaveIfError(ret);

    //Open infrared port
    RComm commPort;
    ret = commPort.Open(commServ,KCommPort,ECommExclusive);
    User::LeaveIfError(ret);


    TCommCaps mycaps;
    commPort.Caps(mycaps);
    if (mycaps().iSIR == 0)
    {
    commPort.Close();
    CEikonEnv::InfoWinL(_L("Reached here"),_L("No SIR" ));
    return ETrue;
    }
    else
    {
    CEikonEnv::InfoWinL(_L("Reached here"),_L("We have SIR" ));
    }

    TCommConfig portSettings;
    commPort.Config(portSettings);
    // MUST disable SIR mode BEFORE setting any serial port
    // options.
    portSettings().iSIREnable = ESIRDisable;
    ret = commPort.SetConfig (portSettings);

    //Configure serial port to 9600 8N1
    portSettings().iRate = EBps9600;
    portSettings().iDataBits = EData8;
    portSettings().iParity = EParityNone;
    portSettings().iStopBits = EStop1;
    portSettings().iHandshake = 0;
    ret = commPort.SetConfig (portSettings);
    // enable SIR
    portSettings().iSIREnable = ESIREnable;
    ret = commPort.SetConfig (portSettings);
    User::LeaveIfError(ret);
    CEikonEnv::InfoWinL(_L("Reached here"),_L("Enabled SIR" ));
    commPort.ResetBuffers();

    const TTimeIntervalMicroSeconds32 KTimeOut(4000000);
    TRequestStatus status;


    const TInt KBufSize (256);
    TBuf8 < KBufSize > localInputBuffer;

    //issue command to get number of readings from my device

    _LIT8(KInfo, "C");
    commPort.Write(status,KInfo,0);
    User::WaitForRequest(status);
    User::LeaveIfError(status.Int());
    CEikonEnv::InfoWinL(_L("Reached here"),_L("Wrote SIR" ));

    commPort.Write(status,KTimeOut,KInfo,1);
    User::WaitForRequest(status);
    User::LeaveIfError(status.Int());
    CEikonEnv::InfoWinL(_L("Reached here"),_L("Wrote SIR1" ));

    User::After(100000);
    _LIT8(KInfo2, "4");
    TBuf8 <2> infoBuf2(KInfo2);
    commPort.Write(status,infoBuf2,1);
    User::LeaveIfError(status.Int());

    CEikonEnv::InfoWinL(_L("Reached here"),_L("Wrote SIR2" ));

    User::After(100000);
    _LIT8(KInfo3, "\r");
    TBuf8 <2> infoBuf3(KInfo3);
    commPort.Write(status,infoBuf3,1);
    User::LeaveIfError(status.Int());


    User::After(100000);
    commPort.Read(status,localInputBuffer);
    User::WaitForRequest(status);


    commPort.Close();
    commServ.Close();

  13. #13
    Regular Contributor
    Join Date
    Mar 2007
    Posts
    105

    Re: Raw/IrSIR in Symbian OS v9.1 solution anyone?

    _LIT(KRS232, "ECUART");
    _LIT(KCommPort, "COMM::2");


    RCommServ commServ;
    commServ.Connect();

    TInt ret;
    ret = commServ.LoadCommModule(KRS232);
    User::LeaveIfError(ret);

    //Open infrared port
    RComm commPort;
    ret = commPort.Open(commServ,KCommPort,ECommExclusive);
    User::LeaveIfError(ret);


    TCommCaps mycaps;
    commPort.Caps(mycaps);


    can you run this on device ,and if you find the reason it did not work .

    on S90., if delelop capbility can do this .?

    i want to know if we can do so on S90. with develop signed>?

    i hava a question , how to config the frequecy of ir ? if it is the iSirseting pulsewithd.?
    Last edited by wjcrr; 2007-10-02 at 00:13.

  14. #14
    Registered User
    Join Date
    Sep 2007
    Posts
    17

    Re: Raw/IrSIR in Symbian OS v9.1 solution anyone?

    Yeah it definitely works on my S60 3rd edition device Nokia E61i, the COMM::2 port returns SIR capability (the actual comm port number it could be different on your device) and I could even read an IrPHY frame from my USB IrDA dongle, it read this:
    c0 ff 3f 1 44 5 1 0 ff ff ff ff 1 0 0 94 84 c1
    Thats an IrPHY frame with BOF (c0) and EOF (c1) etc. If I copy that to an output buffer I can even write too. But the catch seems to be I can read and write only IrPHY frames (possibly with valid Frame checksums). If I try to write a single byte then the write function wont complete. I am currently trying to check if only IrPHY access is allowed (bcos the hardware used in the phone might be an IrDA encoder/decoder and not a Serial encoder/decoder like older phones..can any hardware experts please clarify this?) by setting receive buffer length to 1 byte. It does read and write the one byte to the dongle but that is 0xC0. I am trying to write code that manually creates a buffer of TUint8 bytes to write to the port...

  15. #15
    Regular Contributor
    Join Date
    Mar 2007
    Posts
    105

    Re: Raw/IrSIR in Symbian OS v9.1 solution anyone?

    to you question :
    Symbian OS » Developer Knowledgebase » FAQ-0986
    //**
    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.
    */////////

    so ,i think you can send other frame , but ,you port config , "portSettings().iStopBits = EStop1;" so you must use the EOF.

    I think it is ,and you can try ,not set iStopBits.


    my question :
    I find some remote control on LINUX PC ir config file ,such as
    # brand: Philips TV Model: 29PT5507
    # model no. of remote control: ???
    # devices being controlled by this remote: TV / VCR
    #
    # NB: The following buttons are not changing with the vcr button pressed
    # unknown_1, unknown_[4-8], sound, radio, screen, vol_[up|down], mute, unknown_12

    begin remote

    name Philips-29PT5507
    bits 13
    flags RC5|CONST_LENGTH
    eps 30
    aeps 100

    one 889 889
    zero 889 889
    plead 889
    gap 113792
    toggle_bit 2

    frequency 36000
    duty_cycle 50


    how to difine in your Phone ir frequency , if you write control command .
    at least you must define your ir frequency .

    and there are other argrs ,but i don't know what it s mean.

    at firest we define frequency .i think we can find how to do others.
    reading is diferent to writing . and we how to test our writing data . at the TV??


    i can open the port use your codes . thanks . but how to define others is the problem.
    i think you do this on S60 2nd , did you ??

    i can find the command code on the web ,but ,how to define the ir send condition??
    ask thind do

    2007.10.05
    I find we can simulate the frequency with 115kbps , and using the define bits .

    and now I how the same question with u . how to send the raw code?
    I am reading the lirc source ,and I want to find how to send command use serial ir port .

    and we must to send one byte method from the phone ir port .and i didn't why we can't do so , and

    if we can send with ,frame with c0 and c1 , to simulate the raw frame , if actually send ir output how how the c0 and c1, or it only is a anding port of the phone core.

    my English is du . do you understand .?
    Last edited by wjcrr; 2007-10-05 at 20:42.

Similar Threads

  1. Problems stopping RConnection on Symbian v9.1
    By jan.schenk in forum Symbian Networking & Messaging (Closed)
    Replies: 7
    Last Post: 2007-07-14, 17:08
  2. Replies: 9
    Last Post: 2006-07-19, 07:12
  3. Solution to select IAP without prompting in symbian 7.0.
    By rakesh.jaiswal in forum Symbian Networking & Messaging (Closed)
    Replies: 0
    Last Post: 2005-04-25, 10:13
  4. Replies: 2
    Last Post: 2003-08-19, 16:39
  5. setting of Series 60 MIDP SDK for Symbian OS version 1.2 for networking
    By servigo in forum Mobile Java Networking & Messaging & Security
    Replies: 2
    Last Post: 2003-07-31, 07:47

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×