skyeye-sdk-js 1.0.0 → 1.0.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/index.d.ts +0 -0
- package/dist/index.js +0 -0
- package/dist/src/GrpcUtil.d.ts +9 -0
- package/dist/src/GrpcUtil.js +55 -0
- package/dist/src/JsonRequest.d.ts +10 -0
- package/dist/src/JsonRequest.js +29 -0
- package/dist/src/JsonResponse.d.ts +12 -0
- package/dist/src/JsonResponse.js +36 -0
- package/dist/src/RequestFactory.d.ts +35 -0
- package/dist/src/RequestFactory.js +257 -0
- package/dist/src/SkyEyeClient.d.ts +70 -0
- package/dist/src/SkyEyeClient.js +831 -0
- package/dist/src/SkyEyeClientFactory.d.ts +10 -0
- package/dist/src/SkyEyeClientFactory.js +53 -0
- package/dist/src/exception/SkyEyeSDKException.d.ts +3 -0
- package/dist/src/exception/SkyEyeSDKException.js +13 -0
- package/dist/src/models/Board.d.ts +9 -0
- package/dist/src/models/Board.js +15 -0
- package/dist/src/models/Cpu.d.ts +14 -0
- package/dist/src/models/Cpu.js +47 -0
- package/dist/src/models/CpuInterface.d.ts +13 -0
- package/dist/src/models/CpuInterface.js +2 -0
- package/dist/src/models/Device.d.ts +38 -0
- package/dist/src/models/Device.js +26 -0
- package/dist/src/models/DeviceInterface.d.ts +12 -0
- package/dist/src/models/DeviceInterface.js +2 -0
- package/dist/src/models/DeviceState.d.ts +4 -0
- package/dist/src/models/DeviceState.js +8 -0
- package/dist/src/models/FaultInjectItem.d.ts +11 -0
- package/dist/src/models/FaultInjectItem.js +16 -0
- package/dist/src/models/FaultInjectItemInterface.d.ts +9 -0
- package/dist/src/models/FaultInjectItemInterface.js +2 -0
- package/dist/src/models/FaultInjectType.d.ts +11 -0
- package/dist/src/models/FaultInjectType.js +25 -0
- package/dist/src/models/GlobalVarType.d.ts +5 -0
- package/dist/src/models/GlobalVarType.js +9 -0
- package/dist/src/models/InstructionItem.d.ts +5 -0
- package/dist/src/models/InstructionItem.js +6 -0
- package/dist/src/models/Node.d.ts +4 -0
- package/dist/src/models/Node.js +2 -0
- package/dist/src/models/Register.d.ts +38 -0
- package/dist/src/models/Register.js +32 -0
- package/dist/src/models/RegisterInterface.d.ts +10 -0
- package/dist/src/models/RegisterInterface.js +2 -0
- package/dist/src/requests/BaseRequest.d.ts +13 -0
- package/dist/src/requests/BaseRequest.js +18 -0
- package/dist/src/response/BaseResponse.d.ts +5 -0
- package/dist/src/response/BaseResponse.js +7 -0
- package/dist/src/response/GetAllDeviceInfoResponse.d.ts +5 -0
- package/dist/src/response/GetAllDeviceInfoResponse.js +11 -0
- package/dist/src/response/GetCpuListResponse.d.ts +8 -0
- package/dist/src/response/GetCpuListResponse.js +18 -0
- package/dist/src/response/GetCpuRegisterInfoResponse.d.ts +6 -0
- package/dist/src/response/GetCpuRegisterInfoResponse.js +11 -0
- package/dist/src/response/GetCurrentPCResponse.d.ts +4 -0
- package/dist/src/response/GetCurrentPCResponse.js +7 -0
- package/dist/src/response/GetDeviceListResponse.d.ts +6 -0
- package/dist/src/response/GetDeviceListResponse.js +11 -0
- package/dist/src/response/GetDeviceTreeResponse.d.ts +5 -0
- package/dist/src/response/GetDeviceTreeResponse.js +11 -0
- package/dist/src/response/GetDisassembleInfoResponse.d.ts +5 -0
- package/dist/src/response/GetDisassembleInfoResponse.js +7 -0
- package/dist/src/response/GetFaultInjectListResponse.d.ts +8 -0
- package/dist/src/response/GetFaultInjectListResponse.js +18 -0
- package/dist/src/response/GetRamAddrInfoResponse.d.ts +5 -0
- package/dist/src/response/GetRamAddrInfoResponse.js +7 -0
- package/dist/src/response/GetRunningStateResponse.d.ts +14 -0
- package/dist/src/response/GetRunningStateResponse.js +25 -0
- package/dist/src/utils/ParseBoardUtils.d.ts +6 -0
- package/dist/src/utils/ParseBoardUtils.js +108 -0
- package/index.ts +0 -0
- package/package.json +1 -1
- package/index.js +0 -9
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { SkyEyeClient } from "./SkyEyeClient";
|
|
2
|
+
declare class SkyEyeClientFactory {
|
|
3
|
+
private static _instance;
|
|
4
|
+
private constructor();
|
|
5
|
+
static get instance(): SkyEyeClientFactory;
|
|
6
|
+
createClient(ip: string, port: string): SkyEyeClient;
|
|
7
|
+
createConnectedClient(ip: string, port: string): Promise<SkyEyeClient>;
|
|
8
|
+
createConnectedClientTime(ip: string, port: string, time: number): Promise<SkyEyeClient>;
|
|
9
|
+
}
|
|
10
|
+
export { SkyEyeClientFactory };
|
|
@@ -0,0 +1,53 @@
|
|
|
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;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SkyEyeSDKException = void 0;
|
|
4
|
+
// 定义 SkyEyeSDKException 类
|
|
5
|
+
class SkyEyeSDKException extends Error {
|
|
6
|
+
constructor(message) {
|
|
7
|
+
// 调用父类的构造函数
|
|
8
|
+
super(message);
|
|
9
|
+
// 设置类名
|
|
10
|
+
this.name = 'SkyEyeSDKException';
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
exports.SkyEyeSDKException = SkyEyeSDKException;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Board = void 0;
|
|
4
|
+
class Board {
|
|
5
|
+
getName() {
|
|
6
|
+
return this.name;
|
|
7
|
+
}
|
|
8
|
+
getParent() {
|
|
9
|
+
return null;
|
|
10
|
+
}
|
|
11
|
+
toString() {
|
|
12
|
+
return `Board{name='${this.name}', deviceMap=${this.deviceMap}}`;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
exports.Board = Board;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Device } from './Device';
|
|
2
|
+
import { Node } from './Node';
|
|
3
|
+
import { CpuInterface } from './CpuInterface';
|
|
4
|
+
export declare class Cpu extends Device implements Node {
|
|
5
|
+
/**
|
|
6
|
+
* CPU类型
|
|
7
|
+
*/
|
|
8
|
+
getClassName(): string;
|
|
9
|
+
setClassName(className: string): void;
|
|
10
|
+
setName(name: string): void;
|
|
11
|
+
setParent(parent: Node): void;
|
|
12
|
+
constructor(info: CpuInterface | null);
|
|
13
|
+
toString(): string;
|
|
14
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Cpu = void 0;
|
|
4
|
+
const Device_1 = require("./Device");
|
|
5
|
+
class Cpu extends Device_1.Device {
|
|
6
|
+
/**
|
|
7
|
+
* CPU类型
|
|
8
|
+
*/
|
|
9
|
+
// private className: string;
|
|
10
|
+
getClassName() {
|
|
11
|
+
return this.className;
|
|
12
|
+
}
|
|
13
|
+
setClassName(className) {
|
|
14
|
+
this.className = className;
|
|
15
|
+
}
|
|
16
|
+
setName(name) {
|
|
17
|
+
this.name = name;
|
|
18
|
+
}
|
|
19
|
+
setParent(parent) {
|
|
20
|
+
this.parent = parent;
|
|
21
|
+
}
|
|
22
|
+
constructor(info) {
|
|
23
|
+
if (info) {
|
|
24
|
+
super(info);
|
|
25
|
+
this.className = info.className;
|
|
26
|
+
}
|
|
27
|
+
else {
|
|
28
|
+
super(null);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
// constructor(
|
|
32
|
+
// className: string,
|
|
33
|
+
// name: string,
|
|
34
|
+
// parent: Node | null,
|
|
35
|
+
// registerMap: Map<string, Register>,
|
|
36
|
+
// baseAddr: number | null,
|
|
37
|
+
// length: number | null,
|
|
38
|
+
// state: DeviceState
|
|
39
|
+
// ) {
|
|
40
|
+
// super(name, parent, registerMap, baseAddr, length, 'Cpu', state);
|
|
41
|
+
// this.className = className;
|
|
42
|
+
// }
|
|
43
|
+
toString() {
|
|
44
|
+
return `Cpu{className='${this.className}', name='${this.name}', parent=${this.parent != null ? this.parent.getName() : null}, registerMap=${this.registerMap}, state=${this.state}}`;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
exports.Cpu = Cpu;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Register } from './Register';
|
|
2
|
+
import { DeviceState } from './DeviceState';
|
|
3
|
+
import { Node } from './Node';
|
|
4
|
+
import { DeviceInterface } from './DeviceInterface';
|
|
5
|
+
export interface CpuInterface extends DeviceInterface {
|
|
6
|
+
className: string;
|
|
7
|
+
name: string;
|
|
8
|
+
parent: Node | null;
|
|
9
|
+
registerMap: Map<string, Register>;
|
|
10
|
+
baseAddr: number | null;
|
|
11
|
+
length: number | null;
|
|
12
|
+
state: DeviceState;
|
|
13
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { Node } from './Node';
|
|
2
|
+
import { Register } from './Register';
|
|
3
|
+
import { DeviceState } from './DeviceState';
|
|
4
|
+
import { DeviceInterface } from './DeviceInterface';
|
|
5
|
+
export declare class Device implements Node {
|
|
6
|
+
/**
|
|
7
|
+
* 设备名称
|
|
8
|
+
*/
|
|
9
|
+
name: string;
|
|
10
|
+
/**
|
|
11
|
+
* 设备所在单板
|
|
12
|
+
*/
|
|
13
|
+
parent: Node | null;
|
|
14
|
+
/**
|
|
15
|
+
* 设备上的寄存器列表
|
|
16
|
+
*/
|
|
17
|
+
registerMap: Map<string, Register>;
|
|
18
|
+
/**
|
|
19
|
+
* 设备的基地址
|
|
20
|
+
*/
|
|
21
|
+
baseAddr: number | null;
|
|
22
|
+
/**
|
|
23
|
+
* 设备的地址长度
|
|
24
|
+
*/
|
|
25
|
+
length: number | null;
|
|
26
|
+
/**
|
|
27
|
+
* 设备类型
|
|
28
|
+
*/
|
|
29
|
+
className: string;
|
|
30
|
+
/**
|
|
31
|
+
* 设备状态
|
|
32
|
+
*/
|
|
33
|
+
state: DeviceState;
|
|
34
|
+
getName(): string;
|
|
35
|
+
getParent(): Node | null;
|
|
36
|
+
constructor(info: DeviceInterface | null);
|
|
37
|
+
toString(): string;
|
|
38
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Device = void 0;
|
|
4
|
+
class Device {
|
|
5
|
+
getName() {
|
|
6
|
+
return this.name;
|
|
7
|
+
}
|
|
8
|
+
getParent() {
|
|
9
|
+
return this.parent;
|
|
10
|
+
}
|
|
11
|
+
constructor(info) {
|
|
12
|
+
if (info) {
|
|
13
|
+
this.name = info.name;
|
|
14
|
+
this.parent = info.parent;
|
|
15
|
+
this.registerMap = info.registerMap;
|
|
16
|
+
this.baseAddr = info.baseAddr;
|
|
17
|
+
this.length = info.length;
|
|
18
|
+
this.className = info.className;
|
|
19
|
+
this.state = info.state;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
toString() {
|
|
23
|
+
return `Device{name='${this.name}', parent=${this.parent != null ? this.parent.getName() : null}, registerMap=${this.registerMap}, baseAddr=${this.baseAddr}, length=${this.length}, className='${this.className}', state=${this.state}}`;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
exports.Device = Device;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Register } from './Register';
|
|
2
|
+
import { DeviceState } from './DeviceState';
|
|
3
|
+
import { Node } from './Node';
|
|
4
|
+
export interface DeviceInterface {
|
|
5
|
+
name: string;
|
|
6
|
+
parent: Node | null;
|
|
7
|
+
registerMap: Map<string, Register>;
|
|
8
|
+
baseAddr: number | null;
|
|
9
|
+
length: number | null;
|
|
10
|
+
className: string;
|
|
11
|
+
state: DeviceState;
|
|
12
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DeviceState = void 0;
|
|
4
|
+
var DeviceState;
|
|
5
|
+
(function (DeviceState) {
|
|
6
|
+
DeviceState[DeviceState["ENABLE"] = 1] = "ENABLE";
|
|
7
|
+
DeviceState[DeviceState["DISABLE"] = 0] = "DISABLE";
|
|
8
|
+
})(DeviceState || (exports.DeviceState = DeviceState = {}));
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { FaultInjectItemInterface } from "./FaultInjectItemInterface";
|
|
2
|
+
import { FaultInjectType } from "./FaultInjectType";
|
|
3
|
+
export declare class FaultInjectItem {
|
|
4
|
+
boardName: string;
|
|
5
|
+
deviceName: string;
|
|
6
|
+
registerName: string;
|
|
7
|
+
addr: number;
|
|
8
|
+
bit: number;
|
|
9
|
+
type: FaultInjectType;
|
|
10
|
+
constructor(info: FaultInjectItemInterface | null);
|
|
11
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FaultInjectItem = void 0;
|
|
4
|
+
class FaultInjectItem {
|
|
5
|
+
constructor(info) {
|
|
6
|
+
if (info) {
|
|
7
|
+
this.boardName = info.boardName;
|
|
8
|
+
this.deviceName = info.deviceName;
|
|
9
|
+
this.registerName = info.registerName;
|
|
10
|
+
this.addr = info.addr;
|
|
11
|
+
this.bit = info.bit;
|
|
12
|
+
this.type = info.type;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
exports.FaultInjectItem = FaultInjectItem;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare enum FaultInjectType {
|
|
2
|
+
SET_ZERO = "0",
|
|
3
|
+
SET_ONE = "1",
|
|
4
|
+
SET_REVE = "2"
|
|
5
|
+
}
|
|
6
|
+
export declare const FaultInjectTypeDescription: {
|
|
7
|
+
"0": string;
|
|
8
|
+
"1": string;
|
|
9
|
+
"2": string;
|
|
10
|
+
};
|
|
11
|
+
export declare function getFaultInjectTypeByValue(value: string): FaultInjectType | null;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getFaultInjectTypeByValue = exports.FaultInjectTypeDescription = exports.FaultInjectType = void 0;
|
|
4
|
+
var FaultInjectType;
|
|
5
|
+
(function (FaultInjectType) {
|
|
6
|
+
FaultInjectType["SET_ZERO"] = "0";
|
|
7
|
+
FaultInjectType["SET_ONE"] = "1";
|
|
8
|
+
FaultInjectType["SET_REVE"] = "2";
|
|
9
|
+
})(FaultInjectType || (exports.FaultInjectType = FaultInjectType = {}));
|
|
10
|
+
// 可选的描述信息
|
|
11
|
+
exports.FaultInjectTypeDescription = {
|
|
12
|
+
"0": "置零",
|
|
13
|
+
"1": "置一",
|
|
14
|
+
"2": "取反"
|
|
15
|
+
};
|
|
16
|
+
// 通过值获取故障注入类型
|
|
17
|
+
function getFaultInjectTypeByValue(value) {
|
|
18
|
+
for (const key in FaultInjectType) {
|
|
19
|
+
if (FaultInjectType[key] === value) {
|
|
20
|
+
return key;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
return null;
|
|
24
|
+
}
|
|
25
|
+
exports.getFaultInjectTypeByValue = getFaultInjectTypeByValue;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GlobalVarType = void 0;
|
|
4
|
+
var GlobalVarType;
|
|
5
|
+
(function (GlobalVarType) {
|
|
6
|
+
GlobalVarType["INT"] = "int";
|
|
7
|
+
GlobalVarType["DOUBLE"] = "double";
|
|
8
|
+
GlobalVarType["FLOAT"] = "float";
|
|
9
|
+
})(GlobalVarType || (exports.GlobalVarType = GlobalVarType = {}));
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { Node } from './Node';
|
|
2
|
+
import { RegisterInterface } from './RegisterInterface';
|
|
3
|
+
export declare class Register implements Node {
|
|
4
|
+
/**
|
|
5
|
+
* 寄存器名称
|
|
6
|
+
*/
|
|
7
|
+
name: string;
|
|
8
|
+
/**
|
|
9
|
+
* 寄存器所在设备
|
|
10
|
+
*/
|
|
11
|
+
parent: Node | null;
|
|
12
|
+
/**
|
|
13
|
+
* 寄存器的基地址
|
|
14
|
+
*/
|
|
15
|
+
baseAddr: number | null;
|
|
16
|
+
/**
|
|
17
|
+
* 寄存器位数
|
|
18
|
+
*/
|
|
19
|
+
bits: number | null;
|
|
20
|
+
/**
|
|
21
|
+
* 寄存器值
|
|
22
|
+
*/
|
|
23
|
+
value: number | null;
|
|
24
|
+
/**
|
|
25
|
+
* 寄存器偏移值
|
|
26
|
+
*/
|
|
27
|
+
offset: number | null;
|
|
28
|
+
/**
|
|
29
|
+
* 寄存器描述
|
|
30
|
+
*/
|
|
31
|
+
description: string;
|
|
32
|
+
getName(): string;
|
|
33
|
+
setName(name: string): void;
|
|
34
|
+
getParent(): Node | null;
|
|
35
|
+
setParent(node: Node): void;
|
|
36
|
+
constructor(info: RegisterInterface | null | undefined);
|
|
37
|
+
toString(): string;
|
|
38
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
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) {
|
|
18
|
+
if (info) {
|
|
19
|
+
this.name = info.name;
|
|
20
|
+
this.parent = info.parent;
|
|
21
|
+
this.baseAddr = info.baseAddr;
|
|
22
|
+
this.bits = info.bits;
|
|
23
|
+
this.value = info.value;
|
|
24
|
+
this.offset = info.offset;
|
|
25
|
+
this.description = info.description;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
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
|
+
}
|
|
32
|
+
exports.Register = Register;
|
|
@@ -0,0 +1,18 @@
|
|
|
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;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
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
|
+
}
|
|
7
|
+
exports.BaseResponse = BaseResponse;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
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();
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
exports.GetAllDeviceInfoResponse = GetAllDeviceInfoResponse;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
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";
|
|
10
|
+
}
|
|
11
|
+
getCpuList() {
|
|
12
|
+
return this.cpuList;
|
|
13
|
+
}
|
|
14
|
+
setCpuList(cpuList) {
|
|
15
|
+
this.cpuList = cpuList;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
exports.GetCpuListResponse = GetCpuListResponse;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GetCpuRegisterInfoResponse = void 0;
|
|
4
|
+
const BaseResponse_1 = require("./BaseResponse");
|
|
5
|
+
class GetCpuRegisterInfoResponse extends BaseResponse_1.BaseResponse {
|
|
6
|
+
constructor() {
|
|
7
|
+
super();
|
|
8
|
+
this.registers = [];
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
exports.GetCpuRegisterInfoResponse = GetCpuRegisterInfoResponse;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GetCurrentPCResponse = void 0;
|
|
4
|
+
const BaseResponse_1 = require("./BaseResponse");
|
|
5
|
+
class GetCurrentPCResponse extends BaseResponse_1.BaseResponse {
|
|
6
|
+
}
|
|
7
|
+
exports.GetCurrentPCResponse = GetCurrentPCResponse;
|