Jump to content

The MoDaCo Developer Challenge: Win an i-mate JAQ3!


Guest PaulOBrien

Recommended Posts

Guest euan macinnes
Ok, heres what I got so far:

==========================================================

Module CellInfo

Public Declare Function InitialiseRIL Lib "syncril.dll" () As Integer

Public Declare Function UpdateRIL Lib "syncril.dll" () As Integer

Public Declare Function GetCellID Lib "syncril.dll" () As Integer

Public Declare Function GetSignalQuality Lib "syncril.dll" () As Integer

Public Declare Sub FinaliseRIL Lib "syncril.dll" ()

End Module

Private Sub Refresh_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem2.Click

Dim R As Integer

R = InitialiseRIL()

If R <> 0 Then

MsgBox("InitialiseRIL <> 0: " & CStr®)

Exit Sub

End If

R = UpdateRIL()

If R <> 0 Then

MsgBox("UpdateRIL <> 0: " & CStr®)

Exit Sub

End If

'lblTowerID.Text = GetCellID.ToString

'lblSignal.Text = GetSignalQuality.ToString

Call FinaliseRIL()

MsgBox("Done!")

End Sub

==========================================================

I get a InitializeRIL <> 0: 2147467259 error :D

Ok, well, it's not the problem, but to prevent something later, the return types of Initialise and Update should be Long in VB, as a long is 64 bits, whereas Integer is 32 bits only.

Once that's corrected, we'll get the right return value and see if that comes out any different. It won't make it work, but it'll present the right return value, and therefore error code for what's wrong.

Looking at the RIL code, it's expecting some sort of port number as well, maybe the next thing to try would be a port number parameter to try different RIL ports? The general feel from looking up the problem though is that there's some sort of signing/cert problem/phone unlocking problem though, which is why a non-0 value is being returned.

See: http://forum.xda-developers.com/showthread.php?t=218911

Based on the RIL_Initialize layout in MS' website: http://msdn2.microsoft.com/en-us/library/aa919106.aspx

This is definitely working on the PocketPC though, on both the Wizard and the TyTN, so there's something about the smartphone implementation that's a little different here.

Next step will be to take the serial port version and try that, as that seems to have greater reports of success from SP2003 editions. I've made it into a library today, I'll post up an example tomorrow.

In the meantime, I could use some input on using the SP2003 emulator, the publishing doesn't seem to copy over the syncril.dll properly, how do I copy over a file to it manually? The pocketPC bit is easier as there's a File Explorer already and I can share a folder, but the SP emulator doens't seem to have any options for that ;)

Edited by euan macinnes
Link to comment
Share on other sites

Guest johncody
Ok, well, it's not the problem, but to prevent something later, the return types of Initialise and Update should be Long in VB, as a long is 64 bits, whereas Integer is 32 bits only.

Once that's corrected, we'll get the right return value and see if that comes out any different. It won't make it work, but it'll present the right return value, and therefore error code for what's wrong.

Looking at the RIL code, it's expecting some sort of port number as well, maybe the next thing to try would be a port number parameter to try different RIL ports? The general feel from looking up the problem though is that there's some sort of signing/cert problem/phone unlocking problem though, which is why a non-0 value is being returned.

See: http://forum.xda-developers.com/showthread.php?t=218911

Based on the RIL_Initialize layout in MS' website: http://msdn2.microsoft.com/en-us/library/aa919106.aspx

This is definitely working on the PocketPC though, on both the Wizard and the TyTN, so there's something about the smartphone implementation that's a little different here.

Next step will be to take the serial port version and try that, as that seems to have greater reports of success from SP2003 editions. I've made it into a library today, I'll post up an example tomorrow.

In the meantime, I could use some input on using the SP2003 emulator, the publishing doesn't seem to copy over the syncril.dll properly, how do I copy over a file to it manually? The pocketPC bit is easier as there's a File Explorer already and I can share a folder, but the SP emulator doens't seem to have any options for that ;)

When I change the declare to "Long" from Integer (and also the "R" var) , I get a "NotSupportedException" when I try to do the InitialiseRIL.

OK, using the SP2003 emulator from VS2005 is realtively easy, just do these steps:

1) Disconnect any device currently connected to ActiveSync so activesync goes to sleep.

