node-opcua-server 2.163.1 → 2.164.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/addressSpace_accessor.js +7 -5
- package/dist/addressSpace_accessor.js.map +1 -1
- package/dist/base_server.js +6 -6
- package/dist/base_server.js.map +1 -1
- package/dist/monitored_item.js +32 -32
- package/dist/monitored_item.js.map +1 -1
- package/dist/node_sampler.js +1 -1
- package/dist/node_sampler.js.map +1 -1
- package/dist/opcua_server.js +48 -43
- package/dist/opcua_server.js.map +1 -1
- package/dist/register_server_manager.d.ts +2 -2
- package/dist/register_server_manager.js +12 -6
- package/dist/register_server_manager.js.map +1 -1
- package/dist/register_server_manager_mdns_only.js +1 -1
- package/dist/register_server_manager_mdns_only.js.map +1 -1
- package/dist/server_end_point.js +11 -11
- package/dist/server_end_point.js.map +1 -1
- package/dist/server_engine.js +6 -6
- package/dist/server_engine.js.map +1 -1
- package/dist/server_publish_engine.js +5 -5
- package/dist/server_publish_engine.js.map +1 -1
- package/dist/server_session.js +4 -4
- package/dist/server_session.js.map +1 -1
- package/dist/server_subscription.js +18 -18
- package/dist/server_subscription.js.map +1 -1
- package/dist/sessions_compatible_for_transfer.js +1 -1
- package/dist/sessions_compatible_for_transfer.js.map +1 -1
- package/package.json +47 -47
- package/source/addressSpace_accessor.ts +6 -3
- package/source/base_server.ts +7 -7
- package/source/monitored_item.ts +32 -32
- package/source/node_sampler.ts +1 -1
- package/source/opcua_server.ts +54 -49
- package/source/register_server_manager.ts +11 -5
- package/source/register_server_manager_mdns_only.ts +1 -1
- package/source/server_end_point.ts +11 -11
- package/source/server_engine.ts +15 -14
- package/source/server_publish_engine.ts +5 -5
- package/source/server_session.ts +4 -4
- package/source/server_subscription.ts +18 -18
- package/source/sessions_compatible_for_transfer.ts +4 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "node-opcua-server",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.164.2",
|
|
4
4
|
"description": "pure nodejs OPCUA SDK - module server",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build": "tsc -b",
|
|
@@ -12,61 +12,61 @@
|
|
|
12
12
|
"main": "./dist/index.js",
|
|
13
13
|
"types": "./dist/index.d.ts",
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"@ster5/global-mutex": "^2.
|
|
15
|
+
"@ster5/global-mutex": "^3.2.2",
|
|
16
16
|
"@types/async": "3.2.25",
|
|
17
|
-
"@types/lodash": "4.17.
|
|
17
|
+
"@types/lodash": "4.17.24",
|
|
18
18
|
"async": "^3.2.6",
|
|
19
19
|
"chalk": "4.1.2",
|
|
20
20
|
"dequeue": "^1.0.5",
|
|
21
21
|
"lodash": "4.17.23",
|
|
22
|
-
"node-opcua-address-space": "2.
|
|
23
|
-
"node-opcua-address-space-base": "2.
|
|
24
|
-
"node-opcua-assert": "2.
|
|
25
|
-
"node-opcua-basic-types": "2.
|
|
26
|
-
"node-opcua-binary-stream": "2.
|
|
27
|
-
"node-opcua-certificate-manager": "2.
|
|
28
|
-
"node-opcua-client": "2.
|
|
29
|
-
"node-opcua-common": "2.
|
|
22
|
+
"node-opcua-address-space": "2.164.2",
|
|
23
|
+
"node-opcua-address-space-base": "2.164.0",
|
|
24
|
+
"node-opcua-assert": "2.164.0",
|
|
25
|
+
"node-opcua-basic-types": "2.164.0",
|
|
26
|
+
"node-opcua-binary-stream": "2.164.0",
|
|
27
|
+
"node-opcua-certificate-manager": "2.164.2",
|
|
28
|
+
"node-opcua-client": "2.164.2",
|
|
29
|
+
"node-opcua-common": "2.164.0",
|
|
30
30
|
"node-opcua-constants": "2.157.0",
|
|
31
|
-
"node-opcua-crypto": "
|
|
32
|
-
"node-opcua-data-model": "2.
|
|
33
|
-
"node-opcua-data-value": "2.
|
|
34
|
-
"node-opcua-date-time": "2.
|
|
35
|
-
"node-opcua-debug": "2.
|
|
36
|
-
"node-opcua-extension-object": "2.
|
|
37
|
-
"node-opcua-factory": "2.
|
|
38
|
-
"node-opcua-hostname": "2.
|
|
39
|
-
"node-opcua-nodeid": "2.
|
|
31
|
+
"node-opcua-crypto": "5.3.0",
|
|
32
|
+
"node-opcua-data-model": "2.164.0",
|
|
33
|
+
"node-opcua-data-value": "2.164.0",
|
|
34
|
+
"node-opcua-date-time": "2.164.0",
|
|
35
|
+
"node-opcua-debug": "2.164.0",
|
|
36
|
+
"node-opcua-extension-object": "2.164.0",
|
|
37
|
+
"node-opcua-factory": "2.164.0",
|
|
38
|
+
"node-opcua-hostname": "2.164.0",
|
|
39
|
+
"node-opcua-nodeid": "2.164.0",
|
|
40
40
|
"node-opcua-nodesets": "2.163.1",
|
|
41
|
-
"node-opcua-numeric-range": "2.
|
|
42
|
-
"node-opcua-object-registry": "2.
|
|
43
|
-
"node-opcua-pki": "
|
|
44
|
-
"node-opcua-secure-channel": "2.
|
|
45
|
-
"node-opcua-service-browse": "2.
|
|
46
|
-
"node-opcua-service-call": "2.
|
|
47
|
-
"node-opcua-service-discovery": "2.
|
|
48
|
-
"node-opcua-service-endpoints": "2.
|
|
49
|
-
"node-opcua-service-filter": "2.
|
|
50
|
-
"node-opcua-service-history": "2.
|
|
51
|
-
"node-opcua-service-node-management": "2.
|
|
52
|
-
"node-opcua-service-query": "2.
|
|
53
|
-
"node-opcua-service-read": "2.
|
|
54
|
-
"node-opcua-service-register-node": "2.
|
|
55
|
-
"node-opcua-service-secure-channel": "2.
|
|
56
|
-
"node-opcua-service-session": "2.
|
|
57
|
-
"node-opcua-service-subscription": "2.
|
|
58
|
-
"node-opcua-service-translate-browse-path": "2.
|
|
59
|
-
"node-opcua-service-write": "2.
|
|
60
|
-
"node-opcua-status-code": "2.
|
|
61
|
-
"node-opcua-transport": "2.
|
|
62
|
-
"node-opcua-types": "2.
|
|
63
|
-
"node-opcua-utils": "2.
|
|
64
|
-
"node-opcua-variant": "2.
|
|
41
|
+
"node-opcua-numeric-range": "2.164.0",
|
|
42
|
+
"node-opcua-object-registry": "2.164.0",
|
|
43
|
+
"node-opcua-pki": "6.8.2",
|
|
44
|
+
"node-opcua-secure-channel": "2.164.2",
|
|
45
|
+
"node-opcua-service-browse": "2.164.0",
|
|
46
|
+
"node-opcua-service-call": "2.164.0",
|
|
47
|
+
"node-opcua-service-discovery": "2.164.0",
|
|
48
|
+
"node-opcua-service-endpoints": "2.164.0",
|
|
49
|
+
"node-opcua-service-filter": "2.164.0",
|
|
50
|
+
"node-opcua-service-history": "2.164.0",
|
|
51
|
+
"node-opcua-service-node-management": "2.164.0",
|
|
52
|
+
"node-opcua-service-query": "2.164.0",
|
|
53
|
+
"node-opcua-service-read": "2.164.0",
|
|
54
|
+
"node-opcua-service-register-node": "2.164.0",
|
|
55
|
+
"node-opcua-service-secure-channel": "2.164.0",
|
|
56
|
+
"node-opcua-service-session": "2.164.0",
|
|
57
|
+
"node-opcua-service-subscription": "2.164.2",
|
|
58
|
+
"node-opcua-service-translate-browse-path": "2.164.0",
|
|
59
|
+
"node-opcua-service-write": "2.164.0",
|
|
60
|
+
"node-opcua-status-code": "2.164.0",
|
|
61
|
+
"node-opcua-transport": "2.164.0",
|
|
62
|
+
"node-opcua-types": "2.164.0",
|
|
63
|
+
"node-opcua-utils": "2.164.0",
|
|
64
|
+
"node-opcua-variant": "2.164.0",
|
|
65
65
|
"thenify-ex": "4.4.0"
|
|
66
66
|
},
|
|
67
67
|
"devDependencies": {
|
|
68
|
-
"node-opcua-data-access": "2.
|
|
69
|
-
"node-opcua-leak-detector": "2.
|
|
68
|
+
"node-opcua-data-access": "2.164.0",
|
|
69
|
+
"node-opcua-leak-detector": "2.164.0",
|
|
70
70
|
"node-opcua-test-helpers": "2.157.0"
|
|
71
71
|
},
|
|
72
72
|
"author": "Etienne Rossignon",
|
|
@@ -84,7 +84,7 @@
|
|
|
84
84
|
"internet of things"
|
|
85
85
|
],
|
|
86
86
|
"homepage": "http://node-opcua.github.io/",
|
|
87
|
-
"gitHead": "
|
|
87
|
+
"gitHead": "eb76d34b885c7584785d8eff69ada66f95b55c2e",
|
|
88
88
|
"files": [
|
|
89
89
|
"dist",
|
|
90
90
|
"source"
|
|
@@ -13,7 +13,6 @@ import { TimestampsToReturn, DataValue, coerceTimestampsToReturn, apply_timestam
|
|
|
13
13
|
import { getCurrentClock, isMinDate } from "node-opcua-date-time";
|
|
14
14
|
import { resolveNodeId, coerceNodeId, NodeId } from "node-opcua-nodeid";
|
|
15
15
|
import { NumericRange } from "node-opcua-numeric-range";
|
|
16
|
-
import { doDebug, debugLog } from "node-opcua-pki";
|
|
17
16
|
import { StatusCode, StatusCodes } from "node-opcua-status-code";
|
|
18
17
|
import {
|
|
19
18
|
BrowseDescriptionOptions,
|
|
@@ -33,6 +32,10 @@ import {
|
|
|
33
32
|
} from "node-opcua-types";
|
|
34
33
|
import { Variant } from "node-opcua-variant";
|
|
35
34
|
import { IAddressSpaceAccessor } from "./i_address_space_accessor";
|
|
35
|
+
import { checkDebugFlag, make_debugLog } from "node-opcua-debug";
|
|
36
|
+
|
|
37
|
+
const doDebug = checkDebugFlag(__filename);
|
|
38
|
+
const debugLog = make_debugLog(__filename);
|
|
36
39
|
|
|
37
40
|
function checkReadProcessedDetails(historyReadDetails: ReadProcessedDetails): StatusCode {
|
|
38
41
|
if (!historyReadDetails.aggregateConfiguration) {
|
|
@@ -369,7 +372,7 @@ export class AddressSpaceAccessor implements IAddressSpaceAccessor, IAddressSpac
|
|
|
369
372
|
// Object Not Found
|
|
370
373
|
return new HistoryReadResult({ statusCode: StatusCodes.BadNodeIdUnknown });
|
|
371
374
|
} else {
|
|
372
|
-
//
|
|
375
|
+
// c8 ignore next
|
|
373
376
|
if (!obj.historyRead) {
|
|
374
377
|
// note : Object and View may also support historyRead to provide Event historical data
|
|
375
378
|
// todo implement historyRead for Object and View
|
|
@@ -384,7 +387,7 @@ export class AddressSpaceAccessor implements IAddressSpaceAccessor, IAddressSpac
|
|
|
384
387
|
"\n" +
|
|
385
388
|
"HistoryReadDetails " +
|
|
386
389
|
historyReadDetails.toString();
|
|
387
|
-
//
|
|
390
|
+
// c8 ignore next
|
|
388
391
|
if (doDebug) {
|
|
389
392
|
debugLog(chalk.cyan("ServerEngine#_historyReadNode "), chalk.white.bold(msg));
|
|
390
393
|
}
|
package/source/base_server.ts
CHANGED
|
@@ -36,7 +36,7 @@ import { ServiceFault } from "node-opcua-service-secure-channel";
|
|
|
36
36
|
import { StatusCode, StatusCodes } from "node-opcua-status-code";
|
|
37
37
|
import { ApplicationDescriptionOptions } from "node-opcua-types";
|
|
38
38
|
import { EndpointDescription, GetEndpointsRequest } from "node-opcua-types";
|
|
39
|
-
import { matchUri } from "node-opcua-utils";
|
|
39
|
+
import { matchUri, checkFileExistsAndIsNotEmpty } from "node-opcua-utils";
|
|
40
40
|
|
|
41
41
|
import { performCertificateSanityCheck } from "node-opcua-client";
|
|
42
42
|
import { OPCUAServerEndPoint } from "./server_end_point";
|
|
@@ -189,9 +189,9 @@ export class OPCUABaseServer extends OPCUASecureObject {
|
|
|
189
189
|
/* to do */
|
|
190
190
|
}
|
|
191
191
|
}
|
|
192
|
-
if (!
|
|
192
|
+
if (!checkFileExistsAndIsNotEmpty(this.certificateFile)) {
|
|
193
193
|
await withLock({ fileToLock: this.certificateFile + ".mutex" }, async () => {
|
|
194
|
-
if (
|
|
194
|
+
if (checkFileExistsAndIsNotEmpty(this.certificateFile)) {
|
|
195
195
|
return;
|
|
196
196
|
}
|
|
197
197
|
const applicationUri = this.serverInfo.applicationUri!;
|
|
@@ -387,7 +387,7 @@ export class OPCUABaseServer extends OPCUASecureObject {
|
|
|
387
387
|
channel.send_response("MSG", response, message, emptyCallback);
|
|
388
388
|
}
|
|
389
389
|
} catch (err) {
|
|
390
|
-
/*
|
|
390
|
+
/* c8 ignore next */
|
|
391
391
|
const errMessage1 = "[NODE-OPCUA-W08] EXCEPTION CAUGHT WHILE PROCESSING REQUEST !! " + request.schema.name;
|
|
392
392
|
warningLog(chalk.red.bold(errMessage1));
|
|
393
393
|
warningLog(request.toString());
|
|
@@ -449,20 +449,20 @@ export class OPCUABaseServer extends OPCUASecureObject {
|
|
|
449
449
|
public async suspendEndPoints(): Promise<void>;
|
|
450
450
|
public suspendEndPoints(callback: (err?: Error) => void): void;
|
|
451
451
|
public suspendEndPoints(callback?: (err?: Error) => void): void | Promise<void> {
|
|
452
|
-
/*
|
|
452
|
+
/* c8 ignore next */
|
|
453
453
|
if (!callback) {
|
|
454
454
|
throw new Error("Internal Error");
|
|
455
455
|
}
|
|
456
456
|
async.forEach(
|
|
457
457
|
this.endpoints,
|
|
458
458
|
(ep: OPCUAServerEndPoint, _inner_callback) => {
|
|
459
|
-
/*
|
|
459
|
+
/* c8 ignore next */
|
|
460
460
|
if (doDebug) {
|
|
461
461
|
debugLog("Suspending ", ep.endpointDescriptions()[0].endpointUrl);
|
|
462
462
|
}
|
|
463
463
|
|
|
464
464
|
ep.suspendConnection((err?: Error | null) => {
|
|
465
|
-
/*
|
|
465
|
+
/* c8 ignore next */
|
|
466
466
|
if (doDebug) {
|
|
467
467
|
debugLog("Suspended ", ep.endpointDescriptions()[0].endpointUrl);
|
|
468
468
|
}
|
package/source/monitored_item.ts
CHANGED
|
@@ -184,13 +184,13 @@ function timestampHasChanged(t1: DateTime, t2: DateTime): boolean {
|
|
|
184
184
|
}
|
|
185
185
|
|
|
186
186
|
function apply_dataChange_filter(this: MonitoredItem, newDataValue: DataValue, oldDataValue: DataValue): boolean {
|
|
187
|
-
/*
|
|
187
|
+
/* c8 ignore next */
|
|
188
188
|
if (!this.filter || !(this.filter instanceof DataChangeFilter)) {
|
|
189
189
|
throw new Error("Internal Error");
|
|
190
190
|
}
|
|
191
191
|
|
|
192
192
|
const trigger = this.filter.trigger;
|
|
193
|
-
//
|
|
193
|
+
// c8 ignore next
|
|
194
194
|
if (doDebug) {
|
|
195
195
|
try {
|
|
196
196
|
debugLog("filter pass ?", DataChangeTrigger[trigger], this.oldDataValue?.toString(), newDataValue.toString());
|
|
@@ -274,7 +274,7 @@ function apply_filter(this: MonitoredItem, newDataValue: DataValue) {
|
|
|
274
274
|
return true; // keep
|
|
275
275
|
}
|
|
276
276
|
|
|
277
|
-
//
|
|
277
|
+
// c8 ignore next
|
|
278
278
|
doDebug && safeGuardVerify(this);
|
|
279
279
|
|
|
280
280
|
if (this.filter instanceof DataChangeFilter) {
|
|
@@ -451,7 +451,7 @@ export class MonitoredItem extends EventEmitter implements MonitoredItemBase {
|
|
|
451
451
|
this._node = null;
|
|
452
452
|
this._semantic_version = 0;
|
|
453
453
|
|
|
454
|
-
//
|
|
454
|
+
// c8 ignore next
|
|
455
455
|
if (doDebug) {
|
|
456
456
|
debugLog("Monitoring ", options.itemToMonitor.toString());
|
|
457
457
|
}
|
|
@@ -515,7 +515,7 @@ export class MonitoredItem extends EventEmitter implements MonitoredItemBase {
|
|
|
515
515
|
}
|
|
516
516
|
|
|
517
517
|
public dispose(): void {
|
|
518
|
-
//
|
|
518
|
+
// c8 ignore next
|
|
519
519
|
if (doDebug) {
|
|
520
520
|
debugLog("DISPOSING MONITORED ITEM", this._node!.nodeId.toString());
|
|
521
521
|
}
|
|
@@ -591,7 +591,7 @@ export class MonitoredItem extends EventEmitter implements MonitoredItemBase {
|
|
|
591
591
|
public recordValue(dataValue: DataValue, skipChangeTest?: boolean, indexRange?: NumericRange): boolean {
|
|
592
592
|
if (!this.itemToMonitor) {
|
|
593
593
|
// we must have a valid itemToMonitor(have this monitoredItem been disposed already ?)
|
|
594
|
-
//
|
|
594
|
+
// c8 ignore next
|
|
595
595
|
doDebug && debugLog("recordValue => Rejected", this.node?.browseName.toString(), " because no itemToMonitor");
|
|
596
596
|
return false;
|
|
597
597
|
}
|
|
@@ -607,7 +607,7 @@ export class MonitoredItem extends EventEmitter implements MonitoredItemBase {
|
|
|
607
607
|
// we just ignore changes that do not fall within our range
|
|
608
608
|
// ( unless semantic bit has changed )
|
|
609
609
|
if (!NumericRange.overlap(indexRange as NumericalRange0, this.itemToMonitor.indexRange)) {
|
|
610
|
-
//
|
|
610
|
+
// c8 ignore next
|
|
611
611
|
doDebug && debugLog("recordValue => Rejected", this.node?.browseName.toString(), " because no range not overlap");
|
|
612
612
|
return false; // no overlap !
|
|
613
613
|
}
|
|
@@ -616,7 +616,7 @@ export class MonitoredItem extends EventEmitter implements MonitoredItemBase {
|
|
|
616
616
|
// extract the range that we are interested with
|
|
617
617
|
dataValue = extractRange(dataValue, this.itemToMonitor.indexRange);
|
|
618
618
|
|
|
619
|
-
//
|
|
619
|
+
// c8 ignore next
|
|
620
620
|
if (doDebug2) {
|
|
621
621
|
debugLog(
|
|
622
622
|
"MonitoredItem#recordValue",
|
|
@@ -637,7 +637,7 @@ export class MonitoredItem extends EventEmitter implements MonitoredItemBase {
|
|
|
637
637
|
setSemanticChangeBit(dataValue);
|
|
638
638
|
this._semantic_version = (this.node as UAVariable).semantic_version;
|
|
639
639
|
this._enqueue_value(dataValue);
|
|
640
|
-
//
|
|
640
|
+
// c8 ignore next
|
|
641
641
|
doDebug && debugLog("recordValue => OK ", this.node?.browseName.toString(), " because hasSemanticChanged");
|
|
642
642
|
return true;
|
|
643
643
|
}
|
|
@@ -647,7 +647,7 @@ export class MonitoredItem extends EventEmitter implements MonitoredItemBase {
|
|
|
647
647
|
if (!skipChangeTest) {
|
|
648
648
|
const hasChanged = !sameDataValue(dataValue, this.oldDataValue!);
|
|
649
649
|
if (!hasChanged) {
|
|
650
|
-
//
|
|
650
|
+
// c8 ignore next
|
|
651
651
|
doDebug2 &&
|
|
652
652
|
debugLog(
|
|
653
653
|
"recordValue => Rejected ",
|
|
@@ -659,7 +659,7 @@ export class MonitoredItem extends EventEmitter implements MonitoredItemBase {
|
|
|
659
659
|
}
|
|
660
660
|
|
|
661
661
|
if (!skipChangeTest && !apply_filter.call(this, dataValue)) {
|
|
662
|
-
//
|
|
662
|
+
// c8 ignore next
|
|
663
663
|
if (doDebug) {
|
|
664
664
|
debugLog("recordValue => Rejected ", this.node?.browseName.toString(), " because apply_filter");
|
|
665
665
|
debugLog("current Value =>", this.oldDataValue?.toString());
|
|
@@ -673,7 +673,7 @@ export class MonitoredItem extends EventEmitter implements MonitoredItemBase {
|
|
|
673
673
|
// when an indexRange is provided , make sure that no record happens unless
|
|
674
674
|
// extracted variant in the selected range has really changed.
|
|
675
675
|
|
|
676
|
-
//
|
|
676
|
+
// c8 ignore next
|
|
677
677
|
if (doDebug) {
|
|
678
678
|
debugLog("Current : ", this.oldDataValue?.toString());
|
|
679
679
|
debugLog("New : ", dataValue.toString());
|
|
@@ -681,7 +681,7 @@ export class MonitoredItem extends EventEmitter implements MonitoredItemBase {
|
|
|
681
681
|
}
|
|
682
682
|
|
|
683
683
|
if (this.oldDataValue !== badDataUnavailable && sameVariant(dataValue.value, this.oldDataValue.value)) {
|
|
684
|
-
//
|
|
684
|
+
// c8 ignore next
|
|
685
685
|
doDebug &&
|
|
686
686
|
debugLog("recordValue => Rejected ", this.node?.browseName.toString(), " because useIndexRange && sameVariant");
|
|
687
687
|
return false;
|
|
@@ -693,7 +693,7 @@ export class MonitoredItem extends EventEmitter implements MonitoredItemBase {
|
|
|
693
693
|
|
|
694
694
|
// store last value
|
|
695
695
|
this._enqueue_value(dataValue);
|
|
696
|
-
//
|
|
696
|
+
// c8 ignore next
|
|
697
697
|
doDebug && debugLog("recordValue => OK ", this.node?.browseName.toString());
|
|
698
698
|
return true;
|
|
699
699
|
}
|
|
@@ -748,7 +748,7 @@ export class MonitoredItem extends EventEmitter implements MonitoredItemBase {
|
|
|
748
748
|
}
|
|
749
749
|
assert(linkedMonitoredItem.monitoringMode === MonitoringMode.Sampling);
|
|
750
750
|
|
|
751
|
-
//
|
|
751
|
+
// c8 ignore next
|
|
752
752
|
if (doDebug) {
|
|
753
753
|
debugLog("triggerLinkedItems => ", this.node?.nodeId.toString(), linkedMonitoredItem.node?.nodeId.toString());
|
|
754
754
|
}
|
|
@@ -852,12 +852,12 @@ export class MonitoredItem extends EventEmitter implements MonitoredItemBase {
|
|
|
852
852
|
// the last Publish response was sent.
|
|
853
853
|
// This parameter only applies to MonitoredItems used for monitoring Attribute changes.
|
|
854
854
|
|
|
855
|
-
//
|
|
855
|
+
// c8 ignore next
|
|
856
856
|
if (!this.node) return;
|
|
857
857
|
|
|
858
858
|
const sessionContext = this.getSessionContext() || SessionContext.defaultContext;
|
|
859
859
|
|
|
860
|
-
//
|
|
860
|
+
// c8 ignore next
|
|
861
861
|
if (!sessionContext) return;
|
|
862
862
|
|
|
863
863
|
// no need to resend if a value is already in the queue
|
|
@@ -894,7 +894,7 @@ export class MonitoredItem extends EventEmitter implements MonitoredItemBase {
|
|
|
894
894
|
warningLog("MonitoredItem#_on_sampling_timer : ", this.node?.nodeId.toString(), "cannot find session");
|
|
895
895
|
return;
|
|
896
896
|
}
|
|
897
|
-
//
|
|
897
|
+
// c8 ignore next
|
|
898
898
|
if (doDebug2) {
|
|
899
899
|
debugLog(
|
|
900
900
|
"MonitoredItem#_on_sampling_timer",
|
|
@@ -919,7 +919,7 @@ export class MonitoredItem extends EventEmitter implements MonitoredItemBase {
|
|
|
919
919
|
}
|
|
920
920
|
assert(!this._is_sampling, "sampling func shall not be re-entrant !! fix it");
|
|
921
921
|
|
|
922
|
-
//
|
|
922
|
+
// c8 ignore next
|
|
923
923
|
if (!this.samplingFunc) {
|
|
924
924
|
throw new Error("internal error : missing samplingFunc");
|
|
925
925
|
}
|
|
@@ -932,7 +932,7 @@ export class MonitoredItem extends EventEmitter implements MonitoredItemBase {
|
|
|
932
932
|
// was taking place ... just ignore this
|
|
933
933
|
return;
|
|
934
934
|
}
|
|
935
|
-
//
|
|
935
|
+
// c8 ignore next
|
|
936
936
|
if (err) {
|
|
937
937
|
errorLog(" SAMPLING ERROR =>", err);
|
|
938
938
|
} else {
|
|
@@ -944,14 +944,14 @@ export class MonitoredItem extends EventEmitter implements MonitoredItemBase {
|
|
|
944
944
|
this._is_sampling = false;
|
|
945
945
|
});
|
|
946
946
|
} else {
|
|
947
|
-
/*
|
|
947
|
+
/* c8 ignore next */
|
|
948
948
|
debugLog("_on_sampling_timer call but MonitoredItem has been terminated !!! ");
|
|
949
949
|
}
|
|
950
950
|
}
|
|
951
951
|
|
|
952
952
|
private _stop_sampling() {
|
|
953
953
|
// debugLog("MonitoredItem#_stop_sampling");
|
|
954
|
-
/*
|
|
954
|
+
/* c8 ignore next */
|
|
955
955
|
if (!this.node) {
|
|
956
956
|
throw new Error("Internal Error");
|
|
957
957
|
}
|
|
@@ -1015,7 +1015,7 @@ export class MonitoredItem extends EventEmitter implements MonitoredItemBase {
|
|
|
1015
1015
|
// ignore the Event content filtering associated with a Subscription and will always be
|
|
1016
1016
|
// delivered to the Client.
|
|
1017
1017
|
|
|
1018
|
-
//
|
|
1018
|
+
// c8 ignore next
|
|
1019
1019
|
if (!this.filter || !(this.filter instanceof EventFilter)) {
|
|
1020
1020
|
throw new Error("Internal Error : a EventFilter is requested");
|
|
1021
1021
|
}
|
|
@@ -1030,7 +1030,7 @@ export class MonitoredItem extends EventEmitter implements MonitoredItemBase {
|
|
|
1030
1030
|
|
|
1031
1031
|
const eventFields: Variant[] = extractEventFields(SessionContext.defaultContext, selectClauses, eventData);
|
|
1032
1032
|
|
|
1033
|
-
//
|
|
1033
|
+
// c8 ignore next
|
|
1034
1034
|
if (doDebug) {
|
|
1035
1035
|
debugLog(" RECEIVED INTERNAL EVENT THAT WE ARE MONITORING");
|
|
1036
1036
|
debugLog(this.filter ? this.filter.toString() : "no filter");
|
|
@@ -1053,7 +1053,7 @@ export class MonitoredItem extends EventEmitter implements MonitoredItemBase {
|
|
|
1053
1053
|
}
|
|
1054
1054
|
|
|
1055
1055
|
private _start_sampling(recordInitialValue: boolean): void {
|
|
1056
|
-
//
|
|
1056
|
+
// c8 ignore next
|
|
1057
1057
|
if (!this.node) {
|
|
1058
1058
|
return; // we just want to ignore here ...
|
|
1059
1059
|
}
|
|
@@ -1077,7 +1077,7 @@ export class MonitoredItem extends EventEmitter implements MonitoredItemBase {
|
|
|
1077
1077
|
} else {
|
|
1078
1078
|
const o = this.oldDataValue;
|
|
1079
1079
|
this.oldDataValue = badDataUnavailable;
|
|
1080
|
-
//
|
|
1080
|
+
// c8 ignore next
|
|
1081
1081
|
if (doDebug) {
|
|
1082
1082
|
safeGuardRegister(this);
|
|
1083
1083
|
}
|
|
@@ -1085,13 +1085,13 @@ export class MonitoredItem extends EventEmitter implements MonitoredItemBase {
|
|
|
1085
1085
|
}
|
|
1086
1086
|
}
|
|
1087
1087
|
private __start_sampling(recordInitialValue?: boolean): void {
|
|
1088
|
-
//
|
|
1088
|
+
// c8 ignore next
|
|
1089
1089
|
if (!this.node) {
|
|
1090
1090
|
return; // we just want to ignore here ...
|
|
1091
1091
|
}
|
|
1092
1092
|
|
|
1093
1093
|
const sessionContext = this.getSessionContext() || SessionContext.defaultContext;
|
|
1094
|
-
//
|
|
1094
|
+
// c8 ignore next
|
|
1095
1095
|
if (!sessionContext) {
|
|
1096
1096
|
return;
|
|
1097
1097
|
}
|
|
@@ -1099,7 +1099,7 @@ export class MonitoredItem extends EventEmitter implements MonitoredItemBase {
|
|
|
1099
1099
|
this._stop_sampling();
|
|
1100
1100
|
|
|
1101
1101
|
if (this.itemToMonitor.attributeId === AttributeIds.EventNotifier) {
|
|
1102
|
-
//
|
|
1102
|
+
// c8 ignore next
|
|
1103
1103
|
if (doDebug) {
|
|
1104
1104
|
debugLog("xxxxxx monitoring EventNotifier on", this.node.nodeId.toString(), this.node.browseName.toString());
|
|
1105
1105
|
}
|
|
@@ -1309,13 +1309,13 @@ export class MonitoredItem extends EventEmitter implements MonitoredItemBase {
|
|
|
1309
1309
|
);
|
|
1310
1310
|
}
|
|
1311
1311
|
|
|
1312
|
-
//
|
|
1312
|
+
// c8 ignore next
|
|
1313
1313
|
if (doDebug) {
|
|
1314
1314
|
debugLog("MonitoredItem#_enqueue_value", this.node!.nodeId.toString());
|
|
1315
1315
|
safeGuardVerify(this);
|
|
1316
1316
|
}
|
|
1317
1317
|
this.oldDataValue = dataValue.clone();
|
|
1318
|
-
//
|
|
1318
|
+
// c8 ignore next
|
|
1319
1319
|
if (doDebug) {
|
|
1320
1320
|
safeGuardRegister(this);
|
|
1321
1321
|
}
|
|
@@ -1332,7 +1332,7 @@ export class MonitoredItem extends EventEmitter implements MonitoredItemBase {
|
|
|
1332
1332
|
}
|
|
1333
1333
|
|
|
1334
1334
|
private _enqueue_event(eventFields: any[]) {
|
|
1335
|
-
//
|
|
1335
|
+
// c8 ignore next
|
|
1336
1336
|
if (doDebug) {
|
|
1337
1337
|
debugLog(" MonitoredItem#_enqueue_event");
|
|
1338
1338
|
}
|