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.
@@ -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>;
@@ -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,4 @@
1
+ import { BaseResponse } from "./BaseResponse";
2
+ export declare class GetAddressWidthResponse extends BaseResponse {
3
+ result: object;
4
+ }
@@ -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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "skyeye-sdk-js",
3
- "version": "1.4.1",
3
+ "version": "1.4.2",
4
4
  "description": "gRPC to SkyEye",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -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");
@@ -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
 
@@ -0,0 +1,6 @@
1
+ import { Board } from "../models/Board";
2
+ import { BaseResponse } from "./BaseResponse";
3
+
4
+ export class GetAddressWidthResponse extends BaseResponse{
5
+ result:object
6
+ }