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
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.SkyEyeClientFactory = void 0;
|
|
13
|
-
const SkyEyeClient_1 = require("./SkyEyeClient");
|
|
14
|
-
class SkyEyeClientFactory {
|
|
15
|
-
constructor() { }
|
|
16
|
-
static get instance() {
|
|
17
|
-
if (!this._instance) {
|
|
18
|
-
this._instance = new SkyEyeClientFactory();
|
|
19
|
-
}
|
|
20
|
-
return this._instance;
|
|
21
|
-
}
|
|
22
|
-
createClient(ip, port) {
|
|
23
|
-
return new SkyEyeClient_1.SkyEyeClient(ip, port);
|
|
24
|
-
}
|
|
25
|
-
createConnectedClient(ip, port) {
|
|
26
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
27
|
-
return this.createConnectedClientTime(ip, port, 5);
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
|
-
createConnectedClientTime(ip, port, time) {
|
|
31
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
32
|
-
const client = this.createClient(ip, port);
|
|
33
|
-
const startTime = Date.now();
|
|
34
|
-
while (Date.now() - startTime < time * 1000) {
|
|
35
|
-
try {
|
|
36
|
-
const response = client.getCurrentRunningState();
|
|
37
|
-
console.log("response:", response);
|
|
38
|
-
break;
|
|
39
|
-
}
|
|
40
|
-
catch (error) {
|
|
41
|
-
try {
|
|
42
|
-
yield new Promise(resolve => setTimeout(resolve, 100));
|
|
43
|
-
}
|
|
44
|
-
catch (ex) {
|
|
45
|
-
throw new Error(ex);
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
return client;
|
|
50
|
-
});
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
exports.SkyEyeClientFactory = SkyEyeClientFactory;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.BaseRequest = void 0;
|
|
4
|
-
class BaseRequest {
|
|
5
|
-
constructor(name) {
|
|
6
|
-
this.request = {
|
|
7
|
-
name: name,
|
|
8
|
-
args: null
|
|
9
|
-
};
|
|
10
|
-
}
|
|
11
|
-
toJSONString() {
|
|
12
|
-
return JSON.stringify({ request: this.request });
|
|
13
|
-
}
|
|
14
|
-
setArgs(args) {
|
|
15
|
-
this.request.args = args;
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
exports.BaseRequest = BaseRequest;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|