wifidirectplugin 1.0.8 → 1.1.0
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.
|
@@ -49,13 +49,13 @@ public class WifiDirectPlugin extends Plugin {
|
|
|
49
49
|
JSONArray devicesJson = new JSONArray();
|
|
50
50
|
for(WifiP2pDevice device: peerWifiDirDevices) {
|
|
51
51
|
try {
|
|
52
|
-
|
|
52
|
+
if(!device.deviceName.toUpperCase().contains("LINKVUE")) continue;
|
|
53
53
|
|
|
54
54
|
JSONObject deviceJson = new JSONObject();
|
|
55
55
|
deviceJson.put("deviceName", device.deviceName);
|
|
56
56
|
deviceJson.put("deviceAddress", device.deviceAddress);
|
|
57
57
|
deviceJson.put("status", device.status);
|
|
58
|
-
|
|
58
|
+
deviceJson.put("connected", device.status == WifiP2pDevice.CONNECTED);
|
|
59
59
|
devicesJson.put(deviceJson);
|
|
60
60
|
} catch (JSONException e) {
|
|
61
61
|
Log.e(TAG, "JSON error: ", e);
|
|
@@ -77,6 +77,7 @@ public class WifiDirectPlugin extends Plugin {
|
|
|
77
77
|
|
|
78
78
|
@PluginMethod
|
|
79
79
|
public void connectToDevice(PluginCall call) {
|
|
80
|
+
Log.d(TAG, "connectToDevice Called");
|
|
80
81
|
String deviceAddress = call.getString("deviceAddress");
|
|
81
82
|
String pin = call.getString("pin");
|
|
82
83
|
|
|
@@ -94,11 +95,14 @@ public class WifiDirectPlugin extends Plugin {
|
|
|
94
95
|
manager.connect(channel, config, new WifiP2pManager.ActionListener() {
|
|
95
96
|
@Override
|
|
96
97
|
public void onSuccess() {
|
|
98
|
+
Log.d(TAG, "connect onSuccess Called");
|
|
97
99
|
call.resolve();
|
|
98
100
|
}
|
|
99
101
|
|
|
100
102
|
@Override
|
|
101
103
|
public void onFailure(int reason) {
|
|
104
|
+
Log.e(TAG, "connect onFailure Called");
|
|
105
|
+
|
|
102
106
|
call.reject("Connection failed: " + reason);
|
|
103
107
|
}
|
|
104
108
|
});
|