skyeye-sdk-js 1.0.5 → 1.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/SkyEyeClient.d.ts +2 -1
- package/dist/SkyEyeClient.js +2 -2
- package/dist/src/GrpcUtil.d.ts +1 -0
- package/dist/src/GrpcUtil.js +58 -0
- package/dist/src/SkyEyeClient.d.ts +1 -0
- package/dist/src/SkyEyeClient.js +35 -1
- package/dist/test.d.ts +1 -0
- package/dist/test.js +33 -0
- package/package.json +2 -2
- package/src/GrpcUtil.ts +45 -1
- package/src/RequestFactory.ts +0 -4
- package/src/SkyEyeClient.ts +38 -6
- package/src/exception/SkyEyeSDKException.js +23 -5
- package/src/models/Board.js +12 -9
- package/src/models/Cpu.js +42 -23
- package/src/models/Device.js +13 -12
- package/src/models/FaultInjectItem.js +4 -3
- package/src/models/FaultInjectType.js +1 -1
- package/src/models/InstructionItem.js +5 -2
- package/src/models/Register.js +19 -18
- package/src/response/BaseResponse.js +23 -3
- package/src/response/GetAllDeviceInfoResponse.js +24 -6
- package/src/response/GetCpuListResponse.js +29 -11
- package/src/response/GetCpuRegisterInfoResponse.js +24 -6
- package/src/response/GetDeviceListResponse.js +24 -6
- package/src/response/GetDeviceTreeResponse.js +24 -6
- package/src/response/GetDisassembleInfoResponse.js +23 -3
- package/src/response/GetFaultInjectListResponse.js +35 -13
- package/src/response/GetRamAddrInfoResponse.js +23 -3
- package/src/response/GetRunningStateResponse.js +43 -25
- package/src/{test.js → test1.js} +7 -4
- package/src/utils/ParseBoardUtils.js +33 -30
- package/test.ts +31 -0
- package/src/GrpcUtil.js +0 -55
- package/src/JsonRequest.js +0 -29
- package/src/JsonResponse.js +0 -36
- package/src/RequestFactory.js +0 -257
- package/src/SkyEyeClient.js +0 -831
- package/src/SkyEyeClientFactory.js +0 -53
- package/src/requests/BaseRequest.js +0 -18
- /package/dist/{proto → src/proto}/skyeye_rpc.proto +0 -0
- /package/dist/{proto → src/proto}/skyeye_rpc_grpc_pb.d.ts +0 -0
- /package/dist/{proto → src/proto}/skyeye_rpc_grpc_pb.js +0 -0
- /package/dist/{proto → src/proto}/skyeye_rpc_pb.d.ts +0 -0
- /package/dist/{proto → src/proto}/skyeye_rpc_pb.js +0 -0
package/src/models/Register.js
CHANGED
|
@@ -1,20 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Register = void 0;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
return this.name;
|
|
7
|
-
}
|
|
8
|
-
setName(name) {
|
|
9
|
-
this.name = name;
|
|
10
|
-
}
|
|
11
|
-
getParent() {
|
|
12
|
-
return this.parent;
|
|
13
|
-
}
|
|
14
|
-
setParent(node) {
|
|
15
|
-
this.parent = node;
|
|
16
|
-
}
|
|
17
|
-
constructor(info) {
|
|
4
|
+
var Register = /** @class */ (function () {
|
|
5
|
+
function Register(info) {
|
|
18
6
|
if (info) {
|
|
19
7
|
this.name = info.name;
|
|
20
8
|
this.parent = info.parent;
|
|
@@ -25,8 +13,21 @@ class Register {
|
|
|
25
13
|
this.description = info.description;
|
|
26
14
|
}
|
|
27
15
|
}
|
|
28
|
-
|
|
29
|
-
return
|
|
30
|
-
}
|
|
31
|
-
|
|
16
|
+
Register.prototype.getName = function () {
|
|
17
|
+
return this.name;
|
|
18
|
+
};
|
|
19
|
+
Register.prototype.setName = function (name) {
|
|
20
|
+
this.name = name;
|
|
21
|
+
};
|
|
22
|
+
Register.prototype.getParent = function () {
|
|
23
|
+
return this.parent;
|
|
24
|
+
};
|
|
25
|
+
Register.prototype.setParent = function (node) {
|
|
26
|
+
this.parent = node;
|
|
27
|
+
};
|
|
28
|
+
Register.prototype.toString = function () {
|
|
29
|
+
return "Register{name='".concat(this.name, "', parent=").concat(this.parent != null ? this.parent.getName() : null, ", baseAddr=").concat(this.baseAddr, ", offset=").concat(this.offset, ", bits=").concat(this.bits, ", value=").concat(this.value, ", description='").concat(this.description, "'}");
|
|
30
|
+
};
|
|
31
|
+
return Register;
|
|
32
|
+
}());
|
|
32
33
|
exports.Register = Register;
|
|
@@ -1,7 +1,27 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __extends = (this && this.__extends) || (function () {
|
|
3
|
+
var extendStatics = function (d, b) {
|
|
4
|
+
extendStatics = Object.setPrototypeOf ||
|
|
5
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
+
return extendStatics(d, b);
|
|
8
|
+
};
|
|
9
|
+
return function (d, b) {
|
|
10
|
+
if (typeof b !== "function" && b !== null)
|
|
11
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
+
extendStatics(d, b);
|
|
13
|
+
function __() { this.constructor = d; }
|
|
14
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
+
};
|
|
16
|
+
})();
|
|
2
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
18
|
exports.BaseResponse = void 0;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
19
|
+
var skyeye_rpc_pb_1 = require("../proto/skyeye_rpc_pb");
|
|
20
|
+
var BaseResponse = /** @class */ (function (_super) {
|
|
21
|
+
__extends(BaseResponse, _super);
|
|
22
|
+
function BaseResponse() {
|
|
23
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
24
|
+
}
|
|
25
|
+
return BaseResponse;
|
|
26
|
+
}(skyeye_rpc_pb_1.JSONResponse));
|
|
7
27
|
exports.BaseResponse = BaseResponse;
|
|
@@ -1,11 +1,29 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __extends = (this && this.__extends) || (function () {
|
|
3
|
+
var extendStatics = function (d, b) {
|
|
4
|
+
extendStatics = Object.setPrototypeOf ||
|
|
5
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
+
return extendStatics(d, b);
|
|
8
|
+
};
|
|
9
|
+
return function (d, b) {
|
|
10
|
+
if (typeof b !== "function" && b !== null)
|
|
11
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
+
extendStatics(d, b);
|
|
13
|
+
function __() { this.constructor = d; }
|
|
14
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
+
};
|
|
16
|
+
})();
|
|
2
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
18
|
exports.GetAllDeviceInfoResponse = void 0;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
19
|
+
var BaseResponse_1 = require("./BaseResponse");
|
|
20
|
+
var GetAllDeviceInfoResponse = /** @class */ (function (_super) {
|
|
21
|
+
__extends(GetAllDeviceInfoResponse, _super);
|
|
22
|
+
function GetAllDeviceInfoResponse() {
|
|
23
|
+
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
24
|
+
_this.boardMap = new Map();
|
|
25
|
+
return _this;
|
|
9
26
|
}
|
|
10
|
-
|
|
27
|
+
return GetAllDeviceInfoResponse;
|
|
28
|
+
}(BaseResponse_1.BaseResponse));
|
|
11
29
|
exports.GetAllDeviceInfoResponse = GetAllDeviceInfoResponse;
|
|
@@ -1,18 +1,36 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __extends = (this && this.__extends) || (function () {
|
|
3
|
+
var extendStatics = function (d, b) {
|
|
4
|
+
extendStatics = Object.setPrototypeOf ||
|
|
5
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
+
return extendStatics(d, b);
|
|
8
|
+
};
|
|
9
|
+
return function (d, b) {
|
|
10
|
+
if (typeof b !== "function" && b !== null)
|
|
11
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
+
extendStatics(d, b);
|
|
13
|
+
function __() { this.constructor = d; }
|
|
14
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
+
};
|
|
16
|
+
})();
|
|
2
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
18
|
exports.GetCpuListResponse = void 0;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
19
|
+
var BaseResponse_1 = require("./BaseResponse");
|
|
20
|
+
var GetCpuListResponse = /** @class */ (function (_super) {
|
|
21
|
+
__extends(GetCpuListResponse, _super);
|
|
22
|
+
function GetCpuListResponse() {
|
|
23
|
+
var _this = _super.call(this) || this;
|
|
24
|
+
_this.cpuList = [];
|
|
25
|
+
_this.callFuncName = "cpu_list";
|
|
26
|
+
return _this;
|
|
10
27
|
}
|
|
11
|
-
getCpuList() {
|
|
28
|
+
GetCpuListResponse.prototype.getCpuList = function () {
|
|
12
29
|
return this.cpuList;
|
|
13
|
-
}
|
|
14
|
-
setCpuList(cpuList) {
|
|
30
|
+
};
|
|
31
|
+
GetCpuListResponse.prototype.setCpuList = function (cpuList) {
|
|
15
32
|
this.cpuList = cpuList;
|
|
16
|
-
}
|
|
17
|
-
|
|
33
|
+
};
|
|
34
|
+
return GetCpuListResponse;
|
|
35
|
+
}(BaseResponse_1.BaseResponse));
|
|
18
36
|
exports.GetCpuListResponse = GetCpuListResponse;
|
|
@@ -1,11 +1,29 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __extends = (this && this.__extends) || (function () {
|
|
3
|
+
var extendStatics = function (d, b) {
|
|
4
|
+
extendStatics = Object.setPrototypeOf ||
|
|
5
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
+
return extendStatics(d, b);
|
|
8
|
+
};
|
|
9
|
+
return function (d, b) {
|
|
10
|
+
if (typeof b !== "function" && b !== null)
|
|
11
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
+
extendStatics(d, b);
|
|
13
|
+
function __() { this.constructor = d; }
|
|
14
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
+
};
|
|
16
|
+
})();
|
|
2
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
18
|
exports.GetCpuRegisterInfoResponse = void 0;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
19
|
+
var BaseResponse_1 = require("./BaseResponse");
|
|
20
|
+
var GetCpuRegisterInfoResponse = /** @class */ (function (_super) {
|
|
21
|
+
__extends(GetCpuRegisterInfoResponse, _super);
|
|
22
|
+
function GetCpuRegisterInfoResponse() {
|
|
23
|
+
var _this = _super.call(this) || this;
|
|
24
|
+
_this.registers = [];
|
|
25
|
+
return _this;
|
|
9
26
|
}
|
|
10
|
-
|
|
27
|
+
return GetCpuRegisterInfoResponse;
|
|
28
|
+
}(BaseResponse_1.BaseResponse));
|
|
11
29
|
exports.GetCpuRegisterInfoResponse = GetCpuRegisterInfoResponse;
|
|
@@ -1,11 +1,29 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __extends = (this && this.__extends) || (function () {
|
|
3
|
+
var extendStatics = function (d, b) {
|
|
4
|
+
extendStatics = Object.setPrototypeOf ||
|
|
5
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
+
return extendStatics(d, b);
|
|
8
|
+
};
|
|
9
|
+
return function (d, b) {
|
|
10
|
+
if (typeof b !== "function" && b !== null)
|
|
11
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
+
extendStatics(d, b);
|
|
13
|
+
function __() { this.constructor = d; }
|
|
14
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
+
};
|
|
16
|
+
})();
|
|
2
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
18
|
exports.GetDeviceListResponse = void 0;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
19
|
+
var BaseResponse_1 = require("./BaseResponse");
|
|
20
|
+
var GetDeviceListResponse = /** @class */ (function (_super) {
|
|
21
|
+
__extends(GetDeviceListResponse, _super);
|
|
22
|
+
function GetDeviceListResponse() {
|
|
23
|
+
var _this = _super.call(this) || this;
|
|
24
|
+
_this.deviceList = [];
|
|
25
|
+
return _this;
|
|
9
26
|
}
|
|
10
|
-
|
|
27
|
+
return GetDeviceListResponse;
|
|
28
|
+
}(BaseResponse_1.BaseResponse));
|
|
11
29
|
exports.GetDeviceListResponse = GetDeviceListResponse;
|
|
@@ -1,11 +1,29 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __extends = (this && this.__extends) || (function () {
|
|
3
|
+
var extendStatics = function (d, b) {
|
|
4
|
+
extendStatics = Object.setPrototypeOf ||
|
|
5
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
+
return extendStatics(d, b);
|
|
8
|
+
};
|
|
9
|
+
return function (d, b) {
|
|
10
|
+
if (typeof b !== "function" && b !== null)
|
|
11
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
+
extendStatics(d, b);
|
|
13
|
+
function __() { this.constructor = d; }
|
|
14
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
+
};
|
|
16
|
+
})();
|
|
2
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
18
|
exports.GetDeviceTreeResponse = void 0;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
19
|
+
var BaseResponse_1 = require("./BaseResponse");
|
|
20
|
+
var GetDeviceTreeResponse = /** @class */ (function (_super) {
|
|
21
|
+
__extends(GetDeviceTreeResponse, _super);
|
|
22
|
+
function GetDeviceTreeResponse() {
|
|
23
|
+
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
24
|
+
_this.boardMap = new Map();
|
|
25
|
+
return _this;
|
|
9
26
|
}
|
|
10
|
-
|
|
27
|
+
return GetDeviceTreeResponse;
|
|
28
|
+
}(BaseResponse_1.BaseResponse));
|
|
11
29
|
exports.GetDeviceTreeResponse = GetDeviceTreeResponse;
|
|
@@ -1,7 +1,27 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __extends = (this && this.__extends) || (function () {
|
|
3
|
+
var extendStatics = function (d, b) {
|
|
4
|
+
extendStatics = Object.setPrototypeOf ||
|
|
5
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
+
return extendStatics(d, b);
|
|
8
|
+
};
|
|
9
|
+
return function (d, b) {
|
|
10
|
+
if (typeof b !== "function" && b !== null)
|
|
11
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
+
extendStatics(d, b);
|
|
13
|
+
function __() { this.constructor = d; }
|
|
14
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
+
};
|
|
16
|
+
})();
|
|
2
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
18
|
exports.GetDisassembleInfoResponse = void 0;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
19
|
+
var BaseResponse_1 = require("./BaseResponse");
|
|
20
|
+
var GetDisassembleInfoResponse = /** @class */ (function (_super) {
|
|
21
|
+
__extends(GetDisassembleInfoResponse, _super);
|
|
22
|
+
function GetDisassembleInfoResponse() {
|
|
23
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
24
|
+
}
|
|
25
|
+
return GetDisassembleInfoResponse;
|
|
26
|
+
}(BaseResponse_1.BaseResponse));
|
|
7
27
|
exports.GetDisassembleInfoResponse = GetDisassembleInfoResponse;
|
|
@@ -1,18 +1,40 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __extends = (this && this.__extends) || (function () {
|
|
3
|
+
var extendStatics = function (d, b) {
|
|
4
|
+
extendStatics = Object.setPrototypeOf ||
|
|
5
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
+
return extendStatics(d, b);
|
|
8
|
+
};
|
|
9
|
+
return function (d, b) {
|
|
10
|
+
if (typeof b !== "function" && b !== null)
|
|
11
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
+
extendStatics(d, b);
|
|
13
|
+
function __() { this.constructor = d; }
|
|
14
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
+
};
|
|
16
|
+
})();
|
|
2
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
18
|
exports.GetFaultInjectListResponse = void 0;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
19
|
+
var BaseResponse_1 = require("./BaseResponse");
|
|
20
|
+
var GetFaultInjectListResponse = /** @class */ (function (_super) {
|
|
21
|
+
__extends(GetFaultInjectListResponse, _super);
|
|
22
|
+
function GetFaultInjectListResponse() {
|
|
23
|
+
var _this = _super.call(this) || this;
|
|
24
|
+
_this.callFuncName = "SE_get_fault_inject_list";
|
|
25
|
+
_this._faultInjectItems = [];
|
|
26
|
+
return _this;
|
|
10
27
|
}
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
}
|
|
28
|
+
Object.defineProperty(GetFaultInjectListResponse.prototype, "faultInjectItems", {
|
|
29
|
+
get: function () {
|
|
30
|
+
return this._faultInjectItems;
|
|
31
|
+
},
|
|
32
|
+
set: function (value) {
|
|
33
|
+
this._faultInjectItems = value;
|
|
34
|
+
},
|
|
35
|
+
enumerable: false,
|
|
36
|
+
configurable: true
|
|
37
|
+
});
|
|
38
|
+
return GetFaultInjectListResponse;
|
|
39
|
+
}(BaseResponse_1.BaseResponse));
|
|
18
40
|
exports.GetFaultInjectListResponse = GetFaultInjectListResponse;
|
|
@@ -1,7 +1,27 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __extends = (this && this.__extends) || (function () {
|
|
3
|
+
var extendStatics = function (d, b) {
|
|
4
|
+
extendStatics = Object.setPrototypeOf ||
|
|
5
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
+
return extendStatics(d, b);
|
|
8
|
+
};
|
|
9
|
+
return function (d, b) {
|
|
10
|
+
if (typeof b !== "function" && b !== null)
|
|
11
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
+
extendStatics(d, b);
|
|
13
|
+
function __() { this.constructor = d; }
|
|
14
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
+
};
|
|
16
|
+
})();
|
|
2
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
18
|
exports.GetRamAddrInfoResponse = void 0;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
19
|
+
var BaseResponse_1 = require("./BaseResponse");
|
|
20
|
+
var GetRamAddrInfoResponse = /** @class */ (function (_super) {
|
|
21
|
+
__extends(GetRamAddrInfoResponse, _super);
|
|
22
|
+
function GetRamAddrInfoResponse() {
|
|
23
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
24
|
+
}
|
|
25
|
+
return GetRamAddrInfoResponse;
|
|
26
|
+
}(BaseResponse_1.BaseResponse));
|
|
7
27
|
exports.GetRamAddrInfoResponse = GetRamAddrInfoResponse;
|
|
@@ -1,25 +1,43 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __extends = (this && this.__extends) || (function () {
|
|
3
|
+
var extendStatics = function (d, b) {
|
|
4
|
+
extendStatics = Object.setPrototypeOf ||
|
|
5
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
+
return extendStatics(d, b);
|
|
8
|
+
};
|
|
9
|
+
return function (d, b) {
|
|
10
|
+
if (typeof b !== "function" && b !== null)
|
|
11
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
+
extendStatics(d, b);
|
|
13
|
+
function __() { this.constructor = d; }
|
|
14
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
+
};
|
|
16
|
+
})();
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.GetRunningStateResponse = exports.StateState = void 0;
|
|
19
|
+
var BaseResponse_1 = require("./BaseResponse");
|
|
20
|
+
var StateState;
|
|
21
|
+
(function (StateState) {
|
|
22
|
+
StateState["QUITED"] = "QUITED";
|
|
23
|
+
StateState["UNLOADED"] = "UNLOADED";
|
|
24
|
+
StateState["RUNNING"] = "RUNNING";
|
|
25
|
+
StateState["STOPPED"] = "STOPPED";
|
|
26
|
+
})(StateState || (exports.StateState = StateState = {}));
|
|
27
|
+
var GetRunningStateResponse = /** @class */ (function (_super) {
|
|
28
|
+
__extends(GetRunningStateResponse, _super);
|
|
29
|
+
function GetRunningStateResponse() {
|
|
30
|
+
var _this = _super.call(this) || this;
|
|
31
|
+
_this.state = StateState.QUITED;
|
|
32
|
+
_this.callFuncName = "SE_get_running_status";
|
|
33
|
+
return _this;
|
|
34
|
+
}
|
|
35
|
+
GetRunningStateResponse.prototype.getState = function () {
|
|
36
|
+
return this.state;
|
|
37
|
+
};
|
|
38
|
+
GetRunningStateResponse.prototype.setState = function (state) {
|
|
39
|
+
this.state = state;
|
|
40
|
+
};
|
|
41
|
+
return GetRunningStateResponse;
|
|
42
|
+
}(BaseResponse_1.BaseResponse));
|
|
43
|
+
exports.GetRunningStateResponse = GetRunningStateResponse;
|
package/src/{test.js → test1.js}
RENAMED
|
@@ -10,17 +10,17 @@ const { SkyEyeClient } = require('./SkyEyeClient')
|
|
|
10
10
|
// util.getRunningStatus();
|
|
11
11
|
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
const client = SkyEyeClientFactory.instance.createClient('127.0.0.1','50051');
|
|
14
14
|
// const client = new SkyEyeClient('127.0.0.1','50051');
|
|
15
15
|
// const response = client.getCurrentRunningState();
|
|
16
16
|
// console.log("res:",response)
|
|
17
17
|
|
|
18
18
|
|
|
19
19
|
|
|
20
|
-
const client = SkyEyeClientFactory.instance.createClient('127.0.0.1', '50051');
|
|
20
|
+
// const client = SkyEyeClientFactory.instance.createClient('127.0.0.1', '50051');
|
|
21
21
|
|
|
22
22
|
async function test() {
|
|
23
|
-
let response = await client.getCurrentRunningState();
|
|
23
|
+
// let response = await client.getCurrentRunningState();
|
|
24
24
|
|
|
25
25
|
// response = await client.runCommand();
|
|
26
26
|
|
|
@@ -35,7 +35,10 @@ async function test() {
|
|
|
35
35
|
// await client.getMemoryValue("c67x_core_0",12,0);
|
|
36
36
|
|
|
37
37
|
// const response = await client.getDeviceList();
|
|
38
|
-
|
|
38
|
+
|
|
39
|
+
// client.test();
|
|
40
|
+
// await client.initAndRunExample();
|
|
41
|
+
// console.log("最终response:",response)
|
|
39
42
|
|
|
40
43
|
}
|
|
41
44
|
|
|
@@ -3,36 +3,38 @@
|
|
|
3
3
|
// 直接使用JSON.parse()来解析JSON字符串即可。
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
5
|
exports.ParseBoardUtils = void 0;
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
6
|
+
var Board_1 = require("../models/Board");
|
|
7
|
+
var Device_1 = require("../models/Device");
|
|
8
|
+
var Register_1 = require("../models/Register");
|
|
9
|
+
var Cpu_1 = require("../models/Cpu");
|
|
10
|
+
var DeviceState_1 = require("../models/DeviceState");
|
|
11
|
+
var ParseBoardUtils = /** @class */ (function () {
|
|
12
|
+
function ParseBoardUtils() {
|
|
13
|
+
}
|
|
14
|
+
ParseBoardUtils.parseBoard = function (boardItems) {
|
|
15
|
+
var boardMap = new Map();
|
|
14
16
|
if (boardItems != null && typeof boardItems === 'object') {
|
|
15
|
-
for (
|
|
17
|
+
for (var boardName in boardItems) {
|
|
16
18
|
if (Object.prototype.hasOwnProperty.call(boardItems, boardName)) {
|
|
17
|
-
|
|
19
|
+
var board = new Board_1.Board();
|
|
18
20
|
board.name = boardName;
|
|
19
|
-
|
|
20
|
-
|
|
21
|
+
var devices = boardItems[boardName];
|
|
22
|
+
var deviceMap = ParseBoardUtils.parseDevice(devices, board);
|
|
21
23
|
board.deviceMap = deviceMap;
|
|
22
24
|
boardMap.set(board.name, board);
|
|
23
25
|
}
|
|
24
26
|
}
|
|
25
27
|
}
|
|
26
28
|
return boardMap;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
|
|
29
|
+
};
|
|
30
|
+
ParseBoardUtils.parseDevice = function (devices, board) {
|
|
31
|
+
var deviceMap = new Map();
|
|
30
32
|
if (devices != null && typeof devices === 'object') {
|
|
31
|
-
for (
|
|
33
|
+
for (var deviceName in devices) {
|
|
32
34
|
if (Object.prototype.hasOwnProperty.call(devices, deviceName)) {
|
|
33
|
-
|
|
35
|
+
var device = devices[deviceName];
|
|
34
36
|
if (device != null && typeof device === 'object') {
|
|
35
|
-
|
|
37
|
+
var dev = void 0;
|
|
36
38
|
if (device.type === 'device') {
|
|
37
39
|
dev = new Device_1.Device(null);
|
|
38
40
|
}
|
|
@@ -42,13 +44,13 @@ class ParseBoardUtils {
|
|
|
42
44
|
if (dev) {
|
|
43
45
|
dev.parent = board;
|
|
44
46
|
dev.name = deviceName;
|
|
45
|
-
for (
|
|
47
|
+
for (var itemKey in device) {
|
|
46
48
|
if (Object.prototype.hasOwnProperty.call(device, itemKey)) {
|
|
47
|
-
|
|
49
|
+
var itemValue = device[itemKey];
|
|
48
50
|
switch (itemKey) {
|
|
49
51
|
case 'registers':
|
|
50
|
-
|
|
51
|
-
|
|
52
|
+
var registerItems = itemValue;
|
|
53
|
+
var registerMap = ParseBoardUtils.parseRegister(registerItems, dev);
|
|
52
54
|
dev.registerMap = registerMap;
|
|
53
55
|
break;
|
|
54
56
|
case 'state':
|
|
@@ -74,15 +76,15 @@ class ParseBoardUtils {
|
|
|
74
76
|
}
|
|
75
77
|
}
|
|
76
78
|
return deviceMap;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
|
|
79
|
+
};
|
|
80
|
+
ParseBoardUtils.parseRegister = function (registerItems, device) {
|
|
81
|
+
var registerMap = new Map();
|
|
80
82
|
if (registerItems != null && typeof registerItems === 'object') {
|
|
81
|
-
for (
|
|
83
|
+
for (var regKey in registerItems) {
|
|
82
84
|
if (Object.prototype.hasOwnProperty.call(registerItems, regKey)) {
|
|
83
|
-
|
|
85
|
+
var register = registerItems[regKey];
|
|
84
86
|
if (register != null && typeof register === 'object') {
|
|
85
|
-
|
|
87
|
+
var reg = new Register_1.Register(null);
|
|
86
88
|
reg.parent = device;
|
|
87
89
|
reg.name = regKey;
|
|
88
90
|
if ('bits' in register) {
|
|
@@ -103,6 +105,7 @@ class ParseBoardUtils {
|
|
|
103
105
|
}
|
|
104
106
|
}
|
|
105
107
|
return registerMap;
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
+
};
|
|
109
|
+
return ParseBoardUtils;
|
|
110
|
+
}());
|
|
108
111
|
exports.ParseBoardUtils = ParseBoardUtils;
|
package/test.ts
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { GrpcUtil } from "./src/GrpcUtil";
|
|
2
|
+
|
|
3
|
+
const { SkyEyeClientFactory } = require('./src/SkyEyeClientFactory')
|
|
4
|
+
const { SkyEyeClient } = require('./src/SkyEyeClient')
|
|
5
|
+
|
|
6
|
+
async function test() {
|
|
7
|
+
const client = SkyEyeClientFactory.instance.createClient('127.0.0.1', '50051');
|
|
8
|
+
console.log("Connected to SkyEye server");
|
|
9
|
+
// await client.getDeviceList();
|
|
10
|
+
// await client.getCurrentCpuMips();
|
|
11
|
+
// await client.runCommand();
|
|
12
|
+
|
|
13
|
+
// const response = await client.getCurrentRunningState();
|
|
14
|
+
|
|
15
|
+
// const response = await client.getGlobalVarValueDefault("a",GlobalVarType.DOUBLE);
|
|
16
|
+
// const response = await client.getGlobalVarValue("cx53123","a",16,GlobalVarType.DOUBLE);
|
|
17
|
+
|
|
18
|
+
// const response = await client.getCpuRegistersDefault();
|
|
19
|
+
// const response = await client.getCpuRegisters("c7xx");
|
|
20
|
+
|
|
21
|
+
// const response = await client.getMemoryValueDefault(1, 16);
|
|
22
|
+
// const response = await client.getMemoryValue("c7s",0,16);
|
|
23
|
+
// console.log("结果response:", response)
|
|
24
|
+
|
|
25
|
+
await client.initAndRunExample();
|
|
26
|
+
|
|
27
|
+
// GrpcUtil.initAndRunExample();
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
}
|
|
31
|
+
test();
|