skyeye-sdk-js 1.4.1 → 1.4.2
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/src/RequestFactory.d.ts +1 -0
- package/dist/src/RequestFactory.js +10 -0
- package/dist/src/SkyEyeClient.d.ts +2 -0
- package/dist/src/SkyEyeClient.js +18 -0
- package/dist/src/response/GetAddressWidthResponse.d.ts +4 -0
- package/dist/src/response/GetAddressWidthResponse.js +7 -0
- package/package.json +1 -1
- package/src/RequestFactory.ts +11 -0
- package/src/SkyEyeClient.ts +19 -0
- package/src/response/GetAddressWidthResponse.ts +6 -0
|
@@ -4,6 +4,7 @@ export declare class RequestFactory {
|
|
|
4
4
|
private static _instance;
|
|
5
5
|
private constructor();
|
|
6
6
|
static getInstance(): RequestFactory;
|
|
7
|
+
getAddressWidth(cpuName: string): JSONRequest;
|
|
7
8
|
getModuleStatus(): JSONRequest;
|
|
8
9
|
getRunningStatus(): JSONRequest;
|
|
9
10
|
runScriptRequest(filename: string): JSONRequest;
|
|
@@ -12,6 +12,16 @@ class RequestFactory {
|
|
|
12
12
|
return this._instance;
|
|
13
13
|
}
|
|
14
14
|
//判断模块是否完全加载成功
|
|
15
|
+
getAddressWidth(cpuName) {
|
|
16
|
+
const baseRequest = new BaseRequest_1.BaseRequest("SE_get_cpu_address_width");
|
|
17
|
+
const args = {};
|
|
18
|
+
args.cpuname = cpuName;
|
|
19
|
+
baseRequest.setArgs(args);
|
|
20
|
+
const request = new skyeye_rpc_pb_1.JSONRequest();
|
|
21
|
+
request.setRequest(baseRequest.toJSONString());
|
|
22
|
+
return request;
|
|
23
|
+
}
|
|
24
|
+
//判断模块是否完全加载成功
|
|
15
25
|
getModuleStatus() {
|
|
16
26
|
const baseRequest = new BaseRequest_1.BaseRequest("SE_get_modules_loaded_status");
|
|
17
27
|
const request = new skyeye_rpc_pb_1.JSONRequest();
|
|
@@ -15,6 +15,7 @@ import { GetFaultInjectListResponse } from './response/GetFaultInjectListRespons
|
|
|
15
15
|
import { GetDisassembleInfoResponse } from './response/GetDisassembleInfoResponse';
|
|
16
16
|
import { GetCpuRegisterInfoResponse } from './response/GetCpuRegisterInfoResponse';
|
|
17
17
|
import { BaseResponse } from './response/BaseResponse';
|
|
18
|
+
import { GetAddressWidthResponse } from './response/GetAddressWidthResponse';
|
|
18
19
|
export declare class SkyEyeClient extends JSONTransmissionClient {
|
|
19
20
|
private host;
|
|
20
21
|
private port;
|
|
@@ -59,6 +60,7 @@ export declare class SkyEyeClient extends JSONTransmissionClient {
|
|
|
59
60
|
setCpuRegisterValue(boardName: string, cpuName: string, registerName: string, value: string): Promise<any>;
|
|
60
61
|
setDeviceRegisterValue(machName: string, deviceName: string, registerName: string, value: string): Promise<any>;
|
|
61
62
|
getDeviceTree(): Promise<GetDeviceTreeResponse>;
|
|
63
|
+
getAddressWidth(cpuName: string): Promise<GetAddressWidthResponse>;
|
|
62
64
|
getModuleStatus(): Promise<BaseResponse>;
|
|
63
65
|
getCurrentRunningState(): Promise<GetRunningStateResponse>;
|
|
64
66
|
getAllDeviceInfo(): Promise<GetAllDeviceInfoResponse>;
|
package/dist/src/SkyEyeClient.js
CHANGED
|
@@ -56,6 +56,7 @@ const GetCpuRegisterInfoResponse_1 = require("./response/GetCpuRegisterInfoRespo
|
|
|
56
56
|
const SkyEyeSDKException_1 = require("./exception/SkyEyeSDKException");
|
|
57
57
|
const cp = __importStar(require("child_process"));
|
|
58
58
|
const BaseResponse_1 = require("./response/BaseResponse");
|
|
59
|
+
const GetAddressWidthResponse_1 = require("./response/GetAddressWidthResponse");
|
|
59
60
|
let client = null;
|
|
60
61
|
// ----------------------------当前运行程序的设备树----------------------------------------//
|
|
61
62
|
const boardMap = new Map();
|
|
@@ -730,6 +731,23 @@ class SkyEyeClient extends skyeye_rpc_grpc_pb_1.JSONTransmissionClient {
|
|
|
730
731
|
return response;
|
|
731
732
|
});
|
|
732
733
|
}
|
|
734
|
+
getAddressWidth(cpuName) {
|
|
735
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
736
|
+
const response = new GetAddressWidthResponse_1.GetAddressWidthResponse();
|
|
737
|
+
try {
|
|
738
|
+
const call = yield this.call(RequestFactory_1.RequestFactory.getInstance().getAddressWidth(cpuName));
|
|
739
|
+
// { result: 2, error: null, name: 'SE_get_running_status' }
|
|
740
|
+
if (call != null) {
|
|
741
|
+
response.isSuccess = true;
|
|
742
|
+
response.result = call.result;
|
|
743
|
+
}
|
|
744
|
+
console.log(call);
|
|
745
|
+
}
|
|
746
|
+
catch (error) {
|
|
747
|
+
}
|
|
748
|
+
return response;
|
|
749
|
+
});
|
|
750
|
+
}
|
|
733
751
|
getModuleStatus() {
|
|
734
752
|
return __awaiter(this, void 0, void 0, function* () {
|
|
735
753
|
const response = new BaseResponse_1.BaseResponse();
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GetAddressWidthResponse = void 0;
|
|
4
|
+
const BaseResponse_1 = require("./BaseResponse");
|
|
5
|
+
class GetAddressWidthResponse extends BaseResponse_1.BaseResponse {
|
|
6
|
+
}
|
|
7
|
+
exports.GetAddressWidthResponse = GetAddressWidthResponse;
|
package/package.json
CHANGED
package/src/RequestFactory.ts
CHANGED
|
@@ -16,6 +16,17 @@ export class RequestFactory {
|
|
|
16
16
|
return this._instance;
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
+
//判断模块是否完全加载成功
|
|
20
|
+
public getAddressWidth(cpuName: string) {
|
|
21
|
+
const baseRequest = new BaseRequest("SE_get_cpu_address_width");
|
|
22
|
+
const args: { [key: string]: string } = {};
|
|
23
|
+
args.cpuname = cpuName;
|
|
24
|
+
baseRequest.setArgs(args)
|
|
25
|
+
const request = new JSONRequest()
|
|
26
|
+
request.setRequest(baseRequest.toJSONString());
|
|
27
|
+
return request;
|
|
28
|
+
}
|
|
29
|
+
|
|
19
30
|
//判断模块是否完全加载成功
|
|
20
31
|
public getModuleStatus() {
|
|
21
32
|
const baseRequest = new BaseRequest("SE_get_modules_loaded_status");
|
package/src/SkyEyeClient.ts
CHANGED
|
@@ -25,6 +25,7 @@ import { ServiceError } from '@grpc/grpc-js';
|
|
|
25
25
|
import * as cp from 'child_process';
|
|
26
26
|
import { Board } from './models/Board';
|
|
27
27
|
import { BaseResponse } from './response/BaseResponse';
|
|
28
|
+
import { GetAddressWidthResponse } from './response/GetAddressWidthResponse';
|
|
28
29
|
let client: JSONTransmissionClient | any = null;
|
|
29
30
|
|
|
30
31
|
|
|
@@ -662,6 +663,24 @@ export class SkyEyeClient extends JSONTransmissionClient {
|
|
|
662
663
|
}
|
|
663
664
|
|
|
664
665
|
|
|
666
|
+
public async getAddressWidth(cpuName:string) {
|
|
667
|
+
const response = new GetAddressWidthResponse();
|
|
668
|
+
|
|
669
|
+
try {
|
|
670
|
+
const call = await this.call(RequestFactory.getInstance().getAddressWidth(cpuName))
|
|
671
|
+
// { result: 2, error: null, name: 'SE_get_running_status' }
|
|
672
|
+
if (call != null) {
|
|
673
|
+
response.isSuccess = true;
|
|
674
|
+
response.result = call.result
|
|
675
|
+
}
|
|
676
|
+
console.log(call)
|
|
677
|
+
} catch (error) {
|
|
678
|
+
}
|
|
679
|
+
return response;
|
|
680
|
+
}
|
|
681
|
+
|
|
682
|
+
|
|
683
|
+
|
|
665
684
|
public async getModuleStatus() {
|
|
666
685
|
const response = new BaseResponse();
|
|
667
686
|
|