You Are Here:

Community: Developer Discussion Boards

#1 Old D211 Rasdial ERROR_PORT_NOT_AVAILABLE - 1970-01-01, 02:00

Join Date: Mar 2003
Posts: 12
Location: Amsterdam
koenjo
Offline
Registered User
I am developing an application on a device with os Windows ce3.0 Handheld PC 2000. My application is depending on a GPRS connection. So i wrote a couple control function in my application. First of all my application checks if there is an GPRS connection active. if not then it starts the connection using RasDial(). But somethimes when my application starts the connection it fails with the following error: ERROR_PORT_NOT_AVAILABLE The strange thing is that the Nokia Manager application tells me there is no GPRS connection active. But when I try to activate the connection it immidiatly pops up with a "disconnected" message following "ready to activate GPRS". But when i try it again, of course it fails again. The only thing I can do is remove the d211 from my device and insert it again to solve the problem. Is this a bug in the nokia driver? Does anybody have had simmilar problems and how did they solved it?

Thanks

Koen

#2 Old RE: D211 Rasdial ERROR_PORT_NOT_AVAILABLE - 1970-01-01, 02:00

Join Date: Mar 2003
Posts: 452
Nokia_D211_Support
Offline
Regular Contributor
Hello,

The activation usually fails if APN is incorrect or if connection requires setting IP address to DNS settings. However, ERROR_PORT_NOT_AVAILABLE sounds like the port was left open in a previous attempt. The RasDial() is a Windows RAS API function. If it is left open you need to ensure it is closed before attempting new connection with Nokia D211 SW. You could try RasDial() by giving it as parameter the phone book entry called 'GPRS' that comes with the D211 SW. Maybe the problem is caused by some entry that has incorrect information. Another alternative might be that something goes wrong when you check the status of active GPRS connection. How do you do the checking?


Best Regards,

Nokia D211 Support

#3 Old RE: D211 Rasdial ERROR_PORT_NOT_AVAILABLE - 1970-01-01, 02:00

Join Date: Mar 2003
Posts: 452
Nokia_D211_Support
Offline
Regular Contributor
Hello,

I don't think reseting the GPRS part will help in this case (Although there might be a command for that in the SDK, I'm don't remember for sure). The problem is more probably in RAS or COM port. Does the GPRS activation work at all? I mean can you activate GPRS when you try to activate connection manually or with some other SW? If this is the case then you need to check that GPRS is activated in your SIM and APN is entered correctly.

Another reason might be that you use you PDA while it is connected to PC through desk stand or serial cable. This causes the device to open connection and parallel connection cannot be opened.

The reason why Nokia D211 SW cannot open connection is because it also uses RasDial(). If you have some hyperterminal SW available for your PDA you might want to try activating attachment and context with AT commands to verify that it succeeds that way. APN must naturally be set beforehand.


Best Regards,

Nokia D211 Support

#4 Old RE: D211 Rasdial ERROR_PORT_NOT_AVAILABLE - 1970-01-01, 02:00

Join Date: Mar 2003
Posts: 452
Nokia_D211_Support
Offline
Regular Contributor
ERROR_PORT_NOT_AVAILABLE indicates that the port may already be open. Have you checked that your program always terminates the connection by calling RasHangUp(). Forgetting to call RasHangUp() might cause such symptoms as you describe. There is also the following remark in the Windows Platform SDK:
"An application should not call RasHangUp and then immediately exit. The connection state machine needs time to properly terminate. If the system prematurely terminates the state machine, the state machine may fail to properly close a port, leaving the port in an inconsistent state. A simple way to avoid this problem is to call Sleep(3000) after returning from RasHangUp; after that pause, the application can exit. A more responsive way to avoid the problem is, after returning from RasHangUp, to call RasGetConnectStatus(hrasconn) and Sleep(0) in a loop until RasGetConnectStatus returns ERROR_INVALID_HANDLE."
Best Regards,
Nokia D211 Support

#5 Old RE: D211 Rasdial ERROR_PORT_NOT_AVAILABLE - 1970-01-01, 02:00

Join Date: Mar 2003
Posts: 452
Nokia_D211_Support
Offline
Regular Contributor
Naturally the best way of testing the case of lost connection would be to cause a real loss of signal, e.g. find an area where the signal is weak and then cover the aerial. The NET service set in the D211 SDK provides functions/messages that could be useful. For example, the REQ_NET_POWEROFF_GSMRADIO turns the GSM phone off (the phone can be restarted only by removing the card).
Best Regards,
Nokia D211 Support
  « Previous Thread | Next Thread »
Display Modes
Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules

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

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Rate This

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia