skyeye-sdk-js 1.0.2 → 1.0.4
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/SkyEyeClient.js +9 -9
- package/dist/proto/skyeye_rpc.proto +11 -0
- package/dist/proto/skyeye_rpc_grpc_pb.d.ts +40 -0
- package/dist/proto/skyeye_rpc_grpc_pb.js +44 -0
- package/dist/proto/skyeye_rpc_pb.d.ts +47 -0
- package/dist/proto/skyeye_rpc_pb.js +322 -0
- package/dist/src/SkyEyeClient.js +8 -8
- package/dist/src/SkyEyeClientFactory.js +1 -1
- package/package.json +1 -1
- package/src/SkyEyeClient.js +8 -8
- package/src/SkyEyeClient.ts +8 -8
- package/src/SkyEyeClientFactory.ts +1 -1
- package/src/test.js +2 -2
package/dist/SkyEyeClient.js
CHANGED
|
@@ -334,7 +334,7 @@ class SkyEyeClient extends skyeye_rpc_grpc_pb_1.JSONTransmissionClient {
|
|
|
334
334
|
return yield this.call(RequestFactory_1.RequestFactory.getInstance().getCpuMips(cpuName));
|
|
335
335
|
}
|
|
336
336
|
catch (error) {
|
|
337
|
-
console.error("Error during
|
|
337
|
+
console.error("Error during getCpuMips:", error);
|
|
338
338
|
throw error;
|
|
339
339
|
}
|
|
340
340
|
});
|
|
@@ -348,7 +348,7 @@ class SkyEyeClient extends skyeye_rpc_grpc_pb_1.JSONTransmissionClient {
|
|
|
348
348
|
return yield this.call(RequestFactory_1.RequestFactory.getInstance().getCpuMips(cpuList[0].getName()));
|
|
349
349
|
}
|
|
350
350
|
catch (error) {
|
|
351
|
-
console.error("Error during
|
|
351
|
+
console.error("Error during getCurrentCpuMips:", error);
|
|
352
352
|
throw error;
|
|
353
353
|
}
|
|
354
354
|
}
|
|
@@ -364,7 +364,7 @@ class SkyEyeClient extends skyeye_rpc_grpc_pb_1.JSONTransmissionClient {
|
|
|
364
364
|
return yield this.call(RequestFactory_1.RequestFactory.getInstance().getGlobalVarValue(cpuName, varName, bytesNum, valueType));
|
|
365
365
|
}
|
|
366
366
|
catch (error) {
|
|
367
|
-
console.error("Error during
|
|
367
|
+
console.error("Error during getGlobalVarValue:", error);
|
|
368
368
|
throw error;
|
|
369
369
|
}
|
|
370
370
|
});
|
|
@@ -377,7 +377,7 @@ class SkyEyeClient extends skyeye_rpc_grpc_pb_1.JSONTransmissionClient {
|
|
|
377
377
|
return yield this.call(RequestFactory_1.RequestFactory.getInstance().getGlobalVarValue(cpuList[0].getName(), varName, 4, valueType));
|
|
378
378
|
}
|
|
379
379
|
catch (error) {
|
|
380
|
-
console.error("Error during
|
|
380
|
+
console.error("Error during getGlobalVarValueDefault:", error);
|
|
381
381
|
throw error;
|
|
382
382
|
}
|
|
383
383
|
}
|
|
@@ -393,7 +393,7 @@ class SkyEyeClient extends skyeye_rpc_grpc_pb_1.JSONTransmissionClient {
|
|
|
393
393
|
return yield this.call(RequestFactory_1.RequestFactory.getInstance().setGlobalVarValue(cpuName, varName, bytesNum, valueType, value));
|
|
394
394
|
}
|
|
395
395
|
catch (error) {
|
|
396
|
-
console.error("Error during
|
|
396
|
+
console.error("Error during setGlobalVarValue:", error);
|
|
397
397
|
throw error;
|
|
398
398
|
}
|
|
399
399
|
});
|
|
@@ -406,7 +406,7 @@ class SkyEyeClient extends skyeye_rpc_grpc_pb_1.JSONTransmissionClient {
|
|
|
406
406
|
return yield this.call(RequestFactory_1.RequestFactory.getInstance().setGlobalVarValue(cpuList[0].getName(), varName, 4, valueType, value));
|
|
407
407
|
}
|
|
408
408
|
catch (error) {
|
|
409
|
-
console.error("Error during
|
|
409
|
+
console.error("Error during setGlobalVarValueDefault:", error);
|
|
410
410
|
throw error;
|
|
411
411
|
}
|
|
412
412
|
}
|
|
@@ -560,7 +560,7 @@ class SkyEyeClient extends skyeye_rpc_grpc_pb_1.JSONTransmissionClient {
|
|
|
560
560
|
}
|
|
561
561
|
getDeviceTree() {
|
|
562
562
|
return __awaiter(this, void 0, void 0, function* () {
|
|
563
|
-
const state = (yield this.
|
|
563
|
+
const state = (yield this.getDeviceTree()).getState();
|
|
564
564
|
if (GetRunningStateResponse_1.StateState.UNLOADED === state || GetRunningStateResponse_1.StateState.QUITED === state) {
|
|
565
565
|
throw new SkyEyeSDKException_1.SkyEyeSDKException("当前SkyEye未加载配置,需要加载配置可以获取设备树信息,请检查当前配置");
|
|
566
566
|
}
|
|
@@ -630,7 +630,7 @@ class SkyEyeClient extends skyeye_rpc_grpc_pb_1.JSONTransmissionClient {
|
|
|
630
630
|
}
|
|
631
631
|
}
|
|
632
632
|
catch (error) {
|
|
633
|
-
console.error("Error during
|
|
633
|
+
console.error("Error during getAllDeviceInfo:", error);
|
|
634
634
|
throw error;
|
|
635
635
|
}
|
|
636
636
|
return response;
|
|
@@ -651,7 +651,7 @@ class SkyEyeClient extends skyeye_rpc_grpc_pb_1.JSONTransmissionClient {
|
|
|
651
651
|
}
|
|
652
652
|
}
|
|
653
653
|
catch (error) {
|
|
654
|
-
console.error("Error during
|
|
654
|
+
console.error("Error during getRamAddrInfo:", error);
|
|
655
655
|
throw error;
|
|
656
656
|
}
|
|
657
657
|
return response;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
// package:
|
|
2
|
+
// file: skyeye_rpc.proto
|
|
3
|
+
|
|
4
|
+
/* tslint:disable */
|
|
5
|
+
/* eslint-disable */
|
|
6
|
+
import * as grpc from '@grpc/grpc-js';
|
|
7
|
+
import * as skyeye_rpc_pb from "./skyeye_rpc_pb";
|
|
8
|
+
|
|
9
|
+
interface IJSONTransmissionService extends grpc.ServiceDefinition<grpc.UntypedServiceImplementation> {
|
|
10
|
+
callSkyEye: IJSONTransmissionService_ICallSkyEye;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
interface IJSONTransmissionService_ICallSkyEye extends grpc.MethodDefinition<skyeye_rpc_pb.JSONRequest, skyeye_rpc_pb.JSONResponse> {
|
|
14
|
+
path: "/JSONTransmission/CallSkyEye";
|
|
15
|
+
requestStream: false;
|
|
16
|
+
responseStream: false;
|
|
17
|
+
requestSerialize: grpc.serialize<skyeye_rpc_pb.JSONRequest>;
|
|
18
|
+
requestDeserialize: grpc.deserialize<skyeye_rpc_pb.JSONRequest>;
|
|
19
|
+
responseSerialize: grpc.serialize<skyeye_rpc_pb.JSONResponse>;
|
|
20
|
+
responseDeserialize: grpc.deserialize<skyeye_rpc_pb.JSONResponse>;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export const JSONTransmissionService: IJSONTransmissionService;
|
|
24
|
+
|
|
25
|
+
export interface IJSONTransmissionServer {
|
|
26
|
+
callSkyEye: grpc.handleUnaryCall<skyeye_rpc_pb.JSONRequest, skyeye_rpc_pb.JSONResponse>;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export interface IJSONTransmissionClient {
|
|
30
|
+
callSkyEye(request: skyeye_rpc_pb.JSONRequest, callback: (error: grpc.ServiceError | null, response: skyeye_rpc_pb.JSONResponse) => void): grpc.ClientUnaryCall;
|
|
31
|
+
callSkyEye(request: skyeye_rpc_pb.JSONRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: skyeye_rpc_pb.JSONResponse) => void): grpc.ClientUnaryCall;
|
|
32
|
+
callSkyEye(request: skyeye_rpc_pb.JSONRequest, metadata: grpc.Metadata, options: Partial<grpc.CallOptions>, callback: (error: grpc.ServiceError | null, response: skyeye_rpc_pb.JSONResponse) => void): grpc.ClientUnaryCall;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export class JSONTransmissionClient extends grpc.Client implements IJSONTransmissionClient {
|
|
36
|
+
constructor(address: string, credentials: grpc.ChannelCredentials, options?: object);
|
|
37
|
+
public callSkyEye(request: skyeye_rpc_pb.JSONRequest, callback: (error: grpc.ServiceError | null, response: skyeye_rpc_pb.JSONResponse) => void): grpc.ClientUnaryCall;
|
|
38
|
+
public callSkyEye(request: skyeye_rpc_pb.JSONRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: skyeye_rpc_pb.JSONResponse) => void): grpc.ClientUnaryCall;
|
|
39
|
+
public callSkyEye(request: skyeye_rpc_pb.JSONRequest, metadata: grpc.Metadata, options: Partial<grpc.CallOptions>, callback: (error: grpc.ServiceError | null, response: skyeye_rpc_pb.JSONResponse) => void): grpc.ClientUnaryCall;
|
|
40
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
// GENERATED CODE -- DO NOT EDIT!
|
|
2
|
+
|
|
3
|
+
'use strict';
|
|
4
|
+
var grpc = require('@grpc/grpc-js');
|
|
5
|
+
var src_proto_skyeye_rpc_pb = require('../../src/proto/skyeye_rpc_pb.js');
|
|
6
|
+
|
|
7
|
+
function serialize_JSONRequest(arg) {
|
|
8
|
+
if (!(arg instanceof src_proto_skyeye_rpc_pb.JSONRequest)) {
|
|
9
|
+
throw new Error('Expected argument of type JSONRequest');
|
|
10
|
+
}
|
|
11
|
+
return Buffer.from(arg.serializeBinary());
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
function deserialize_JSONRequest(buffer_arg) {
|
|
15
|
+
return src_proto_skyeye_rpc_pb.JSONRequest.deserializeBinary(new Uint8Array(buffer_arg));
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
function serialize_JSONResponse(arg) {
|
|
19
|
+
if (!(arg instanceof src_proto_skyeye_rpc_pb.JSONResponse)) {
|
|
20
|
+
throw new Error('Expected argument of type JSONResponse');
|
|
21
|
+
}
|
|
22
|
+
return Buffer.from(arg.serializeBinary());
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
function deserialize_JSONResponse(buffer_arg) {
|
|
26
|
+
return src_proto_skyeye_rpc_pb.JSONResponse.deserializeBinary(new Uint8Array(buffer_arg));
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
var JSONTransmissionService = exports.JSONTransmissionService = {
|
|
31
|
+
callSkyEye: {
|
|
32
|
+
path: '/JSONTransmission/CallSkyEye',
|
|
33
|
+
requestStream: false,
|
|
34
|
+
responseStream: false,
|
|
35
|
+
requestType: src_proto_skyeye_rpc_pb.JSONRequest,
|
|
36
|
+
responseType: src_proto_skyeye_rpc_pb.JSONResponse,
|
|
37
|
+
requestSerialize: serialize_JSONRequest,
|
|
38
|
+
requestDeserialize: deserialize_JSONRequest,
|
|
39
|
+
responseSerialize: serialize_JSONResponse,
|
|
40
|
+
responseDeserialize: deserialize_JSONResponse,
|
|
41
|
+
},
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
exports.JSONTransmissionClient = grpc.makeGenericClientConstructor(JSONTransmissionService);
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
// package:
|
|
2
|
+
// file: skyeye_rpc.proto
|
|
3
|
+
|
|
4
|
+
/* tslint:disable */
|
|
5
|
+
/* eslint-disable */
|
|
6
|
+
|
|
7
|
+
import * as jspb from "google-protobuf";
|
|
8
|
+
|
|
9
|
+
export class JSONRequest extends jspb.Message {
|
|
10
|
+
getRequest(): string;
|
|
11
|
+
setRequest(value: string): JSONRequest;
|
|
12
|
+
|
|
13
|
+
serializeBinary(): Uint8Array;
|
|
14
|
+
toObject(includeInstance?: boolean): JSONRequest.AsObject;
|
|
15
|
+
static toObject(includeInstance: boolean, msg: JSONRequest): JSONRequest.AsObject;
|
|
16
|
+
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
|
|
17
|
+
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
|
|
18
|
+
static serializeBinaryToWriter(message: JSONRequest, writer: jspb.BinaryWriter): void;
|
|
19
|
+
static deserializeBinary(bytes: Uint8Array): JSONRequest;
|
|
20
|
+
static deserializeBinaryFromReader(message: JSONRequest, reader: jspb.BinaryReader): JSONRequest;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export namespace JSONRequest {
|
|
24
|
+
export type AsObject = {
|
|
25
|
+
request: string,
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export class JSONResponse extends jspb.Message {
|
|
30
|
+
getResponse(): string;
|
|
31
|
+
setResponse(value: string): JSONResponse;
|
|
32
|
+
|
|
33
|
+
serializeBinary(): Uint8Array;
|
|
34
|
+
toObject(includeInstance?: boolean): JSONResponse.AsObject;
|
|
35
|
+
static toObject(includeInstance: boolean, msg: JSONResponse): JSONResponse.AsObject;
|
|
36
|
+
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
|
|
37
|
+
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
|
|
38
|
+
static serializeBinaryToWriter(message: JSONResponse, writer: jspb.BinaryWriter): void;
|
|
39
|
+
static deserializeBinary(bytes: Uint8Array): JSONResponse;
|
|
40
|
+
static deserializeBinaryFromReader(message: JSONResponse, reader: jspb.BinaryReader): JSONResponse;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export namespace JSONResponse {
|
|
44
|
+
export type AsObject = {
|
|
45
|
+
response: string,
|
|
46
|
+
}
|
|
47
|
+
}
|
|
@@ -0,0 +1,322 @@
|
|
|
1
|
+
// source: src/proto/skyeye_rpc.proto
|
|
2
|
+
/**
|
|
3
|
+
* @fileoverview
|
|
4
|
+
* @enhanceable
|
|
5
|
+
* @suppress {missingRequire} reports error on implicit type usages.
|
|
6
|
+
* @suppress {messageConventions} JS Compiler reports an error if a variable or
|
|
7
|
+
* field starts with 'MSG_' and isn't a translatable message.
|
|
8
|
+
* @public
|
|
9
|
+
*/
|
|
10
|
+
// GENERATED CODE -- DO NOT EDIT!
|
|
11
|
+
/* eslint-disable */
|
|
12
|
+
// @ts-nocheck
|
|
13
|
+
|
|
14
|
+
var jspb = require('google-protobuf');
|
|
15
|
+
var goog = jspb;
|
|
16
|
+
var global = Function('return this')();
|
|
17
|
+
|
|
18
|
+
goog.exportSymbol('proto.JSONRequest', null, global);
|
|
19
|
+
goog.exportSymbol('proto.JSONResponse', null, global);
|
|
20
|
+
/**
|
|
21
|
+
* Generated by JsPbCodeGenerator.
|
|
22
|
+
* @param {Array=} opt_data Optional initial data array, typically from a
|
|
23
|
+
* server response, or constructed directly in Javascript. The array is used
|
|
24
|
+
* in place and becomes part of the constructed object. It is not cloned.
|
|
25
|
+
* If no data is provided, the constructed object will be empty, but still
|
|
26
|
+
* valid.
|
|
27
|
+
* @extends {jspb.Message}
|
|
28
|
+
* @constructor
|
|
29
|
+
*/
|
|
30
|
+
proto.JSONRequest = function(opt_data) {
|
|
31
|
+
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
|
|
32
|
+
};
|
|
33
|
+
goog.inherits(proto.JSONRequest, jspb.Message);
|
|
34
|
+
if (goog.DEBUG && !COMPILED) {
|
|
35
|
+
/**
|
|
36
|
+
* @public
|
|
37
|
+
* @override
|
|
38
|
+
*/
|
|
39
|
+
proto.JSONRequest.displayName = 'proto.JSONRequest';
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Generated by JsPbCodeGenerator.
|
|
43
|
+
* @param {Array=} opt_data Optional initial data array, typically from a
|
|
44
|
+
* server response, or constructed directly in Javascript. The array is used
|
|
45
|
+
* in place and becomes part of the constructed object. It is not cloned.
|
|
46
|
+
* If no data is provided, the constructed object will be empty, but still
|
|
47
|
+
* valid.
|
|
48
|
+
* @extends {jspb.Message}
|
|
49
|
+
* @constructor
|
|
50
|
+
*/
|
|
51
|
+
proto.JSONResponse = function(opt_data) {
|
|
52
|
+
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
|
|
53
|
+
};
|
|
54
|
+
goog.inherits(proto.JSONResponse, jspb.Message);
|
|
55
|
+
if (goog.DEBUG && !COMPILED) {
|
|
56
|
+
/**
|
|
57
|
+
* @public
|
|
58
|
+
* @override
|
|
59
|
+
*/
|
|
60
|
+
proto.JSONResponse.displayName = 'proto.JSONResponse';
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
if (jspb.Message.GENERATE_TO_OBJECT) {
|
|
66
|
+
/**
|
|
67
|
+
* Creates an object representation of this proto.
|
|
68
|
+
* Field names that are reserved in JavaScript and will be renamed to pb_name.
|
|
69
|
+
* Optional fields that are not set will be set to undefined.
|
|
70
|
+
* To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
|
|
71
|
+
* For the list of reserved names please see:
|
|
72
|
+
* net/proto2/compiler/js/internal/generator.cc#kKeyword.
|
|
73
|
+
* @param {boolean=} opt_includeInstance Deprecated. whether to include the
|
|
74
|
+
* JSPB instance for transitional soy proto support:
|
|
75
|
+
* http://goto/soy-param-migration
|
|
76
|
+
* @return {!Object}
|
|
77
|
+
*/
|
|
78
|
+
proto.JSONRequest.prototype.toObject = function(opt_includeInstance) {
|
|
79
|
+
return proto.JSONRequest.toObject(opt_includeInstance, this);
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* Static version of the {@see toObject} method.
|
|
85
|
+
* @param {boolean|undefined} includeInstance Deprecated. Whether to include
|
|
86
|
+
* the JSPB instance for transitional soy proto support:
|
|
87
|
+
* http://goto/soy-param-migration
|
|
88
|
+
* @param {!proto.JSONRequest} msg The msg instance to transform.
|
|
89
|
+
* @return {!Object}
|
|
90
|
+
* @suppress {unusedLocalVariables} f is only used for nested messages
|
|
91
|
+
*/
|
|
92
|
+
proto.JSONRequest.toObject = function(includeInstance, msg) {
|
|
93
|
+
var f, obj = {
|
|
94
|
+
request: jspb.Message.getFieldWithDefault(msg, 1, "")
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
if (includeInstance) {
|
|
98
|
+
obj.$jspbMessageInstance = msg;
|
|
99
|
+
}
|
|
100
|
+
return obj;
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* Deserializes binary data (in protobuf wire format).
|
|
107
|
+
* @param {jspb.ByteSource} bytes The bytes to deserialize.
|
|
108
|
+
* @return {!proto.JSONRequest}
|
|
109
|
+
*/
|
|
110
|
+
proto.JSONRequest.deserializeBinary = function(bytes) {
|
|
111
|
+
var reader = new jspb.BinaryReader(bytes);
|
|
112
|
+
var msg = new proto.JSONRequest;
|
|
113
|
+
return proto.JSONRequest.deserializeBinaryFromReader(msg, reader);
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* Deserializes binary data (in protobuf wire format) from the
|
|
119
|
+
* given reader into the given message object.
|
|
120
|
+
* @param {!proto.JSONRequest} msg The message object to deserialize into.
|
|
121
|
+
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
|
|
122
|
+
* @return {!proto.JSONRequest}
|
|
123
|
+
*/
|
|
124
|
+
proto.JSONRequest.deserializeBinaryFromReader = function(msg, reader) {
|
|
125
|
+
while (reader.nextField()) {
|
|
126
|
+
if (reader.isEndGroup()) {
|
|
127
|
+
break;
|
|
128
|
+
}
|
|
129
|
+
var field = reader.getFieldNumber();
|
|
130
|
+
switch (field) {
|
|
131
|
+
case 1:
|
|
132
|
+
var value = /** @type {string} */ (reader.readString());
|
|
133
|
+
msg.setRequest(value);
|
|
134
|
+
break;
|
|
135
|
+
default:
|
|
136
|
+
reader.skipField();
|
|
137
|
+
break;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
return msg;
|
|
141
|
+
};
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* Serializes the message to binary data (in protobuf wire format).
|
|
146
|
+
* @return {!Uint8Array}
|
|
147
|
+
*/
|
|
148
|
+
proto.JSONRequest.prototype.serializeBinary = function() {
|
|
149
|
+
var writer = new jspb.BinaryWriter();
|
|
150
|
+
proto.JSONRequest.serializeBinaryToWriter(this, writer);
|
|
151
|
+
return writer.getResultBuffer();
|
|
152
|
+
};
|
|
153
|
+
|
|
154
|
+
|
|
155
|
+
/**
|
|
156
|
+
* Serializes the given message to binary data (in protobuf wire
|
|
157
|
+
* format), writing to the given BinaryWriter.
|
|
158
|
+
* @param {!proto.JSONRequest} message
|
|
159
|
+
* @param {!jspb.BinaryWriter} writer
|
|
160
|
+
* @suppress {unusedLocalVariables} f is only used for nested messages
|
|
161
|
+
*/
|
|
162
|
+
proto.JSONRequest.serializeBinaryToWriter = function(message, writer) {
|
|
163
|
+
var f = undefined;
|
|
164
|
+
f = message.getRequest();
|
|
165
|
+
if (f.length > 0) {
|
|
166
|
+
writer.writeString(
|
|
167
|
+
1,
|
|
168
|
+
f
|
|
169
|
+
);
|
|
170
|
+
}
|
|
171
|
+
};
|
|
172
|
+
|
|
173
|
+
|
|
174
|
+
/**
|
|
175
|
+
* optional string request = 1;
|
|
176
|
+
* @return {string}
|
|
177
|
+
*/
|
|
178
|
+
proto.JSONRequest.prototype.getRequest = function() {
|
|
179
|
+
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
|
|
180
|
+
};
|
|
181
|
+
|
|
182
|
+
|
|
183
|
+
/**
|
|
184
|
+
* @param {string} value
|
|
185
|
+
* @return {!proto.JSONRequest} returns this
|
|
186
|
+
*/
|
|
187
|
+
proto.JSONRequest.prototype.setRequest = function(value) {
|
|
188
|
+
return jspb.Message.setProto3StringField(this, 1, value);
|
|
189
|
+
};
|
|
190
|
+
|
|
191
|
+
|
|
192
|
+
|
|
193
|
+
|
|
194
|
+
|
|
195
|
+
if (jspb.Message.GENERATE_TO_OBJECT) {
|
|
196
|
+
/**
|
|
197
|
+
* Creates an object representation of this proto.
|
|
198
|
+
* Field names that are reserved in JavaScript and will be renamed to pb_name.
|
|
199
|
+
* Optional fields that are not set will be set to undefined.
|
|
200
|
+
* To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
|
|
201
|
+
* For the list of reserved names please see:
|
|
202
|
+
* net/proto2/compiler/js/internal/generator.cc#kKeyword.
|
|
203
|
+
* @param {boolean=} opt_includeInstance Deprecated. whether to include the
|
|
204
|
+
* JSPB instance for transitional soy proto support:
|
|
205
|
+
* http://goto/soy-param-migration
|
|
206
|
+
* @return {!Object}
|
|
207
|
+
*/
|
|
208
|
+
proto.JSONResponse.prototype.toObject = function(opt_includeInstance) {
|
|
209
|
+
return proto.JSONResponse.toObject(opt_includeInstance, this);
|
|
210
|
+
};
|
|
211
|
+
|
|
212
|
+
|
|
213
|
+
/**
|
|
214
|
+
* Static version of the {@see toObject} method.
|
|
215
|
+
* @param {boolean|undefined} includeInstance Deprecated. Whether to include
|
|
216
|
+
* the JSPB instance for transitional soy proto support:
|
|
217
|
+
* http://goto/soy-param-migration
|
|
218
|
+
* @param {!proto.JSONResponse} msg The msg instance to transform.
|
|
219
|
+
* @return {!Object}
|
|
220
|
+
* @suppress {unusedLocalVariables} f is only used for nested messages
|
|
221
|
+
*/
|
|
222
|
+
proto.JSONResponse.toObject = function(includeInstance, msg) {
|
|
223
|
+
var f, obj = {
|
|
224
|
+
response: jspb.Message.getFieldWithDefault(msg, 1, "")
|
|
225
|
+
};
|
|
226
|
+
|
|
227
|
+
if (includeInstance) {
|
|
228
|
+
obj.$jspbMessageInstance = msg;
|
|
229
|
+
}
|
|
230
|
+
return obj;
|
|
231
|
+
};
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
|
|
235
|
+
/**
|
|
236
|
+
* Deserializes binary data (in protobuf wire format).
|
|
237
|
+
* @param {jspb.ByteSource} bytes The bytes to deserialize.
|
|
238
|
+
* @return {!proto.JSONResponse}
|
|
239
|
+
*/
|
|
240
|
+
proto.JSONResponse.deserializeBinary = function(bytes) {
|
|
241
|
+
var reader = new jspb.BinaryReader(bytes);
|
|
242
|
+
var msg = new proto.JSONResponse;
|
|
243
|
+
return proto.JSONResponse.deserializeBinaryFromReader(msg, reader);
|
|
244
|
+
};
|
|
245
|
+
|
|
246
|
+
|
|
247
|
+
/**
|
|
248
|
+
* Deserializes binary data (in protobuf wire format) from the
|
|
249
|
+
* given reader into the given message object.
|
|
250
|
+
* @param {!proto.JSONResponse} msg The message object to deserialize into.
|
|
251
|
+
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
|
|
252
|
+
* @return {!proto.JSONResponse}
|
|
253
|
+
*/
|
|
254
|
+
proto.JSONResponse.deserializeBinaryFromReader = function(msg, reader) {
|
|
255
|
+
while (reader.nextField()) {
|
|
256
|
+
if (reader.isEndGroup()) {
|
|
257
|
+
break;
|
|
258
|
+
}
|
|
259
|
+
var field = reader.getFieldNumber();
|
|
260
|
+
switch (field) {
|
|
261
|
+
case 1:
|
|
262
|
+
var value = /** @type {string} */ (reader.readString());
|
|
263
|
+
msg.setResponse(value);
|
|
264
|
+
break;
|
|
265
|
+
default:
|
|
266
|
+
reader.skipField();
|
|
267
|
+
break;
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
return msg;
|
|
271
|
+
};
|
|
272
|
+
|
|
273
|
+
|
|
274
|
+
/**
|
|
275
|
+
* Serializes the message to binary data (in protobuf wire format).
|
|
276
|
+
* @return {!Uint8Array}
|
|
277
|
+
*/
|
|
278
|
+
proto.JSONResponse.prototype.serializeBinary = function() {
|
|
279
|
+
var writer = new jspb.BinaryWriter();
|
|
280
|
+
proto.JSONResponse.serializeBinaryToWriter(this, writer);
|
|
281
|
+
return writer.getResultBuffer();
|
|
282
|
+
};
|
|
283
|
+
|
|
284
|
+
|
|
285
|
+
/**
|
|
286
|
+
* Serializes the given message to binary data (in protobuf wire
|
|
287
|
+
* format), writing to the given BinaryWriter.
|
|
288
|
+
* @param {!proto.JSONResponse} message
|
|
289
|
+
* @param {!jspb.BinaryWriter} writer
|
|
290
|
+
* @suppress {unusedLocalVariables} f is only used for nested messages
|
|
291
|
+
*/
|
|
292
|
+
proto.JSONResponse.serializeBinaryToWriter = function(message, writer) {
|
|
293
|
+
var f = undefined;
|
|
294
|
+
f = message.getResponse();
|
|
295
|
+
if (f.length > 0) {
|
|
296
|
+
writer.writeString(
|
|
297
|
+
1,
|
|
298
|
+
f
|
|
299
|
+
);
|
|
300
|
+
}
|
|
301
|
+
};
|
|
302
|
+
|
|
303
|
+
|
|
304
|
+
/**
|
|
305
|
+
* optional string response = 1;
|
|
306
|
+
* @return {string}
|
|
307
|
+
*/
|
|
308
|
+
proto.JSONResponse.prototype.getResponse = function() {
|
|
309
|
+
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
|
|
310
|
+
};
|
|
311
|
+
|
|
312
|
+
|
|
313
|
+
/**
|
|
314
|
+
* @param {string} value
|
|
315
|
+
* @return {!proto.JSONResponse} returns this
|
|
316
|
+
*/
|
|
317
|
+
proto.JSONResponse.prototype.setResponse = function(value) {
|
|
318
|
+
return jspb.Message.setProto3StringField(this, 1, value);
|
|
319
|
+
};
|
|
320
|
+
|
|
321
|
+
|
|
322
|
+
goog.object.extend(exports, proto);
|
package/dist/src/SkyEyeClient.js
CHANGED
|
@@ -334,7 +334,7 @@ class SkyEyeClient extends skyeye_rpc_grpc_pb_1.JSONTransmissionClient {
|
|
|
334
334
|
return yield this.call(RequestFactory_1.RequestFactory.getInstance().getCpuMips(cpuName));
|
|
335
335
|
}
|
|
336
336
|
catch (error) {
|
|
337
|
-
console.error("Error during
|
|
337
|
+
console.error("Error during getCpuMips:", error);
|
|
338
338
|
throw error;
|
|
339
339
|
}
|
|
340
340
|
});
|
|
@@ -348,7 +348,7 @@ class SkyEyeClient extends skyeye_rpc_grpc_pb_1.JSONTransmissionClient {
|
|
|
348
348
|
return yield this.call(RequestFactory_1.RequestFactory.getInstance().getCpuMips(cpuList[0].getName()));
|
|
349
349
|
}
|
|
350
350
|
catch (error) {
|
|
351
|
-
console.error("Error during
|
|
351
|
+
console.error("Error during getCurrentCpuMips:", error);
|
|
352
352
|
throw error;
|
|
353
353
|
}
|
|
354
354
|
}
|
|
@@ -364,7 +364,7 @@ class SkyEyeClient extends skyeye_rpc_grpc_pb_1.JSONTransmissionClient {
|
|
|
364
364
|
return yield this.call(RequestFactory_1.RequestFactory.getInstance().getGlobalVarValue(cpuName, varName, bytesNum, valueType));
|
|
365
365
|
}
|
|
366
366
|
catch (error) {
|
|
367
|
-
console.error("Error during
|
|
367
|
+
console.error("Error during getGlobalVarValue:", error);
|
|
368
368
|
throw error;
|
|
369
369
|
}
|
|
370
370
|
});
|
|
@@ -377,7 +377,7 @@ class SkyEyeClient extends skyeye_rpc_grpc_pb_1.JSONTransmissionClient {
|
|
|
377
377
|
return yield this.call(RequestFactory_1.RequestFactory.getInstance().getGlobalVarValue(cpuList[0].getName(), varName, 4, valueType));
|
|
378
378
|
}
|
|
379
379
|
catch (error) {
|
|
380
|
-
console.error("Error during
|
|
380
|
+
console.error("Error during getGlobalVarValueDefault:", error);
|
|
381
381
|
throw error;
|
|
382
382
|
}
|
|
383
383
|
}
|
|
@@ -393,7 +393,7 @@ class SkyEyeClient extends skyeye_rpc_grpc_pb_1.JSONTransmissionClient {
|
|
|
393
393
|
return yield this.call(RequestFactory_1.RequestFactory.getInstance().setGlobalVarValue(cpuName, varName, bytesNum, valueType, value));
|
|
394
394
|
}
|
|
395
395
|
catch (error) {
|
|
396
|
-
console.error("Error during
|
|
396
|
+
console.error("Error during setGlobalVarValue:", error);
|
|
397
397
|
throw error;
|
|
398
398
|
}
|
|
399
399
|
});
|
|
@@ -406,7 +406,7 @@ class SkyEyeClient extends skyeye_rpc_grpc_pb_1.JSONTransmissionClient {
|
|
|
406
406
|
return yield this.call(RequestFactory_1.RequestFactory.getInstance().setGlobalVarValue(cpuList[0].getName(), varName, 4, valueType, value));
|
|
407
407
|
}
|
|
408
408
|
catch (error) {
|
|
409
|
-
console.error("Error during
|
|
409
|
+
console.error("Error during setGlobalVarValueDefault:", error);
|
|
410
410
|
throw error;
|
|
411
411
|
}
|
|
412
412
|
}
|
|
@@ -630,7 +630,7 @@ class SkyEyeClient extends skyeye_rpc_grpc_pb_1.JSONTransmissionClient {
|
|
|
630
630
|
}
|
|
631
631
|
}
|
|
632
632
|
catch (error) {
|
|
633
|
-
console.error("Error during
|
|
633
|
+
console.error("Error during getAllDeviceInfo:", error);
|
|
634
634
|
throw error;
|
|
635
635
|
}
|
|
636
636
|
return response;
|
|
@@ -651,7 +651,7 @@ class SkyEyeClient extends skyeye_rpc_grpc_pb_1.JSONTransmissionClient {
|
|
|
651
651
|
}
|
|
652
652
|
}
|
|
653
653
|
catch (error) {
|
|
654
|
-
console.error("Error during
|
|
654
|
+
console.error("Error during getRamAddrInfo:", error);
|
|
655
655
|
throw error;
|
|
656
656
|
}
|
|
657
657
|
return response;
|
|
@@ -33,7 +33,7 @@ class SkyEyeClientFactory {
|
|
|
33
33
|
const startTime = Date.now();
|
|
34
34
|
while (Date.now() - startTime < time * 1000) {
|
|
35
35
|
try {
|
|
36
|
-
const response = client.
|
|
36
|
+
const response = client.createConnectedClientTime();
|
|
37
37
|
console.log("response:", response);
|
|
38
38
|
break;
|
|
39
39
|
}
|
package/package.json
CHANGED
package/src/SkyEyeClient.js
CHANGED
|
@@ -334,7 +334,7 @@ class SkyEyeClient extends skyeye_rpc_grpc_pb_1.JSONTransmissionClient {
|
|
|
334
334
|
return yield this.call(RequestFactory_1.RequestFactory.getInstance().getCpuMips(cpuName));
|
|
335
335
|
}
|
|
336
336
|
catch (error) {
|
|
337
|
-
console.error("Error during
|
|
337
|
+
console.error("Error during getCpuMips:", error);
|
|
338
338
|
throw error;
|
|
339
339
|
}
|
|
340
340
|
});
|
|
@@ -348,7 +348,7 @@ class SkyEyeClient extends skyeye_rpc_grpc_pb_1.JSONTransmissionClient {
|
|
|
348
348
|
return yield this.call(RequestFactory_1.RequestFactory.getInstance().getCpuMips(cpuList[0].getName()));
|
|
349
349
|
}
|
|
350
350
|
catch (error) {
|
|
351
|
-
console.error("Error during
|
|
351
|
+
console.error("Error during getCurrentCpuMips:", error);
|
|
352
352
|
throw error;
|
|
353
353
|
}
|
|
354
354
|
}
|
|
@@ -364,7 +364,7 @@ class SkyEyeClient extends skyeye_rpc_grpc_pb_1.JSONTransmissionClient {
|
|
|
364
364
|
return yield this.call(RequestFactory_1.RequestFactory.getInstance().getGlobalVarValue(cpuName, varName, bytesNum, valueType));
|
|
365
365
|
}
|
|
366
366
|
catch (error) {
|
|
367
|
-
console.error("Error during
|
|
367
|
+
console.error("Error during getGlobalVarValue:", error);
|
|
368
368
|
throw error;
|
|
369
369
|
}
|
|
370
370
|
});
|
|
@@ -377,7 +377,7 @@ class SkyEyeClient extends skyeye_rpc_grpc_pb_1.JSONTransmissionClient {
|
|
|
377
377
|
return yield this.call(RequestFactory_1.RequestFactory.getInstance().getGlobalVarValue(cpuList[0].getName(), varName, 4, valueType));
|
|
378
378
|
}
|
|
379
379
|
catch (error) {
|
|
380
|
-
console.error("Error during
|
|
380
|
+
console.error("Error during getGlobalVarValueDefault:", error);
|
|
381
381
|
throw error;
|
|
382
382
|
}
|
|
383
383
|
}
|
|
@@ -393,7 +393,7 @@ class SkyEyeClient extends skyeye_rpc_grpc_pb_1.JSONTransmissionClient {
|
|
|
393
393
|
return yield this.call(RequestFactory_1.RequestFactory.getInstance().setGlobalVarValue(cpuName, varName, bytesNum, valueType, value));
|
|
394
394
|
}
|
|
395
395
|
catch (error) {
|
|
396
|
-
console.error("Error during
|
|
396
|
+
console.error("Error during setGlobalVarValue:", error);
|
|
397
397
|
throw error;
|
|
398
398
|
}
|
|
399
399
|
});
|
|
@@ -406,7 +406,7 @@ class SkyEyeClient extends skyeye_rpc_grpc_pb_1.JSONTransmissionClient {
|
|
|
406
406
|
return yield this.call(RequestFactory_1.RequestFactory.getInstance().setGlobalVarValue(cpuList[0].getName(), varName, 4, valueType, value));
|
|
407
407
|
}
|
|
408
408
|
catch (error) {
|
|
409
|
-
console.error("Error during
|
|
409
|
+
console.error("Error during setGlobalVarValueDefault:", error);
|
|
410
410
|
throw error;
|
|
411
411
|
}
|
|
412
412
|
}
|
|
@@ -630,7 +630,7 @@ class SkyEyeClient extends skyeye_rpc_grpc_pb_1.JSONTransmissionClient {
|
|
|
630
630
|
}
|
|
631
631
|
}
|
|
632
632
|
catch (error) {
|
|
633
|
-
console.error("Error during
|
|
633
|
+
console.error("Error during getAllDeviceInfo:", error);
|
|
634
634
|
throw error;
|
|
635
635
|
}
|
|
636
636
|
return response;
|
|
@@ -651,7 +651,7 @@ class SkyEyeClient extends skyeye_rpc_grpc_pb_1.JSONTransmissionClient {
|
|
|
651
651
|
}
|
|
652
652
|
}
|
|
653
653
|
catch (error) {
|
|
654
|
-
console.error("Error during
|
|
654
|
+
console.error("Error during getRamAddrInfo:", error);
|
|
655
655
|
throw error;
|
|
656
656
|
}
|
|
657
657
|
return response;
|
package/src/SkyEyeClient.ts
CHANGED
|
@@ -297,7 +297,7 @@ export class SkyEyeClient extends JSONTransmissionClient {
|
|
|
297
297
|
try {
|
|
298
298
|
return await this.call(RequestFactory.getInstance().getCpuMips(cpuName))
|
|
299
299
|
} catch (error) {
|
|
300
|
-
console.error("Error during
|
|
300
|
+
console.error("Error during getCpuMips:", error);
|
|
301
301
|
throw error;
|
|
302
302
|
}
|
|
303
303
|
}
|
|
@@ -311,7 +311,7 @@ export class SkyEyeClient extends JSONTransmissionClient {
|
|
|
311
311
|
|
|
312
312
|
return await this.call(RequestFactory.getInstance().getCpuMips(cpuList[0].getName()))
|
|
313
313
|
} catch (error) {
|
|
314
|
-
console.error("Error during
|
|
314
|
+
console.error("Error during getCurrentCpuMips:", error);
|
|
315
315
|
throw error;
|
|
316
316
|
}
|
|
317
317
|
} else {
|
|
@@ -325,7 +325,7 @@ export class SkyEyeClient extends JSONTransmissionClient {
|
|
|
325
325
|
try {
|
|
326
326
|
return await this.call(RequestFactory.getInstance().getGlobalVarValue(cpuName, varName, bytesNum, valueType))
|
|
327
327
|
} catch (error) {
|
|
328
|
-
console.error("Error during
|
|
328
|
+
console.error("Error during getGlobalVarValue:", error);
|
|
329
329
|
throw error;
|
|
330
330
|
}
|
|
331
331
|
}
|
|
@@ -339,7 +339,7 @@ export class SkyEyeClient extends JSONTransmissionClient {
|
|
|
339
339
|
try {
|
|
340
340
|
return await this.call(RequestFactory.getInstance().getGlobalVarValue(cpuList[0].getName(), varName, 4, valueType));
|
|
341
341
|
} catch (error) {
|
|
342
|
-
console.error("Error during
|
|
342
|
+
console.error("Error during getGlobalVarValueDefault:", error);
|
|
343
343
|
throw error;
|
|
344
344
|
}
|
|
345
345
|
} else {
|
|
@@ -356,7 +356,7 @@ export class SkyEyeClient extends JSONTransmissionClient {
|
|
|
356
356
|
try {
|
|
357
357
|
return await this.call(RequestFactory.getInstance().setGlobalVarValue(cpuName, varName, bytesNum, valueType, value))
|
|
358
358
|
} catch (error) {
|
|
359
|
-
console.error("Error during
|
|
359
|
+
console.error("Error during setGlobalVarValue:", error);
|
|
360
360
|
throw error;
|
|
361
361
|
}
|
|
362
362
|
}
|
|
@@ -367,7 +367,7 @@ export class SkyEyeClient extends JSONTransmissionClient {
|
|
|
367
367
|
try {
|
|
368
368
|
return await this.call(RequestFactory.getInstance().setGlobalVarValue(cpuList[0].getName(), varName, 4, valueType, value));
|
|
369
369
|
} catch (error) {
|
|
370
|
-
console.error("Error during
|
|
370
|
+
console.error("Error during setGlobalVarValueDefault:", error);
|
|
371
371
|
throw error;
|
|
372
372
|
}
|
|
373
373
|
} else {
|
|
@@ -576,7 +576,7 @@ export class SkyEyeClient extends JSONTransmissionClient {
|
|
|
576
576
|
throw new SkyEyeSDKException(String(call.error));
|
|
577
577
|
}
|
|
578
578
|
} catch (error) {
|
|
579
|
-
console.error("Error during
|
|
579
|
+
console.error("Error during getAllDeviceInfo:", error);
|
|
580
580
|
throw error;
|
|
581
581
|
}
|
|
582
582
|
return response;
|
|
@@ -595,7 +595,7 @@ export class SkyEyeClient extends JSONTransmissionClient {
|
|
|
595
595
|
throw new SkyEyeSDKException(String(call.error));
|
|
596
596
|
}
|
|
597
597
|
} catch (error) {
|
|
598
|
-
console.error("Error during
|
|
598
|
+
console.error("Error during getRamAddrInfo:", error);
|
|
599
599
|
throw error;
|
|
600
600
|
}
|
|
601
601
|
return response;
|
|
@@ -28,7 +28,7 @@ class SkyEyeClientFactory {
|
|
|
28
28
|
const startTime: number = Date.now();
|
|
29
29
|
while (Date.now() - startTime < time * 1000) {
|
|
30
30
|
try {
|
|
31
|
-
const response = client.
|
|
31
|
+
const response = client.createConnectedClientTime();
|
|
32
32
|
console.log("response:",response);
|
|
33
33
|
break;
|
|
34
34
|
} catch (error) {
|
package/src/test.js
CHANGED
|
@@ -30,9 +30,9 @@ async function test() {
|
|
|
30
30
|
|
|
31
31
|
// await client.getCurrentCpuMips();
|
|
32
32
|
|
|
33
|
-
|
|
33
|
+
await client.getCpuMips("c67x_core_0");
|
|
34
34
|
|
|
35
|
-
|
|
35
|
+
await client.getMemoryValue("c67x_core_0",12,0);
|
|
36
36
|
|
|
37
37
|
const response = await client.getDeviceList();
|
|
38
38
|
console.log("最终response:",response)
|