wifidirectplugin 0.0.6 → 0.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -92,6 +92,22 @@ public class WifiDirectPlugin extends Plugin {
|
|
|
92
92
|
};
|
|
93
93
|
|
|
94
94
|
getContext().registerReceiver(receiver, intentFilter);
|
|
95
|
+
|
|
96
|
+
manager.discoverPeers(channel, new WifiP2pManager.ActionListener() {
|
|
97
|
+
@Override
|
|
98
|
+
public void onSuccess() {
|
|
99
|
+
Logger.info("Peer discovery started");
|
|
100
|
+
JSObject ret = new JSObject();
|
|
101
|
+
ret.put("message", "Discovery started");
|
|
102
|
+
call.resolve(ret);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
@Override
|
|
106
|
+
public void onFailure(int reason) {
|
|
107
|
+
call.reject("Peer discovery failed, reason: " + reason);
|
|
108
|
+
getContext().unregisterReceiver(receiver);
|
|
109
|
+
}
|
|
110
|
+
});
|
|
95
111
|
}
|
|
96
112
|
|
|
97
113
|
private void connectToDevice(WifiP2pDevice device, PluginCall call) {
|