Re: Which framework for Wifi?

2008-05-28 Thread Peter Burtis

On May 27, 2008, at 11:28 PM, J. Scott Tury wrote:

And in 10.5.2 the -x command line option does not work at all


Hrm... That's odd and disturbing.  But not *quite* true. :)

I'm using 'airport -x -s' in my little network jumper app to list  
networks in range, which--I just checked--*does* still give XML plist  
output in 10.5.2.  So it's not completely gone.


But like you say, the -x flag seems to be gone for everything else  
now.  I hadn't noticed that.  (Was it ever there? I can't remember  
ever playing with it although I'm sure I must have.)


*Sigh* The wonderful world of hacking around where you're not welcome.

-Pete
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Which framework for Wifi?

2008-05-27 Thread Howard Shere


Which Apple framework would I use to interact with the wireless  
settings? I need to be able to get a list of the current visible  
networks, change networks, etc. from within my app.


Howard Shere
http://www.livejournal.com/users/realgreendragon/
Altair 8800a to Mac OS X so far...


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: Which framework for Wifi?

2008-05-27 Thread Ken Thomases

On May 27, 2008, at 5:25 PM, Howard Shere wrote:


Which Apple framework would I use to interact with the wireless  
settings? I need to be able to get a list of the current visible  
networks, change networks, etc. from within my app.


The System Configuration framework: http://developer.apple.com/ 
documentation/Networking/Conceptual/SystemConfigFrameworks/


Although I'm not certain it allows you to get a list of the current  
visible networks.  At least it's a starting point for that sort of  
thing.


Cheers,
Ken
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: Which framework for Wifi?

2008-05-27 Thread Peter Burtis

There is a private command line utility at the path:

/System/Library/PrivateFrameworks/Apple80211.framework/Versions/ 
Current/Resources/airport


Calling it with NSTask works.  If there's a better way I'd love to  
know it.


It will give XML output with the right flag (-x) so it's quite  
useable.  You can use it to check network signal levels and get a list  
of visible networks, you can join networks, create WPA keys from  
passwords, restore user settings (which never quite works, when I do  
it), etc. All the documentation that I know of that exists for this  
utility can be found by calling it with the -h flag:




 -z--disassociate   Disassociate from any network
 -i[arg] --ibss=[arg]   Create IBSS
 -x--xmlPrint info as XML
 -s[arg] --scan=[arg]   Perform a wireless broadcast scan.
   Will perform a directed scan if the optional 
arg is provided
 -rarg   --repeats=arg  Repeat the command the specified  
number of times

 -A[arg] --associate=[arg]  Associate to network.
   Will prompt for network name if arg is not 
specified
   and if necessary, for a password if the network is using WEP  
or WPA.
   The following additional arguments may be specified with this  
command:
  --bssid=arg Specify BSSID to  
associate with
  --password=arg  Specify a WEP  
key or WPA password
 -I--getinfoPrint current wireless status, e.g.  
signal info, BSSID, port type etc.
 -Parg   --psk=arg  Create PSK from specified pass  
phrase and SSID.
   The following additional arguments must be specified with  
this command:
  --ssid=arg  Specify SSID  
when creating a PSK

 -c[arg] --channel=[arg]Set arbitrary channel on the card
 -h--help   Show this help





 Which is to say, there's no real documentation that I know of.

-Pete


On May 27, 2008, at 6:25 PM, Howard Shere wrote:



Which Apple framework would I use to interact with the wireless  
settings? I need to be able to get a list of the current visible  
networks, change networks, etc. from within my app.


Howard Shere
http://www.livejournal.com/users/realgreendragon/
Altair 8800a to Mac OS X so far...


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/pete 
%40glossysheep.com


This email sent to [EMAIL PROTECTED]


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: Which framework for Wifi?

2008-05-27 Thread J. Scott Tury

There is a private command line utility at the path:

/System/Library/PrivateFrameworks/Apple80211.framework/Versions/
Current/Resources/airport


One word of warning about using this utility:  it's output seems to  
change between OS builds (at least major ones)...  So be prepared to  
update this code, and test it on different OS versions.


I've noticed the output is actually different for certain values  
between 10.4 and 10.5.  And in 10.5.2 the -x command line option does  
not work at all, so you'll have to write a parser for the output.   
But then again it's probably the most supported utility you have  
available to you at this point in time.


If this utility isn't enough for you, you can try the alternative,  
which is to see what other projects use to get this information.  One  
good project to lookup would be MacStumbler.  They have a header  
(Apple80211.h) which may prove useful to you.


Scott Tury



___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]