8
8
import android .net .wifi .WifiConfiguration ;
9
9
10
10
import com .developerfromjokela .motioneyeclient .ui .utils .URLUtils ;
11
+ import com .google .gson .Gson ;
11
12
12
13
import java .io .Serializable ;
13
14
import java .net .Inet4Address ;
@@ -26,7 +27,7 @@ public class Device implements Serializable {
26
27
private String motionVersion = "" ;
27
28
private String osVersion = "" ;
28
29
private ArrayList <Camera > cameras = new ArrayList <>();
29
- private WifiConfiguration wlan ;
30
+ private String wlan ;
30
31
31
32
32
33
public Device (String ID , String deviceName , String deviceUrl , String ddnsURL , String localPort , String DDNSPort , CameraUser user , String motioneyeVersion , String motionVersion , String osVersion , ArrayList <Camera > cameras , WifiConfiguration wlan ) {
@@ -41,7 +42,7 @@ public Device(String ID, String deviceName, String deviceUrl, String ddnsURL, St
41
42
this .motionVersion = motionVersion ;
42
43
this .osVersion = osVersion ;
43
44
this .cameras = cameras ;
44
- this .wlan = wlan ;
45
+ this .wlan = new Gson (). toJson ( wlan ) ;
45
46
}
46
47
47
48
public String getDeviceUrlCombo () {
@@ -132,7 +133,7 @@ public String getID() {
132
133
}
133
134
134
135
public WifiConfiguration getWlan () {
135
- return wlan ;
136
+ return new Gson (). fromJson ( this . wlan , WifiConfiguration . class ) ;
136
137
}
137
138
138
139
public String getPort () {
@@ -148,7 +149,7 @@ public void setPort(String port) {
148
149
}
149
150
150
151
public void setWlan (WifiConfiguration wlan ) {
151
- this .wlan = wlan ;
152
+ this .wlan = new Gson (). toJson ( wlan ) ;
152
153
}
153
154
154
155
public String getDeviceName () {
0 commit comments