2) Open ActiveSync's (AS) "Communication Settings" and check the "Allow connections to one fo the following" - Then select "DMA".

3) In VS2005, select "Tools...Device Emulator Manager" and select the "Smartphone 2003 SE Emulator". Right click on it and select "Connect" which will open/run the emulator.

4) Right click on "Smartphone 2003 SE Emulator" again and select "Cradle".

5) This will now cause Activesync to awaken and connect to the emulator as if it was a real device. You should then be able to use AS's file explorer to copy files to the device.

-John

Edited by johncody
Link to comment
Share on other sites

Guest euan macinnes
When I change the declare to "Long" from Integer (and also the "R" var) , I get a "NotSupportedException" when I try to do the InitialiseRIL.

OK, using the SP2003 emulator from VS2005 is realtively easy, just do these steps:

1) Disconnect any device currently connected to ActiveSync so activesync goes to sleep.

2) Open ActiveSync's (AS) "Communication Settings" and check the "Allow connections to one fo the following" - Then select "DMA".

3) In VS2005, select "Tools...Device Emulator Manager" and select the "Smartphone 2003 SE Emulator". Right click on it and select "Connect" which will open/run the emulator.

4) Right click on "Smartphone 2003 SE Emulator" again and select "Cradle".

5) This will now cause Activesync to awaken and connect to the emulator as if it was a real device. You should then be able to use AS's file explorer to copy files to the device.

-John

Ok thanks, got the emulator connected.

The emulator is driving me crazy. I keep getting a NotSupportedException error, even on a completely empty function in the DLL, but only in the Smartphone emulator, the PocketPC stuff is again Ok and works as expected. The test function does nothing, no return values, no parameters. Any ideas why? does the DLL need to be in a specific location (other than Windows, or the same folder as the app) for it to be found? It's not likely a P/Invoke restriction, as the serial port commands use that, and they don't cause that error.

Link to comment
Share on other sites

Guest johncody
Ok thanks, got the emulator connected.

The emulator is driving me crazy. I keep getting a NotSupportedException error, even on a completely empty function in the DLL, but only in the Smartphone emulator, the PocketPC stuff is again Ok and works as expected. The test function does nothing, no return values, no parameters. Any ideas why? does the DLL need to be in a specific location (other than Windows, or the same folder as the app) for it to be found? It's not likely a P/Invoke restriction, as the serial port commands use that, and they don't cause that error.

The radio functions may not be fully implemented in the SP2003 emulator - I don't think MS put a lot of work into that section of this [older] emulator.

As far as the location to put the file, it should be "\Storage\Windows". There are actually two "\windows" directory. The "\Windows" off of the root just contains ROM files built-into the phone - you can place files there, but when the phone is powered off, they will be erased. The "\Storage\Windows" directory is persistant and is basically treated the same as "\windows" to the OS for all intent and purpose.

I have a real SP2003 device, so if there is any testing I can do on it to help you figure out real-world operations, please let me know.

Link to comment
Share on other sites

Guest euan macinnes
The radio functions may not be fully implemented in the SP2003 emulator - I don't think MS put a lot of work into that section of this [older] emulator.

As far as the location to put the file, it should be "\Storage\Windows". There are actually two "\windows" directory. The "\Windows" off of the root just contains ROM files built-into the phone - you can place files there, but when the phone is powered off, they will be erased. The "\Storage\Windows" directory is persistant and is basically treated the same as "\windows" to the OS for all intent and purpose.

I have a real SP2003 device, so if there is any testing I can do on it to help you figure out real-world operations, please let me know.

I'll be busy for the next week on work issues, (I do get to work on this during office hours, but my primary mission is the engineering app for Windows CE 5.0 and the applications behind it, I'm actually working on a network-based solution for this and using the phone app as a test solution), but will see what I can do with it. My C++ is a little limited though, I'll have to do some more research on why the RIL isn't activating, as it's clear that the call is working for you, but RIL just isn't responding with a valid handle.

Link to comment
Share on other sites

  • 5 weeks later...
Guest Dick Heuser

I have downloaded this Library and found that it works well. It has taught me a lot about how to access RIL and other unmanaged code from managed code. I have added a couple of more API calls to RIL including EquipmentInfo and SubscriberNumbers.

