|
|
|
|
@ -58,11 +58,13 @@ export class WifiModalComponent implements OnInit {
|
|
|
|
|
|
|
|
|
|
if (isAndroid) {
|
|
|
|
|
console.log("Connecting wifi to mark attendance...");
|
|
|
|
|
this.wifiWizard2.connect(this.ssid, true, this.password, this.algo).then((value) => {
|
|
|
|
|
this.wifiWizard2.connect(this.ssid, true, this.password, this.algo).then(async (value) =>{
|
|
|
|
|
|
|
|
|
|
console.log("Wifi Connected: Verified Access | " + value);
|
|
|
|
|
let ssid_ = await this.wifiWizard2.getConnectedSSID();
|
|
|
|
|
let bssid = await this.wifiWizard2.getConnectedBSSID();
|
|
|
|
|
console.log("Wifi Connected: Verified Access | " + value + " | " + ssid_ + " | " + bssid);
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
this.swipeAttendanceWifi(this.ssid);
|
|
|
|
|
this.swipeAttendanceWifi(bssid);
|
|
|
|
|
},2000);
|
|
|
|
|
|
|
|
|
|
})
|
|
|
|
|
@ -81,7 +83,7 @@ export class WifiModalComponent implements OnInit {
|
|
|
|
|
console.log("Wifi Connected: Verified Access | " + value + " | " + ssid_ + " | " + bssid);
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
this.swipeAttendanceWifi(this.ssid);
|
|
|
|
|
},2000);
|
|
|
|
|
},1000);
|
|
|
|
|
|
|
|
|
|
})
|
|
|
|
|
.catch((err) => {
|
|
|
|
|
@ -121,8 +123,8 @@ export class WifiModalComponent implements OnInit {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
async swipeAttendanceWifi(code:string) {
|
|
|
|
|
this.attendScanService.getDeviceLocation( async (latitude, longitude)=>{
|
|
|
|
|
async swipeAttendanceWifi(code:any) {
|
|
|
|
|
// this.attendScanService.getDeviceLocation( async (latitude, longitude)=>{
|
|
|
|
|
|
|
|
|
|
console.log("Marking attendance to server... at location: "); //+ latitude +","+longitude
|
|
|
|
|
let ip = await this.wifiWizard2.getWifiIP();
|
|
|
|
|
@ -154,13 +156,13 @@ export class WifiModalComponent implements OnInit {
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
this.closeModal();
|
|
|
|
|
this.common.openHome();
|
|
|
|
|
}, 4000);
|
|
|
|
|
}, 6000);
|
|
|
|
|
}else{
|
|
|
|
|
console.log(result);
|
|
|
|
|
this.closeModal();
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
// });
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public closeModal() {
|
|
|
|
|
|