@owvision/station-interface-ts 0.0.1
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/README.md +58 -0
- package/dist/generated/recorder.d.ts +205 -0
- package/dist/generated/recorder.d.ts.map +1 -0
- package/dist/generated/recorder.js +1018 -0
- package/dist/generated/recorder.js.map +1 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +27 -0
- package/dist/index.js.map +1 -0
- package/package.json +33 -0
- package/src/generated/recorder.ts +1373 -0
- package/src/index.ts +57 -0
- package/tsconfig.json +44 -0
|
@@ -0,0 +1,1018 @@
|
|
|
1
|
+
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
2
|
+
// versions:
|
|
3
|
+
// protoc-gen-ts_proto v2.10.1
|
|
4
|
+
// protoc v6.33.3
|
|
5
|
+
// source: recorder.proto
|
|
6
|
+
/* eslint-disable */
|
|
7
|
+
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
|
8
|
+
import { Client, makeGenericClientConstructor, } from "@grpc/grpc-js";
|
|
9
|
+
export const protobufPackage = "recorder";
|
|
10
|
+
function createBasePingMessage() {
|
|
11
|
+
return { randomId: 0 };
|
|
12
|
+
}
|
|
13
|
+
export const PingMessage = {
|
|
14
|
+
encode(message, writer = new BinaryWriter()) {
|
|
15
|
+
if (message.randomId !== 0) {
|
|
16
|
+
writer.uint32(8).int64(message.randomId);
|
|
17
|
+
}
|
|
18
|
+
return writer;
|
|
19
|
+
},
|
|
20
|
+
decode(input, length) {
|
|
21
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
22
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
23
|
+
const message = createBasePingMessage();
|
|
24
|
+
while (reader.pos < end) {
|
|
25
|
+
const tag = reader.uint32();
|
|
26
|
+
switch (tag >>> 3) {
|
|
27
|
+
case 1: {
|
|
28
|
+
if (tag !== 8) {
|
|
29
|
+
break;
|
|
30
|
+
}
|
|
31
|
+
message.randomId = longToNumber(reader.int64());
|
|
32
|
+
continue;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
36
|
+
break;
|
|
37
|
+
}
|
|
38
|
+
reader.skip(tag & 7);
|
|
39
|
+
}
|
|
40
|
+
return message;
|
|
41
|
+
},
|
|
42
|
+
fromJSON(object) {
|
|
43
|
+
return { randomId: isSet(object.randomId) ? globalThis.Number(object.randomId) : 0 };
|
|
44
|
+
},
|
|
45
|
+
toJSON(message) {
|
|
46
|
+
const obj = {};
|
|
47
|
+
if (message.randomId !== 0) {
|
|
48
|
+
obj.randomId = Math.round(message.randomId);
|
|
49
|
+
}
|
|
50
|
+
return obj;
|
|
51
|
+
},
|
|
52
|
+
create(base) {
|
|
53
|
+
return PingMessage.fromPartial(base ?? {});
|
|
54
|
+
},
|
|
55
|
+
fromPartial(object) {
|
|
56
|
+
const message = createBasePingMessage();
|
|
57
|
+
message.randomId = object.randomId ?? 0;
|
|
58
|
+
return message;
|
|
59
|
+
},
|
|
60
|
+
};
|
|
61
|
+
function createBaseGetStationRequest() {
|
|
62
|
+
return { stationId: 0 };
|
|
63
|
+
}
|
|
64
|
+
export const GetStationRequest = {
|
|
65
|
+
encode(message, writer = new BinaryWriter()) {
|
|
66
|
+
if (message.stationId !== 0) {
|
|
67
|
+
writer.uint32(8).int64(message.stationId);
|
|
68
|
+
}
|
|
69
|
+
return writer;
|
|
70
|
+
},
|
|
71
|
+
decode(input, length) {
|
|
72
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
73
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
74
|
+
const message = createBaseGetStationRequest();
|
|
75
|
+
while (reader.pos < end) {
|
|
76
|
+
const tag = reader.uint32();
|
|
77
|
+
switch (tag >>> 3) {
|
|
78
|
+
case 1: {
|
|
79
|
+
if (tag !== 8) {
|
|
80
|
+
break;
|
|
81
|
+
}
|
|
82
|
+
message.stationId = longToNumber(reader.int64());
|
|
83
|
+
continue;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
87
|
+
break;
|
|
88
|
+
}
|
|
89
|
+
reader.skip(tag & 7);
|
|
90
|
+
}
|
|
91
|
+
return message;
|
|
92
|
+
},
|
|
93
|
+
fromJSON(object) {
|
|
94
|
+
return { stationId: isSet(object.stationId) ? globalThis.Number(object.stationId) : 0 };
|
|
95
|
+
},
|
|
96
|
+
toJSON(message) {
|
|
97
|
+
const obj = {};
|
|
98
|
+
if (message.stationId !== 0) {
|
|
99
|
+
obj.stationId = Math.round(message.stationId);
|
|
100
|
+
}
|
|
101
|
+
return obj;
|
|
102
|
+
},
|
|
103
|
+
create(base) {
|
|
104
|
+
return GetStationRequest.fromPartial(base ?? {});
|
|
105
|
+
},
|
|
106
|
+
fromPartial(object) {
|
|
107
|
+
const message = createBaseGetStationRequest();
|
|
108
|
+
message.stationId = object.stationId ?? 0;
|
|
109
|
+
return message;
|
|
110
|
+
},
|
|
111
|
+
};
|
|
112
|
+
function createBaseUpdateSensorsRequest() {
|
|
113
|
+
return { updates: [] };
|
|
114
|
+
}
|
|
115
|
+
export const UpdateSensorsRequest = {
|
|
116
|
+
encode(message, writer = new BinaryWriter()) {
|
|
117
|
+
for (const v of message.updates) {
|
|
118
|
+
UpdateSensorRequest.encode(v, writer.uint32(10).fork()).join();
|
|
119
|
+
}
|
|
120
|
+
return writer;
|
|
121
|
+
},
|
|
122
|
+
decode(input, length) {
|
|
123
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
124
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
125
|
+
const message = createBaseUpdateSensorsRequest();
|
|
126
|
+
while (reader.pos < end) {
|
|
127
|
+
const tag = reader.uint32();
|
|
128
|
+
switch (tag >>> 3) {
|
|
129
|
+
case 1: {
|
|
130
|
+
if (tag !== 10) {
|
|
131
|
+
break;
|
|
132
|
+
}
|
|
133
|
+
message.updates.push(UpdateSensorRequest.decode(reader, reader.uint32()));
|
|
134
|
+
continue;
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
138
|
+
break;
|
|
139
|
+
}
|
|
140
|
+
reader.skip(tag & 7);
|
|
141
|
+
}
|
|
142
|
+
return message;
|
|
143
|
+
},
|
|
144
|
+
fromJSON(object) {
|
|
145
|
+
return {
|
|
146
|
+
updates: globalThis.Array.isArray(object?.updates)
|
|
147
|
+
? object.updates.map((e) => UpdateSensorRequest.fromJSON(e))
|
|
148
|
+
: [],
|
|
149
|
+
};
|
|
150
|
+
},
|
|
151
|
+
toJSON(message) {
|
|
152
|
+
const obj = {};
|
|
153
|
+
if (message.updates?.length) {
|
|
154
|
+
obj.updates = message.updates.map((e) => UpdateSensorRequest.toJSON(e));
|
|
155
|
+
}
|
|
156
|
+
return obj;
|
|
157
|
+
},
|
|
158
|
+
create(base) {
|
|
159
|
+
return UpdateSensorsRequest.fromPartial(base ?? {});
|
|
160
|
+
},
|
|
161
|
+
fromPartial(object) {
|
|
162
|
+
const message = createBaseUpdateSensorsRequest();
|
|
163
|
+
message.updates = object.updates?.map((e) => UpdateSensorRequest.fromPartial(e)) || [];
|
|
164
|
+
return message;
|
|
165
|
+
},
|
|
166
|
+
};
|
|
167
|
+
function createBaseUpdateSensorRequest() {
|
|
168
|
+
return { sensorId: 0, newState: undefined };
|
|
169
|
+
}
|
|
170
|
+
export const UpdateSensorRequest = {
|
|
171
|
+
encode(message, writer = new BinaryWriter()) {
|
|
172
|
+
if (message.sensorId !== 0) {
|
|
173
|
+
writer.uint32(8).int64(message.sensorId);
|
|
174
|
+
}
|
|
175
|
+
if (message.newState !== undefined) {
|
|
176
|
+
SensorState.encode(message.newState, writer.uint32(18).fork()).join();
|
|
177
|
+
}
|
|
178
|
+
return writer;
|
|
179
|
+
},
|
|
180
|
+
decode(input, length) {
|
|
181
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
182
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
183
|
+
const message = createBaseUpdateSensorRequest();
|
|
184
|
+
while (reader.pos < end) {
|
|
185
|
+
const tag = reader.uint32();
|
|
186
|
+
switch (tag >>> 3) {
|
|
187
|
+
case 1: {
|
|
188
|
+
if (tag !== 8) {
|
|
189
|
+
break;
|
|
190
|
+
}
|
|
191
|
+
message.sensorId = longToNumber(reader.int64());
|
|
192
|
+
continue;
|
|
193
|
+
}
|
|
194
|
+
case 2: {
|
|
195
|
+
if (tag !== 18) {
|
|
196
|
+
break;
|
|
197
|
+
}
|
|
198
|
+
message.newState = SensorState.decode(reader, reader.uint32());
|
|
199
|
+
continue;
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
203
|
+
break;
|
|
204
|
+
}
|
|
205
|
+
reader.skip(tag & 7);
|
|
206
|
+
}
|
|
207
|
+
return message;
|
|
208
|
+
},
|
|
209
|
+
fromJSON(object) {
|
|
210
|
+
return {
|
|
211
|
+
sensorId: isSet(object.sensorId) ? globalThis.Number(object.sensorId) : 0,
|
|
212
|
+
newState: isSet(object.newState) ? SensorState.fromJSON(object.newState) : undefined,
|
|
213
|
+
};
|
|
214
|
+
},
|
|
215
|
+
toJSON(message) {
|
|
216
|
+
const obj = {};
|
|
217
|
+
if (message.sensorId !== 0) {
|
|
218
|
+
obj.sensorId = Math.round(message.sensorId);
|
|
219
|
+
}
|
|
220
|
+
if (message.newState !== undefined) {
|
|
221
|
+
obj.newState = SensorState.toJSON(message.newState);
|
|
222
|
+
}
|
|
223
|
+
return obj;
|
|
224
|
+
},
|
|
225
|
+
create(base) {
|
|
226
|
+
return UpdateSensorRequest.fromPartial(base ?? {});
|
|
227
|
+
},
|
|
228
|
+
fromPartial(object) {
|
|
229
|
+
const message = createBaseUpdateSensorRequest();
|
|
230
|
+
message.sensorId = object.sensorId ?? 0;
|
|
231
|
+
message.newState = (object.newState !== undefined && object.newState !== null)
|
|
232
|
+
? SensorState.fromPartial(object.newState)
|
|
233
|
+
: undefined;
|
|
234
|
+
return message;
|
|
235
|
+
},
|
|
236
|
+
};
|
|
237
|
+
function createBaseUpdateSensorsResponse() {
|
|
238
|
+
return { errors: [], processed: [] };
|
|
239
|
+
}
|
|
240
|
+
export const UpdateSensorsResponse = {
|
|
241
|
+
encode(message, writer = new BinaryWriter()) {
|
|
242
|
+
for (const v of message.errors) {
|
|
243
|
+
writer.uint32(10).string(v);
|
|
244
|
+
}
|
|
245
|
+
writer.uint32(18).fork();
|
|
246
|
+
for (const v of message.processed) {
|
|
247
|
+
writer.int32(v);
|
|
248
|
+
}
|
|
249
|
+
writer.join();
|
|
250
|
+
return writer;
|
|
251
|
+
},
|
|
252
|
+
decode(input, length) {
|
|
253
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
254
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
255
|
+
const message = createBaseUpdateSensorsResponse();
|
|
256
|
+
while (reader.pos < end) {
|
|
257
|
+
const tag = reader.uint32();
|
|
258
|
+
switch (tag >>> 3) {
|
|
259
|
+
case 1: {
|
|
260
|
+
if (tag !== 10) {
|
|
261
|
+
break;
|
|
262
|
+
}
|
|
263
|
+
message.errors.push(reader.string());
|
|
264
|
+
continue;
|
|
265
|
+
}
|
|
266
|
+
case 2: {
|
|
267
|
+
if (tag === 16) {
|
|
268
|
+
message.processed.push(reader.int32());
|
|
269
|
+
continue;
|
|
270
|
+
}
|
|
271
|
+
if (tag === 18) {
|
|
272
|
+
const end2 = reader.uint32() + reader.pos;
|
|
273
|
+
while (reader.pos < end2) {
|
|
274
|
+
message.processed.push(reader.int32());
|
|
275
|
+
}
|
|
276
|
+
continue;
|
|
277
|
+
}
|
|
278
|
+
break;
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
282
|
+
break;
|
|
283
|
+
}
|
|
284
|
+
reader.skip(tag & 7);
|
|
285
|
+
}
|
|
286
|
+
return message;
|
|
287
|
+
},
|
|
288
|
+
fromJSON(object) {
|
|
289
|
+
return {
|
|
290
|
+
errors: globalThis.Array.isArray(object?.errors) ? object.errors.map((e) => globalThis.String(e)) : [],
|
|
291
|
+
processed: globalThis.Array.isArray(object?.processed)
|
|
292
|
+
? object.processed.map((e) => globalThis.Number(e))
|
|
293
|
+
: [],
|
|
294
|
+
};
|
|
295
|
+
},
|
|
296
|
+
toJSON(message) {
|
|
297
|
+
const obj = {};
|
|
298
|
+
if (message.errors?.length) {
|
|
299
|
+
obj.errors = message.errors;
|
|
300
|
+
}
|
|
301
|
+
if (message.processed?.length) {
|
|
302
|
+
obj.processed = message.processed.map((e) => Math.round(e));
|
|
303
|
+
}
|
|
304
|
+
return obj;
|
|
305
|
+
},
|
|
306
|
+
create(base) {
|
|
307
|
+
return UpdateSensorsResponse.fromPartial(base ?? {});
|
|
308
|
+
},
|
|
309
|
+
fromPartial(object) {
|
|
310
|
+
const message = createBaseUpdateSensorsResponse();
|
|
311
|
+
message.errors = object.errors?.map((e) => e) || [];
|
|
312
|
+
message.processed = object.processed?.map((e) => e) || [];
|
|
313
|
+
return message;
|
|
314
|
+
},
|
|
315
|
+
};
|
|
316
|
+
function createBaseUpdateStationRequest() {
|
|
317
|
+
return { stationId: 0, definition: undefined };
|
|
318
|
+
}
|
|
319
|
+
export const UpdateStationRequest = {
|
|
320
|
+
encode(message, writer = new BinaryWriter()) {
|
|
321
|
+
if (message.stationId !== 0) {
|
|
322
|
+
writer.uint32(8).int64(message.stationId);
|
|
323
|
+
}
|
|
324
|
+
if (message.definition !== undefined) {
|
|
325
|
+
StationDefinition.encode(message.definition, writer.uint32(18).fork()).join();
|
|
326
|
+
}
|
|
327
|
+
return writer;
|
|
328
|
+
},
|
|
329
|
+
decode(input, length) {
|
|
330
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
331
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
332
|
+
const message = createBaseUpdateStationRequest();
|
|
333
|
+
while (reader.pos < end) {
|
|
334
|
+
const tag = reader.uint32();
|
|
335
|
+
switch (tag >>> 3) {
|
|
336
|
+
case 1: {
|
|
337
|
+
if (tag !== 8) {
|
|
338
|
+
break;
|
|
339
|
+
}
|
|
340
|
+
message.stationId = longToNumber(reader.int64());
|
|
341
|
+
continue;
|
|
342
|
+
}
|
|
343
|
+
case 2: {
|
|
344
|
+
if (tag !== 18) {
|
|
345
|
+
break;
|
|
346
|
+
}
|
|
347
|
+
message.definition = StationDefinition.decode(reader, reader.uint32());
|
|
348
|
+
continue;
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
352
|
+
break;
|
|
353
|
+
}
|
|
354
|
+
reader.skip(tag & 7);
|
|
355
|
+
}
|
|
356
|
+
return message;
|
|
357
|
+
},
|
|
358
|
+
fromJSON(object) {
|
|
359
|
+
return {
|
|
360
|
+
stationId: isSet(object.stationId) ? globalThis.Number(object.stationId) : 0,
|
|
361
|
+
definition: isSet(object.definition) ? StationDefinition.fromJSON(object.definition) : undefined,
|
|
362
|
+
};
|
|
363
|
+
},
|
|
364
|
+
toJSON(message) {
|
|
365
|
+
const obj = {};
|
|
366
|
+
if (message.stationId !== 0) {
|
|
367
|
+
obj.stationId = Math.round(message.stationId);
|
|
368
|
+
}
|
|
369
|
+
if (message.definition !== undefined) {
|
|
370
|
+
obj.definition = StationDefinition.toJSON(message.definition);
|
|
371
|
+
}
|
|
372
|
+
return obj;
|
|
373
|
+
},
|
|
374
|
+
create(base) {
|
|
375
|
+
return UpdateStationRequest.fromPartial(base ?? {});
|
|
376
|
+
},
|
|
377
|
+
fromPartial(object) {
|
|
378
|
+
const message = createBaseUpdateStationRequest();
|
|
379
|
+
message.stationId = object.stationId ?? 0;
|
|
380
|
+
message.definition = (object.definition !== undefined && object.definition !== null)
|
|
381
|
+
? StationDefinition.fromPartial(object.definition)
|
|
382
|
+
: undefined;
|
|
383
|
+
return message;
|
|
384
|
+
},
|
|
385
|
+
};
|
|
386
|
+
function createBaseGetStationDefinitionRequest() {
|
|
387
|
+
return {};
|
|
388
|
+
}
|
|
389
|
+
export const GetStationDefinitionRequest = {
|
|
390
|
+
encode(_, writer = new BinaryWriter()) {
|
|
391
|
+
return writer;
|
|
392
|
+
},
|
|
393
|
+
decode(input, length) {
|
|
394
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
395
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
396
|
+
const message = createBaseGetStationDefinitionRequest();
|
|
397
|
+
while (reader.pos < end) {
|
|
398
|
+
const tag = reader.uint32();
|
|
399
|
+
switch (tag >>> 3) {
|
|
400
|
+
}
|
|
401
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
402
|
+
break;
|
|
403
|
+
}
|
|
404
|
+
reader.skip(tag & 7);
|
|
405
|
+
}
|
|
406
|
+
return message;
|
|
407
|
+
},
|
|
408
|
+
fromJSON(_) {
|
|
409
|
+
return {};
|
|
410
|
+
},
|
|
411
|
+
toJSON(_) {
|
|
412
|
+
const obj = {};
|
|
413
|
+
return obj;
|
|
414
|
+
},
|
|
415
|
+
create(base) {
|
|
416
|
+
return GetStationDefinitionRequest.fromPartial(base ?? {});
|
|
417
|
+
},
|
|
418
|
+
fromPartial(_) {
|
|
419
|
+
const message = createBaseGetStationDefinitionRequest();
|
|
420
|
+
return message;
|
|
421
|
+
},
|
|
422
|
+
};
|
|
423
|
+
function createBaseStationDefinition() {
|
|
424
|
+
return { name: "", sensors: [], longitude: 0, latitude: 0, version: 0 };
|
|
425
|
+
}
|
|
426
|
+
export const StationDefinition = {
|
|
427
|
+
encode(message, writer = new BinaryWriter()) {
|
|
428
|
+
if (message.name !== "") {
|
|
429
|
+
writer.uint32(10).string(message.name);
|
|
430
|
+
}
|
|
431
|
+
for (const v of message.sensors) {
|
|
432
|
+
SensorDefinition.encode(v, writer.uint32(18).fork()).join();
|
|
433
|
+
}
|
|
434
|
+
if (message.longitude !== 0) {
|
|
435
|
+
writer.uint32(25).double(message.longitude);
|
|
436
|
+
}
|
|
437
|
+
if (message.latitude !== 0) {
|
|
438
|
+
writer.uint32(33).double(message.latitude);
|
|
439
|
+
}
|
|
440
|
+
if (message.version !== 0) {
|
|
441
|
+
writer.uint32(40).int32(message.version);
|
|
442
|
+
}
|
|
443
|
+
return writer;
|
|
444
|
+
},
|
|
445
|
+
decode(input, length) {
|
|
446
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
447
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
448
|
+
const message = createBaseStationDefinition();
|
|
449
|
+
while (reader.pos < end) {
|
|
450
|
+
const tag = reader.uint32();
|
|
451
|
+
switch (tag >>> 3) {
|
|
452
|
+
case 1: {
|
|
453
|
+
if (tag !== 10) {
|
|
454
|
+
break;
|
|
455
|
+
}
|
|
456
|
+
message.name = reader.string();
|
|
457
|
+
continue;
|
|
458
|
+
}
|
|
459
|
+
case 2: {
|
|
460
|
+
if (tag !== 18) {
|
|
461
|
+
break;
|
|
462
|
+
}
|
|
463
|
+
message.sensors.push(SensorDefinition.decode(reader, reader.uint32()));
|
|
464
|
+
continue;
|
|
465
|
+
}
|
|
466
|
+
case 3: {
|
|
467
|
+
if (tag !== 25) {
|
|
468
|
+
break;
|
|
469
|
+
}
|
|
470
|
+
message.longitude = reader.double();
|
|
471
|
+
continue;
|
|
472
|
+
}
|
|
473
|
+
case 4: {
|
|
474
|
+
if (tag !== 33) {
|
|
475
|
+
break;
|
|
476
|
+
}
|
|
477
|
+
message.latitude = reader.double();
|
|
478
|
+
continue;
|
|
479
|
+
}
|
|
480
|
+
case 5: {
|
|
481
|
+
if (tag !== 40) {
|
|
482
|
+
break;
|
|
483
|
+
}
|
|
484
|
+
message.version = reader.int32();
|
|
485
|
+
continue;
|
|
486
|
+
}
|
|
487
|
+
}
|
|
488
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
489
|
+
break;
|
|
490
|
+
}
|
|
491
|
+
reader.skip(tag & 7);
|
|
492
|
+
}
|
|
493
|
+
return message;
|
|
494
|
+
},
|
|
495
|
+
fromJSON(object) {
|
|
496
|
+
return {
|
|
497
|
+
name: isSet(object.name) ? globalThis.String(object.name) : "",
|
|
498
|
+
sensors: globalThis.Array.isArray(object?.sensors)
|
|
499
|
+
? object.sensors.map((e) => SensorDefinition.fromJSON(e))
|
|
500
|
+
: [],
|
|
501
|
+
longitude: isSet(object.longitude) ? globalThis.Number(object.longitude) : 0,
|
|
502
|
+
latitude: isSet(object.latitude) ? globalThis.Number(object.latitude) : 0,
|
|
503
|
+
version: isSet(object.version) ? globalThis.Number(object.version) : 0,
|
|
504
|
+
};
|
|
505
|
+
},
|
|
506
|
+
toJSON(message) {
|
|
507
|
+
const obj = {};
|
|
508
|
+
if (message.name !== "") {
|
|
509
|
+
obj.name = message.name;
|
|
510
|
+
}
|
|
511
|
+
if (message.sensors?.length) {
|
|
512
|
+
obj.sensors = message.sensors.map((e) => SensorDefinition.toJSON(e));
|
|
513
|
+
}
|
|
514
|
+
if (message.longitude !== 0) {
|
|
515
|
+
obj.longitude = message.longitude;
|
|
516
|
+
}
|
|
517
|
+
if (message.latitude !== 0) {
|
|
518
|
+
obj.latitude = message.latitude;
|
|
519
|
+
}
|
|
520
|
+
if (message.version !== 0) {
|
|
521
|
+
obj.version = Math.round(message.version);
|
|
522
|
+
}
|
|
523
|
+
return obj;
|
|
524
|
+
},
|
|
525
|
+
create(base) {
|
|
526
|
+
return StationDefinition.fromPartial(base ?? {});
|
|
527
|
+
},
|
|
528
|
+
fromPartial(object) {
|
|
529
|
+
const message = createBaseStationDefinition();
|
|
530
|
+
message.name = object.name ?? "";
|
|
531
|
+
message.sensors = object.sensors?.map((e) => SensorDefinition.fromPartial(e)) || [];
|
|
532
|
+
message.longitude = object.longitude ?? 0;
|
|
533
|
+
message.latitude = object.latitude ?? 0;
|
|
534
|
+
message.version = object.version ?? 0;
|
|
535
|
+
return message;
|
|
536
|
+
},
|
|
537
|
+
};
|
|
538
|
+
function createBaseSensorDefinition() {
|
|
539
|
+
return { name: "", element: "", recordIntervalSeconds: 0 };
|
|
540
|
+
}
|
|
541
|
+
export const SensorDefinition = {
|
|
542
|
+
encode(message, writer = new BinaryWriter()) {
|
|
543
|
+
if (message.name !== "") {
|
|
544
|
+
writer.uint32(10).string(message.name);
|
|
545
|
+
}
|
|
546
|
+
if (message.element !== "") {
|
|
547
|
+
writer.uint32(18).string(message.element);
|
|
548
|
+
}
|
|
549
|
+
if (message.recordIntervalSeconds !== 0) {
|
|
550
|
+
writer.uint32(24).int64(message.recordIntervalSeconds);
|
|
551
|
+
}
|
|
552
|
+
return writer;
|
|
553
|
+
},
|
|
554
|
+
decode(input, length) {
|
|
555
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
556
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
557
|
+
const message = createBaseSensorDefinition();
|
|
558
|
+
while (reader.pos < end) {
|
|
559
|
+
const tag = reader.uint32();
|
|
560
|
+
switch (tag >>> 3) {
|
|
561
|
+
case 1: {
|
|
562
|
+
if (tag !== 10) {
|
|
563
|
+
break;
|
|
564
|
+
}
|
|
565
|
+
message.name = reader.string();
|
|
566
|
+
continue;
|
|
567
|
+
}
|
|
568
|
+
case 2: {
|
|
569
|
+
if (tag !== 18) {
|
|
570
|
+
break;
|
|
571
|
+
}
|
|
572
|
+
message.element = reader.string();
|
|
573
|
+
continue;
|
|
574
|
+
}
|
|
575
|
+
case 3: {
|
|
576
|
+
if (tag !== 24) {
|
|
577
|
+
break;
|
|
578
|
+
}
|
|
579
|
+
message.recordIntervalSeconds = longToNumber(reader.int64());
|
|
580
|
+
continue;
|
|
581
|
+
}
|
|
582
|
+
}
|
|
583
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
584
|
+
break;
|
|
585
|
+
}
|
|
586
|
+
reader.skip(tag & 7);
|
|
587
|
+
}
|
|
588
|
+
return message;
|
|
589
|
+
},
|
|
590
|
+
fromJSON(object) {
|
|
591
|
+
return {
|
|
592
|
+
name: isSet(object.name) ? globalThis.String(object.name) : "",
|
|
593
|
+
element: isSet(object.element) ? globalThis.String(object.element) : "",
|
|
594
|
+
recordIntervalSeconds: isSet(object.recordIntervalSeconds) ? globalThis.Number(object.recordIntervalSeconds) : 0,
|
|
595
|
+
};
|
|
596
|
+
},
|
|
597
|
+
toJSON(message) {
|
|
598
|
+
const obj = {};
|
|
599
|
+
if (message.name !== "") {
|
|
600
|
+
obj.name = message.name;
|
|
601
|
+
}
|
|
602
|
+
if (message.element !== "") {
|
|
603
|
+
obj.element = message.element;
|
|
604
|
+
}
|
|
605
|
+
if (message.recordIntervalSeconds !== 0) {
|
|
606
|
+
obj.recordIntervalSeconds = Math.round(message.recordIntervalSeconds);
|
|
607
|
+
}
|
|
608
|
+
return obj;
|
|
609
|
+
},
|
|
610
|
+
create(base) {
|
|
611
|
+
return SensorDefinition.fromPartial(base ?? {});
|
|
612
|
+
},
|
|
613
|
+
fromPartial(object) {
|
|
614
|
+
const message = createBaseSensorDefinition();
|
|
615
|
+
message.name = object.name ?? "";
|
|
616
|
+
message.element = object.element ?? "";
|
|
617
|
+
message.recordIntervalSeconds = object.recordIntervalSeconds ?? 0;
|
|
618
|
+
return message;
|
|
619
|
+
},
|
|
620
|
+
};
|
|
621
|
+
function createBaseStation() {
|
|
622
|
+
return { id: 0, sensors: [], version: 0 };
|
|
623
|
+
}
|
|
624
|
+
export const Station = {
|
|
625
|
+
encode(message, writer = new BinaryWriter()) {
|
|
626
|
+
if (message.id !== 0) {
|
|
627
|
+
writer.uint32(8).int64(message.id);
|
|
628
|
+
}
|
|
629
|
+
for (const v of message.sensors) {
|
|
630
|
+
Sensor.encode(v, writer.uint32(18).fork()).join();
|
|
631
|
+
}
|
|
632
|
+
if (message.version !== 0) {
|
|
633
|
+
writer.uint32(24).int32(message.version);
|
|
634
|
+
}
|
|
635
|
+
return writer;
|
|
636
|
+
},
|
|
637
|
+
decode(input, length) {
|
|
638
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
639
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
640
|
+
const message = createBaseStation();
|
|
641
|
+
while (reader.pos < end) {
|
|
642
|
+
const tag = reader.uint32();
|
|
643
|
+
switch (tag >>> 3) {
|
|
644
|
+
case 1: {
|
|
645
|
+
if (tag !== 8) {
|
|
646
|
+
break;
|
|
647
|
+
}
|
|
648
|
+
message.id = longToNumber(reader.int64());
|
|
649
|
+
continue;
|
|
650
|
+
}
|
|
651
|
+
case 2: {
|
|
652
|
+
if (tag !== 18) {
|
|
653
|
+
break;
|
|
654
|
+
}
|
|
655
|
+
message.sensors.push(Sensor.decode(reader, reader.uint32()));
|
|
656
|
+
continue;
|
|
657
|
+
}
|
|
658
|
+
case 3: {
|
|
659
|
+
if (tag !== 24) {
|
|
660
|
+
break;
|
|
661
|
+
}
|
|
662
|
+
message.version = reader.int32();
|
|
663
|
+
continue;
|
|
664
|
+
}
|
|
665
|
+
}
|
|
666
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
667
|
+
break;
|
|
668
|
+
}
|
|
669
|
+
reader.skip(tag & 7);
|
|
670
|
+
}
|
|
671
|
+
return message;
|
|
672
|
+
},
|
|
673
|
+
fromJSON(object) {
|
|
674
|
+
return {
|
|
675
|
+
id: isSet(object.id) ? globalThis.Number(object.id) : 0,
|
|
676
|
+
sensors: globalThis.Array.isArray(object?.sensors) ? object.sensors.map((e) => Sensor.fromJSON(e)) : [],
|
|
677
|
+
version: isSet(object.version) ? globalThis.Number(object.version) : 0,
|
|
678
|
+
};
|
|
679
|
+
},
|
|
680
|
+
toJSON(message) {
|
|
681
|
+
const obj = {};
|
|
682
|
+
if (message.id !== 0) {
|
|
683
|
+
obj.id = Math.round(message.id);
|
|
684
|
+
}
|
|
685
|
+
if (message.sensors?.length) {
|
|
686
|
+
obj.sensors = message.sensors.map((e) => Sensor.toJSON(e));
|
|
687
|
+
}
|
|
688
|
+
if (message.version !== 0) {
|
|
689
|
+
obj.version = Math.round(message.version);
|
|
690
|
+
}
|
|
691
|
+
return obj;
|
|
692
|
+
},
|
|
693
|
+
create(base) {
|
|
694
|
+
return Station.fromPartial(base ?? {});
|
|
695
|
+
},
|
|
696
|
+
fromPartial(object) {
|
|
697
|
+
const message = createBaseStation();
|
|
698
|
+
message.id = object.id ?? 0;
|
|
699
|
+
message.sensors = object.sensors?.map((e) => Sensor.fromPartial(e)) || [];
|
|
700
|
+
message.version = object.version ?? 0;
|
|
701
|
+
return message;
|
|
702
|
+
},
|
|
703
|
+
};
|
|
704
|
+
function createBaseSensor() {
|
|
705
|
+
return { id: 0, name: "", recordIntervalSeconds: 0 };
|
|
706
|
+
}
|
|
707
|
+
export const Sensor = {
|
|
708
|
+
encode(message, writer = new BinaryWriter()) {
|
|
709
|
+
if (message.id !== 0) {
|
|
710
|
+
writer.uint32(8).int64(message.id);
|
|
711
|
+
}
|
|
712
|
+
if (message.name !== "") {
|
|
713
|
+
writer.uint32(18).string(message.name);
|
|
714
|
+
}
|
|
715
|
+
if (message.recordIntervalSeconds !== 0) {
|
|
716
|
+
writer.uint32(24).int64(message.recordIntervalSeconds);
|
|
717
|
+
}
|
|
718
|
+
return writer;
|
|
719
|
+
},
|
|
720
|
+
decode(input, length) {
|
|
721
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
722
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
723
|
+
const message = createBaseSensor();
|
|
724
|
+
while (reader.pos < end) {
|
|
725
|
+
const tag = reader.uint32();
|
|
726
|
+
switch (tag >>> 3) {
|
|
727
|
+
case 1: {
|
|
728
|
+
if (tag !== 8) {
|
|
729
|
+
break;
|
|
730
|
+
}
|
|
731
|
+
message.id = longToNumber(reader.int64());
|
|
732
|
+
continue;
|
|
733
|
+
}
|
|
734
|
+
case 2: {
|
|
735
|
+
if (tag !== 18) {
|
|
736
|
+
break;
|
|
737
|
+
}
|
|
738
|
+
message.name = reader.string();
|
|
739
|
+
continue;
|
|
740
|
+
}
|
|
741
|
+
case 3: {
|
|
742
|
+
if (tag !== 24) {
|
|
743
|
+
break;
|
|
744
|
+
}
|
|
745
|
+
message.recordIntervalSeconds = longToNumber(reader.int64());
|
|
746
|
+
continue;
|
|
747
|
+
}
|
|
748
|
+
}
|
|
749
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
750
|
+
break;
|
|
751
|
+
}
|
|
752
|
+
reader.skip(tag & 7);
|
|
753
|
+
}
|
|
754
|
+
return message;
|
|
755
|
+
},
|
|
756
|
+
fromJSON(object) {
|
|
757
|
+
return {
|
|
758
|
+
id: isSet(object.id) ? globalThis.Number(object.id) : 0,
|
|
759
|
+
name: isSet(object.name) ? globalThis.String(object.name) : "",
|
|
760
|
+
recordIntervalSeconds: isSet(object.recordIntervalSeconds) ? globalThis.Number(object.recordIntervalSeconds) : 0,
|
|
761
|
+
};
|
|
762
|
+
},
|
|
763
|
+
toJSON(message) {
|
|
764
|
+
const obj = {};
|
|
765
|
+
if (message.id !== 0) {
|
|
766
|
+
obj.id = Math.round(message.id);
|
|
767
|
+
}
|
|
768
|
+
if (message.name !== "") {
|
|
769
|
+
obj.name = message.name;
|
|
770
|
+
}
|
|
771
|
+
if (message.recordIntervalSeconds !== 0) {
|
|
772
|
+
obj.recordIntervalSeconds = Math.round(message.recordIntervalSeconds);
|
|
773
|
+
}
|
|
774
|
+
return obj;
|
|
775
|
+
},
|
|
776
|
+
create(base) {
|
|
777
|
+
return Sensor.fromPartial(base ?? {});
|
|
778
|
+
},
|
|
779
|
+
fromPartial(object) {
|
|
780
|
+
const message = createBaseSensor();
|
|
781
|
+
message.id = object.id ?? 0;
|
|
782
|
+
message.name = object.name ?? "";
|
|
783
|
+
message.recordIntervalSeconds = object.recordIntervalSeconds ?? 0;
|
|
784
|
+
return message;
|
|
785
|
+
},
|
|
786
|
+
};
|
|
787
|
+
function createBaseGetSensorStateRequest() {
|
|
788
|
+
return { name: "" };
|
|
789
|
+
}
|
|
790
|
+
export const GetSensorStateRequest = {
|
|
791
|
+
encode(message, writer = new BinaryWriter()) {
|
|
792
|
+
if (message.name !== "") {
|
|
793
|
+
writer.uint32(10).string(message.name);
|
|
794
|
+
}
|
|
795
|
+
return writer;
|
|
796
|
+
},
|
|
797
|
+
decode(input, length) {
|
|
798
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
799
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
800
|
+
const message = createBaseGetSensorStateRequest();
|
|
801
|
+
while (reader.pos < end) {
|
|
802
|
+
const tag = reader.uint32();
|
|
803
|
+
switch (tag >>> 3) {
|
|
804
|
+
case 1: {
|
|
805
|
+
if (tag !== 10) {
|
|
806
|
+
break;
|
|
807
|
+
}
|
|
808
|
+
message.name = reader.string();
|
|
809
|
+
continue;
|
|
810
|
+
}
|
|
811
|
+
}
|
|
812
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
813
|
+
break;
|
|
814
|
+
}
|
|
815
|
+
reader.skip(tag & 7);
|
|
816
|
+
}
|
|
817
|
+
return message;
|
|
818
|
+
},
|
|
819
|
+
fromJSON(object) {
|
|
820
|
+
return { name: isSet(object.name) ? globalThis.String(object.name) : "" };
|
|
821
|
+
},
|
|
822
|
+
toJSON(message) {
|
|
823
|
+
const obj = {};
|
|
824
|
+
if (message.name !== "") {
|
|
825
|
+
obj.name = message.name;
|
|
826
|
+
}
|
|
827
|
+
return obj;
|
|
828
|
+
},
|
|
829
|
+
create(base) {
|
|
830
|
+
return GetSensorStateRequest.fromPartial(base ?? {});
|
|
831
|
+
},
|
|
832
|
+
fromPartial(object) {
|
|
833
|
+
const message = createBaseGetSensorStateRequest();
|
|
834
|
+
message.name = object.name ?? "";
|
|
835
|
+
return message;
|
|
836
|
+
},
|
|
837
|
+
};
|
|
838
|
+
function createBaseSensorState() {
|
|
839
|
+
return { unitId: "", value: undefined, createdAt: 0, intervalStart: undefined };
|
|
840
|
+
}
|
|
841
|
+
export const SensorState = {
|
|
842
|
+
encode(message, writer = new BinaryWriter()) {
|
|
843
|
+
if (message.unitId !== "") {
|
|
844
|
+
writer.uint32(18).string(message.unitId);
|
|
845
|
+
}
|
|
846
|
+
if (message.value !== undefined) {
|
|
847
|
+
writer.uint32(25).double(message.value);
|
|
848
|
+
}
|
|
849
|
+
if (message.createdAt !== 0) {
|
|
850
|
+
writer.uint32(32).int64(message.createdAt);
|
|
851
|
+
}
|
|
852
|
+
if (message.intervalStart !== undefined) {
|
|
853
|
+
writer.uint32(40).int64(message.intervalStart);
|
|
854
|
+
}
|
|
855
|
+
return writer;
|
|
856
|
+
},
|
|
857
|
+
decode(input, length) {
|
|
858
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
859
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
860
|
+
const message = createBaseSensorState();
|
|
861
|
+
while (reader.pos < end) {
|
|
862
|
+
const tag = reader.uint32();
|
|
863
|
+
switch (tag >>> 3) {
|
|
864
|
+
case 2: {
|
|
865
|
+
if (tag !== 18) {
|
|
866
|
+
break;
|
|
867
|
+
}
|
|
868
|
+
message.unitId = reader.string();
|
|
869
|
+
continue;
|
|
870
|
+
}
|
|
871
|
+
case 3: {
|
|
872
|
+
if (tag !== 25) {
|
|
873
|
+
break;
|
|
874
|
+
}
|
|
875
|
+
message.value = reader.double();
|
|
876
|
+
continue;
|
|
877
|
+
}
|
|
878
|
+
case 4: {
|
|
879
|
+
if (tag !== 32) {
|
|
880
|
+
break;
|
|
881
|
+
}
|
|
882
|
+
message.createdAt = longToNumber(reader.int64());
|
|
883
|
+
continue;
|
|
884
|
+
}
|
|
885
|
+
case 5: {
|
|
886
|
+
if (tag !== 40) {
|
|
887
|
+
break;
|
|
888
|
+
}
|
|
889
|
+
message.intervalStart = longToNumber(reader.int64());
|
|
890
|
+
continue;
|
|
891
|
+
}
|
|
892
|
+
}
|
|
893
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
894
|
+
break;
|
|
895
|
+
}
|
|
896
|
+
reader.skip(tag & 7);
|
|
897
|
+
}
|
|
898
|
+
return message;
|
|
899
|
+
},
|
|
900
|
+
fromJSON(object) {
|
|
901
|
+
return {
|
|
902
|
+
unitId: isSet(object.unitId) ? globalThis.String(object.unitId) : "",
|
|
903
|
+
value: isSet(object.value) ? globalThis.Number(object.value) : undefined,
|
|
904
|
+
createdAt: isSet(object.createdAt) ? globalThis.Number(object.createdAt) : 0,
|
|
905
|
+
intervalStart: isSet(object.intervalStart) ? globalThis.Number(object.intervalStart) : undefined,
|
|
906
|
+
};
|
|
907
|
+
},
|
|
908
|
+
toJSON(message) {
|
|
909
|
+
const obj = {};
|
|
910
|
+
if (message.unitId !== "") {
|
|
911
|
+
obj.unitId = message.unitId;
|
|
912
|
+
}
|
|
913
|
+
if (message.value !== undefined) {
|
|
914
|
+
obj.value = message.value;
|
|
915
|
+
}
|
|
916
|
+
if (message.createdAt !== 0) {
|
|
917
|
+
obj.createdAt = Math.round(message.createdAt);
|
|
918
|
+
}
|
|
919
|
+
if (message.intervalStart !== undefined) {
|
|
920
|
+
obj.intervalStart = Math.round(message.intervalStart);
|
|
921
|
+
}
|
|
922
|
+
return obj;
|
|
923
|
+
},
|
|
924
|
+
create(base) {
|
|
925
|
+
return SensorState.fromPartial(base ?? {});
|
|
926
|
+
},
|
|
927
|
+
fromPartial(object) {
|
|
928
|
+
const message = createBaseSensorState();
|
|
929
|
+
message.unitId = object.unitId ?? "";
|
|
930
|
+
message.value = object.value ?? undefined;
|
|
931
|
+
message.createdAt = object.createdAt ?? 0;
|
|
932
|
+
message.intervalStart = object.intervalStart ?? undefined;
|
|
933
|
+
return message;
|
|
934
|
+
},
|
|
935
|
+
};
|
|
936
|
+
export const DaemonServiceService = {
|
|
937
|
+
createStation: {
|
|
938
|
+
path: "/recorder.DaemonService/CreateStation",
|
|
939
|
+
requestStream: false,
|
|
940
|
+
responseStream: false,
|
|
941
|
+
requestSerialize: (value) => Buffer.from(StationDefinition.encode(value).finish()),
|
|
942
|
+
requestDeserialize: (value) => StationDefinition.decode(value),
|
|
943
|
+
responseSerialize: (value) => Buffer.from(Station.encode(value).finish()),
|
|
944
|
+
responseDeserialize: (value) => Station.decode(value),
|
|
945
|
+
},
|
|
946
|
+
getStation: {
|
|
947
|
+
path: "/recorder.DaemonService/GetStation",
|
|
948
|
+
requestStream: false,
|
|
949
|
+
responseStream: false,
|
|
950
|
+
requestSerialize: (value) => Buffer.from(GetStationRequest.encode(value).finish()),
|
|
951
|
+
requestDeserialize: (value) => GetStationRequest.decode(value),
|
|
952
|
+
responseSerialize: (value) => Buffer.from(Station.encode(value).finish()),
|
|
953
|
+
responseDeserialize: (value) => Station.decode(value),
|
|
954
|
+
},
|
|
955
|
+
updateStation: {
|
|
956
|
+
path: "/recorder.DaemonService/UpdateStation",
|
|
957
|
+
requestStream: false,
|
|
958
|
+
responseStream: false,
|
|
959
|
+
requestSerialize: (value) => Buffer.from(UpdateStationRequest.encode(value).finish()),
|
|
960
|
+
requestDeserialize: (value) => UpdateStationRequest.decode(value),
|
|
961
|
+
responseSerialize: (value) => Buffer.from(Station.encode(value).finish()),
|
|
962
|
+
responseDeserialize: (value) => Station.decode(value),
|
|
963
|
+
},
|
|
964
|
+
updateSensors: {
|
|
965
|
+
path: "/recorder.DaemonService/UpdateSensors",
|
|
966
|
+
requestStream: false,
|
|
967
|
+
responseStream: false,
|
|
968
|
+
requestSerialize: (value) => Buffer.from(UpdateSensorsRequest.encode(value).finish()),
|
|
969
|
+
requestDeserialize: (value) => UpdateSensorsRequest.decode(value),
|
|
970
|
+
responseSerialize: (value) => Buffer.from(UpdateSensorsResponse.encode(value).finish()),
|
|
971
|
+
responseDeserialize: (value) => UpdateSensorsResponse.decode(value),
|
|
972
|
+
},
|
|
973
|
+
ping: {
|
|
974
|
+
path: "/recorder.DaemonService/Ping",
|
|
975
|
+
requestStream: false,
|
|
976
|
+
responseStream: false,
|
|
977
|
+
requestSerialize: (value) => Buffer.from(PingMessage.encode(value).finish()),
|
|
978
|
+
requestDeserialize: (value) => PingMessage.decode(value),
|
|
979
|
+
responseSerialize: (value) => Buffer.from(PingMessage.encode(value).finish()),
|
|
980
|
+
responseDeserialize: (value) => PingMessage.decode(value),
|
|
981
|
+
},
|
|
982
|
+
};
|
|
983
|
+
export const DaemonServiceClient = makeGenericClientConstructor(DaemonServiceService, "recorder.DaemonService");
|
|
984
|
+
export const StationInterfaceService = {
|
|
985
|
+
getStationDefinition: {
|
|
986
|
+
path: "/recorder.StationInterface/GetStationDefinition",
|
|
987
|
+
requestStream: false,
|
|
988
|
+
responseStream: false,
|
|
989
|
+
requestSerialize: (value) => Buffer.from(GetStationDefinitionRequest.encode(value).finish()),
|
|
990
|
+
requestDeserialize: (value) => GetStationDefinitionRequest.decode(value),
|
|
991
|
+
responseSerialize: (value) => Buffer.from(StationDefinition.encode(value).finish()),
|
|
992
|
+
responseDeserialize: (value) => StationDefinition.decode(value),
|
|
993
|
+
},
|
|
994
|
+
getSensorState: {
|
|
995
|
+
path: "/recorder.StationInterface/GetSensorState",
|
|
996
|
+
requestStream: false,
|
|
997
|
+
responseStream: false,
|
|
998
|
+
requestSerialize: (value) => Buffer.from(GetSensorStateRequest.encode(value).finish()),
|
|
999
|
+
requestDeserialize: (value) => GetSensorStateRequest.decode(value),
|
|
1000
|
+
responseSerialize: (value) => Buffer.from(SensorState.encode(value).finish()),
|
|
1001
|
+
responseDeserialize: (value) => SensorState.decode(value),
|
|
1002
|
+
},
|
|
1003
|
+
};
|
|
1004
|
+
export const StationInterfaceClient = makeGenericClientConstructor(StationInterfaceService, "recorder.StationInterface");
|
|
1005
|
+
function longToNumber(int64) {
|
|
1006
|
+
const num = globalThis.Number(int64.toString());
|
|
1007
|
+
if (num > globalThis.Number.MAX_SAFE_INTEGER) {
|
|
1008
|
+
throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER");
|
|
1009
|
+
}
|
|
1010
|
+
if (num < globalThis.Number.MIN_SAFE_INTEGER) {
|
|
1011
|
+
throw new globalThis.Error("Value is smaller than Number.MIN_SAFE_INTEGER");
|
|
1012
|
+
}
|
|
1013
|
+
return num;
|
|
1014
|
+
}
|
|
1015
|
+
function isSet(value) {
|
|
1016
|
+
return value !== null && value !== undefined;
|
|
1017
|
+
}
|
|
1018
|
+
//# sourceMappingURL=recorder.js.map
|