I am trying to get the list of available Wireless Networks available and their signal strength. I am trying to use Apple80211Scan Private APIs and using an iOS 7 device (not jail-breaken). So far successful in getting currently connected network's information using Apple80211GetInfoCopy. However the scan API doesn't work. The return code by this method is 1.
I looked at the error codes for the 80211 Scan APIs listed # http://code.google.com/p/iphone-wireless/wiki/Apple80211Scan. However 0 and -1 is alone discussed. Has any one tried this on iOS7. Any help is appreciated.
Apple80211Scan will not work on a non jailbroken device due to sandboxing. The return value of 1 signifies that it was unable to scan the network, and the reason why is because Apple simply does not allow you to do this in a sandboxed environment. The only you can use Apple80211Scan is by jailbreaking and installing your app in /Applications on the device to remove the sandboxing.
Related
I have a BLE peripheral running on Raspberry Pi with gobbledegook.
In parallel, I have an iOS app working as BLE central which does a scanForPeripheralsWithServices with nil in order to detect all the devices around.
I'm able to detect a few devices, but not the one running on Raspberry Pi.
However, when scanning with the nRF Connect app on iOS, I'm able to see it.
How is that possible? (I assume that nRF Connect is also using Core Bluetooth...)
You're likely doing something (such as using the nRF Connect app) to connect to the device, causing it to stop advertising. Most BLE platforms stop advertising when they are connected to.
Use retrieveConnectedPeripherals(withServices:) to detect devices that are already connected. You must provide a list of services; there is no way to detect all devices currently connected.
Since this is on a Pi, you can also verify on that side whether the system is really currently advertising and whether it has any connections. Core Bluetooth does extensive caching, which can lead to things appearing to be happen that actually are coming out of cache. I haven't recently dug into the nRF app to verify how much it relies on the cache. I recommend also testing with LightBlue, and testing with multiple devices simultaneously (I typically use multiple apps on iOS, Android, and Mac, and occasionally an Ubertooth, to verify what I'm seeing is true).
Note also that once you've seen an advertisement from a device once, you won't see any more during that scan unless you set CBCentralManagerScanOptionAllowDuplicatesKey to true in you scan options. That flag is ignored in the background. This probably isn't the issue in this case, but often trips people up who are used to other platforms. Similarly it is almost always faster and more reliable to scan for specific services rather than nil unless you're building a generic BLE scanner. (Again, I doubt that's the problem in this case.)
As far as I know it's not possible to scan for hotspots in range and read their bssid and signal strengths. This was possible on iOS 4 by using private APIs and not longer possible on iOS 5 without jailbreak. Even if it were possible, the app would be rejected on the App Store. Is that right?
One company that has an indoor positioning system is claiming they can develop this system in iOS. I know for a fact they are scanning for hotspots and signal strengths and then triangulating the signal on their current Android app.
Are there any alternatives I am missing? Their claiming sounds impossible to me but I would love to hear from the people here. I would like to be ready when they demo (although I am expecting a jailbreak or some kind of mock up)
As far as i know this can still be done (using private APIs, of course) by MobileApple80211 framework.
Stumbler code is a good source of information on how to use this framework.
For iOS 5 you'll need a jailbroken iPhone. Guvener Gokce has a very educational blog post on this: iPhone Wireless Scanner iOS5
Just to update the answer: The MobileApple80211 framework has been replaced by MobileWifi.framework. You will need a jailbroken device (supposedly it can't be done using just private API's, hence on a development/enterprise non-jailbroken device).
I'm trying to create an app that scans available wifi networks and if it is available accesses.
It's possible?
iOS 5 it is possible to scan the network list using private API on a jailbroken device only. This blog post states the following:
Last year Apple has blocked wifi scanners from App Store, however till
iOS5 it was still available for private usage via WiFiManager bundle.
In iOS5, WifiManager bundle no more exists however 80211 functions are
still available via IPConfiguration bundle.
The API you linked provides an open-source tool Stumbler which seems like something you were seeking. The tool is claimed to work under iOS 5.
I've been banging my head against this for the last week or so. I've already gone through the following resources:
StackOverflow: Bonjour over bluetooth WITHOUT Gamekit ? (3844189)
StackOverflow: How does Bonjour Over Bluetooth Work (3350094)
StackOverflow: Using iOS GameKit's “Bluetooth Bonjour” with other platforms (8070998)
Technical Q&A QA1753 -- Apple Developer
WiTap sample application
SRVResolver sample application
DNSSDObjects sample application
I'm using Mac OS 10.7, Xcode 4.5, an iPhone 4 with iOS 6, and an iPad 1 with iOS 5.1.1.
My problem is this: I am modifying an application that currently uses GameKit's peer picker to connect between an iPad and a iP{hone|od touch}. We want to modify this to use Bonjour over Bluetooth instead because we've had issues with reconnecting the devices using Gamekit if the connection is lost. I've used dns_sd.h API to some success and have gotten the service to advertise and resolve over wifi, but even though I am passing kDNSServiceFlagsIncludeP2P I am not getting any success over bluetooth.
I thought possibly Bluetooth Bonjour need a PAN established between devices already, but even pairing the iPad to the iMac and browsing for DNS-SD services gives me nothing...and the iPhone won't pair to the iPad anyway.
I just finished solving this in my own app in the last 24 hours. I used the core classes from the OS X sample app DNSSDObjects. I only had to change three lines of code to add support for bluetooth. This works great in my iOS app.
In DNSSDBrowser.m, the call to DNSServiceBrowse needs to have kDNSServiceFlagsIncludeP2P passed in for the 2nd parameter.
In DNSSDRegister.m, the call to DNSServiceRegister needs the same change.
In DNSSDService.m, the call to DNSServiceResolve also needs the same change.
If you want to limit yourself to just bluetooth, and not WiFi, then the same three lines of code should be updated so the 3rd parameter is kDNSServiceInterfaceIndexP2P instead of kDNSServiceInterfaceIndexAny.
Indeed, it looks like the kDNSServiceInterfaceIndexP2P flag won't work on OSX.
If you run the code on IOS, you'll notice that Bonjour will publish two IP Adresses: one for your local WiFi network, and an 169.xx.xx.xx adress for Bluetooth.
The same code on OSX never publishes the 169.xx.xx.xx adress, so it's only found over WiFi.
I am trying to find whether the private APIs listed at: http://code.google.com/p/iphone-wireless/wiki/Apple80211Functions still work with iOS 4.0 and above. I am trying to turn the wifi ON, scan the networks available and latch on to one of the networks. I am not going to put the application in appStore and it is just an experiment. I found many applications pulled down from the appStore but they seem to have been developed on iOS versions less than 3.0. I would also like to get an example if possible.
Please Help.
I needed the same thing as you, and after some research I must say that starting from iOS 5 it is possible to scan the network list using private API on a jailbroken device only. This blog post states the following:
Last year Apple has blocked wifi scanners from App Store, however till iOS5 it was still available for private usage via WiFiManager bundle.
In iOS5, WifiManager bundle no more exists however 80211 functions are still available via IPConfiguration bundle.
The API you linked provides an open-source tool Stumbler which seems like something you were seeking. The tool is claimed to work under iOS 5.
Tried stumbler for iOS5 via linking to framework
/System/Library/SystemConfiguration/IPConfiguration.bundle/IPConfiguration
I could link to Apple80211Open, Apple80211BindToInterface, Apple80211Scan. However, I only receive empty WiFi scan results on jailbroken iPhone4S / iOS 5.1.1
The folks from WifiFofum did a good job and have a app on cydia which runs on JB iOS 5.1.1 and does an excellent job for scanning WiFi networks (BSSID, link level, SSID, channels, ...).