-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathTestModule.js
More file actions
39 lines (31 loc) · 909 Bytes
/
TestModule.js
File metadata and controls
39 lines (31 loc) · 909 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import wifidetails from './wificonnection/index';
import Location from './Location/index';
import DeviceDetail from './device/index';
import wifilist from './wifilist/index';
async function getWifi() {
let connection = "";
await wifidetails.fetch().then(conn => {
if (conn !== undefined) {
connection = conn;
}
});
return connection;
}
async function getLocation() {
let location = "";
await Location.getCurrentPosition({ enableHighAccuracy: true, timeout: 15000 })
.then(loc => {
location = loc;
}).catch(err => {
console.log("TCL: getLocation -> err", err)
})
return location;
}
async function getAddress() {
let device = "";
await DeviceDetail.getMacAddress().then(res => {
device = res;
});
return device;
}
export default { getWifi, getLocation, getAddress, wifilist }