Comparing version 2.0.0 to 2.0.1
import SerialPort from 'serialport'; | ||
import { Subject } from 'rxjs'; | ||
export interface SerialDataEvent { | ||
arduino: string; | ||
pinType: 'digital' | 'analog'; | ||
@@ -5,0 +6,0 @@ pin: number; |
@@ -53,2 +53,3 @@ "use strict"; | ||
const event = { | ||
arduino: this.name, | ||
pinType: 'digital', | ||
@@ -55,0 +56,0 @@ pin, |
@@ -83,3 +83,3 @@ "use strict"; | ||
iocpToPin[cc.iocp] = cc.pin; | ||
pinToIOCP[cc.pin] = cc.iocp; | ||
pinToIOCP[`${cc.arduino}::${cc.pin}`] = cc.iocp; | ||
pinToDevice[cc.pin] = cc.arduino || ''; | ||
@@ -95,3 +95,3 @@ iocpToName[cc.iocp] = kk; | ||
const handleArduinoEvent = (ee) => { | ||
const iocpVariable = pinToIOCP[ee.pin]; | ||
const iocpVariable = pinToIOCP[`${ee.arduino}::${ee.pin}`]; | ||
if (iocpVariable) { | ||
@@ -108,3 +108,3 @@ exports.setValue(iocpVariable, parseInt(`${ee.value}`)); | ||
.filter(cc => cc.type === 'led' || cc.type === 'gauge') | ||
.map(cc => pinToIOCP[cc.pin]) | ||
.map(cc => pinToIOCP[`${cc.arduino}::${cc.pin}`]) | ||
.filter(cc => !!cc); | ||
@@ -111,0 +111,0 @@ iocpClient.addVariableSubscriptions(iocpVariableSubscriptions, (iocpVariable, value) => __awaiter(void 0, void 0, void 0, function* () { |
{ | ||
"name": "lba-cli", | ||
"version": "2.0.0", | ||
"version": "2.0.1", | ||
"author": "Lebronaire", | ||
@@ -5,0 +5,0 @@ "repository": "https://github.com/lebronaire/flight-control-system/tree/main/packages/cli", |
@@ -10,2 +10,3 @@ import SerialPort from 'serialport'; | ||
export interface SerialDataEvent { | ||
arduino: string; | ||
pinType: 'digital' | 'analog'; | ||
@@ -67,2 +68,3 @@ pin: number; | ||
const event: SerialDataEvent = { | ||
arduino: this.name, | ||
pinType: 'digital', | ||
@@ -69,0 +71,0 @@ pin, |
@@ -10,3 +10,3 @@ import { getConfig } from '../config'; | ||
let store: ControlsStore = {}; | ||
let pinToIOCP: { [pin: number]: number } = {}; | ||
let pinToIOCP: { [arduinoPin: string]: number } = {}; | ||
let pinToDevice: { [pin: number]: string } = {}; | ||
@@ -63,3 +63,3 @@ let iocpToPin: { [iocpVariable: number]: number } = {}; | ||
iocpToPin[cc.iocp] = cc.pin; | ||
pinToIOCP[cc.pin] = cc.iocp; | ||
pinToIOCP[`${cc.arduino}::${cc.pin}`] = cc.iocp; | ||
pinToDevice[cc.pin] = cc.arduino || ''; | ||
@@ -77,3 +77,3 @@ iocpToName[cc.iocp] = kk; | ||
const handleArduinoEvent = (ee: SerialDataEvent) => { | ||
const iocpVariable = pinToIOCP[ee.pin]; | ||
const iocpVariable = pinToIOCP[`${ee.arduino}::${ee.pin}`]; | ||
@@ -93,3 +93,3 @@ if (iocpVariable) { | ||
.filter(cc => cc.type === 'led' || cc.type === 'gauge') | ||
.map(cc => pinToIOCP[cc.pin]) | ||
.map(cc => pinToIOCP[`${cc.arduino}::${cc.pin}`]) | ||
.filter(cc => !!cc); | ||
@@ -96,0 +96,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
95516
1612