0
When you require to make use of a ad-hoc configured AP/device to connect with, the default Android Wifi Manager ignores ad-hoc networks.

There's a few ways to fix this:

* MOD Android Framework to support ad-hoc networks
Some ROMs have this, have no clue how to fix that in the framework yet.

* MOD Android Framework to support ad-hoc networks
* By hand configure the wpa_supplicant to connect to an ad-hoc network
* Patch the wpa_supplicant to pretend that ad-hoc networks are regular access points

Ad-hoc (IBSS) entries are filtered out from the scan results reported by the wpa_supplicant.

* By hand configure the wpa_supplicant to connect to an ad-hoc network
The trick is to make use of the wpa-supplication settings file to force the driver to go to ad-hoc mode. By the default the tiwlan cmd line utility does not understand ad-hoc mode:

A more crazy way to do this is to increase the wpa_supplicant to masquerade ad-hoc networks as regular infrastructure access points (APs). This makes changes only to the wpa_supplicant and allows a drop in replacement on rooted rings.

To add ad-hoc network support could increase the WifiStateTracker to not filter IBSS entries out and set the wpa_supplicant in AP_SCAN two mode to establish new IBSS in lieu of associating with a scanned. That would need fiddling with the Java framework on the phone.

two. go to wpa_cli command shell:
EXE: su -c "/system/bin/wpa_cli -p /data/misc/wifi/"

one. turn on Wi-Fi and start the adb shell

four. EXE: add_network

three. EXE: scan_results

five. add a new network. Shows a number. Here the example number is "2"

EXE:
set_network two mode one
set_network two ssid "MYADHOC"
set_network two bssid 00:ef:ee:ba:be:f0
set_network two frequency 2457
set_network two key_mgmt NONE
enable_network two

7. EXE: select_network two

6. EXE: ap_scan two

* Patch the wpa_supplicant to pretend that ad-hoc networks are regular access points

The patch below modifies the wpa_supplicant code in the external/wpa_supplicant AOSP repo to make ad-hoc networks appear as regular APs with a (*) prefix.

* removes the [IBSS] flag from scan results,
* masquerades and demasquerades ad-hoc ssid with (*) prefix
* sets mode one (ad-hoc) if the ssid is for IBSS
* permits the supplicant to choose an IBSS when associating to a given ssid

Download the patch (by SZYM): http://szym.net/2010/12/adhoc-wifi-in-android/ - http://szym.net/android/wpa_supplicant-ibss.patch

Post a Comment Blogger

 
Top