Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Mockup & CodeGen, iPhone & iPad
($9.99)

Make your own iPhone apps
and run them live!
(free)

Manu
($0.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum

Thread: Check for Wifi?
View Single Post
Old 03-11-2010, 11:17 AM   #8 (permalink)
Dr.Lightning
Registered Member
 
Join Date: Feb 2010
Posts: 13
Default Reachability doesn't do what I need

I have a similar need, but Reachability doesn't seem to do it.

My app is intended for an iPod Touch connecting via WiFi to an adhoc network created by a WiSnap (Wi-Fi RS-232 serial adapter iPhone Android BlackBerry Windows Symbian) that is essentially a WiFi-to-RS232 adapter. The WiSnap [hosts?] the adhoc network on 169.254.1.1.

I need to be able to tell (1) if the WiSnap is powered up and the adhoc network available, (2) if I can actually reach 169.254.1.1, and (3) if my socket connection is working.

Well, I modified the reachability sample program to go to 169.254.1.1 instead of Apple. I'll describe a scenario where, at some prior time, the iPod was connected to the adhoc WiFi network. I turn both iPod and WiSnap power off. I turn iPod back on. I run Reachability. It says that Rmote Host 169.254.1.1 is "Reachable WiFi". It says the same for TCP/IP routing and local WiFi. This is NOT TRUE. The power is still OFF to the WiSnap. There is NO adhoc network in existence.

When I go to Settings on the iPod and look at WiFi, it still lists the WiSnap on the the main Settings page ("WiSnap-3727" is the adhoc network name). If I touch and go to the Wi-Fi Networks view, there's still a check mark net to WiSnap-3727, but the signal strength icon is almost all grayed out.

So, I believe the Settings program knows there's not actually a connection at the moment. But Reachability doesn't.

To further test, I can change WiFi connections to my office LAN, which is obviously different from the WiSnap. When I do this and subsequently run Reachability, it can still find remote host 169.254.1.1 (this must be some OTHER host on my LAN, not the WiSnap. I'm not worrying about this.) It says TCP/IP routing works. However, for Local WiFi, it says "Access Not Available". This is *indeed* what I *expect*.

Now I change WiFi connections back to the WiSnap. Well, I can't do that without turning the WiSnap on. I do so. I connect with Settings app. I immediately turn WiSnap power back OFF before leaving Settings app. I exist Settings and run Reachability. It thinks I can reach WiSnap. So, it's not going 'far enough' determining reachbility.

IN ADDITION TO ALL THIS, what I really need is for my app to assist the user in switching between TWO different adhoc networks. One is the adhoc network between the iPod and the WiSnap. Another is a hypothetical adhoc between the iPod and a lone Laptop. For test purposes, I can use my office WiFi LAN in lieu of the lone Laptop. Either way, I want my app to be able to SWAP connections between the two networks.
Dr.Lightning is offline   Reply With Quote
 

» Advertisements
» Online Users: 349
20 members and 329 guests
ADY, apatsufas, chemistry, Duncan C, fkmtc, HemiMG, iDifferent, MarkC, marto1914, Meoz, padsoftware, Promo Dispenser, Raffaello, sneaky, sojourner, syver, tathaastu, tgjorgoski, Thrillhouse1919, ziocleto
Most users ever online was 1,187, 10-11-2011 at 08:09 AM.
» Stats
Members: 158,877
Threads: 89,220
Posts: 380,716
Top Poster: BrianSlick (7,129)
Welcome to our newest member, peterkessler45
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 09:48 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.