@signalk/streams 4.4.0 → 4.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/autodetect.js CHANGED
@@ -143,6 +143,12 @@ require('util').inherits(ToTimestamped, Transform)
143
143
  // runs only once, self-assigns the actual transform functions
144
144
  // on first call
145
145
  ToTimestamped.prototype._transform = function (msg, encoding, done) {
146
+ //ignore empty lines in the beginning of the file, encountered in some cases
147
+ if (msg.trim().length === 0) {
148
+ done()
149
+ return
150
+ }
151
+
146
152
  const line = msg.toString()
147
153
  this.multiplexedFormat =
148
154
  line.length > 16 && line.charAt(13) === ';' && line.split(';').length >= 3
package/gpiod-seatalk.js CHANGED
@@ -6,7 +6,7 @@
6
6
  * You may obtain a copy of the License at
7
7
  *
8
8
  * http://www.apache.org/licenses/LICENSE-2.0
9
-
9
+
10
10
  * Unless required by applicable law or agreed to in writing, software
11
11
  * distributed under the License is distributed on an "AS IS" BASIS,
12
12
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -25,7 +25,7 @@ const Execute = require('./execute')
25
25
  const cmd = `
26
26
  import gpiod, sys, datetime, glob
27
27
 
28
- ST_PIN = 20
28
+ ST_PIN = 4
29
29
 
30
30
  ST_INVERT = 0 # 0=idle high, 1=idle low
31
31
  ST_BITS = 9
@@ -318,9 +318,13 @@ class st1rx:
318
318
 
319
319
  if __name__ == "__main__":
320
320
  gpio = ST_PIN
321
- if len(sys.argv) > 1:
321
+ if len(sys.argv) > 1 and isinstance(sys.argv[1], str) and sys.argv[1][:4]=="GPIO":
322
322
  # Gpio, info as "GPIOnn", from GUI setup. Sensing the seatalk1 (yellow wire)
323
- gpio = int("".join(filter(str.isdigit, sys.argv[1])))
323
+ try:
324
+ gpio = int(sys.argv[1][4:])
325
+ except:
326
+ pass
327
+
324
328
  pol = ST_INVERT
325
329
  if len(sys.argv) > 2:
326
330
  # Invert, inverted input from ST1, selected in the GUI
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@signalk/streams",
3
- "version": "4.4.0",
3
+ "version": "4.4.1",
4
4
  "description": "Utilities for handling streams of Signal K data",
5
5
  "main": "index.js",
6
6
  "scripts": {