Skip to content

Commit 16da901

Browse files
committed
skip unreachable boards due to device_info() being empty
1 parent 071c562 commit 16da901

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

assets/main/home.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import { WebWorkflow } from "../backends/web.js"
1010
import { USBWorkflow } from "../backends/usb.js"
1111
import { BLEWorkflow } from "../backends/ble.js"
1212

13+
const WEB_WORKFLOW_ENABLED = true
1314
const BOARD_PAGE = "html/board-template.html"
1415
var update_timer = null
1516
var update_timer_running = false
@@ -137,7 +138,7 @@ async function giveup_web(e) {
137138

138139
async function detect_web() {
139140
// Web workflow
140-
if(true) {
141+
if(WEB_WORKFLOW_ENABLED) {
141142
// $(".web_workflow").show()
142143
const devices = await WebWorkflow.find_devices()
143144
// candidates
@@ -157,10 +158,14 @@ async function detect_web() {
157158
var wf = new WebWorkflow(board_link)
158159
var did_start = await wf.start()
159160
if(!did_start) {
160-
console.log("SKIP")
161+
console.log("SKIP: no start")
161162
continue
162163
}
163164
const info = await wf.device_info()
165+
if($.isEmptyObject(info)) {
166+
console.log("SKIP: device info not available")
167+
continue
168+
}
164169
var board_identifier = (await wf.get_identifier()).replace(/\.local$/, "")
165170
if(!board_identifier) board_identifier = board_path
166171
const serial = info["serial_num"] || board_identifier

0 commit comments

Comments
 (0)