Commit eb05f9bd authored by Skye Yu's avatar Skye Yu

test:

parent 156a0202
......@@ -717,11 +717,11 @@ Jensen.prototype.getFile = async function (filename, length, ondata, onprogress)
let handler = (msg) => {
if (msg != null) {
flen += msg.body.length || msg.body.byteLength;
let hexString = Array.from(msg.body).map(b => b.toString(16).padStart(2, '0')).join('');
let regex = /4869446f636b564d.*/;
let result = hexString.replace(regex, '');
let data = new Uint8Array(result.match(/.{1,2}/g).map(byte => parseInt(byte, 16)));
ondata(data);
// let hexString = Array.from(msg.body).map(b => b.toString(16).padStart(2, '0')).join('');
// let regex = /4869446f636b564d.*/;
// let result = hexString.replace(regex, '');
// let data = new Uint8Array(result.match(/.{1,2}/g).map(byte => parseInt(byte, 16)));
ondata(msg.body);
// return OK indicates all file blocks received
if (flen >= length) return 'OK';
} else {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment