locked
Forcing a GPRS Connection RRS feed

  • Question

  • Good day

     

    I wonder if someone can help me - I'm at a bit of a loss...

     

    I have VS2005 on VISTA and a Windows Mobile 6 powered Pocket PC Device.

     

    I want to collect user data (bitmaps, gps data, status messages) and send them to a server.

     

    I have the server up and working

     

    I have an app on the Smart Device which connects over my Wireless Network and transfers. It works just fine using TcpClient(IPAddress,Port)

     

    I can connect, send data and disconnect manually and programatically using my WiFi link

     

    However, when the WiFi is not in operation, I would expect my device to automatically connect using GPRS (Naturally I change the IP Address to the public one) But when I try this I cannot connect.

     

    So the questions are:

     

    1) Should Connection Manager automatically route the data via WiFi if present or GPRS if no WiFi?

     

    2) Should I establish a connection first

     

    3) Is there some documentation or CF.NET classes to cover this (I'm not upto speed on P/Invoke)

     

    Thanks

     

    Nigel V Thomas

    Saturday, December 29, 2007 11:30 AM

Answers

  • Craig / Stephen

     

    Using ConnMgrMapURL in cellcore.dll I can force a GPRS connection to become established even if I have WiFi

     

    The code is in 'dirty fingers' mode at the moment, but once I have it clean-up a bit I'll post it

     

    Thanks for your help

     

    Nigel

     

     

    Wednesday, January 2, 2008 4:23 PM

All replies

  • In short yes, the connection manager should route the data request for you when WiFi is not available.

     

    All I can do is recommend that you read about the connection manager.

     

    If you have platform builder or you are a gold partner you have access to the docs and libs to initiate the GPRS data connection in C++ code.

     

    I have not done any Mobile 6 stuff yet so there may be some changes in Mobile 6 I am unaware of.

     

    We use a third party object to manage our connections but I cannot disclose who or what.

     

    I would test that application on a Mobile 5 device and see how it works to see if it is possibly differences in the Mobile 5 and Mobile 6 connection manager.

     

     

     

     

     

     

    Monday, December 31, 2007 3:02 PM
  • Stephen

     

    Thanks for taking the time to reply

     

    From my searches it seems that if you are doing a HTTP request, then yes Connection Manager will deal with the appropriate routing (WiFi/GPRS) however, if you are connecting via TCPClient then, you have to make the connection yourself if you want something other than the currently connected stream

     

    I find it unbelieveable that the CF does not support managed code in order to set the connection method.

     

    Has anyone any other thoughts or workthroughs I could try

     

    Nigel

    Wednesday, January 2, 2008 11:04 AM
  • Although unbelievable it's true.

     

    I spoke extensively with MS people at MEDC last year about this and I have not looked into 2008 yet to see if there is any new connectivity added via managed code.

     

    If you have the PPC2003 SDK docs you can find the connection manager stuff that also shows how to create a connection request but sadly it is unmanaged C++.

     

    We actually wrote an app here to do it to troubleshoot our vendors connectivity issues and found that it was the hardware vendor not the software vendor.

     

    If you find something please post it here for all of us to benefit from.

     

     

     

    Wednesday, January 2, 2008 12:35 PM
  •  

    You could use the State and Notification API to monitor the connections, and then when the wifi goes you can perform a webrequest to forfce the GPRS to connect.

     

    We also use the TCP Client classes and when no connection is available I create a webrequest to www.google.com which will force your gprs to connect.

     

    here is a link to info on the state and notifcation apis, http://fabdecret.blogspot.com/2007/04/state-and-notification-broker-api.html

     

     

    Wednesday, January 2, 2008 2:34 PM
  • Craig / Stephen

     

    Using ConnMgrMapURL in cellcore.dll I can force a GPRS connection to become established even if I have WiFi

     

    The code is in 'dirty fingers' mode at the moment, but once I have it clean-up a bit I'll post it

     

    Thanks for your help

     

    Nigel

     

     

    Wednesday, January 2, 2008 4:23 PM
  • The Connection Manager API is a bit hairy. As the other posts have said using raw sockets does not force a connection. Instead of writing a managed wrapper around the Connection Manager API, have you considered the OpenNETCF's implementation. They have written a managed wrapper in C#.

     

    Wednesday, January 2, 2008 6:48 PM
  • Simon

     

    Yup, the Connection manager API is a bit hairy-scarey but OpenNETCF's solution has a cost involved I believe and it seems a bit lazy to use there wrapper when I could try and write my own.

     

    Cheers

     

    Nigel

     

    Wednesday, January 2, 2008 7:26 PM
  • The cost is if you want the source code of the SDF or want the vs add-ins. Even still, it will cost you a lot more in development time than it would to purchase the SDF, not to mention the SDF has been developed over the last 5 years or so, so is tried and tested matured nicely.

    Wednesday, January 2, 2008 8:03 PM
  • Hi,

    I'm doing a little gps hobby (beginner) project, I've got a little gps tracking device, that i can put in gprs mode via "at" commands sent via sms to it. I need to pass an ip address, apn and port (thus i'll try my sql database ip address, network provider apn and the sql database port #1433) then write some to code to listen to the port, parse the gps nema stream and put into sql, is this correct (conceptually)?

    Thanks

    Mike

     

    Friday, January 4, 2008 7:50 PM
  • Hi

    Could you tell me if your approach "I need to pass an ip address, apn and port (thus i'll try my sql database ip address, network provider apn and the sql database port #1433) then write some to code to listen to the port, parse the gps nema stream and put into sql, is this correct (conceptually)" worked, as i want to do the exact same thing?

     

    Thanks

     

    John

     

    Wednesday, July 23, 2008 11:46 AM