@lessondesk/marker-protocol
Advanced tools
Comparing version 3.0.11 to 3.0.12
@@ -367,2 +367,18 @@ function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } | ||
this.markerIsTracked = function (serial) { | ||
var ref = this$1.markers.filter(function (marker) { return marker.serial === serial; }); | ||
var marker = ref[0]; | ||
return marker; | ||
}; | ||
this.updateMarker = function (markerToAdd) { | ||
var marker = markerIsTracked(markerToAdd.serial); | ||
if (!marker) { | ||
this$1.markers.push(markerToAdd); | ||
} else { | ||
Object.assign(marker, markerToAdd); | ||
} | ||
}; | ||
this.markerDump = function (port) { | ||
@@ -377,10 +393,3 @@ port.write(Buffer.from([0xfd, 0xfd, 0xfd, 0x03, 0x06])); | ||
this.handleMarkerInfoResponse = function (packet) { | ||
// Add the marker to our list | ||
var ref = packet.data; | ||
var gtin = ref.gtin; | ||
var serial = ref.serial; | ||
this$1.markers.push({ | ||
gtin: gtin, | ||
serial: serial | ||
}); | ||
this$1.updateMarker(packet.data); | ||
}; | ||
@@ -387,0 +396,0 @@ |
{ | ||
"name": "@lessondesk/marker-protocol", | ||
"version": "3.0.11", | ||
"version": "3.0.12", | ||
"description": "Lesson Desk Group marker protocol", | ||
@@ -5,0 +5,0 @@ "source": "src/index.js", |
Sorry, the diff of this file is not supported yet
60592
411