Closed mitchmitchell closed 1 year ago
The code below does not work correctly because the typeof data.data is object not string -- this results in errors from the parser being passed on when the string "# logresp verified, server ..." is received.
ws.onmessage = function(data, flags, number) { console.debug(`${new Date().toISOString()} ws.onmessage data.data=${data.data}`); node.status({fill: 'blue', shape: 'dot', text: 'Receiving'}); if (typeof data.data === 'string' && data.data.startsWith('# ')) { if (data.data.includes('verified')) { node.status({fill: 'green', shape: 'dot', text: 'Connected'}); } } else { node.send({'payload': aprs_parser.parse(`${data.data}`)}); } };
The code below does not work correctly because the typeof data.data is object not string -- this results in errors from the parser being passed on when the string "# logresp verified, server ..." is received.