//
//  Licensed to the Apache Software Foundation (ASF) under one or more
//  contributor license agreements.  See the NOTICE file distributed with
//  this work for additional information regarding copyright ownership.
//  The ASF licenses this file to You under the Apache License, Version 2.0
//  (the "License"); you may not use this file except in compliance with
//  the License.  You may obtain a copy of the License at
//
//      https://www.apache.org/licenses/LICENSE-2.0
//
//  Unless required by applicable law or agreed to in writing, software
//  distributed under the License is distributed on an "AS IS" BASIS,
//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//  See the License for the specific language governing permissions and
//  limitations under the License.
//
:imagesdir: ../../images/users/protocols
:icons: font

== PLC4X (Proxy) (TCP)

=== Connection String Options

[cols="2,2a,5a"]
|===
|Name |Value |Description

|Code
2+|`plc4x`

|Name
2+|PLC4X (Proxy-Protocol)

|Maven Dependency
2+|
----
<dependency>
  <groupId>org.apache.plc4x</groupId>
  <artifactId>plc4j-driver-plc4x</artifactId>
  <version>{current-last-released-version}</version>
</dependency>
----

|Default Transport:
2+|`tcp`

3+|Supported Operations:
|
2+| `read`
|
2+| `write`
|
2+| `subscribe`

3+|Options

|
| `remote-connection-string`
| URL-Encoded connection string to use on the proxy side to reach the given PLC.

|
| `request-timeout` (5000ms)
| Timeout for operations (Defaults to 5s)
|===

=== Individual Resource Address Format

==== Connection String

The `plc4x` protocol connection has the following connection string format:-
----
plc4x:{transport}://{ip-address/hostname}:{port}?remote-connection-string={url-encoded-connection-string}
----

An example connection string would look like:-
----
plc4x://127.0.0.1?remote-connection-string=simulated%3A%2F%2Flocalhost
----
Note the transport, port and option fields are optional.
The remote connection string: `simulated://localhost` is encoded as `simulated%3A%2F%2Flocalhost`

==== General Format

The address format is simply the address format of the used remote connection.
So if you specify a remote connection as `simulated`, please follow the address format of that driver.