diff --git a/tools/bcs.js b/tools/bcs.js new file mode 100644 index 000000000..9069b82c1 --- /dev/null +++ b/tools/bcs.js @@ -0,0 +1,8 @@ +const bcs = require('../lib/scanner-genmega') +const { argv } = require('node:process'); +const device = argv[2] +bcs.config({ scanner: { device } }) +bcs.scanMainQR('BTC', (res, err) => { + if (res) process.exit(0) + process.exit(1) +}) diff --git a/tools/find-bcs-device.sh b/tools/find-bcs-device.sh new file mode 100644 index 000000000..94a850e89 --- /dev/null +++ b/tools/find-bcs-device.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env sh +for dev in /dev/ttyS*; do + echo "Trying ${dev}" + timeout 5s node tools/bcs.js "${dev}" +done