skyeye-sdk-js 1.4.13 → 1.4.14

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.
@@ -0,0 +1,22 @@
1
+ {
2
+ // Use IntelliSense to learn about possible attributes.
3
+ // Hover to view descriptions of existing attributes.
4
+ // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5
+ "version": "0.2.0",
6
+ "configurations": [
7
+
8
+ {
9
+ "type": "node",
10
+ "request": "launch",
11
+ "name": "Launch Program",
12
+ "skipFiles": [
13
+ "<node_internals>/**"
14
+ ],
15
+ "program": "${workspaceFolder}\\dist\\test.js",
16
+ "preLaunchTask": "tsc: build - tsconfig.json",
17
+ "outFiles": [
18
+ "${workspaceFolder}/dist/**/*.js"
19
+ ]
20
+ }
21
+ ]
22
+ }
@@ -41,8 +41,8 @@ export declare class RequestFactory {
41
41
  step(cpuName: string, stepNum: number): JSONRequest;
42
42
  singleStep(cpuName: string): JSONRequest;
43
43
  getcpuRegisterInfo(cpuName: string): JSONRequest;
44
- startTimeMonitor(): JSONRequest;
45
- stopTimeMonitor(): JSONRequest;
44
+ startTimeMonitor(id?: string): JSONRequest;
45
+ stopTimeMonitor(id?: string): JSONRequest;
46
46
  registerTimeMonitor(config: object): JSONRequest;
47
- getTimeMonitorConfig(): JSONRequest;
47
+ getTimeMonitorConfig(id?: string): JSONRequest;
48
48
  }
@@ -348,14 +348,20 @@ class RequestFactory {
348
348
  request.setRequest(baseRequest.toJSONString());
349
349
  return request;
350
350
  }
