aboutsummaryrefslogtreecommitdiffstats
path: root/wpadebug/src
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2013-05-04 15:50:48 (GMT)
committerJouni Malinen <j@w1.fi>2013-05-04 15:50:48 (GMT)
commite32547ef4c675788f24d00e4c1ea2c3137d23d9f (patch)
treec901c907f44878142da1dfc337a67264ee6c424a /wpadebug/src
parent0f105f9e5fc58602ee06abe107b1618af17673a6 (diff)
downloadhostap-e32547ef4c675788f24d00e4c1ea2c3137d23d9f.zip
hostap-e32547ef4c675788f24d00e4c1ea2c3137d23d9f.tar.gz
hostap-e32547ef4c675788f24d00e4c1ea2c3137d23d9f.tar.bz2
wpadebug: Add WSC request through Android beam
Signed-hostap: Jouni Malinen <j@w1.fi>
Diffstat (limited to 'wpadebug/src')
-rw-r--r--wpadebug/src/w1/fi/wpadebug/MainActivity.java25
1 files changed, 25 insertions, 0 deletions
diff --git a/wpadebug/src/w1/fi/wpadebug/MainActivity.java b/wpadebug/src/w1/fi/wpadebug/MainActivity.java
index 74e441e..1407932 100644
--- a/wpadebug/src/w1/fi/wpadebug/MainActivity.java
+++ b/wpadebug/src/w1/fi/wpadebug/MainActivity.java
@@ -20,10 +20,14 @@ import android.content.Intent;
import android.content.Context;
import android.content.DialogInterface;
import android.widget.EditText;
+import android.widget.Toast;
import android.util.Log;
import android.net.wifi.WifiManager;
import android.net.wifi.WifiInfo;
import android.net.wifi.WifiConfiguration;
+import android.nfc.NdefMessage;
+import android.nfc.NdefRecord;
+import android.nfc.NfcAdapter;
public class MainActivity extends Activity
{
@@ -180,4 +184,25 @@ public class MainActivity extends Activity
intent.putExtra(EXTRA_MESSAGE, sb.toString());
startActivity(intent);
}
+
+ public void nfcWpsHandoverRequest(View view)
+ {
+ NfcAdapter nfc;
+ nfc = NfcAdapter.getDefaultAdapter(this);
+ if (nfc == null) {
+ Toast.makeText(this, "NFC is not available",
+ Toast.LENGTH_LONG).show();
+ return;
+ }
+
+ NdefMessage msg;
+ msg = new NdefMessage(new NdefRecord[] {
+ NdefRecord.createMime("application/vnd.wfa.wsc",
+ new byte[0])
+ });
+
+ nfc.setNdefPushMessage(msg, this);
+ Toast.makeText(this, "NFC push message (WSC) configured",
+ Toast.LENGTH_LONG).show();
+ }
}