Skip to content

Commit

Permalink
Configure wifi over serial for particle-serial-wifi
Browse files Browse the repository at this point in the history
  • Loading branch information
keeramis committed May 20, 2024
1 parent 6a0eb44 commit d137755
Showing 1 changed file with 4 additions and 17 deletions.
21 changes: 4 additions & 17 deletions src/cmd/serial.js
Original file line number Diff line number Diff line change
Expand Up @@ -532,25 +532,12 @@ module.exports = class SerialCommand extends CLICommandBase {
throw new VError('The device does not support Wi-Fi');
}

// if device's firmware version is less than 6.0.0, use the old way
const fwVer = device.firmwareVersion;
if (semver.lt(fwVer, '6.0.0')) {
// configure serial
if (file){
return this._configWifiFromFile(deviceFromSerialPort, file);
} else {
return this.promptWifiScan(deviceFromSerialPort);
}
// configure serial
if (file){
return this._configWifiFromFile(deviceFromSerialPort, file);
} else {
const wifiControlRequest = new WifiControlRequest(deviceFromSerialPort.deviceId, {
file,
ui: this.ui,
newSpin: this.newSpin,
stopSpin: this.stopSpin
});
await wifiControlRequest.configureWifi();
return this.promptWifiScan(deviceFromSerialPort);
}

}

_configWifiFromFile(device, filename){
Expand Down

0 comments on commit d137755

Please sign in to comment.