351
- startTimeMonitor() {
351
+ startTimeMonitor(id) {
352
352
  const baseRequest = new BaseRequest_1.BaseRequest("SE_start_time_monitor");
353
+ const args = {};
354
+ args.id = id;
355
+ baseRequest.setArgs(args);
353
356
  const request = new skyeye_rpc_pb_1.JSONRequest();
354
357
  request.setRequest(baseRequest.toJSONString());
355
358
  return request;
356
359
  }
357
- stopTimeMonitor() {
360
+ stopTimeMonitor(id) {
358
361
  const baseRequest = new BaseRequest_1.BaseRequest("SE_stop_time_monitor");
362
+ const args = {};
363
+ args.id = id;
364
+ baseRequest.setArgs(args);
359
365
  const request = new skyeye_rpc_pb_1.JSONRequest();
360
366
  request.setRequest(baseRequest.toJSONString());
361
367
  return request;
@@ -369,8 +375,11 @@ class RequestFactory {
369
375
  request.setRequest(baseRequest.toJSONString());
370
376
  return request;
371
377
  }
372
- getTimeMonitorConfig() {
378
+ getTimeMonitorConfig(id) {
373
379
  const baseRequest = new BaseRequest_1.BaseRequest("SE_get_time_monitor_config");
380
+ const args = {};
381
+ args.id = id;
382
+ baseRequest.setArgs(args);
374
383
  const request = new skyeye_rpc_pb_1.JSONRequest();
375
384
  request.setRequest(baseRequest.toJSONString());
376
385
  return request;
@@ -25,7 +25,7 @@ export declare class SkyEyeClient extends JSONTransmissionClient {
25
25
  stopGrpcService(json: string): Promise<any>;
26
26
  RunTestcase(json: string): Promise<any>;
27
27
  Monitor(json: string): Promise<any>;
28
- timeDataReceive(json: string): any;
28
+ timeDataReceive(id: string): any;
29
29
  call(request: JSONRequest): Promise<any>;
30
30
  callTimeout(request: JSONRequest, timeout: number): Promise<any>;
31
31
  private printRequestLog;
@@ -97,8 +97,8 @@ export declare class SkyEyeClient extends JSONTransmissionClient {
97
97
  private startSkyEye;
98
98
  private setWorkingDirectory;
99
99
  private runScript;
100
- startTimeMonitor(): Promise<any>;
101
- stopTimeMonitor(): Promise<any>;
100
+ startTimeMonitor(id?: string): Promise<any>;
101
+ stopTimeMonitor(id?: string): Promise<any>;
102
102
  registerTimeMonitor(config: object): Promise<any>;
103
- getTimeMonitorConfig(): Promise<any>;
103
+ getTimeMonitorConfig(id?: string): Promise<any>;
104
104
  }
@@ -127,10 +127,10 @@ class SkyEyeClient extends skyeye_rpc_grpc_pb_1.JSONTransmissionClient {
127
127
  }
128
128
  });
129
129
  }
130
- timeDataReceive(json) {
130
+ timeDataReceive(id) {
131
131
  try {
132
132
  const request = new skyeye_rpc_pb_1.JSONRequest();
133
- request.setRequest(json);
133
+ request.setRequest(JSON.stringify({ id: id }));
134
134
  const stream = super.timeDataReceive(request);
135
135
  return stream;
136
136
  }
@@ -1318,10 +1318,10 @@ class SkyEyeClient extends skyeye_rpc_grpc_pb_1.JSONTransmissionClient {
1318
1318
  });
1319
1319
  });
1320
1320
  }
1321
- startTimeMonitor() {
1321
+ startTimeMonitor(id) {
1322
1322
  return __awaiter(this, void 0, void 0, function* () {
1323
1323
  try {
1324
- return yield this.call(RequestFactory_1.RequestFactory.getInstance().startTimeMonitor());
1324
+ return yield this.call(RequestFactory_1.RequestFactory.getInstance().startTimeMonitor(id));
1325
1325
  }
1326
1326
  catch (error) {
1327
1327
  console.error("Error during stopCommand:", error);
@@ -1329,10 +1329,10 @@ class SkyEyeClient extends skyeye_rpc_grpc_pb_1.JSONTransmissionClient {
1329
1329
  }
1330
1330
  });
1331
1331
  }
1332
- stopTimeMonitor() {
1332
+ stopTimeMonitor(id) {
1333
1333
  return __awaiter(this, void 0, void 0, function* () {
1334
1334
  try {
1335
- return yield this.call(RequestFactory_1.RequestFactory.getInstance().stopTimeMonitor());
1335
+ return yield this.call(RequestFactory_1.RequestFactory.getInstance().stopTimeMonitor(id));
1336
1336
  }
1337
1337
  catch (error) {
1338
1338
  console.error("Error during stopCommand:", error);
@@ -1351,10 +1351,10 @@ class SkyEyeClient extends skyeye_rpc_grpc_pb_1.JSONTransmissionClient {
1351
1351
  }
1352
1352
  });
1353
1353
  }
1354
- getTimeMonitorConfig() {
1354
+ getTimeMonitorConfig(id) {
1355
1355
  return __awaiter(this, void 0, void 0, function* () {
1356
1356
  try {
1357
- return yield this.call(RequestFactory_1.RequestFactory.getInstance().getTimeMonitorConfig());
1357
+ return yield this.call(RequestFactory_1.RequestFactory.getInstance().getTimeMonitorConfig(id));
1358
1358
  }
1359
1359
  catch (error) {
1360
1360
  console.error("Error during stopCommand:", error);
package/dist/test.js CHANGED
@@ -17,6 +17,7 @@ var RegisterType;
17
17
  RegisterType[RegisterType["CPU"] = 0] = "CPU";
18
18
  RegisterType[RegisterType["Device"] = 1] = "Device";
19
19
  })(RegisterType || (RegisterType = {}));
20
+ let call;
20
21
  function test() {
21
22
  return __awaiter(this, void 0, void 0, function* () {
22
23
  // console.log("Connected to SkyEye server");
@@ -45,39 +46,49 @@ function test() {
45
46
  // console.log("response:", response)
46
47
  // console.log("response:", response.boardMap)
47
48
  // console.log("response:", response.boardMap.keys[0])
48
- // await client.initSkyEyeAndRun(pathSkyEye,fileName,port,skyeyeDir);
49
49
  // const pathSkyEye = "D:/data/case/FMQL45T900_SylixOS";
50
50
  // const fileName = "FMQL45T900_SylixOS.skyeye";
51
51
  // const skyeyeDir = "D:/install/SkyEye/opt/skyeye/bin/skyeye.exe"
52
52
  // const port = "50066"
53
- // const pathSkyEye = "G:/SkyEye/demo/c6713_demo";
54
- // const fileName = "G:/SkyEye/demo/c6713_demo/c6713_demo.skyeye";
55
- // const skyeyeDir = "G:/SkyEye/opt/skyeye/bin/skyeye.exe"
53
+ const pathSkyEye = "C:/Users/lingt/Downloads/SkyTest_Double";
54
+ const fileName = "C:/Users/lingt/Downloads/SkyTest_Double/SkyTest_Double.skyeye";
55
+ const skyeyeDir = "G:/SkyEye/opt/skyeye/bin/skyeye.exe";
56
56
  const port = "50051";
57
- const client = yield SkyEyeClientFactory.instance.createConnectedClient('127.0.0.1', port);
58
- yield client.registerTimeMonitor({
59
- time: 10,
60
- cpu_name: 'c67x_core_0',
61
- items: [
62
- {
63
- id: '1',
64
- cpu_name: 'c67x_core_0',
65
- var_name: 'int1',
66
- var_type: 'int',
67
- var_bytes: 4,
68
- type: 'global'
69
- }
70
- ]
71
- });
72
- yield client.startTimeMonitor();
73
- const response = yield client.getTimeMonitorConfig();
57
+ // const client = await SkyEyeClientFactory.instance.createConnectedClient('127.0.0.1', port);
58
+ const client = SkyEyeClientFactory.instance.createClient('127.0.0.1', port);
59
+ const t = yield client.initSkyEyeAndRun2(pathSkyEye, fileName, port, skyeyeDir);
60
+ // await client.runCommand();
61
+ const response = yield client.getDeviceTree();
74
62
  console.log(response);
75
- yield client.stopTimeMonitor();
63
+ // await client.registerTimeMonitor({
64
+ // "id": "1",
65
+ // "time": 50,
66
+ // "cpu_name": "c67x_core_0",
67
+ // "direction":"recv",
68
+ // "cycle":-1,
69
+ // "items": [
70
+ // {
71
+ // "id": "cc5f450b-6fbb-7bb3-4544-e761a907b46d",
72
+ // "cpu_name": "c67x_core_0",
73
+ // "var_name": "int1",
74
+ // "var_type": "int",
75
+ // "var_bytes": 4,
76
+ // "type": "global",
77
+ // "value": "111"
78
+ // }
79
+ // ],
80
+ // })
81
+ // await client.startTimeMonitor("1")
82
+ // // await client.getTimeMonitorConfig()
83
+ // console.log('bbbbbbbbbbbb')
84
+ // call = client.timeDataReceive("1")
85
+ // call.on('data',(response)=> {
86
+ // const ackObj = response.getResponse();
87
+ // console.log(ackObj)
88
+ // })
89
+ // console.log('gggggggggggggg')
90
+ // console.log(call)
76
91
  // await client.stopTimeMonitor()
77
- const call = client.timeDataReceive('');
78
- call.on('data', (response) => {
79
- console.log(response);
80
- });
81
92
  // response = client.setBitValue('c67x_core_0', '0x1000','1', 8)
82
93
  // console.log("response:", response)
83
94
  // const responseCpuList = await client.getCpuList()
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "skyeye-sdk-js",
3
- "version": "1.4.13",
3
+ "version": "1.4.14",
4
4
  "description": "gRPC to SkyEye",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -421,15 +421,21 @@ export class RequestFactory {
421
421
  return request;
422
422
  }
423
423
 
424
- public startTimeMonitor() {
424
+ public startTimeMonitor(id?: string) {
425
425
  const baseRequest = new BaseRequest("SE_start_time_monitor");
426
+ const args: { [key: string]: string } = {};
427
+ args.id = id;
428
+ baseRequest.setArgs(args)
426
429
  const request = new JSONRequest()
427
430
  request.setRequest(baseRequest.toJSONString());
428
431
  return request;
429
432
  }
430
433
 
431
- public stopTimeMonitor() {
434
+ public stopTimeMonitor(id?: string) {
432
435
  const baseRequest = new BaseRequest("SE_stop_time_monitor");
436
+ const args: { [key: string]: string } = {};
437
+ args.id = id;
438
+ baseRequest.setArgs(args)
433
439
  const request = new JSONRequest()
434
440
  request.setRequest(baseRequest.toJSONString());
435
441
  return request;
@@ -445,8 +451,11 @@ export class RequestFactory {
445
451
  return request;
446
452
  }
447
453
 
448
- public getTimeMonitorConfig() {
454
+ public getTimeMonitorConfig(id?: string) {
449
455
  const baseRequest = new BaseRequest("SE_get_time_monitor_config");
456
+ const args: { [key: string]: string } = {};
457
+ args.id = id;
458
+ baseRequest.setArgs(args)
450
459
  const request = new JSONRequest()
451
460
  request.setRequest(baseRequest.toJSONString());
452
461
  return request;
@@ -95,10 +95,11 @@ export class SkyEyeClient extends JSONTransmissionClient {
95
95
  }
96
96
 
97
97
 
98
- public timeDataReceive(json: string) {
98
+ public timeDataReceive(id: string) {
99
99
  try {
100
100
  const request = new JSONRequest();
101
- request.setRequest(json);
101
+
102
+ request.setRequest(JSON.stringify({id: id}));
102
103
  const stream = super.timeDataReceive(request);
103
104
  return stream;
104
105
  } catch (error) {
@@ -1239,18 +1240,18 @@ export class SkyEyeClient extends JSONTransmissionClient {
1239
1240
  });
1240
1241
  }
1241
1242
 
1242
- public async startTimeMonitor() {
1243
+ public async startTimeMonitor(id?:string) {
1243
1244
  try {
1244
- return await this.call(RequestFactory.getInstance().startTimeMonitor());
1245
+ return await this.call(RequestFactory.getInstance().startTimeMonitor(id));
1245
1246
  } catch (error) {
1246
1247
  console.error("Error during stopCommand:", error);
1247
1248
  throw error;
1248
1249
  }
1249
1250
  }
1250
1251
 
1251
- public async stopTimeMonitor() {
1252
+ public async stopTimeMonitor(id?:string) {
1252
1253
  try {
1253
- return await this.call(RequestFactory.getInstance().stopTimeMonitor());
1254
+ return await this.call(RequestFactory.getInstance().stopTimeMonitor(id));
1254
1255
  } catch (error) {
1255
1256
  console.error("Error during stopCommand:", error);
1256
1257
  throw error;
@@ -1266,9 +1267,9 @@ export class SkyEyeClient extends JSONTransmissionClient {
1266
1267
  }
1267
1268
  }
1268
1269
 
1269
- public async getTimeMonitorConfig() {
1270
+ public async getTimeMonitorConfig(id?:string) {
1270
1271
  try {
1271
- return await this.call(RequestFactory.getInstance().getTimeMonitorConfig());
1272
+ return await this.call(RequestFactory.getInstance().getTimeMonitorConfig(id));
1272
1273
  } catch (error) {
1273
1274
  console.error("Error during stopCommand:", error);
1274
1275
  throw error;
package/test.ts CHANGED
@@ -12,7 +12,7 @@ enum RegisterType {
12
12
  CPU,
13
13
  Device
14
14
  }
15
-
15
+ let call
16
16
  async function test() {
17
17
  // console.log("Connected to SkyEye server");
18
18
  // await client.getDeviceList();
@@ -50,41 +50,57 @@ async function test() {
50
50
  // console.log("response:", response.boardMap)
51
51
  // console.log("response:", response.boardMap.keys[0])
52
52
 
53
- // await client.initSkyEyeAndRun(pathSkyEye,fileName,port,skyeyeDir);
53
+
54
54
 
55
55
  // const pathSkyEye = "D:/data/case/FMQL45T900_SylixOS";
56
56
  // const fileName = "FMQL45T900_SylixOS.skyeye";
57
57
  // const skyeyeDir = "D:/install/SkyEye/opt/skyeye/bin/skyeye.exe"
58
58
  // const port = "50066"
59
59
 
60
- // const pathSkyEye = "G:/SkyEye/demo/c6713_demo";
61
- // const fileName = "G:/SkyEye/demo/c6713_demo/c6713_demo.skyeye";
62
- // const skyeyeDir = "G:/SkyEye/opt/skyeye/bin/skyeye.exe"
60
+ const pathSkyEye = "C:/Users/lingt/Downloads/SkyTest_Double";
61
+ const fileName = "C:/Users/lingt/Downloads/SkyTest_Double/SkyTest_Double.skyeye";
62
+ const skyeyeDir = "G:/SkyEye/opt/skyeye/bin/skyeye.exe"
63
63
  const port = "50051"
64
- const client = await SkyEyeClientFactory.instance.createConnectedClient('127.0.0.1', port);
65
- await client.registerTimeMonitor({
66
- time: 10,
67
- cpu_name: 'c67x_core_0',
68
- items: [
69
- {
70
- id: '1',
71
- cpu_name: 'c67x_core_0',
72
- var_name: 'int1',
73
- var_type: 'int',
74
- var_bytes: 4,
75
- type: 'global'
76
- }
77
- ]
78
- })
79
- await client.startTimeMonitor()
80
- const response = await client.getTimeMonitorConfig()
64
+ // const client = await SkyEyeClientFactory.instance.createConnectedClient('127.0.0.1', port);
65
+ const client = SkyEyeClientFactory.instance.createClient('127.0.0.1', port);
66
+ const t = await client.initSkyEyeAndRun2(pathSkyEye, fileName, port, skyeyeDir)
67
+ // await client.runCommand();
68
+ const response = await client.getDeviceTree()
81
69
  console.log(response)
82
- await client.stopTimeMonitor()
70
+ // await client.registerTimeMonitor({
71
+ // "id": "1",
72
+ // "time": 50,
73
+ // "cpu_name": "c67x_core_0",
74
+ // "direction":"recv",
75
+ // "cycle":-1,
76
+ // "items": [
77
+
78
+ // {
79
+ // "id": "cc5f450b-6fbb-7bb3-4544-e761a907b46d",
80
+ // "cpu_name": "c67x_core_0",
81
+ // "var_name": "int1",
82
+ // "var_type": "int",
83
+ // "var_bytes": 4,
84
+ // "type": "global",
85
+ // "value": "111"
86
+ // }
87
+ // ],
88
+ // })
89
+
90
+ // await client.startTimeMonitor("1")
91
+ // // await client.getTimeMonitorConfig()
92
+ // console.log('bbbbbbbbbbbb')
93
+
94
+ // call = client.timeDataReceive("1")
95
+ // call.on('data',(response)=> {
96
+ // const ackObj = response.getResponse();
97
+ // console.log(ackObj)
98
+ // })
99
+ // console.log('gggggggggggggg')
100
+
101
+ // console.log(call)
83
102
  // await client.stopTimeMonitor()
84
- const call = client.timeDataReceive('')
85
- call.on('data',(response)=> {
86
- console.log(response)
87
- })
103
+
88
104
 
89
105
  // response = client.setBitValue('c67x_core_0', '0x1000','1', 8)
90
106
  // console.log("response:", response)