-
-
Notifications
You must be signed in to change notification settings - Fork 748
/
wifiEvents.js
32 lines (31 loc) · 1.06 KB
/
wifiEvents.js
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
// Test ESP32 WiFi event callbacks
var ssid="RASPI3";
var password="password";
var wifi=require("Wifi");
wifi.on("associated", function(details) {
console.log("Event-> associated: " + JSON.stringify(details));
});
wifi.on("connected", function(details) {
console.log("Event-> connected: " + JSON.stringify(details));
});
wifi.on("disconnected", function(details) {
console.log("Event-> disconnected: " + JSON.stringify(details));
});
wifi.on("auth_change", function(details) {
console.log("Event-> auth_change: " + JSON.stringify(details));
});
wifi.on("dhcp_timeout", function(details) {
console.log("Event-> dhcp_timeout: " + JSON.stringify(details));
});
wifi.on("probe_recv", function(details) {
console.log("Event-> probe_recv: " + JSON.stringify(details));
});
wifi.on("sta_joined", function(details) {
console.log("Event-> sta_joined: " + JSON.stringify(details));
});
wifi.on("sta_left", function(details) {
console.log("Event-> sta_left: " + JSON.stringify(details));
});
wifi.connect(ssid, {password: password}, function() {
console.log("Connect completed");
});