PDA

View Full Version : isDeviceUsingWifi? deviceIPAddress??




DaveGee
Jul 28, 2008, 08:31 AM
Okay this might be simple they might not... and they might just be the same routines that I'd use in a normal Cocoa application but here goes...

Does anyone know code that can tell me:

- If the device is currently connected to wifi (aka not using cell-data)?

- What the device IP address is (again for wifi - not for cell-data)?

I'm writing a program that need to talk to a specific piece of hardware that can only be connect to if you are on the same network as *it*... Aka you can't talk to it if you are going over the internet (even if you could I wouldn't want feature to work at the moment).

Any ideas?

Dave



kainjow
Jul 28, 2008, 09:25 AM
- If the device is currently connected to wifi (aka not using cell-data)?

On the iPhone Dev Center there is a how-to: "Determine whether the currently active network connection is Wi-Fi or cellular?"

- What the device IP address is (again for wifi - not for cell-data)?

NSHost

DaveGee
Jul 28, 2008, 10:21 PM
On the iPhone Dev Center there is a how-to: "Determine whether the currently active network connection is Wi-Fi or cellular?"



NSHost

Ugh... NSHost dunno what I was thinking... :lol:

And thanks for the heads up to the sample code I keep forgetting to check that stuff time and time again.. it actually has some fairly good stuff and it seems to be fairly well maintained...

Dave