functionconstructor
Creates an MQTT instance.
Extends from Modelica.Icons.Function (Icon for functions).
Inputs
| Type | Name | Default | Description |
|---|---|---|---|
| String | provider | "tcp://" - TCP, "ssl://" - encrypted TCP, "ws://" - websocket, , "wss://" - encrypted websocket | |
| String | address | IP address | |
| Integer | port | 1883 | Port |
| Boolean | receiver | false - sender, true - receiver | |
| String | channel | Receive channel | |
| Integer | bufferSize | 16*1024 | Size of receive buffer |
| Integer | QoS | 1 | Quality of service for receiver: 0 - at most once, 1 - at least once, 2 - exactly once |
| String | clientID | Unique client identifier | |
| String | userName | "" | User name for authentication and authorisation |
| String | password | "" | Password for authentication and authorisation |
| String | trustStore | "" | Public digital certificates trusted by the client |
| String | keyStore | "" | Public certificate chain of the client |
| String | privateKey | "" | Private key of the client |
| Integer | keepAliveInterval | 60 | Maximum time (in seconds) that should pass without communication between the client and the server |
| Boolean | cleanSession | true | false - keep session state for this client at disconnect, true - discard session state at connect and disconnect |
| Boolean | reliable | true | false - increase number of messages that can be in-flight simultaneously to 10, true - a published message must be completed (acknowledgements received) before another message can be sent |
| Integer | connectTimeout | 30 | Connection timeout (in seconds) |
| Integer | MQTTVersion | 0 | MQTT version: 0 - default: start with 3.1.1, and if that fails, fall back to 3.1, 3 - only try version 3.1, 4 - only try version 3.1.1, 5 - only try version 5.0 |
| Integer | disconnectTimeout | 10 | Disconnect timeout (in seconds) |
| Boolean | enableServerCertAuth | true | false - disable verification of the server certificate, true - enable verification of the server certificate |
| Boolean | verify | false | false - disable post-connect checks, true - enable post-connect checks, including that a certificate matches the given host name |
| Integer | sslVersion | 0 | SSL/TLS version: 0 - default, 1 - TLS 1.0, 2 - TLS 1.1, 3 - TLS 1.2 |
| Integer | traceLevel | 0 | Trace level: 0 - none, 1 - maximum, 2 - medium, 3 - minimum, 4 - protocol, 5 - error, 6 - severe, 7 - fatal |
Outputs
| Type | Name | Default | Description |
|---|---|---|---|
| MQTT | mqtt |