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.
Files changed (45) hide show
  1. package/dist/SkyEyeClient.d.ts +2 -1
  2. package/dist/SkyEyeClient.js +2 -2
  3. package/dist/src/GrpcUtil.d.ts +1 -0
  4. package/dist/src/GrpcUtil.js +58 -0
  5. package/dist/src/SkyEyeClient.d.ts +1 -0
  6. package/dist/src/SkyEyeClient.js +35 -1
  7. package/dist/test.d.ts +1 -0
  8. package/dist/test.js +33 -0
  9. package/package.json +2 -2
  10. package/src/GrpcUtil.ts +45 -1
  11. package/src/RequestFactory.ts +0 -4
  12. package/src/SkyEyeClient.ts +38 -6
  13. package/src/exception/SkyEyeSDKException.js +23 -5
  14. package/src/models/Board.js +12 -9
  15. package/src/models/Cpu.js +42 -23
  16. package/src/models/Device.js +13 -12
  17. package/src/models/FaultInjectItem.js +4 -3
  18. package/src/models/FaultInjectType.js +1 -1
  19. package/src/models/InstructionItem.js +5 -2
  20. package/src/models/Register.js +19 -18
  21. package/src/response/BaseResponse.js +23 -3
  22. package/src/response/GetAllDeviceInfoResponse.js +24 -6
  23. package/src/response/GetCpuListResponse.js +29 -11
  24. package/src/response/GetCpuRegisterInfoResponse.js +24 -6
  25. package/src/response/GetDeviceListResponse.js +24 -6
  26. package/src/response/GetDeviceTreeResponse.js +24 -6
  27. package/src/response/GetDisassembleInfoResponse.js +23 -3
  28. package/src/response/GetFaultInjectListResponse.js +35 -13
  29. package/src/response/GetRamAddrInfoResponse.js +23 -3
  30. package/src/response/GetRunningStateResponse.js +43 -25
  31. package/src/{test.js → test1.js} +7 -4
  32. package/src/utils/ParseBoardUtils.js +33 -30
  33. package/test.ts +31 -0
  34. package/src/GrpcUtil.js +0 -55
  35. package/src/JsonRequest.js +0 -29
  36. package/src/JsonResponse.js +0 -36
  37. package/src/RequestFactory.js +0 -257
  38. package/src/SkyEyeClient.js +0 -831
  39. package/src/SkyEyeClientFactory.js +0 -53
  40. package/src/requests/BaseRequest.js +0 -18
  41. /package/dist/{proto → src/proto}/skyeye_rpc.proto +0 -0
  42. /package/dist/{proto → src/proto}/skyeye_rpc_grpc_pb.d.ts +0 -0
  43. /package/dist/{proto → src/proto}/skyeye_rpc_grpc_pb.js +0 -0
  44. /package/dist/{proto → src/proto}/skyeye_rpc_pb.d.ts +0 -0
  45. /package/dist/{proto → src/proto}/skyeye_rpc_pb.js +0 -0
