当ESP8266连接到WiFi网络时,我需要得到通知。
为此,我正在收听WiFi模块中的 public ActionResult ChangeDefaultUserLockingSetting(int PasswordAttempts, int DefaultLockingTime)
{
var defaultAccountSettings = new DefaultAccountSettingsDataContext();
var accountSettings = defaultAccountSettings.DefaultAccountSettings.First(u => u.id == 1);
accountSettings.DefaultAccountLockoutTimeSpan = DefaultLockingTime;
accountSettings.MaxFailedAccessAttemptsBeforeLockout = PasswordAttempts;
defaultAccountSettings.SubmitChanges();
return View("Index", loadAdministrationViewModel());
}
事件。
永远不会调用回调函数。
代码:
connected
输出:
var wifi = require("Wifi");
wifi.on('connected', function(details) {
console.log('connected to wifi', details);
});
wifi.connect("*****", {password:"****"}, function(err){
console.log("connected? err=", err, "info=", wifi.getIP());
});