Commit 75218b55 authored by Jake Read's avatar Jake Read
Browse files

verbose serial port

parent 107b9a0b
......@@ -96,6 +96,7 @@ let findSerialPort = (pid) => {
SerialPort.list().then((ports) => {
let found = false
for (let port of ports) {
console.log(`found ${port.productId}...`)
if (port.productId === pid) {
found = true
resolve(port.path)
......@@ -114,6 +115,7 @@ let opencount = 0
// options: passthrough for node-serialport API
let startSerialPort = (pid, options) => {
serVPort.phy.status = EP.PORTSTATUS.OPENING
console.log(`SERPORT Looking for Serial Port w/ PID ${pid}...`)
findSerialPort(pid).then((com) => {
if (true) console.log(`SERPORT contact at ${com}, opening`)
let port = new SerialPort(com, options)
......@@ -172,7 +174,7 @@ let startSerialPort = (pid, options) => {
console.log(`SERPORT #${pcount} closed`)
})
}).catch((err) => {
if (LOGSER) console.log(`SERPORT cannot find device at ${pid}`, err)
if (true) console.log(`SERPORT cannot find device at ${pid}`, err)
serVPort.phy.status = EP.PORTSTATUS.CLOSED
})
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment