@lessondesk/marker-protocol
Advanced tools
Comparing version 3.0.2 to 3.0.3
@@ -22,3 +22,3 @@ function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } | ||
Framer.prototype._transform = function _transform (chunk, encoding, cb) { | ||
console.log(chunk); | ||
// console.log(chunk); | ||
var data = Buffer.concat([this.buffer, chunk]); // We need to have atleast 8 bytes in order to determine the message type. | ||
@@ -313,4 +313,3 @@ | ||
Protocol.prototype._transform = function _transform (chunk, encoding, cb) { | ||
console.log(chunk); | ||
//console.log(chunk); | ||
try { | ||
@@ -346,3 +345,3 @@ var data = PARSER.parse(chunk); | ||
this.addMarker = function (port, serial) { | ||
var header = Buffer.from([0xfd, 0xfd, 0xfd, 0x02]); | ||
var header = Buffer.from([0xfd, 0xfd, 0xfd, 0x03, 0x02]); | ||
var payload = Buffer.alloc(4); | ||
@@ -353,14 +352,4 @@ payload.writeUInt8(121, 0); | ||
payload.writeUInt8(0x000000ff & serial, 3); | ||
var packet = Buffer.concat([header, payload]); | ||
port.write(packet); | ||
}; | ||
var packet = Buffer.concat([header, payload]); // console.log('responding with: ', packet) | ||
this.addMarker = function (port, serial) { | ||
var header = Buffer.from([0xfd, 0xfd, 0xfd, 0x02]); | ||
var payload = Buffer.alloc(4); | ||
payload.writeUInt8(121, 0); | ||
payload.writeUInt8((0x00ff0000 & serial) >> 16, 1); | ||
payload.writeUInt8((0x0000ff00 & serial) >> 8, 2); | ||
payload.writeUInt8(0x000000ff & serial, 3); | ||
var packet = Buffer.concat([header, payload]); | ||
port.write(packet); | ||
@@ -380,4 +369,2 @@ }; | ||
parser.on("data", function (packet) { | ||
console.log(packet); | ||
if (packet.type === Packets.MARKER_JOIN) { | ||
@@ -384,0 +371,0 @@ console.log("\nReceived a marker join request, accepting...\n"); |
{ | ||
"name": "@lessondesk/marker-protocol", | ||
"version": "3.0.2", | ||
"version": "3.0.3", | ||
"description": "Lesson Desk Group marker protocol", | ||
@@ -5,0 +5,0 @@ "source": "src/index.js", |
Sorry, the diff of this file is not supported yet
53616
343