Basic4ppc - Windows Mobile Development  

Go Back   Basic4ppc - Windows Mobile Development > Main Category > Questions & Help Needed
Home Register FAQ Members List Search Today's Posts Mark Forums Read

Questions & Help Needed Post any question regarding Basic4ppc.


Network access


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 02-18-2008, 05:03 PM
Junior Member
 
Join Date: Dec 2007
Posts: 40
Default Network access

Hello all,

I'm trying to use the Network.dll to connect the PDA with a PC in the company network. I need to read/write to a SqLite db in a shared forlder on the PC acting as a server.

The PC as been defined as accepting incoming connection from inside a VPN (but I'm not sure if this is the right configuration: this is the only way I've found to acces the PC using the File Explorer).

Using the Client.GetIP("MA-MASTER-XX") (where MA-MASTER-XX is the PC name) I get the right IP address (192.168.157.57).

Now the question are:
1) how to check if the Wi-Fi is enabled?
2) How to check if the connection is established?

Is someone here that could please give me any input?

Many thanks

Mimmo
Reply With Quote
  #2 (permalink)  
Old 02-19-2008, 01:29 AM
Cableguy's Avatar
Basic4ppc Expert
 
Join Date: Apr 2007
Location: N 41º11'30.30" W 8º39'46.60"
Posts: 1,343
Awards Showcase
Forum Contributer 
Total Awards: 1
Default

the easyest way would be to check the pc folder for a known file...if the file was not found, then the conection was not successfull...
__________________
Paulo Gomes
Porto, Portugal

PC: Dual-Core 1,8Ghz, 2GB RAM, 80GB HD
PPC: Qtek9000, 1GB SD

DLL Version Listing
Reply With Quote
  #3 (permalink)  
Old 02-19-2008, 08:42 AM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 3,199
Default

If Client.GetIP returns the server IP then Wi-Fi is enabled and the network is detected.

Other options to download the file:
- If your server supports FTP or HTTP downloads you could use those.
- Create a small application on the server that waits for the device connection and then sends the file.
See the Chit-Chat and FileTransfer examples: http://www.basic4ppc.com/Downloads.html
Reply With Quote
  #4 (permalink)  
Old 02-19-2008, 09:10 AM
Junior Member
 
Join Date: Dec 2007
Posts: 40
Default

Thanks you Paulo & Erel!

your solution, Erel, is what I was thinking about... just a kind of "service" running on the server and waiting for incoming connection.

What do you think about using the Hardware.dll events
- evNetConnected
- evNetDisconnected
for testing the wi-fi on/off without running an external application with RunAppAtEvent? Could you please suggest any guideline?

Many thanks
Mimmo
Reply With Quote
  #5 (permalink)  
Old 02-19-2008, 09:21 AM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 3,199
Default

These events will fire when the device connects or disconnects to a network.
I don't think thet can help here.

You could use GetIP and if it fails show a message like: "No network was detected. Please make sure that WiFi is enabled."
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
FTP with Network Byak@ Questions & Help Needed 7 09-03-2008 12:06 PM
How to test if network is available? obrienj Questions & Help Needed 4 07-13-2008 05:53 PM
Complex Network Library Example aerohost Questions & Help Needed 5 06-29-2008 01:25 PM
Network Heinz Questions & Help Needed 1 02-24-2008 11:30 AM
network and WEB??? Brian Questions & Help Needed 0 05-05-2007 08:22 AM


All times are GMT. The time now is 02:44 AM.


Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.1.0