As the contest seems quite dead I am publishing the source code of my work. Initially I intended to publish the source code after the winner of the contest was choosen cause it took me 3 days of work to get all the data I needed and to get it better it's just a matter of time and not knowledge anymore. Hope you will make use of it.

RilTest.zip

Link to comment
Share on other sites

Guest Dick Heuser
As the contest seems quite dead I am publishing the source code of my work. Initially I intended to publish the source code after the winner of the contest was choosen cause it took me 3 days of work to get all the data I needed and to get it better it's just a matter of time and not knowledge anymore. Hope you will make use of it.

RilTest.zip

I have spent the last two days working with your RilTest code posted on April 10, 2007 to learn how to access Ril facilities from managed code. It has been extremely helpful. Thank you. The code is excellent and I have learned a lot from it.

It works well on my Cingular 8525 and Blackjack.

I have added calls to EquipmentInfo and SubscriberNumbers. They are both working but I am having some difficulty in figuring out how to handle the Marshalling of the RILADDRESS that is embedded in the RILSUBSCRIBERINFO, ie, a Struct within a Struct. Would you be willing to take a look at what I have done to determine how I should fix it?

Link to comment
Share on other sites

Guest Dick Heuser
As the contest seems quite dead I am publishing the source code of my work. Initially I intended to publish the source code after the winner of the contest was choosen cause it took me 3 days of work to get all the data I needed and to get it better it's just a matter of time and not knowledge anymore. Hope you will make use of it.

RilTest.zip

I have attached the copy of your Riltest code which I have updated adding support for calls to EquipmentInfo and SubscriberNumbers. I was after Serial number and the Subscriber Address or phone number. I am getting that information but I do not know how to preperly handle the RILADDRESS structure that is embedded in the RILSUBSCRIBERINFOstructure. I jury rigged a way around my ignorance but I would love to know the right way to handle this kind of a data structure. Thanks for you terrific code and your help.

RilTest_2007_5_22.zip

Link to comment
Share on other sites

Guest Dick Heuser

I have attached the copy of your Riltest code which I have updated adding support for calls to EquipmentInfo and SubscriberNumbers. I was after Serial number and the Subscriber Address or phone number. I am getting that information but I do not know how to preperly handle the RILADDRESS structure that is embedded in the RILSUBSCRIBERINFOstructure. I jury rigged a way around my ignorance but I would love to know the right way to handle this kind of a data structure. Thanks for you terrific code and your help.

RilTest_2007_5_22.zip

Link to comment
Share on other sites

Guest Dick Heuser
As the contest seems quite dead I am publishing the source code of my work. Initially I intended to publish the source code after the winner of the contest was choosen cause it took me 3 days of work to get all the data I needed and to get it better it's just a matter of time and not knowledge anymore. Hope you will make use of it.

RilTest.zip

I have downloaded this library and found that it works well on both my Cingular 8525 and my Samsung Blackjack.

I have attached the copy of your Riltest code which I have updated adding support for calls to EquipmentInfo and SubscriberNumbers. I was after Serial number and the Subscriber Address or phone number. I am getting that information but I do not know how to preperly handle the RILADDRESS structure that is embedded in the RILSUBSCRIBERINFOstructure. I jury rigged a way around my ignorance but I would love to know the right way to handle this kind of a data structure. Thanks for you terrific code and your help.

RilTest_2007_5_22.zip

Link to comment
Share on other sites

  • 4 weeks later...
Guest Dick Heuser
As the contest seems quite dead I am publishing the source code of my work. Initially I intended to publish the source code after the winner of the contest was choosen cause it took me 3 days of work to get all the data I needed and to get it better it's just a matter of time and not knowledge anymore. Hope you will make use of it.

RilTest.zip

I have developed an app using your Riltest as a guide that gets Cell Tower info and Gets Cell Tower info on Notify of a change. It works quite well for a PocketPC based Phone. However, for a Smartphone it fails on the GetCellTowerInfo but the Notifies work just fine. Do you have any idea from your experience what I might be doing wrong.

Link to comment
Share on other sites

  • 4 weeks later...
Guest b0ris747
post-1-1169067238_thumb.png

We've done Developer Challenges before on MoDaCo and they've always been a great success... so i'm proud to announce another one! This one raises the bar somewhat however :P

...

After some work, I submit my DLL, with C# application and C++ application

The C# side is just a PoC to show it is compatible. The C++ side is more complete, and implements some offset finder, a learning mode and others feats.

You can manually edit the cellguardian.xml file to set a new configuration for your device (which include compatible methods to access CellID Informations, the AT Commands COM port, the offset in memory...)

By default, it will try to determine the best method to use on your device.

On the website you'll see some generated Google Maps made using this application.

http://usuc.dyndns.org/tv/gsm/

Thanks for feedbacks, or new configuration submission.    :)

Link to comment
Share on other sites

  • 5 weeks later...
Guest b0ris747

Nobody tested this one?  sad.... It means NO configuration improvement

The current version has only a few bugs

-offset method only recognizes "ALL" version

-the fieldTest compatible version does not work (no device to try, need some debug traces to determine the structure of the RIL answer)

-Mio devices were not tested, a RIL subclass should be done later

Any way, this application should be able to give cell informations for most HTC devices under WM5.

I'd like someone to try this!

Works on (tested):

Prophet/Wizard: RIL GSMTestMode, Offset, COM Port on COM9:, RIL Notifications and RIL Tower

HP ipaq 6910: Offset

I hope to have some feedbacks!

After some work, I submit my DLL, with C# application and C++ application

The C# side is just a PoC to show it is compatible. The C++ side is more complete, and implements some offset finder, a learning mode and others feats.

You can manually edit the cellguardian.xml file to set a new configuration for your device (which include compatible methods to access CellID Informations, the AT Commands COM port, the offset in memory...)

By default, it will try to determine the best method to use on your device.

On the website you'll see some generated Google Maps made using this application.

http://usuc.dyndns.org/tv/gsm/

Thanks for feedbacks, or new configuration submission.    :)

Link to comment
Share on other sites

  • 5 months later...
  • 3 months later...
Guest abramQ
Hope you will make use of it.

Hello Dan!

I am trying to use your nice work, but please tell me - is it possible to list more than one CellID? I mean like in old CellTrack - where was all visible cells (eight of them as I remember) shown.

Please answer:-)

Thanks in advance!

RA

Link to comment
Share on other sites

  • 3 months later...
  • 1 year later...
Guest pirlouwi
Nobody tested this one? sad.... It means NO configuration improvement

The current version has only a few bugs

-offset method only recognizes "ALL" version

-the fieldTest compatible version does not work (no device to try, need some debug traces to determine the structure of the RIL answer)

-Mio devices were not tested, a RIL subclass should be done later

Any way, this application should be able to give cell informations for most HTC devices under WM5.

I'd like someone to try this!

Works on (tested):

Prophet/Wizard: RIL GSMTestMode, Offset, COM Port on COM9:, RIL Notifications and RIL Tower

HP ipaq 6910: Offset

I hope to have some feedbacks!

Hello,

j'ai testé votre appli GSMCelluloz sur mon HTC Polaris, mais je n'arrive pas à obtenir les infos sur les cellules voisines. La cellule courante oui, mais cette info est déjà présente via ril.dll assez facilement.

A votre avis, existe-t-il une manière simple qui marche pour tous les windows mobile actuellement (Windows Mobile 6.0/6.1/6.5) pour obtenir les infos sur les neighbour cells?

On ne peut que se demander comment fait GoogleMaps pour estimer notre position, et pas celle de la cellule active. Ils ont forcément accès aux données des cellules voisines, et ca marcherait sur plein de mobiles, mais comment font-ils?

Une idée?

Hello

I have tested your appli GSMCelluloz on my HTC Polaris, but I just cant get info of neighbor cells. Only current cell, but this one is easily obtained using ril.dll.

Do you know an easy way for getting this neighbor cells information working on every mobile at the time we speak now ? (Windows Mobile 6.0/6.1/6.5)

I ask myself how GoogleMaps is able to estimate our position (not the one of the active cell). They certainly use neighbor cells info, and it seems to be working on a lot of mobiles. How do they manage that?

Any clue?

Louis

Edited by pirlouwi
Link to comment
Share on other sites


×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.