skyeye-sdk-js 1.3.9 → 1.4.0
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 +2 -0
- package/dist/src/RequestFactory.js +19 -0
- package/dist/src/SkyEyeClient.d.ts +2 -0
- package/dist/src/SkyEyeClient.js +22 -0
- package/dist/src/response/RunToTimeResponse.d.ts +4 -0
- package/dist/src/response/RunToTimeResponse.js +10 -0
- package/dist/test.js +23 -380
- package/dist/test_backup1.d.ts +1 -0
- package/dist/test_backup1.js +303 -0
- package/package.json +1 -1
- package/src/RequestFactory.ts +22 -0
- package/src/SkyEyeClient.ts +22 -2
- package/src/response/RunToTimeResponse.ts +9 -0
- package/test.ts +30 -448
- package/test_backup1.ts +365 -0
- package/skyeye-sdk-js-1.3.6.tgz +0 -0
- package/skyeye-sdk-js-1.3.7.tgz +0 -0
- package/skyeye-sdk-js-1.3.8.tgz +0 -0
|
@@ -18,6 +18,8 @@ export declare class RequestFactory {
|
|
|
18
18
|
getRunningDeviceInfo(): JSONRequest;
|
|
19
19
|
getSimulationTime(cpuName: string): JSONRequest;
|
|
20
20
|
getCurrentSimulationTime(): JSONRequest;
|
|
21
|
+
getCpuFreq(cpuName: string): JSONRequest;
|
|
22
|
+
runToTimeRequest(cpuName: string, time: string): JSONRequest;
|
|
21
23
|
getCurrentPC(cpuName: string): JSONRequest;
|
|
22
24
|
getCpuMips(cpuName: string): JSONRequest;
|
|
23
25
|
getGlobalVarValue(cpuName: string, varName: string, bytesNum: number, valueType: GlobalVarType): JSONRequest;
|
|
@@ -120,6 +120,25 @@ class RequestFactory {
|
|
|
120
120
|
request.setRequest(baseRequest.toJSONString());
|
|
121
121
|
return request;
|
|
122
122
|
}
|
|
123
|
+
getCpuFreq(cpuName) {
|
|
124
|
+
const baseRequest = new BaseRequest_1.BaseRequest("SE_get_cpu_freq_hz");
|
|
125
|
+
const args = {};
|
|
126
|
+
args.cpuname = cpuName;
|
|
127
|
+
baseRequest.setArgs(args);
|
|
128
|
+
const request = new skyeye_rpc_pb_1.JSONRequest();
|
|
129
|
+
request.setRequest(baseRequest.toJSONString());
|
|
130
|
+
return request;
|
|
131
|
+
}
|
|
132
|
+
runToTimeRequest(cpuName, time) {
|
|
133
|
+
const baseRequest = new BaseRequest_1.BaseRequest("SE_run_to_time");
|
|
134
|
+
const args = {};
|
|
135
|
+
args.cpu_name = cpuName;
|
|
136
|
+
args.time_s = time;
|
|
137
|
+
baseRequest.setArgs(args);
|
|
138
|
+
const request = new skyeye_rpc_pb_1.JSONRequest();
|
|
139
|
+
request.setRequest(baseRequest.toJSONString());
|
|
140
|
+
return request;
|
|
141
|
+
}
|
|
123
142
|
getCurrentPC(cpuName) {
|
|
124
143
|
const baseRequest = new BaseRequest_1.BaseRequest("SE_get_current_pc");
|
|
125
144
|
const args = {};
|
|
@@ -36,6 +36,8 @@ export declare class SkyEyeClient extends JSONTransmissionClient {
|
|
|
36
36
|
getSimulationTime(cpuName: string): Promise<any>;
|
|
37
37
|
getCurrentSimulationTime(): Promise<any>;
|
|
38
38
|
getDeviceList(): Promise<GetDeviceListResponse>;
|
|
39
|
+
runToTime(cpuName: string, time: string): Promise<any>;
|
|
40
|
+
getCpuFreq(cpuName: string): Promise<any>;
|
|
39
41
|
getPC(cpuName: string): Promise<any>;
|
|
40
42
|
getCurrentPC(): Promise<any>;
|
|
41
43
|
getCpuMips(cpuName: string): Promise<any>;
|
package/dist/src/SkyEyeClient.js
CHANGED
|
@@ -361,6 +361,28 @@ class SkyEyeClient extends skyeye_rpc_grpc_pb_1.JSONTransmissionClient {
|
|
|
361
361
|
return response;
|
|
362
362
|
});
|
|
363
363
|
}
|
|
364
|
+
runToTime(cpuName, time) {
|
|
365
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
366
|
+
try {
|
|
367
|
+
return yield this.call(RequestFactory_1.RequestFactory.getInstance().runToTimeRequest(cpuName, time));
|
|
368
|
+
}
|
|
369
|
+
catch (error) {
|
|
370
|
+
console.error("Error during runToTime:", error);
|
|
371
|
+
throw error;
|
|
372
|
+
}
|
|
373
|
+
});
|
|
374
|
+
}
|
|
375
|
+
getCpuFreq(cpuName) {
|
|
376
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
377
|
+
try {
|
|
378
|
+
return yield this.call(RequestFactory_1.RequestFactory.getInstance().getCpuFreq(cpuName));
|
|
379
|
+
}
|
|
380
|
+
catch (error) {
|
|
381
|
+
console.error("Error during getCpuFreq:", error);
|
|
382
|
+
throw error;
|
|
383
|
+
}
|
|
384
|
+
});
|
|
385
|
+
}
|
|
364
386
|
getPC(cpuName) {
|
|
365
387
|
return __awaiter(this, void 0, void 0, function* () {
|
|
366
388
|
try {
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RunToTimeResponse = void 0;
|
|
4
|
+
const BaseResponse_1 = require("./BaseResponse");
|
|
5
|
+
class RunToTimeResponse extends BaseResponse_1.BaseResponse {
|
|
6
|
+
constructor() {
|
|
7
|
+
super();
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
exports.RunToTimeResponse = RunToTimeResponse;
|
package/dist/test.js
CHANGED
|
@@ -12,339 +12,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
12
12
|
const { SkyEyeClientFactory } = require('./src/SkyEyeClientFactory');
|
|
13
13
|
const { SkyEyeClient } = require('./src/SkyEyeClient');
|
|
14
14
|
const { Cpu } = require('./src/models/Cpu');
|
|
15
|
-
const json = {
|
|
16
|
-
"id": "4a162d75-3a84-5264-992f-287624830ead",
|
|
17
|
-
"name": "鍙戦€佸唴瀛樻秷鎭祴璇?",
|
|
18
|
-
"overview": "",
|
|
19
|
-
"parentId": "8a6d70cd-bd7a-4871-d2f3-2f4fdf7b5a46",
|
|
20
|
-
"projectId": "15ffe24f-8ca6-4fcf-afe5-fe01027e2ffb",
|
|
21
|
-
"steps": [
|
|
22
|
-
{
|
|
23
|
-
"id": "35846013-6510-fd0a-a046-a98c2f24157b",
|
|
24
|
-
"sendConditions": {
|
|
25
|
-
"id": "b3c97e92-7367-63ba-6a6b-5f7ca590164c",
|
|
26
|
-
"name": "杩愯0.5s",
|
|
27
|
-
"projectId": "15ffe24f-8ca6-4fcf-afe5-fe01027e2ffb",
|
|
28
|
-
"overview": "",
|
|
29
|
-
"relationship": "A",
|
|
30
|
-
"child": [
|
|
31
|
-
{
|
|
32
|
-
"id": "5ba88de6-a224-0e80-6585-d5e417b424ce",
|
|
33
|
-
"tag": "A",
|
|
34
|
-
"condition": {
|
|
35
|
-
"type": 1,
|
|
36
|
-
"time": 0.5
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
]
|
|
40
|
-
},
|
|
41
|
-
"expectConditions": {
|
|
42
|
-
"id": "6e265328-255e-d7e3-11fd-0a4211d0d0d6",
|
|
43
|
-
"name": "杩愯0.8s",
|
|
44
|
-
"projectId": "15ffe24f-8ca6-4fcf-afe5-fe01027e2ffb",
|
|
45
|
-
"overview": "",
|
|
46
|
-
"relationship": "A",
|
|
47
|
-
"child": [
|
|
48
|
-
{
|
|
49
|
-
"id": "d9e08452-f88b-8de9-bd20-5d5288987fde",
|
|
50
|
-
"tag": "A",
|
|
51
|
-
"condition": {
|
|
52
|
-
"type": 1,
|
|
53
|
-
"time": 0.8
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
]
|
|
57
|
-
},
|
|
58
|
-
"sends": {
|
|
59
|
-
"templateId": "",
|
|
60
|
-
"name": "鍐呭瓨0x4鍙戦€?",
|
|
61
|
-
"child": [
|
|
62
|
-
{
|
|
63
|
-
"id": "0cd71a92-4e7a-dcb8-d74b-dc6ea8103d02",
|
|
64
|
-
"templdateId": "",
|
|
65
|
-
"name": "鏂扮殑鍙戦€?",
|
|
66
|
-
"target": {
|
|
67
|
-
"type": 3,
|
|
68
|
-
"globalName": "",
|
|
69
|
-
"varType": "",
|
|
70
|
-
"addr": "0x4",
|
|
71
|
-
"length": 4,
|
|
72
|
-
"name": "",
|
|
73
|
-
"deviceName": "",
|
|
74
|
-
"busType": 0,
|
|
75
|
-
"directions": 1,
|
|
76
|
-
"nodes": [
|
|
77
|
-
{
|
|
78
|
-
"name": "鑺傜偣1",
|
|
79
|
-
"rtAddr": "",
|
|
80
|
-
"subAddr": "",
|
|
81
|
-
"id": "row_253"
|
|
82
|
-
},
|
|
83
|
-
{
|
|
84
|
-
"name": "鑺傜偣2",
|
|
85
|
-
"rtAddr": "",
|
|
86
|
-
"subAddr": "",
|
|
87
|
-
"id": "row_254"
|
|
88
|
-
}
|
|
89
|
-
],
|
|
90
|
-
"fields": [
|
|
91
|
-
{
|
|
92
|
-
"name": "field1",
|
|
93
|
-
"dataType": 0,
|
|
94
|
-
"defaultValue": 4,
|
|
95
|
-
"dataRange": [],
|
|
96
|
-
"desc": "this is field1",
|
|
97
|
-
"id": "a89ee30f-ea3d-411e-9bf1-543935a003fc"
|
|
98
|
-
}
|
|
99
|
-
]
|
|
100
|
-
},
|
|
101
|
-
"dataFormat": 0,
|
|
102
|
-
"value": "4",
|
|
103
|
-
"fields": [
|
|
104
|
-
{
|
|
105
|
-
"name": "field1",
|
|
106
|
-
"dataType": 0,
|
|
107
|
-
"defaultValue": 4,
|
|
108
|
-
"dataRange": [],
|
|
109
|
-
"desc": "this is field1",
|
|
110
|
-
"id": "d4c808d1-47ba-a30e-cfbe-68c0d2772b3d"
|
|
111
|
-
}
|
|
112
|
-
],
|
|
113
|
-
"_X_ROW_KEY": "row_251"
|
|
114
|
-
}
|
|
115
|
-
]
|
|
116
|
-
},
|
|
117
|
-
"expects": {
|
|
118
|
-
"templateId": "",
|
|
119
|
-
"name": "鍐呭瓨0x14鍙戦€?",
|
|
120
|
-
"child": [
|
|
121
|
-
{
|
|
122
|
-
"id": "85276ca0-0a09-aa87-ebff-1e6dfc4e5f4f",
|
|
123
|
-
"name": "鏂扮殑棰勬湡",
|
|
124
|
-
"templateId": "",
|
|
125
|
-
"target": {
|
|
126
|
-
"type": 3,
|
|
127
|
-
"globalName": "",
|
|
128
|
-
"varType": "",
|
|
129
|
-
"addr": "0x44",
|
|
130
|
-
"length": 4,
|
|
131
|
-
"name": "",
|
|
132
|
-
"deviceName": "",
|
|
133
|
-
"busType": 0,
|
|
134
|
-
"directions": 1,
|
|
135
|
-
"nodes": [
|
|
136
|
-
{
|
|
137
|
-
"name": "鑺傜偣1",
|
|
138
|
-
"rtAddr": "",
|
|
139
|
-
"subAddr": "",
|
|
140
|
-
"id": "row_299"
|
|
141
|
-
},
|
|
142
|
-
{
|
|
143
|
-
"name": "鑺傜偣2",
|
|
144
|
-
"rtAddr": "",
|
|
145
|
-
"subAddr": "",
|
|
146
|
-
"id": "row_300"
|
|
147
|
-
}
|
|
148
|
-
],
|
|
149
|
-
"fields": [
|
|
150
|
-
{
|
|
151
|
-
"name": "field1",
|
|
152
|
-
"dataType": 0,
|
|
153
|
-
"defaultValue": 4,
|
|
154
|
-
"dataRange": [],
|
|
155
|
-
"desc": "this is field1",
|
|
156
|
-
"id": "ef2b8873-516c-a338-a8d0-5e8eda5fa08b"
|
|
157
|
-
}
|
|
158
|
-
]
|
|
159
|
-
},
|
|
160
|
-
"dataFormat": 0,
|
|
161
|
-
"value": "8",
|
|
162
|
-
"fields": [
|
|
163
|
-
{
|
|
164
|
-
"name": "field1",
|
|
165
|
-
"dataType": 0,
|
|
166
|
-
"defaultValue": 4,
|
|
167
|
-
"dataRange": [],
|
|
168
|
-
"desc": "this is field1",
|
|
169
|
-
"id": "379506c9-33d2-167d-6c22-8e0ca8559c0a"
|
|
170
|
-
}
|
|
171
|
-
],
|
|
172
|
-
"_X_ROW_KEY": "row_297"
|
|
173
|
-
}
|
|
174
|
-
]
|
|
175
|
-
},
|
|
176
|
-
"select": true
|
|
177
|
-
}
|
|
178
|
-
],
|
|
179
|
-
"settings": {
|
|
180
|
-
"timeout": ""
|
|
181
|
-
},
|
|
182
|
-
"createdAt": "2024-06-05T02:18:27.630Z",
|
|
183
|
-
"updatedAt": "2024-06-11T06:37:05.487Z",
|
|
184
|
-
"results": []
|
|
185
|
-
};
|
|
186
|
-
class RegisterItem {
|
|
187
|
-
}
|
|
188
15
|
var RegisterType;
|
|
189
16
|
(function (RegisterType) {
|
|
190
17
|
RegisterType[RegisterType["CPU"] = 0] = "CPU";
|
|
191
18
|
RegisterType[RegisterType["Device"] = 1] = "Device";
|
|
192
19
|
})(RegisterType || (RegisterType = {}));
|
|
193
|
-
function getAllRegisterList() {
|
|
194
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
195
|
-
const allRegister = [];
|
|
196
|
-
const client = SkyEyeClientFactory.instance.createClient('127.0.0.1', '50051');
|
|
197
|
-
//通过 getDeviceTree 获取板卡、设备、寄存器层级, 列出所有寄存器列表选择
|
|
198
|
-
const resultTree = yield client.getDeviceTree();
|
|
199
|
-
console.log("结果 resultTree:", JSON.stringify(resultTree));
|
|
200
|
-
console.log("结果 keys:", resultTree.boardMap.keys());
|
|
201
|
-
for (const key of resultTree.boardMap.keys()) {
|
|
202
|
-
const device = resultTree.boardMap.get(key);
|
|
203
|
-
// 在这里对获取到的键值对进行处理
|
|
204
|
-
console.log(`板卡: ${key},设备: ${device.deviceMap}`);
|
|
205
|
-
if (!device.deviceMap || device.deviceMap.keys().length == 0) {
|
|
206
|
-
continue;
|
|
207
|
-
}
|
|
208
|
-
for (const k of device.deviceMap.keys()) {
|
|
209
|
-
const register = device.deviceMap.get(k);
|
|
210
|
-
console.log(`设备: ${k}, 寄存器: ${register}`);
|
|
211
|
-
console.log("寄存器下的寄存器: ", register.registerMap);
|
|
212
|
-
if (!register.registerMap || register.registerMap.keys().length == 0) {
|
|
213
|
-
continue;
|
|
214
|
-
}
|
|
215
|
-
getRegisterMap(register, allRegister);
|
|
216
|
-
}
|
|
217
|
-
}
|
|
218
|
-
console.log("allRegister2:", allRegister.length);
|
|
219
|
-
return allRegister;
|
|
220
|
-
});
|
|
221
|
-
}
|
|
222
|
-
function getRegisterMap(bean, allRegister) {
|
|
223
|
-
if (!bean.registerMap || bean.registerMap.keys().length == 0) {
|
|
224
|
-
return;
|
|
225
|
-
}
|
|
226
|
-
for (const r of bean.registerMap.keys()) {
|
|
227
|
-
const result = bean.registerMap.get(r);
|
|
228
|
-
console.log(`设备: ${r}, 寄存器: ${result}`);
|
|
229
|
-
const item = new RegisterItem();
|
|
230
|
-
item.name = r.name;
|
|
231
|
-
if (bean instanceof Cpu) {
|
|
232
|
-
console.log(`寄存器类型: ${bean.className}`);
|
|
233
|
-
item.type = RegisterType.CPU;
|
|
234
|
-
}
|
|
235
|
-
else {
|
|
236
|
-
item.type = RegisterType.Device;
|
|
237
|
-
}
|
|
238
|
-
allRegister.push(item);
|
|
239
|
-
getRegisterMap(result, allRegister);
|
|
240
|
-
}
|
|
241
|
-
}
|
|
242
|
-
function setRegister() {
|
|
243
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
244
|
-
const client = SkyEyeClientFactory.instance.createClient('127.0.0.1', '50051');
|
|
245
|
-
const r2 = yield client.setDeviceRegisterValue('c6713_0', 'c67x_core_0', 'A7', '34');
|
|
246
|
-
console.log("setRegister:", r2);
|
|
247
|
-
});
|
|
248
|
-
}
|
|
249
|
-
function getRegister() {
|
|
250
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
251
|
-
const client = SkyEyeClientFactory.instance.createClient('127.0.0.1', '50051');
|
|
252
|
-
const result = yield client.getCpuRegisters("");
|
|
253
|
-
console.log("setRegister:", result);
|
|
254
|
-
});
|
|
255
|
-
}
|
|
256
|
-
function getState() {
|
|
257
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
258
|
-
const client = SkyEyeClientFactory.instance.createClient('127.0.0.2', '50051');
|
|
259
|
-
const result = yield client.getCurrentRunningState();
|
|
260
|
-
console.log("getState:", result);
|
|
261
|
-
});
|
|
262
|
-
}
|
|
263
|
-
// getState()
|
|
264
|
-
function setMemoryValue() {
|
|
265
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
266
|
-
const client = SkyEyeClientFactory.instance.createClient('127.0.0.1', '50051');
|
|
267
|
-
const result = yield client.setMemoryValue('c67x_core_0', '10000', '15', 2);
|
|
268
|
-
console.log("setMemoryValue:", result);
|
|
269
|
-
});
|
|
270
|
-
}
|
|
271
|
-
// setMemoryValue()
|
|
272
|
-
function getMemoryValue() {
|
|
273
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
274
|
-
const client = SkyEyeClientFactory.instance.createClient('127.0.0.1', '50051');
|
|
275
|
-
const result = yield client.getMemoryValue('c67x_core_0', "10000", 2);
|
|
276
|
-
console.log("setMemoryValue:", result);
|
|
277
|
-
});
|
|
278
|
-
}
|
|
279
|
-
// getMemoryValue()
|
|
280
|
-
function testSocket() {
|
|
281
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
282
|
-
const json = {
|
|
283
|
-
"msgId": "0",
|
|
284
|
-
"msgTime": "2023-12-5 12:00:00",
|
|
285
|
-
"msgType": "2",
|
|
286
|
-
"msgData": {
|
|
287
|
-
"version": "10001",
|
|
288
|
-
"protocol": "0",
|
|
289
|
-
"direction": "0",
|
|
290
|
-
"bigEndian": "0",
|
|
291
|
-
"length": "0",
|
|
292
|
-
"data": "0"
|
|
293
|
-
}
|
|
294
|
-
};
|
|
295
|
-
const net = require('net');
|
|
296
|
-
const client = new net.Socket();
|
|
297
|
-
const host = '127.0.0.1';
|
|
298
|
-
const port = 8099;
|
|
299
|
-
client.connect(port, host, () => {
|
|
300
|
-
console.log('Connected');
|
|
301
|
-
// const str = JSON.stringify(json)
|
|
302
|
-
// // const str = "hhh"
|
|
303
|
-
// const strBuffer = Buffer.from(str, 'utf8'); // 将字符串转换为 Buffer
|
|
304
|
-
// const strLength = strBuffer.length; // 获取 JSON 数据的长度
|
|
305
|
-
// // 创建一个新的 Buffer 用于存储长度信息和数据
|
|
306
|
-
// const totalLength = 4 + strLength; // 4 字节长度 + 数据长度
|
|
307
|
-
// const buffer = Buffer.alloc(totalLength);
|
|
308
|
-
// // 写入前 4 个字节的长度信息
|
|
309
|
-
// buffer.writeUInt32LE(strLength, 0); // 以小端序方式写入 JSON 数据的长度
|
|
310
|
-
// // 将 JSON 数据复制到 Buffer 中
|
|
311
|
-
// strBuffer.copy(buffer, 4); // 从第 5 个字节开始复制 JSON 数据
|
|
312
|
-
// console.log("Buffer sent:", buffer);
|
|
313
|
-
// console.log("String Length:", strLength); // 打印实际的字符串长度
|
|
314
|
-
// console.log("Hex Length:", strLength.toString(16)); // 打印十六进制表示
|
|
315
|
-
// client.write(buffer); // 发送拼接后的 Buffer
|
|
316
|
-
// 发送数据
|
|
317
|
-
//第一阶段0827测试
|
|
318
|
-
// const hexString = "B90000007B0A09226D73674964223A2230222C0A09226D736754696D65223A22323032332D31322D352031323A30303A3030222C0A09226D736754797065223A2232222C0A09226D736744617461223A7B0A09092276657273696F6E223A2231222C0A09092270726F746F636F6C223A2230222C0A090922646972656374696F6E223A2230222C0A090922626967456E6469616E223A2230222C0A0909226C656E677468223A2230222C0A09092264617461223A2230220A097D0A7D0A";
|
|
319
|
-
const s1 = "12 01 AA 11 BB 22 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 FF FF 00 00 00 00 33 33 00 00 00 00 00 00 00 00 44 44 00 00 00 00 00 00 88 88 66 44 00 00 00 00 00 00 00 00 00 00 65 76";
|
|
320
|
-
const s1_1 = s1.replace(/\s+/g, '');
|
|
321
|
-
const hexString = "B90000007B0D0A09226D73674964223A2230222C0D0A09226D736754797065223A2232222C0D0A09226D736754696D65223A22323032332D31322D352031323A30303A3030222C0D0A09226D736744617461223A207B0D0A09092276657273696F6E223A223130303031222C0D0A09092270726F746F636F6C223A2230222C0D0A090922646972656374696F6E223A2230222C0D0A090922626967456E6469616E223A2230222C0D0A0909226C656E677468223A36340D0A097D0D0A7D" + s1_1;
|
|
322
|
-
//74
|
|
323
|
-
// const hexString = "B90000007B0D0A09226D73674964223A2230222C0D0A09226D736754797065223A2232222C0D0A09226D736754696D65223A22323032332D31322D352031323A30303A3030222C0D0A09226D736744617461223A207B0D0A09092276657273696F6E223A223130303031222C0D0A09092270726F746F636F6C223A2230222C0D0A090922646972656374696F6E223A2230222C0D0A090922626967456E6469616E223A2230222C0D0A0909226C656E677468223A37340D0A097D0D0A7D1201AA11BB220000000000000000000000000000FFFF000000003333000000000000000044440000000000008888664400000000000000000000006576";
|
|
324
|
-
console.log("hexString:", hexString);
|
|
325
|
-
console.log("hexString:", hexString.length);
|
|
326
|
-
const buffer2 = Buffer.from(hexString, 'hex');
|
|
327
|
-
console.log("buffer2:", buffer2.length);
|
|
328
|
-
client.write(buffer2);
|
|
329
|
-
});
|
|
330
|
-
client.on('data', (data) => {
|
|
331
|
-
console.log('Received: ' + data);
|
|
332
|
-
client.destroy();
|
|
333
|
-
});
|
|
334
|
-
client.on('close', () => {
|
|
335
|
-
console.log('Connection closed');
|
|
336
|
-
});
|
|
337
|
-
});
|
|
338
|
-
}
|
|
339
|
-
testSocket();
|
|
340
|
-
function testgetGlobalVarValue() {
|
|
341
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
342
|
-
const client = SkyEyeClientFactory.instance.createClient('127.0.0.1', '50052');
|
|
343
|
-
const response = yield client.getGlobalVarValue("cx53123", "a", 16, "double");
|
|
344
|
-
console.log("testgetGlobalVarValue response:", response);
|
|
345
|
-
});
|
|
346
|
-
}
|
|
347
|
-
// testgetGlobalVarValue()
|
|
348
20
|
function test() {
|
|
349
21
|
return __awaiter(this, void 0, void 0, function* () {
|
|
350
22
|
// console.log("Connected to SkyEye server");
|
|
@@ -359,18 +31,12 @@ function test() {
|
|
|
359
31
|
// const response = await client.getMemoryValueDefault(1, 16);
|
|
360
32
|
// const response = await client.getMemoryValue("c7s",0,16);
|
|
361
33
|
// console.log("结果response:", response)
|
|
362
|
-
// await client.initSkyEyeAndRun(pathSkyEye,fileName,port,skyeyeDir);
|
|
363
|
-
// const pathSkyEye = "D:/data/case/c6713_demo";
|
|
364
|
-
// const fileName = "c6713_demo.skyeye";
|
|
365
|
-
// const skyeyeDir = "D:/install/skyeye/opt/skyeye/bin/skyeye.exe"
|
|
366
|
-
// const port = "50051"
|
|
367
|
-
// const client = SkyEyeClientFactory.instance.createClient('127.0.0.1', '50051');
|
|
368
|
-
// await client.initSkyEyeAndRun2(pathSkyEye, fileName, port, skyeyeDir)
|
|
369
34
|
// const pathSkyEye = "D:/data/case/workspace_c6713/targets/c6713_fc_1553b";
|
|
370
35
|
// const fileName = "c6713_fc_1553b.skyeye";
|
|
371
36
|
// const skyeyeDir = "D:/install/skyeye/opt/skyeye/bin/skyeye.exe"
|
|
372
|
-
// const client = SkyEyeClientFactory.instance.createClient('127.0.0.1',
|
|
37
|
+
// const client = SkyEyeClientFactory.instance.createClient('127.0.0.1', 50061);
|
|
373
38
|
// const response =await client.getCurrentRunningState()
|
|
39
|
+
// console.log("response:", response)
|
|
374
40
|
// const response = await client.getMemoryValueDefault("128","4")
|
|
375
41
|
// const response = await client.getGlobalVarValueDefault("number_a","int")
|
|
376
42
|
// const response = await client.setGlobalVarValueDefault("number_a", "int", "12")
|
|
@@ -379,49 +45,26 @@ function test() {
|
|
|
379
45
|
// console.log("response:", response)
|
|
380
46
|
// console.log("response:", response.boardMap)
|
|
381
47
|
// console.log("response:", response.boardMap.keys[0])
|
|
48
|
+
// await client.initSkyEyeAndRun(pathSkyEye,fileName,port,skyeyeDir);
|
|
49
|
+
// const pathSkyEye = "D:/data/case/FMQL45T900_SylixOS";
|
|
50
|
+
// const fileName = "FMQL45T900_SylixOS.skyeye";
|
|
51
|
+
// const skyeyeDir = "D:/install/SkyEye/opt/skyeye/bin/skyeye.exe"
|
|
52
|
+
// const port = "50066"
|
|
53
|
+
const pathSkyEye = "D:/data/case/c6713_timer_test";
|
|
54
|
+
const fileName = "c6k.skyeye";
|
|
55
|
+
const skyeyeDir = "D:/install/SkyEye/opt/skyeye/bin/skyeye.exe";
|
|
56
|
+
const port = "50053";
|
|
57
|
+
const client = SkyEyeClientFactory.instance.createClient('127.0.0.1', port);
|
|
58
|
+
const t = yield client.initSkyEyeAndRun2(pathSkyEye, fileName, port, skyeyeDir);
|
|
59
|
+
client.runCommand();
|
|
60
|
+
const response = yield client.runToTime("c67x_core_0", "1");
|
|
61
|
+
console.log("response:", response);
|
|
62
|
+
// const responseCpuList = await client.getCpuList()
|
|
63
|
+
// console.log("responseCpuList:", responseCpuList)
|
|
64
|
+
// const client = SkyEyeClientFactory.instance.createClient('127.0.0.1', 50056);
|
|
65
|
+
// const cpuname = "fmql45t900_0_fmql45t900_core_0";
|
|
66
|
+
// const response = await client.getCpuFreq(cpuname)
|
|
67
|
+
// { name: 'SE_get_cpu_freq_hz', result: 200000000, error: null }
|
|
382
68
|
});
|
|
383
69
|
}
|
|
384
|
-
|
|
385
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
386
|
-
const pathSkyEye = "D:/data/case/workspace_c6713/targets/c6713_fc_1553b";
|
|
387
|
-
const fileName = "c6713_fc_1553b.skyeye";
|
|
388
|
-
const skyeyeDir = "D:/install/skyeye/opt/skyeye/bin/skyeye.exe";
|
|
389
|
-
const client = SkyEyeClientFactory.instance.createClient('127.0.0.1', '50051');
|
|
390
|
-
//启动多个skyeye
|
|
391
|
-
const count = 5;
|
|
392
|
-
const map = new Map;
|
|
393
|
-
for (let i = 1; i < count; i++) {
|
|
394
|
-
const port = 50050 + i;
|
|
395
|
-
const client = SkyEyeClientFactory.instance.createClient('127.0.0.1', port.toString());
|
|
396
|
-
yield client.initSkyEyeAndRun2(pathSkyEye, fileName, port.toString(), skyeyeDir);
|
|
397
|
-
yield client.RunTestcase(json);
|
|
398
|
-
yield client.runCommand();
|
|
399
|
-
const res = yield client.getCurrentRunningState();
|
|
400
|
-
console.log("state3:", res.state);
|
|
401
|
-
map.set(port, client);
|
|
402
|
-
}
|
|
403
|
-
for (let i = 1; i < count; i++) {
|
|
404
|
-
setTimeout(() => __awaiter(this, void 0, void 0, function* () {
|
|
405
|
-
const port = 50050 + i;
|
|
406
|
-
const client = map.get(port);
|
|
407
|
-
yield client.quitCommand();
|
|
408
|
-
}), i * 5000);
|
|
409
|
-
}
|
|
410
|
-
setTimeout(() => __awaiter(this, void 0, void 0, function* () {
|
|
411
|
-
// await map.get(50051).stopGrpcService("")
|
|
412
|
-
yield map.get(50051).quitCommand();
|
|
413
|
-
}), 2000);
|
|
414
|
-
setTimeout(() => __awaiter(this, void 0, void 0, function* () {
|
|
415
|
-
// await map.get(50052).stopGrpcService("")
|
|
416
|
-
yield map.get(50052).quitCommand();
|
|
417
|
-
}), 5000);
|
|
418
|
-
setTimeout(() => __awaiter(this, void 0, void 0, function* () {
|
|
419
|
-
// await map.get(50053).stopGrpcService("")
|
|
420
|
-
yield map.get(50053).quitCommand();
|
|
421
|
-
}), 8000);
|
|
422
|
-
setTimeout(() => __awaiter(this, void 0, void 0, function* () {
|
|
423
|
-
// await map.get(50054).stopGrpcService("")
|
|
424
|
-
yield map.get(50054).quitCommand();
|
|
425
|
-
}), 11000);
|
|
426
|
-
});
|
|
427
|
-
}
|
|
70
|
+
test();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|