From 37bfcf19a1fda6f2314ad3b1a5c10b28037b2649 Mon Sep 17 00:00:00 2001 From: Nebz <28622481+NebzHB@users.noreply.github.com> Date: Sun, 8 Mar 2020 09:10:56 +0100 Subject: [PATCH] Fix Buffer Constructor depreciated use --- alexa-wsmqtt.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/alexa-wsmqtt.js b/alexa-wsmqtt.js index 062a1763..086d8693 100755 --- a/alexa-wsmqtt.js +++ b/alexa-wsmqtt.js @@ -75,7 +75,7 @@ class AlexaWsMqtt extends EventEmitter { }, 30000); // tell Tuning Service that we support "A:H" protocol = AlphaPrococol - const msg = new Buffer('0x99d4f71a 0x0000001d A:HTUNE'); + const msg = Buffer.from('0x99d4f71a 0x0000001d A:HTUNE'); //console.log('SEND: ' + msg.toString('ascii')); this._options.logger && this._options.logger('Alexa-Remote WS-MQTT: Initialization Msg 1 sent'); this.websocket.send(msg); @@ -138,7 +138,7 @@ class AlexaWsMqtt extends EventEmitter { else { this._options.logger && this._options.logger('Alexa-Remote WS-MQTT: Unexpected Response: ' + JSON.stringify(message)); } - let msg = new Buffer('0xa6f6a951 0x0000009c {"protocolName":"A:H","parameters":{"AlphaProtocolHandler.receiveWindowSize":"16","AlphaProtocolHandler.maxFragmentSize":"16000"}}TUNE'); + let msg = Buffer.from('0xa6f6a951 0x0000009c {"protocolName":"A:H","parameters":{"AlphaProtocolHandler.receiveWindowSize":"16","AlphaProtocolHandler.maxFragmentSize":"16000"}}TUNE'); //console.log('SEND: ' + msg.toString('ascii')); this.websocket.send(msg); //msg = new Buffer('MSG 0x00000361 0x0e414e45 f 0x00000001 0xd7c62f29 0x0000009b INI 0x00000003 1.0 0x00000024 ff1c4525-c036-4942-bf6c-a098755ac82f 0x00000164d106ce6b END FABE');