@@ -1,20 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Register = void 0;
4
- class Register {
5
- getName() {
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
- toString() {
29
- return `Register{name='${this.name}', parent=${this.parent != null ? this.parent.getName() : null}, baseAddr=${this.baseAddr}, offset=${this.offset}, bits=${this.bits}, value=${this.value}, description='${this.description}'}`;
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
- const skyeye_rpc_pb_1 = require("../proto/skyeye_rpc_pb");
5
- class BaseResponse extends skyeye_rpc_pb_1.JSONResponse {
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
- const BaseResponse_1 = require("./BaseResponse");
5
- class GetAllDeviceInfoResponse extends BaseResponse_1.BaseResponse {
6
- constructor() {
7
- super(...arguments);
8
- this.boardMap = new Map();
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
- const BaseResponse_1 = require("./BaseResponse");
5
- class GetCpuListResponse extends BaseResponse_1.BaseResponse {
6
- constructor() {
7
- super();
8
- this.cpuList = [];
9
- this.callFuncName = "cpu_list";
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
- const BaseResponse_1 = require("./BaseResponse");
5
- class GetCpuRegisterInfoResponse extends BaseResponse_1.BaseResponse {
6
- constructor() {
7
- super();
8
- this.registers = [];
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
- const BaseResponse_1 = require("./BaseResponse");
5
- class GetDeviceListResponse extends BaseResponse_1.BaseResponse {
6
- constructor() {
7
- super();
8
- this.deviceList = [];
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
- const BaseResponse_1 = require("./BaseResponse");
5
- class GetDeviceTreeResponse extends BaseResponse_1.BaseResponse {
6
- constructor() {
7
- super(...arguments);
8
- this.boardMap = new Map();
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
- const BaseResponse_1 = require("./BaseResponse");
5
- class GetDisassembleInfoResponse extends BaseResponse_1.BaseResponse {
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
- const BaseResponse_1 = require("./BaseResponse");
5
- class GetFaultInjectListResponse extends BaseResponse_1.BaseResponse {
6
- constructor() {
7
- super();
8
- this.callFuncName = "SE_get_fault_inject_list";
9
- this._faultInjectItems = [];
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
- get faultInjectItems() {
12
- return this._faultInjectItems;
13
- }
14
- set faultInjectItems(value) {
15
- this._faultInjectItems = value;
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
- const BaseResponse_1 = require("./BaseResponse");
5
- class GetRamAddrInfoResponse extends BaseResponse_1.BaseResponse {
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
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.GetRunningStateResponse = exports.StateState = void 0;
4
- const BaseResponse_1 = require("./BaseResponse");
5
- var StateState;
6
- (function (StateState) {
7
- StateState["QUITED"] = "QUITED";
8
- StateState["UNLOADED"] = "UNLOADED";
9
- StateState["RUNNING"] = "RUNNING";
10
- StateState["STOPPED"] = "STOPPED";
11
- })(StateState || (exports.StateState = StateState = {}));
12
- class GetRunningStateResponse extends BaseResponse_1.BaseResponse {
13
- constructor() {
14
- super();
15
- this.state = StateState.QUITED;
16
- this.callFuncName = "SE_get_running_status";
17
- }
18
- getState() {
19
- return this.state;
20
- }
21
- setState(state) {
22
- this.state = state;
23
- }
24
- }
25
- exports.GetRunningStateResponse = GetRunningStateResponse;
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;
@@ -10,17 +10,17 @@ const { SkyEyeClient } = require('./SkyEyeClient')
10
10
  // util.getRunningStatus();
11
11
 
12
12
 
13
- // const client = SkyEyeClientFactory.instance.createClient('127.0.0.1','50051');
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
- console.log("最终response:",response)
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
- const Board_1 = require("../models/Board");
7
- const Device_1 = require("../models/Device");
8
- const Register_1 = require("../models/Register");
9
- const Cpu_1 = require("../models/Cpu");
10
- const DeviceState_1 = require("../models/DeviceState");
11
- class ParseBoardUtils {
12
- static parseBoard(boardItems) {
13
- const boardMap = new Map();
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 (const boardName in boardItems) {
17
+ for (var boardName in boardItems) {
16
18
  if (Object.prototype.hasOwnProperty.call(boardItems, boardName)) {
17
- const board = new Board_1.Board();
19
+ var board = new Board_1.Board();
18
20
  board.name = boardName;
19
- const devices = boardItems[boardName];
20
- const deviceMap = ParseBoardUtils.parseDevice(devices, board);
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
- static parseDevice(devices, board) {
29
- const deviceMap = new Map();
29
+ };
30
+ ParseBoardUtils.parseDevice = function (devices, board) {
31
+ var deviceMap = new Map();
30
32
  if (devices != null && typeof devices === 'object') {
31
- for (const deviceName in devices) {
33
+ for (var deviceName in devices) {
32
34
  if (Object.prototype.hasOwnProperty.call(devices, deviceName)) {
33
- const device = devices[deviceName];
35
+ var device = devices[deviceName];
34
36
  if (device != null && typeof device === 'object') {
35
- let dev;
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 (const itemKey in device) {
47
+ for (var itemKey in device) {
46
48
  if (Object.prototype.hasOwnProperty.call(device, itemKey)) {
47
- const itemValue = device[itemKey];
49
+ var itemValue = device[itemKey];
48
50
  switch (itemKey) {
49
51
  case 'registers':
50
- const registerItems = itemValue;
51
- const registerMap = ParseBoardUtils.parseRegister(registerItems, dev);
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
- static parseRegister(registerItems, device) {
79
- const registerMap = new Map();
79
+ };
80
+ ParseBoardUtils.parseRegister = function (registerItems, device) {
81
+ var registerMap = new Map();
80
82
  if (registerItems != null && typeof registerItems === 'object') {
81
- for (const regKey in registerItems) {
83
+ for (var regKey in registerItems) {
82
84
  if (Object.prototype.hasOwnProperty.call(registerItems, regKey)) {
83
- const register = registerItems[regKey];
85
+ var register = registerItems[regKey];
84
86
  if (register != null && typeof register === 'object') {
85
- const reg = new Register_1.Register(null);
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();