How to get Cell Tower Info on a Windows Mobile CDMA Phone

windows-mobile

Tools/Env.: C++, VS2008, WM6.1

I currently only have the HTC Diamond Windows Mobile phone available for testing and try as I may, with all of my hacking prowess, I still cannot accomplish the task of acquiring the remaining details of Cell ID and LAC, to complete my cellular location based program.

I have managed to get the MCC and MNC, but the Cell ID and LAC numbers are still hidden to me. There must be a way of getting these, for the phone itself no doubt uses them for other things. :/

To reiterate what I have tried, it would be the following:

RIL_GetCellTowerInfo (g_hRIL);  // doesn't even signal the 'ResultCallback' function.

RIL_GetCurrentOperator (g_hRIL, RIL_OPFORMAT_NUM);  // calls the 'ResultCallback' function and only with this am I able to at least get the MCC and MNC.

Tried the following test code too, and nothing worked.

//constants and structures for cell ID
#define RIL_DEVSPECIFICPARAM_ENABLECELLIDSUPPORT 26
#define RIL_DEVSPECIFICPARAM_DISABLECELLIDSUPPORT 27

bool mode = true;
DWORD dwFuncID=0;

if (mode)
  dwFuncID = RIL_DEVSPECIFICPARAM_ENABLECELLIDSUPPORT;
else
  dwFuncID = RIL_DEVSPECIFICPARAM_DISABLECELLIDSUPPORT;

m_hrCellIdRequest_ = RIL_DevSpecific (g_hRIL,(LPBYTE) &dwFuncID, sizeof(DWORD));

//  no 'ResultCallback' triggered either.


BYTE req[4]= {24, 0, 0, 0};
m_hrCellIdRequest_ = RIL_DevSpecific (g_hRIL, req, 4);
req[0]=26;
m_hrCellIdRequest_ = RIL_DevSpecific (g_hRIL, req, 4);

I even tried sending the serial AT commands to get something back. eg. "AT+CCED=0\r"
I only get a failed result of '4\r'.

I have read that the last option would be to read its internal memory. But that doesn't seem to be a general method that would work for other phones. And besides, I don't even know where to begin with that.

So I finally broke down with a plea for help to this fabulous community in that if you have somehow managed to get this information from this phone, can you please share it with us?

Or if it is impossible to get, can you explain in detail why that may be?

I just want closure of this once and for all. 🙂

Best Answer

So after yet more digging around and stubborn "googling", it seems that the reason for the original RIL_* code not working on my phone is that I am on a CDMA (UMTS) network, and not a GSM network.

The GSM network, as I learned, provides the phone with values for MCC, MNC, Cell ID, and LAC.

The CDMA network on the other hand provides a different set of numbers, which are BID, NID, and SID.

e.g. CID -> BID, LAC -> NID, MNC -> SID, MCC -> MCC

The above RIL_* interface code is popular because there are more GSM phones/networks in the world than CDMA (North America mainly).

Now without a true GSM phone at hand, I cannot really test the RIL_* interface code I have. The WM6.1 SDK Cell Emulator tool is neat, but not enough to release a product with.

This then leaves me once again asking for any help from a mobile cellular expert regarding a way to retreive the BID, NID, and SID values from my HTC Diamond phone, in the hope that they really do translate to Cell ID and LAC.

Google Mobile Maps on my phone somehow manages to perform this spectacle. I can only guess they must have found a way on the CDMA network to get the cell tower info.

Any help is appreciated. :)

Related Topic