node-opcua-transport 2.75.0 → 2.76.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/source/AcknowledgeMessage.d.ts +27 -27
- package/dist/source/AcknowledgeMessage.js +78 -78
- package/dist/source/HelloMessage.d.ts +27 -27
- package/dist/source/HelloMessage.js +94 -94
- package/dist/source/TCPErrorMessage.d.ts +18 -18
- package/dist/source/TCPErrorMessage.js +46 -46
- package/dist/source/client_tcp_transport.d.ts +86 -86
- package/dist/source/client_tcp_transport.js +331 -331
- package/dist/source/index.d.ts +13 -13
- package/dist/source/index.js +29 -29
- package/dist/source/message_builder_base.d.ts +112 -112
- package/dist/source/message_builder_base.js +244 -244
- package/dist/source/server_tcp_transport.d.ts +44 -44
- package/dist/source/server_tcp_transport.js +228 -228
- package/dist/source/status_codes.d.ts +100 -100
- package/dist/source/status_codes.js +110 -110
- package/dist/source/tcp_transport.d.ts +136 -136
- package/dist/source/tcp_transport.js +376 -376
- package/dist/source/tools.d.ts +14 -14
- package/dist/source/tools.js +103 -103
- package/dist/source/utils.d.ts +3 -3
- package/dist/source/utils.js +9 -9
- package/dist/test-fixtures/fixture_full_tcp_packets.d.ts +21 -21
- package/dist/test-fixtures/fixture_full_tcp_packets.js +41 -41
- package/dist/test-fixtures/index.d.ts +1 -1
- package/dist/test-fixtures/index.js +17 -17
- package/dist/test_helpers/direct_transport.d.ts +18 -18
- package/dist/test_helpers/direct_transport.js +62 -62
- package/dist/test_helpers/fake_server.d.ts +19 -19
- package/dist/test_helpers/fake_server.js +54 -54
- package/dist/test_helpers/half_com_channel.d.ts +17 -17
- package/dist/test_helpers/half_com_channel.js +31 -31
- package/dist/test_helpers/index.d.ts +4 -4
- package/dist/test_helpers/index.js +20 -20
- package/dist/test_helpers/socket_transport.d.ts +10 -10
- package/dist/test_helpers/socket_transport.js +30 -30
- package/package.json +13 -16
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @module node-opcua-transport
|
|
3
|
-
*/
|
|
4
|
-
import { UInt32 } from "node-opcua-basic-types";
|
|
5
|
-
import { BinaryStream, OutputBinaryStream } from "node-opcua-binary-stream";
|
|
6
|
-
import { BaseUAObject, StructuredTypeSchema } from "node-opcua-factory";
|
|
7
|
-
interface AcknowledgeMessageOptions {
|
|
8
|
-
protocolVersion?: UInt32;
|
|
9
|
-
receiveBufferSize?: UInt32;
|
|
10
|
-
sendBufferSize?: UInt32;
|
|
11
|
-
maxMessageSize?: UInt32;
|
|
12
|
-
maxChunkCount?: UInt32;
|
|
13
|
-
}
|
|
14
|
-
export declare class AcknowledgeMessage extends BaseUAObject {
|
|
15
|
-
static possibleFields: string[];
|
|
16
|
-
static schema: StructuredTypeSchema;
|
|
17
|
-
protocolVersion: UInt32;
|
|
18
|
-
receiveBufferSize: UInt32;
|
|
19
|
-
sendBufferSize: UInt32;
|
|
20
|
-
maxMessageSize: UInt32;
|
|
21
|
-
maxChunkCount: UInt32;
|
|
22
|
-
constructor(options?: AcknowledgeMessageOptions);
|
|
23
|
-
encode(stream: OutputBinaryStream): void;
|
|
24
|
-
decode(stream: BinaryStream): void;
|
|
25
|
-
toString(): string;
|
|
26
|
-
}
|
|
27
|
-
export {};
|
|
1
|
+
/**
|
|
2
|
+
* @module node-opcua-transport
|
|
3
|
+
*/
|
|
4
|
+
import { UInt32 } from "node-opcua-basic-types";
|
|
5
|
+
import { BinaryStream, OutputBinaryStream } from "node-opcua-binary-stream";
|
|
6
|
+
import { BaseUAObject, StructuredTypeSchema } from "node-opcua-factory";
|
|
7
|
+
interface AcknowledgeMessageOptions {
|
|
8
|
+
protocolVersion?: UInt32;
|
|
9
|
+
receiveBufferSize?: UInt32;
|
|
10
|
+
sendBufferSize?: UInt32;
|
|
11
|
+
maxMessageSize?: UInt32;
|
|
12
|
+
maxChunkCount?: UInt32;
|
|
13
|
+
}
|
|
14
|
+
export declare class AcknowledgeMessage extends BaseUAObject {
|
|
15
|
+
static possibleFields: string[];
|
|
16
|
+
static schema: StructuredTypeSchema;
|
|
17
|
+
protocolVersion: UInt32;
|
|
18
|
+
receiveBufferSize: UInt32;
|
|
19
|
+
sendBufferSize: UInt32;
|
|
20
|
+
maxMessageSize: UInt32;
|
|
21
|
+
maxChunkCount: UInt32;
|
|
22
|
+
constructor(options?: AcknowledgeMessageOptions);
|
|
23
|
+
encode(stream: OutputBinaryStream): void;
|
|
24
|
+
decode(stream: BinaryStream): void;
|
|
25
|
+
toString(): string;
|
|
26
|
+
}
|
|
27
|
+
export {};
|
|
@@ -1,79 +1,79 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.AcknowledgeMessage = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* @module node-opcua-transport
|
|
6
|
-
*/
|
|
7
|
-
const node_opcua_basic_types_1 = require("node-opcua-basic-types");
|
|
8
|
-
const node_opcua_factory_1 = require("node-opcua-factory");
|
|
9
|
-
const schemaAcknowledgeMessage = (0, node_opcua_factory_1.buildStructuredType)({
|
|
10
|
-
name: "AcknowledgeMessage",
|
|
11
|
-
baseType: "BaseObjectType",
|
|
12
|
-
fields: [
|
|
13
|
-
{
|
|
14
|
-
name: "protocolVersion",
|
|
15
|
-
fieldType: "UInt32",
|
|
16
|
-
documentation: "The latest version of the OPC UA TCP protocol supported by the Server."
|
|
17
|
-
},
|
|
18
|
-
{ name: "receiveBufferSize", fieldType: "UInt32" },
|
|
19
|
-
{ name: "sendBufferSize", fieldType: "UInt32" },
|
|
20
|
-
{ name: "maxMessageSize", fieldType: "UInt32", documentation: "The maximum size for any request message." },
|
|
21
|
-
{
|
|
22
|
-
name: "maxChunkCount",
|
|
23
|
-
fieldType: "UInt32",
|
|
24
|
-
documentation: "The maximum number of chunks in any request message."
|
|
25
|
-
}
|
|
26
|
-
]
|
|
27
|
-
});
|
|
28
|
-
class AcknowledgeMessage extends node_opcua_factory_1.BaseUAObject {
|
|
29
|
-
constructor(options) {
|
|
30
|
-
options = options || {};
|
|
31
|
-
super();
|
|
32
|
-
const schema = schemaAcknowledgeMessage;
|
|
33
|
-
/* istanbul ignore next */
|
|
34
|
-
if (node_opcua_factory_1.parameters.debugSchemaHelper) {
|
|
35
|
-
(0, node_opcua_factory_1.check_options_correctness_against_schema)(this, schema, options);
|
|
36
|
-
}
|
|
37
|
-
this.protocolVersion = (0, node_opcua_factory_1.initialize_field)(schema.fields[0], options.protocolVersion);
|
|
38
|
-
this.receiveBufferSize = (0, node_opcua_factory_1.initialize_field)(schema.fields[1], options.receiveBufferSize);
|
|
39
|
-
this.sendBufferSize = (0, node_opcua_factory_1.initialize_field)(schema.fields[2], options.sendBufferSize);
|
|
40
|
-
this.maxMessageSize = (0, node_opcua_factory_1.initialize_field)(schema.fields[3], options.maxMessageSize);
|
|
41
|
-
this.maxChunkCount = (0, node_opcua_factory_1.initialize_field)(schema.fields[4], options.maxChunkCount);
|
|
42
|
-
}
|
|
43
|
-
encode(stream) {
|
|
44
|
-
super.encode(stream);
|
|
45
|
-
(0, node_opcua_basic_types_1.encodeUInt32)(this.protocolVersion, stream);
|
|
46
|
-
(0, node_opcua_basic_types_1.encodeUInt32)(this.receiveBufferSize, stream);
|
|
47
|
-
(0, node_opcua_basic_types_1.encodeUInt32)(this.sendBufferSize, stream);
|
|
48
|
-
(0, node_opcua_basic_types_1.encodeUInt32)(this.maxMessageSize, stream);
|
|
49
|
-
(0, node_opcua_basic_types_1.encodeUInt32)(this.maxChunkCount, stream);
|
|
50
|
-
}
|
|
51
|
-
decode(stream) {
|
|
52
|
-
// call base class implementation first
|
|
53
|
-
super.decode(stream);
|
|
54
|
-
this.protocolVersion = (0, node_opcua_basic_types_1.decodeUInt32)(stream);
|
|
55
|
-
this.receiveBufferSize = (0, node_opcua_basic_types_1.decodeUInt32)(stream);
|
|
56
|
-
this.sendBufferSize = (0, node_opcua_basic_types_1.decodeUInt32)(stream);
|
|
57
|
-
this.maxMessageSize = (0, node_opcua_basic_types_1.decodeUInt32)(stream);
|
|
58
|
-
this.maxChunkCount = (0, node_opcua_basic_types_1.decodeUInt32)(stream);
|
|
59
|
-
}
|
|
60
|
-
toString() {
|
|
61
|
-
let str = "";
|
|
62
|
-
str += "protocolVersion = " + this.protocolVersion + "\n";
|
|
63
|
-
str += "receiveBufferSize = " + this.receiveBufferSize + "\n";
|
|
64
|
-
str += "sendBufferSize = " + this.sendBufferSize + "\n";
|
|
65
|
-
str += "maxMessageSize = " + this.maxMessageSize + "\n";
|
|
66
|
-
str += "maxChunkCount = " + this.maxChunkCount + "\n";
|
|
67
|
-
return str;
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
exports.AcknowledgeMessage = AcknowledgeMessage;
|
|
71
|
-
AcknowledgeMessage.possibleFields = [
|
|
72
|
-
"protocolVersion",
|
|
73
|
-
"receiveBufferSize",
|
|
74
|
-
"sendBufferSize",
|
|
75
|
-
"maxMessageSize",
|
|
76
|
-
"maxChunkCount"
|
|
77
|
-
];
|
|
78
|
-
AcknowledgeMessage.schema = schemaAcknowledgeMessage;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AcknowledgeMessage = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* @module node-opcua-transport
|
|
6
|
+
*/
|
|
7
|
+
const node_opcua_basic_types_1 = require("node-opcua-basic-types");
|
|
8
|
+
const node_opcua_factory_1 = require("node-opcua-factory");
|
|
9
|
+
const schemaAcknowledgeMessage = (0, node_opcua_factory_1.buildStructuredType)({
|
|
10
|
+
name: "AcknowledgeMessage",
|
|
11
|
+
baseType: "BaseObjectType",
|
|
12
|
+
fields: [
|
|
13
|
+
{
|
|
14
|
+
name: "protocolVersion",
|
|
15
|
+
fieldType: "UInt32",
|
|
16
|
+
documentation: "The latest version of the OPC UA TCP protocol supported by the Server."
|
|
17
|
+
},
|
|
18
|
+
{ name: "receiveBufferSize", fieldType: "UInt32" },
|
|
19
|
+
{ name: "sendBufferSize", fieldType: "UInt32" },
|
|
20
|
+
{ name: "maxMessageSize", fieldType: "UInt32", documentation: "The maximum size for any request message." },
|
|
21
|
+
{
|
|
22
|
+
name: "maxChunkCount",
|
|
23
|
+
fieldType: "UInt32",
|
|
24
|
+
documentation: "The maximum number of chunks in any request message."
|
|
25
|
+
}
|
|
26
|
+
]
|
|
27
|
+
});
|
|
28
|
+
class AcknowledgeMessage extends node_opcua_factory_1.BaseUAObject {
|
|
29
|
+
constructor(options) {
|
|
30
|
+
options = options || {};
|
|
31
|
+
super();
|
|
32
|
+
const schema = schemaAcknowledgeMessage;
|
|
33
|
+
/* istanbul ignore next */
|
|
34
|
+
if (node_opcua_factory_1.parameters.debugSchemaHelper) {
|
|
35
|
+
(0, node_opcua_factory_1.check_options_correctness_against_schema)(this, schema, options);
|
|
36
|
+
}
|
|
37
|
+
this.protocolVersion = (0, node_opcua_factory_1.initialize_field)(schema.fields[0], options.protocolVersion);
|
|
38
|
+
this.receiveBufferSize = (0, node_opcua_factory_1.initialize_field)(schema.fields[1], options.receiveBufferSize);
|
|
39
|
+
this.sendBufferSize = (0, node_opcua_factory_1.initialize_field)(schema.fields[2], options.sendBufferSize);
|
|
40
|
+
this.maxMessageSize = (0, node_opcua_factory_1.initialize_field)(schema.fields[3], options.maxMessageSize);
|
|
41
|
+
this.maxChunkCount = (0, node_opcua_factory_1.initialize_field)(schema.fields[4], options.maxChunkCount);
|
|
42
|
+
}
|
|
43
|
+
encode(stream) {
|
|
44
|
+
super.encode(stream);
|
|
45
|
+
(0, node_opcua_basic_types_1.encodeUInt32)(this.protocolVersion, stream);
|
|
46
|
+
(0, node_opcua_basic_types_1.encodeUInt32)(this.receiveBufferSize, stream);
|
|
47
|
+
(0, node_opcua_basic_types_1.encodeUInt32)(this.sendBufferSize, stream);
|
|
48
|
+
(0, node_opcua_basic_types_1.encodeUInt32)(this.maxMessageSize, stream);
|
|
49
|
+
(0, node_opcua_basic_types_1.encodeUInt32)(this.maxChunkCount, stream);
|
|
50
|
+
}
|
|
51
|
+
decode(stream) {
|
|
52
|
+
// call base class implementation first
|
|
53
|
+
super.decode(stream);
|
|
54
|
+
this.protocolVersion = (0, node_opcua_basic_types_1.decodeUInt32)(stream);
|
|
55
|
+
this.receiveBufferSize = (0, node_opcua_basic_types_1.decodeUInt32)(stream);
|
|
56
|
+
this.sendBufferSize = (0, node_opcua_basic_types_1.decodeUInt32)(stream);
|
|
57
|
+
this.maxMessageSize = (0, node_opcua_basic_types_1.decodeUInt32)(stream);
|
|
58
|
+
this.maxChunkCount = (0, node_opcua_basic_types_1.decodeUInt32)(stream);
|
|
59
|
+
}
|
|
60
|
+
toString() {
|
|
61
|
+
let str = "";
|
|
62
|
+
str += "protocolVersion = " + this.protocolVersion + "\n";
|
|
63
|
+
str += "receiveBufferSize = " + this.receiveBufferSize + "\n";
|
|
64
|
+
str += "sendBufferSize = " + this.sendBufferSize + "\n";
|
|
65
|
+
str += "maxMessageSize = " + this.maxMessageSize + "\n";
|
|
66
|
+
str += "maxChunkCount = " + this.maxChunkCount + "\n";
|
|
67
|
+
return str;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
exports.AcknowledgeMessage = AcknowledgeMessage;
|
|
71
|
+
AcknowledgeMessage.possibleFields = [
|
|
72
|
+
"protocolVersion",
|
|
73
|
+
"receiveBufferSize",
|
|
74
|
+
"sendBufferSize",
|
|
75
|
+
"maxMessageSize",
|
|
76
|
+
"maxChunkCount"
|
|
77
|
+
];
|
|
78
|
+
AcknowledgeMessage.schema = schemaAcknowledgeMessage;
|
|
79
79
|
//# sourceMappingURL=AcknowledgeMessage.js.map
|
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @module node-opcua-transport
|
|
3
|
-
*/
|
|
4
|
-
import { UAString, UInt32 } from "node-opcua-basic-types";
|
|
5
|
-
import { BinaryStream, OutputBinaryStream } from "node-opcua-binary-stream";
|
|
6
|
-
import { BaseUAObject } from "node-opcua-factory";
|
|
7
|
-
export interface HelloMessageOptions {
|
|
8
|
-
protocolVersion?: UInt32;
|
|
9
|
-
receiveBufferSize?: UInt32;
|
|
10
|
-
sendBufferSize?: UInt32;
|
|
11
|
-
maxMessageSize?: UInt32;
|
|
12
|
-
maxChunkCount?: UInt32;
|
|
13
|
-
endpointUrl?: UAString;
|
|
14
|
-
}
|
|
15
|
-
export declare class HelloMessage extends BaseUAObject {
|
|
16
|
-
static possibleFields: string[];
|
|
17
|
-
protocolVersion: UInt32;
|
|
18
|
-
receiveBufferSize: UInt32;
|
|
19
|
-
sendBufferSize: UInt32;
|
|
20
|
-
maxMessageSize: UInt32;
|
|
21
|
-
maxChunkCount: UInt32;
|
|
22
|
-
endpointUrl: UAString;
|
|
23
|
-
constructor(options?: HelloMessageOptions);
|
|
24
|
-
encode(stream: OutputBinaryStream): void;
|
|
25
|
-
decode(stream: BinaryStream): void;
|
|
26
|
-
toString(): string;
|
|
27
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* @module node-opcua-transport
|
|
3
|
+
*/
|
|
4
|
+
import { UAString, UInt32 } from "node-opcua-basic-types";
|
|
5
|
+
import { BinaryStream, OutputBinaryStream } from "node-opcua-binary-stream";
|
|
6
|
+
import { BaseUAObject } from "node-opcua-factory";
|
|
7
|
+
export interface HelloMessageOptions {
|
|
8
|
+
protocolVersion?: UInt32;
|
|
9
|
+
receiveBufferSize?: UInt32;
|
|
10
|
+
sendBufferSize?: UInt32;
|
|
11
|
+
maxMessageSize?: UInt32;
|
|
12
|
+
maxChunkCount?: UInt32;
|
|
13
|
+
endpointUrl?: UAString;
|
|
14
|
+
}
|
|
15
|
+
export declare class HelloMessage extends BaseUAObject {
|
|
16
|
+
static possibleFields: string[];
|
|
17
|
+
protocolVersion: UInt32;
|
|
18
|
+
receiveBufferSize: UInt32;
|
|
19
|
+
sendBufferSize: UInt32;
|
|
20
|
+
maxMessageSize: UInt32;
|
|
21
|
+
maxChunkCount: UInt32;
|
|
22
|
+
endpointUrl: UAString;
|
|
23
|
+
constructor(options?: HelloMessageOptions);
|
|
24
|
+
encode(stream: OutputBinaryStream): void;
|
|
25
|
+
decode(stream: BinaryStream): void;
|
|
26
|
+
toString(): string;
|
|
27
|
+
}
|
|
@@ -1,95 +1,95 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.HelloMessage = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* @module node-opcua-transport
|
|
6
|
-
*/
|
|
7
|
-
const node_opcua_basic_types_1 = require("node-opcua-basic-types");
|
|
8
|
-
const node_opcua_factory_1 = require("node-opcua-factory");
|
|
9
|
-
const schemaHelloMessage = (0, node_opcua_factory_1.buildStructuredType)({
|
|
10
|
-
name: "HelloMessage",
|
|
11
|
-
baseType: "BaseUAObject",
|
|
12
|
-
fields: [
|
|
13
|
-
{
|
|
14
|
-
name: "protocolVersion",
|
|
15
|
-
fieldType: "UInt32",
|
|
16
|
-
documentation: "The latest version of the OPC UA TCP protocol supported by the Client"
|
|
17
|
-
},
|
|
18
|
-
{
|
|
19
|
-
name: "receiveBufferSize",
|
|
20
|
-
fieldType: "UInt32",
|
|
21
|
-
documentation: "The largest message that the sender can receive."
|
|
22
|
-
},
|
|
23
|
-
{
|
|
24
|
-
name: "sendBufferSize",
|
|
25
|
-
fieldType: "UInt32",
|
|
26
|
-
documentation: "The largest message that the sender will send."
|
|
27
|
-
},
|
|
28
|
-
{ name: "maxMessageSize", fieldType: "UInt32", documentation: "The maximum size for any response message." },
|
|
29
|
-
{
|
|
30
|
-
name: "maxChunkCount",
|
|
31
|
-
fieldType: "UInt32",
|
|
32
|
-
documentation: "The maximum number of chunks in any response message"
|
|
33
|
-
},
|
|
34
|
-
{
|
|
35
|
-
name: "endpointUrl",
|
|
36
|
-
fieldType: "String",
|
|
37
|
-
documentation: "The URL of the Endpoint which the Client wished to connect to."
|
|
38
|
-
}
|
|
39
|
-
]
|
|
40
|
-
});
|
|
41
|
-
class HelloMessage extends node_opcua_factory_1.BaseUAObject {
|
|
42
|
-
constructor(options) {
|
|
43
|
-
options = options || {};
|
|
44
|
-
super();
|
|
45
|
-
const schema = schemaHelloMessage;
|
|
46
|
-
/* istanbul ignore next */
|
|
47
|
-
if (node_opcua_factory_1.parameters.debugSchemaHelper) {
|
|
48
|
-
(0, node_opcua_factory_1.check_options_correctness_against_schema)(this, schema, options);
|
|
49
|
-
}
|
|
50
|
-
this.protocolVersion = (0, node_opcua_factory_1.initialize_field)(schema.fields[0], options.protocolVersion);
|
|
51
|
-
this.receiveBufferSize = (0, node_opcua_factory_1.initialize_field)(schema.fields[1], options.receiveBufferSize);
|
|
52
|
-
this.sendBufferSize = (0, node_opcua_factory_1.initialize_field)(schema.fields[2], options.sendBufferSize);
|
|
53
|
-
this.maxMessageSize = (0, node_opcua_factory_1.initialize_field)(schema.fields[3], options.maxMessageSize);
|
|
54
|
-
this.maxChunkCount = (0, node_opcua_factory_1.initialize_field)(schema.fields[4], options.maxChunkCount);
|
|
55
|
-
this.endpointUrl = (0, node_opcua_factory_1.initialize_field)(schema.fields[5], options.endpointUrl);
|
|
56
|
-
}
|
|
57
|
-
encode(stream) {
|
|
58
|
-
super.encode(stream);
|
|
59
|
-
(0, node_opcua_basic_types_1.encodeUInt32)(this.protocolVersion, stream);
|
|
60
|
-
(0, node_opcua_basic_types_1.encodeUInt32)(this.receiveBufferSize, stream);
|
|
61
|
-
(0, node_opcua_basic_types_1.encodeUInt32)(this.sendBufferSize, stream);
|
|
62
|
-
(0, node_opcua_basic_types_1.encodeUInt32)(this.maxMessageSize, stream);
|
|
63
|
-
(0, node_opcua_basic_types_1.encodeUInt32)(this.maxChunkCount, stream);
|
|
64
|
-
(0, node_opcua_basic_types_1.encodeUAString)(this.endpointUrl, stream);
|
|
65
|
-
}
|
|
66
|
-
decode(stream) {
|
|
67
|
-
super.decode(stream);
|
|
68
|
-
this.protocolVersion = (0, node_opcua_basic_types_1.decodeUInt32)(stream);
|
|
69
|
-
this.receiveBufferSize = (0, node_opcua_basic_types_1.decodeUInt32)(stream);
|
|
70
|
-
this.sendBufferSize = (0, node_opcua_basic_types_1.decodeUInt32)(stream);
|
|
71
|
-
this.maxMessageSize = (0, node_opcua_basic_types_1.decodeUInt32)(stream);
|
|
72
|
-
this.maxChunkCount = (0, node_opcua_basic_types_1.decodeUInt32)(stream);
|
|
73
|
-
this.endpointUrl = (0, node_opcua_basic_types_1.decodeUAString)(stream);
|
|
74
|
-
}
|
|
75
|
-
toString() {
|
|
76
|
-
let str = "";
|
|
77
|
-
str += "protocolVersion = " + this.protocolVersion + "\n";
|
|
78
|
-
str += "receiveBufferSize = " + this.receiveBufferSize + "\n";
|
|
79
|
-
str += "sendBufferSize = " + this.sendBufferSize + "\n";
|
|
80
|
-
str += "maxMessageSize = " + this.maxMessageSize + "\n";
|
|
81
|
-
str += "maxChunkCount = " + this.maxChunkCount + "\n";
|
|
82
|
-
str += "endpointUrl = " + this.endpointUrl + "\n";
|
|
83
|
-
return str;
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
exports.HelloMessage = HelloMessage;
|
|
87
|
-
HelloMessage.possibleFields = [
|
|
88
|
-
"protocolVersion",
|
|
89
|
-
"receiveBufferSize",
|
|
90
|
-
"sendBufferSize",
|
|
91
|
-
"maxMessageSize",
|
|
92
|
-
"maxChunkCount",
|
|
93
|
-
"endpointUrl"
|
|
94
|
-
];
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.HelloMessage = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* @module node-opcua-transport
|
|
6
|
+
*/
|
|
7
|
+
const node_opcua_basic_types_1 = require("node-opcua-basic-types");
|
|
8
|
+
const node_opcua_factory_1 = require("node-opcua-factory");
|
|
9
|
+
const schemaHelloMessage = (0, node_opcua_factory_1.buildStructuredType)({
|
|
10
|
+
name: "HelloMessage",
|
|
11
|
+
baseType: "BaseUAObject",
|
|
12
|
+
fields: [
|
|
13
|
+
{
|
|
14
|
+
name: "protocolVersion",
|
|
15
|
+
fieldType: "UInt32",
|
|
16
|
+
documentation: "The latest version of the OPC UA TCP protocol supported by the Client"
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
name: "receiveBufferSize",
|
|
20
|
+
fieldType: "UInt32",
|
|
21
|
+
documentation: "The largest message that the sender can receive."
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
name: "sendBufferSize",
|
|
25
|
+
fieldType: "UInt32",
|
|
26
|
+
documentation: "The largest message that the sender will send."
|
|
27
|
+
},
|
|
28
|
+
{ name: "maxMessageSize", fieldType: "UInt32", documentation: "The maximum size for any response message." },
|
|
29
|
+
{
|
|
30
|
+
name: "maxChunkCount",
|
|
31
|
+
fieldType: "UInt32",
|
|
32
|
+
documentation: "The maximum number of chunks in any response message"
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
name: "endpointUrl",
|
|
36
|
+
fieldType: "String",
|
|
37
|
+
documentation: "The URL of the Endpoint which the Client wished to connect to."
|
|
38
|
+
}
|
|
39
|
+
]
|
|
40
|
+
});
|
|
41
|
+
class HelloMessage extends node_opcua_factory_1.BaseUAObject {
|
|
42
|
+
constructor(options) {
|
|
43
|
+
options = options || {};
|
|
44
|
+
super();
|
|
45
|
+
const schema = schemaHelloMessage;
|
|
46
|
+
/* istanbul ignore next */
|
|
47
|
+
if (node_opcua_factory_1.parameters.debugSchemaHelper) {
|
|
48
|
+
(0, node_opcua_factory_1.check_options_correctness_against_schema)(this, schema, options);
|
|
49
|
+
}
|
|
50
|
+
this.protocolVersion = (0, node_opcua_factory_1.initialize_field)(schema.fields[0], options.protocolVersion);
|
|
51
|
+
this.receiveBufferSize = (0, node_opcua_factory_1.initialize_field)(schema.fields[1], options.receiveBufferSize);
|
|
52
|
+
this.sendBufferSize = (0, node_opcua_factory_1.initialize_field)(schema.fields[2], options.sendBufferSize);
|
|
53
|
+
this.maxMessageSize = (0, node_opcua_factory_1.initialize_field)(schema.fields[3], options.maxMessageSize);
|
|
54
|
+
this.maxChunkCount = (0, node_opcua_factory_1.initialize_field)(schema.fields[4], options.maxChunkCount);
|
|
55
|
+
this.endpointUrl = (0, node_opcua_factory_1.initialize_field)(schema.fields[5], options.endpointUrl);
|
|
56
|
+
}
|
|
57
|
+
encode(stream) {
|
|
58
|
+
super.encode(stream);
|
|
59
|
+
(0, node_opcua_basic_types_1.encodeUInt32)(this.protocolVersion, stream);
|
|
60
|
+
(0, node_opcua_basic_types_1.encodeUInt32)(this.receiveBufferSize, stream);
|
|
61
|
+
(0, node_opcua_basic_types_1.encodeUInt32)(this.sendBufferSize, stream);
|
|
62
|
+
(0, node_opcua_basic_types_1.encodeUInt32)(this.maxMessageSize, stream);
|
|
63
|
+
(0, node_opcua_basic_types_1.encodeUInt32)(this.maxChunkCount, stream);
|
|
64
|
+
(0, node_opcua_basic_types_1.encodeUAString)(this.endpointUrl, stream);
|
|
65
|
+
}
|
|
66
|
+
decode(stream) {
|
|
67
|
+
super.decode(stream);
|
|
68
|
+
this.protocolVersion = (0, node_opcua_basic_types_1.decodeUInt32)(stream);
|
|
69
|
+
this.receiveBufferSize = (0, node_opcua_basic_types_1.decodeUInt32)(stream);
|
|
70
|
+
this.sendBufferSize = (0, node_opcua_basic_types_1.decodeUInt32)(stream);
|
|
71
|
+
this.maxMessageSize = (0, node_opcua_basic_types_1.decodeUInt32)(stream);
|
|
72
|
+
this.maxChunkCount = (0, node_opcua_basic_types_1.decodeUInt32)(stream);
|
|
73
|
+
this.endpointUrl = (0, node_opcua_basic_types_1.decodeUAString)(stream);
|
|
74
|
+
}
|
|
75
|
+
toString() {
|
|
76
|
+
let str = "";
|
|
77
|
+
str += "protocolVersion = " + this.protocolVersion + "\n";
|
|
78
|
+
str += "receiveBufferSize = " + this.receiveBufferSize + "\n";
|
|
79
|
+
str += "sendBufferSize = " + this.sendBufferSize + "\n";
|
|
80
|
+
str += "maxMessageSize = " + this.maxMessageSize + "\n";
|
|
81
|
+
str += "maxChunkCount = " + this.maxChunkCount + "\n";
|
|
82
|
+
str += "endpointUrl = " + this.endpointUrl + "\n";
|
|
83
|
+
return str;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
exports.HelloMessage = HelloMessage;
|
|
87
|
+
HelloMessage.possibleFields = [
|
|
88
|
+
"protocolVersion",
|
|
89
|
+
"receiveBufferSize",
|
|
90
|
+
"sendBufferSize",
|
|
91
|
+
"maxMessageSize",
|
|
92
|
+
"maxChunkCount",
|
|
93
|
+
"endpointUrl"
|
|
94
|
+
];
|
|
95
95
|
//# sourceMappingURL=HelloMessage.js.map
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @module node-opcua-transport
|
|
3
|
-
*/
|
|
4
|
-
import { UAString } from "node-opcua-basic-types";
|
|
5
|
-
import { BinaryStream, OutputBinaryStream } from "node-opcua-binary-stream";
|
|
6
|
-
import { BaseUAObject } from "node-opcua-factory";
|
|
7
|
-
import { StatusCode } from "node-opcua-status-code";
|
|
8
|
-
export declare class TCPErrorMessage extends BaseUAObject {
|
|
9
|
-
static possibleFields: string[];
|
|
10
|
-
statusCode: StatusCode;
|
|
11
|
-
reason: UAString;
|
|
12
|
-
constructor(options?: {
|
|
13
|
-
statusCode?: StatusCode;
|
|
14
|
-
reason?: string;
|
|
15
|
-
});
|
|
16
|
-
encode(stream: OutputBinaryStream): void;
|
|
17
|
-
decode(stream: BinaryStream): void;
|
|
18
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* @module node-opcua-transport
|
|
3
|
+
*/
|
|
4
|
+
import { UAString } from "node-opcua-basic-types";
|
|
5
|
+
import { BinaryStream, OutputBinaryStream } from "node-opcua-binary-stream";
|
|
6
|
+
import { BaseUAObject } from "node-opcua-factory";
|
|
7
|
+
import { StatusCode } from "node-opcua-status-code";
|
|
8
|
+
export declare class TCPErrorMessage extends BaseUAObject {
|
|
9
|
+
static possibleFields: string[];
|
|
10
|
+
statusCode: StatusCode;
|
|
11
|
+
reason: UAString;
|
|
12
|
+
constructor(options?: {
|
|
13
|
+
statusCode?: StatusCode;
|
|
14
|
+
reason?: string;
|
|
15
|
+
});
|
|
16
|
+
encode(stream: OutputBinaryStream): void;
|
|
17
|
+
decode(stream: BinaryStream): void;
|
|
18
|
+
}
|
|
@@ -1,47 +1,47 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.TCPErrorMessage = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* @module node-opcua-transport
|
|
6
|
-
*/
|
|
7
|
-
const node_opcua_basic_types_1 = require("node-opcua-basic-types");
|
|
8
|
-
const node_opcua_factory_1 = require("node-opcua-factory");
|
|
9
|
-
const node_opcua_status_code_1 = require("node-opcua-status-code");
|
|
10
|
-
// TCP Error Message OPC Unified Architecture, Part 6 page 46
|
|
11
|
-
// the server always close the connection after sending the TCPError message
|
|
12
|
-
const schemaTCPErrorMessage = (0, node_opcua_factory_1.buildStructuredType)({
|
|
13
|
-
name: "TCPErrorMessage",
|
|
14
|
-
baseType: "BaseUAObject",
|
|
15
|
-
fields: [
|
|
16
|
-
{ name: "statusCode", fieldType: "StatusCode" },
|
|
17
|
-
{ name: "reason", fieldType: "String" } // A more verbose description of the error.
|
|
18
|
-
]
|
|
19
|
-
});
|
|
20
|
-
class TCPErrorMessage extends node_opcua_factory_1.BaseUAObject {
|
|
21
|
-
constructor(options) {
|
|
22
|
-
options = options || {};
|
|
23
|
-
const schema = schemaTCPErrorMessage;
|
|
24
|
-
super();
|
|
25
|
-
/* istanbul ignore next */
|
|
26
|
-
if (node_opcua_factory_1.parameters.debugSchemaHelper) {
|
|
27
|
-
(0, node_opcua_factory_1.check_options_correctness_against_schema)(this, schema, options);
|
|
28
|
-
}
|
|
29
|
-
this.statusCode = (0, node_opcua_factory_1.initialize_field)(schema.fields[0], options.statusCode);
|
|
30
|
-
this.reason = (0, node_opcua_factory_1.initialize_field)(schema.fields[1], options.reason);
|
|
31
|
-
}
|
|
32
|
-
encode(stream) {
|
|
33
|
-
// call base class implementation first
|
|
34
|
-
super.encode(stream);
|
|
35
|
-
(0, node_opcua_status_code_1.encodeStatusCode)(this.statusCode, stream);
|
|
36
|
-
(0, node_opcua_basic_types_1.encodeString)(this.reason, stream);
|
|
37
|
-
}
|
|
38
|
-
decode(stream) {
|
|
39
|
-
// call base class implementation first
|
|
40
|
-
super.decode(stream);
|
|
41
|
-
this.statusCode = (0, node_opcua_status_code_1.decodeStatusCode)(stream);
|
|
42
|
-
this.reason = (0, node_opcua_basic_types_1.decodeString)(stream);
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
exports.TCPErrorMessage = TCPErrorMessage;
|
|
46
|
-
TCPErrorMessage.possibleFields = ["statusCode", "reason"];
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TCPErrorMessage = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* @module node-opcua-transport
|
|
6
|
+
*/
|
|
7
|
+
const node_opcua_basic_types_1 = require("node-opcua-basic-types");
|
|
8
|
+
const node_opcua_factory_1 = require("node-opcua-factory");
|
|
9
|
+
const node_opcua_status_code_1 = require("node-opcua-status-code");
|
|
10
|
+
// TCP Error Message OPC Unified Architecture, Part 6 page 46
|
|
11
|
+
// the server always close the connection after sending the TCPError message
|
|
12
|
+
const schemaTCPErrorMessage = (0, node_opcua_factory_1.buildStructuredType)({
|
|
13
|
+
name: "TCPErrorMessage",
|
|
14
|
+
baseType: "BaseUAObject",
|
|
15
|
+
fields: [
|
|
16
|
+
{ name: "statusCode", fieldType: "StatusCode" },
|
|
17
|
+
{ name: "reason", fieldType: "String" } // A more verbose description of the error.
|
|
18
|
+
]
|
|
19
|
+
});
|
|
20
|
+
class TCPErrorMessage extends node_opcua_factory_1.BaseUAObject {
|
|
21
|
+
constructor(options) {
|
|
22
|
+
options = options || {};
|
|
23
|
+
const schema = schemaTCPErrorMessage;
|
|
24
|
+
super();
|
|
25
|
+
/* istanbul ignore next */
|
|
26
|
+
if (node_opcua_factory_1.parameters.debugSchemaHelper) {
|
|
27
|
+
(0, node_opcua_factory_1.check_options_correctness_against_schema)(this, schema, options);
|
|
28
|
+
}
|
|
29
|
+
this.statusCode = (0, node_opcua_factory_1.initialize_field)(schema.fields[0], options.statusCode);
|
|
30
|
+
this.reason = (0, node_opcua_factory_1.initialize_field)(schema.fields[1], options.reason);
|
|
31
|
+
}
|
|
32
|
+
encode(stream) {
|
|
33
|
+
// call base class implementation first
|
|
34
|
+
super.encode(stream);
|
|
35
|
+
(0, node_opcua_status_code_1.encodeStatusCode)(this.statusCode, stream);
|
|
36
|
+
(0, node_opcua_basic_types_1.encodeString)(this.reason, stream);
|
|
37
|
+
}
|
|
38
|
+
decode(stream) {
|
|
39
|
+
// call base class implementation first
|
|
40
|
+
super.decode(stream);
|
|
41
|
+
this.statusCode = (0, node_opcua_status_code_1.decodeStatusCode)(stream);
|
|
42
|
+
this.reason = (0, node_opcua_basic_types_1.decodeString)(stream);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
exports.TCPErrorMessage = TCPErrorMessage;
|
|
46
|
+
TCPErrorMessage.possibleFields = ["statusCode", "reason"];
|
|
47
47
|
//# sourceMappingURL=TCPErrorMessage.js.map
|