Skip to content

Commit 420eaaa

Browse files
authored
docs: update select-serial-port example (electron#26992)
1 parent 998f17e commit 420eaaa

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

docs/api/session.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -215,15 +215,15 @@ app.whenReady().then(() => {
215215
enableBlinkFeatures: 'Serial'
216216
}
217217
})
218-
win.webContents.session.on('select-serial-port', (event, portList, callback) => {
218+
win.webContents.session.on('select-serial-port', (event, portList, webContents, callback) => {
219219
event.preventDefault()
220220
const selectedPort = portList.find((device) => {
221-
return device.vendorId === 0x2341 && device.productId === 0x0043
221+
return device.vendorId === '9025' && device.productId === '67'
222222
})
223223
if (!selectedPort) {
224224
callback('')
225225
} else {
226-
callback(result1.portId)
226+
callback(selectedPort.portId)
227227
}
228228
})
229229
})

0 commit comments

Comments
 (0)