From cdc3bd367f4ae367eee5f3acee795893aa65fc88 Mon Sep 17 00:00:00 2001 From: Alwin Arrasyid Date: Sat, 23 Jul 2022 10:20:30 +0700 Subject: [PATCH] add serial port options to daemon --- cli/daemon.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cli/daemon.ts b/cli/daemon.ts index fb7e567..a8391a4 100644 --- a/cli/daemon.ts +++ b/cli/daemon.ts @@ -38,6 +38,8 @@ const baudRateArgvIx = process.argv.indexOf('--baud-rate'); const baudRateArgv = baudRateArgvIx !== -1 ? process.argv[baudRateArgvIx + 1] : undefined; const whichDeviceArgvIx = process.argv.indexOf('--which-device'); const whichDeviceArgv = whichDeviceArgvIx !== -1 ? Number(process.argv[whichDeviceArgvIx + 1]) : undefined; +const serialPortArgvIx = process.argv.indexOf('--port'); +const serialPortArgv = serialPortArgvIx !== -1 ? process.argv[serialPortArgvIx + 1] : undefined; let configFactory: Config; let serial: SerialConnector | undefined; @@ -474,7 +476,7 @@ class SerialDevice extends (EventEmitter as new () => TypedEmitter<{ console.log(' Ingestion:', config.endpoints.internal.ingestion); console.log(''); - let deviceId = await findSerial(whichDeviceArgv); + let deviceId = serialPortArgv || await findSerial(whichDeviceArgv); await connectToSerial(config, deviceId, baudRate, (cleanArgv || apiKeyArgv) ? true : false); } catch (ex) {