From baa28c31d4ee887abf638152433ab398b2e4a3b8 Mon Sep 17 00:00:00 2001 From: Mashintime Date: Fri, 10 Feb 2023 20:08:36 -0500 Subject: [PATCH] Remove comment and simplify sendMessage --- gui/sock.js | 21 +-------------------- 1 file changed, 1 insertion(+), 20 deletions(-) diff --git a/gui/sock.js b/gui/sock.js index a23dd99f..19c9f415 100644 --- a/gui/sock.js +++ b/gui/sock.js @@ -535,26 +535,7 @@ exports.sendFile = function(dxcallsign, mode, frames, filename, filetype, data, // Send Message exports.sendMessage = function(dxcallsign, mode, frames, data, checksum, uuid, command) { - //socketLog.info(data) - - // Disabled this here - // convert message to plain utf8 because of unicode emojis - //data = utf8.encode(data) - - //socketLog.info(data) - //shorten uuid - - var datatype = "m" - data = datatype + split_char + command + split_char + checksum + split_char + uuid + split_char + data - //socketLog.info(data) - console.log(data) - - console.log("CHECKSUM" + checksum) - //socketLog.info(btoa(data)) - //data = btoa(data) - data = btoa_FD(data); - - //command = '{"type" : "arq", "command" : "send_message", "parameter" : [{ "dxcallsign" : "' + dxcallsign + '", "mode" : "' + mode + '", "n_frames" : "' + frames + '", "data" : "' + data + '" , "checksum" : "' + checksum + '"}]}' + data = btoa_FD("m" + split_char + command + split_char + checksum + split_char + uuid + split_char + data); command = '{"type" : "arq", "command" : "send_raw", "uuid" : "'+ uuid +'", "parameter" : [{"dxcallsign" : "' + dxcallsign + '", "mode" : "' + mode + '", "n_frames" : "' + frames + '", "data" : "' + data + '", "attempts": "15"}]}' socketLog.info(command) socketLog.info("-------------------------------------")