1
0
mirror of https://github.com/Ylianst/MeshAgent synced 2025-12-15 07:43:50 +00:00

From Ylian:

Changed new Buffer to Buffer.alloc
Fixed Base64 encoding
Updated copyright
Updated meshcmd
This commit is contained in:
Bryan Roe
2019-03-27 15:06:04 -07:00
parent 31be55c945
commit 9db8b4d349
8 changed files with 178 additions and 153 deletions

View File

@@ -1,5 +1,5 @@
/* /*
Copyright 2018 Intel Corporation Copyright 2018-2019 Intel Corporation
Licensed under the Apache License, Version 2.0 (the "License"); Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. you may not use this file except in compliance with the License.
@@ -256,7 +256,7 @@ function amt_heci() {
var optional = []; var optional = [];
for (var i = 2; i < arguments.length; ++i) { optional.push(arguments[i]); } for (var i = 2; i < arguments.length; ++i) { optional.push(arguments[i]); }
var data = new Buffer(4); var data = Buffer.alloc(4);
data.writeUInt32LE(handle, 0); data.writeUInt32LE(handle, 0);
this.sendCommand(0x2D, data, function (header, fn, opt) { this.sendCommand(0x2D, data, function (header, fn, opt) {
@@ -356,7 +356,7 @@ function amt_heci() {
this.unprovision = function unprovision(mode, callback) { this.unprovision = function unprovision(mode, callback) {
var optional = []; var optional = [];
for (var i = 2; i < arguments.length; ++i) { optional.push(arguments[i]); } for (var i = 2; i < arguments.length; ++i) { optional.push(arguments[i]); }
var data = new Buffer(4); var data = Buffer.alloc(4);
data.writeUInt32LE(mode, 0); data.writeUInt32LE(mode, 0);
this.sendCommand(16, data, function (header, fn, opt) { this.sendCommand(16, data, function (header, fn, opt) {
opt.unshift(header.Status); opt.unshift(header.Status);

View File

@@ -1,5 +1,5 @@
/* /*
Copyright 2018 Intel Corporation Copyright 2018-2019 Intel Corporation
Licensed under the Apache License, Version 2.0 (the "License"); Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. you may not use this file except in compliance with the License.

View File

@@ -1,5 +1,5 @@
/* /*
Copyright 2018 Intel Corporation Copyright 2018-2019 Intel Corporation
Licensed under the Apache License, Version 2.0 (the "License"); Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. you may not use this file except in compliance with the License.

View File

@@ -1,5 +1,5 @@
/* /*
Copyright 2018 Intel Corporation Copyright 2018-2019 Intel Corporation
Licensed under the Apache License, Version 2.0 (the "License"); Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. you may not use this file except in compliance with the License.

View File

@@ -1,5 +1,5 @@
/* /*
Copyright 2018 Intel Corporation Copyright 2018-2019 Intel Corporation
Licensed under the Apache License, Version 2.0 (the "License"); Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. you may not use this file except in compliance with the License.

View File

@@ -1,5 +1,5 @@
/* /*
Copyright 2018 Intel Corporation Copyright 2018-2019 Intel Corporation
Licensed under the Apache License, Version 2.0 (the "License"); Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. you may not use this file except in compliance with the License.

View File

@@ -1,5 +1,5 @@
/* /*
Copyright 2018 Intel Corporation Copyright 2018-2019 Intel Corporation
Licensed under the Apache License, Version 2.0 (the "License"); Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. you may not use this file except in compliance with the License.
@@ -720,7 +720,7 @@ function AmtStackCreateService(wsmanStack) {
function _GetAuditLog0(stack, name, responses, status, tag) { function _GetAuditLog0(stack, name, responses, status, tag) {
if (status != 200) { tag[0](obj, [], status); return; } if (status != 200) { tag[0](obj, [], status); return; }
var ptr, i, e, es, x, r = tag[1], t = new Date(), TimeStamp; var ptr, i, e, x, r = tag[1], t = new Date(), TimeStamp;
if (responses.Body['RecordsReturned'] > 0) { if (responses.Body['RecordsReturned'] > 0) {
responses.Body['EventRecords'] = MakeToArray(responses.Body['EventRecords']); responses.Body['EventRecords'] = MakeToArray(responses.Body['EventRecords']);
@@ -728,8 +728,7 @@ function AmtStackCreateService(wsmanStack) {
for (i in responses.Body['EventRecords']) { for (i in responses.Body['EventRecords']) {
e = null; e = null;
try { try {
es = atob(responses.Body['EventRecords'][i]); e = Buffer.from(responses.Body['EventRecords'][i], 'base64');
e = new Buffer(es);
} catch (ex) { } catch (ex) {
console.log(ex + " " + responses.Body['EventRecords'][i]) console.log(ex + " " + responses.Body['EventRecords'][i])
} }

File diff suppressed because one or more lines are too long