RIL returning error code 3 when requesting RIL_GetCellTowerInfo() RRS feed

  • Question

  • Hi,

    I have created a C++ application that uses RIL.dll. Everything seems to work ok in the emulator when connected to the celluer simulator. I get back Cell ID of 0 but I think this is just because it not a real network.

    Anyways, I've placed it on a WM6 phone, a Toshiba Portégé.
    RIL_Initialize works fine and I get a handle. When I call the RIL_GetCellTowerInfo method passing a callback function, this works good and my call back returns few milliseconds later but the problem is, the data in it is all random.

    Checking the dwCode parameter value in the call back function:
    void CellTowerInfo::callBackFunction(unsigned long dwCode,void* hrCmdID,const void* lpData,unsigned long cbData,unsigned long dwParam),

    I get the number 3, which I believe is RIL_RESULT_ERROR from the defines in the ril.h header file.

    However, on the WM emulator, I get a return of 1, indicating RIL_RESULT_OK.

    I've tried other applications, including C# versions and nothing seems to be able to get the Cell ID. I also get the value of 3 for the code from this blog: http://dalelane.co.uk/blog/?p=241 so I believe my code is fine and it must be the phone.

    Is it optional for the manufacturer to implement this interface or is it mandatory? - I find it quite strange as surely WM has to use the Cell ID somewhere, or does it bypass the RIL and go to the main device driver or something?

    I'll be working on  HTC Touch Diamond phones and am praying that it will work in these!

    Thanks very much.

    Sunday, July 5, 2009 4:16 PM

All replies

  • when dwCode is RIL_RESULT_ERROR, lpData is an LPDWORD that points to HRESULT. What is its value?

    Alex Feinman. MVP .NET Compact Framework
    Sunday, July 5, 2009 6:29 PM
  • Hi,

    I am not very familiar with windows API programming but I tried to interpret the HRESULT as a decimal int and I got weird result:

    int result = *((int*)(lpData));
    std::cout << "Result" << std::endl;

    I get: -2147467259 which can't be right?

    Is there some method to decode this result, or if the result is even there, I not sure?

    Thanks for your time.

    Monday, July 6, 2009 3:47 PM
  • The hresult you got is 80004005 (E_FAIL). Not much help there.
    If you try google maps mobile, can it locate you?
    Alex Feinman. MVP .NET Compact Framework
    Tuesday, July 7, 2009 6:17 AM
  • I'll probably just wait for the HTCs, should work on them hopefully.

    However, I am now using the RIL notifications. This works fine for everything like text messages, signal strength changes, radio on/off etc but it will not work for RIL_NOTIFY_LOCATIONUPDATE ( 0x00000008 | RIL_NCLASS_NETWORK) in the RIL_NCLASS_NETWORK class. I get all the other RIL_NCLASS_NETWORK notifications, such as RIL_NOTIFY_SYSTEMCHANGE etc but the one I want doesn't ever come through!

    This is very strange as I used an application called GSMCelluloz - what I enter a new cell, I get the cell ID according to this.

    Microsoft say they dont' implement the RIL_NOTIFY_LOCATIONUPDATE in any apps they have but besides this, would there be any other notification to include cell ID information. There isn't according to what I can see.

    Thursday, July 9, 2009 8:25 AM