Skip to content

Commit 76aaff7

Browse files
committed
Dont support wifi commandsfor non-wifi devices
1 parent 547e197 commit 76aaff7

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/lib/wifi-control-request.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,10 +103,15 @@ module.exports = class WiFiControlRequest {
103103
this.device = await usbUtils.getOneUsbDevice({ api: this.api, idOrName: this.deviceId, ui: this.ui });
104104
const deviceGen = platformForId(this.device.platformId).generation;
105105
const platformName = platformForId(this.device.platformId).name;
106+
const features = platformForId(this.device.platformId).features;
106107
this.deviceId = this.device._id;
108+
if (features.includes('wifi') === false) {
109+
throw new Error(`The current device (${this.deviceId} / ${platformName})does not support Wi-Fi.${os.EOL}`);
110+
}
107111
if (deviceGen < WIFI_COMMANDS_SUPPORTED_DEVICE_GEN) {
108112
throw new Error(`The 'particle wifi' commands are not supported on this device (${this.deviceId} / ${platformName}).${os.EOL}Use 'particle serial wifi' instead.${os.EOL}`);
109113
}
114+
110115
}
111116
return await fn();
112117
} catch (error) {

0 commit comments

Comments
 (0)