diff --git a/plc4cpp/protocols/driver-bases/base/pom.xml b/plc4cpp/protocols/driver-bases/base/pom.xml
new file mode 100644
index 00000000000..b1190e02b9f
--- /dev/null
+++ b/plc4cpp/protocols/driver-bases/base/pom.xml
@@ -0,0 +1,47 @@
+
+
+
+
+ 4.0.0
+
+
+ org.apache.plc4x
+ plc4cpp-protocols-driver-bases
+ 0.4.0-SNAPSHOT
+
+
+ plc4cpp-protocol-driver-base
+ PLC4Cpp: Protocol: Driver-Base: Base
+ Base classes needed to implement all of the other driver bases.
+
+
+
+ src/main/cpp
+
+
+
+
+ org.apache.plc4x
+ plc4cpp-api
+ 0.4.0-SNAPSHOT
+
+
+
+
\ No newline at end of file
diff --git a/plc4cpp/protocols/driver-bases/base/src/main/cmake/CMakeLists.txt b/plc4cpp/protocols/driver-bases/base/src/main/cmake/CMakeLists.txt
new file mode 100644
index 00000000000..071be41557a
--- /dev/null
+++ b/plc4cpp/protocols/driver-bases/base/src/main/cmake/CMakeLists.txt
@@ -0,0 +1,58 @@
+#[[
+ 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
+
+ http://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.
+]]
+
+cmake_minimum_required(VERSION 3.7)
+set(CMAKE_CXX_STANDARD 11)
+set(CMAKE_CXX_STANDARD_REQUIRED ON)
+set(CMAKE_CXX_EXTENSIONS OFF)
+
+add_library(api ../../src/main/cpp/org/apache/plc4x/cpp/base/connection/AbstractPlcConnection.cpp
+ ../../src/main/cpp/org/apache/plc4x/cpp/base/connection/ChannelFactory.cpp
+ ../../src/main/cpp/org/apache/plc4x/cpp/base/connection/DefaultPlcFieldHandler.cpp
+ ../../src/main/cpp/org/apache/plc4x/cpp/base/connection/PlcFieldHandler.cpp
+ ../../src/main/cpp/org/apache/plc4x/cpp/base/events/ConnectedEvent.cpp
+ ../../src/main/cpp/org/apache/plc4x/cpp/base/events/ConnectEvent.cpp
+ ../../src/main/cpp/org/apache/plc4x/cpp/base/messages/items/BaseDefaultFieldItem.cpp
+ ../../src/main/cpp/org/apache/plc4x/cpp/base/messages/items/DefaultBigDecimalFieldItem.cpp
+ ../../src/main/cpp/org/apache/plc4x/cpp/base/messages/items/DefaultBigIntegerFieldItem.cpp
+ ../../src/main/cpp/org/apache/plc4x/cpp/base/messages/items/DefaultBooleanFieldItem.cpp
+ ../../src/main/cpp/org/apache/plc4x/cpp/base/messages/items/DefaultByteArrayFieldItem.cpp
+ ../../src/main/cpp/org/apache/plc4x/cpp/base/messages/items/DefaultByteFieldItem.cpp
+ ../../src/main/cpp/org/apache/plc4x/cpp/base/messages/items/DefaultDoubleFieldItem.cpp
+ ../../src/main/cpp/org/apache/plc4x/cpp/base/messages/DefaultPlcReadRequest.cpp
+ ../../src/main/cpp/org/apache/plc4x/cpp/base/messages/DefaultPlcWriteRequest.cpp
+ ../../src/main/cpp/org/apache/plc4x/cpp/base/messages/InternalPlcFieldRequest.cpp
+ ../../src/main/cpp/org/apache/plc4x/cpp/base/messages/InternalPlcFieldResponse.cpp
+ ../../src/main/cpp/org/apache/plc4x/cpp/base/messages/InternalPlcProprietaryRequest.cpp
+ ../../src/main/cpp/org/apache/plc4x/cpp/base/messages/InternalPlcProprietaryResponse.cpp
+ ../../src/main/cpp/org/apache/plc4x/cpp/base/messages/InternalPlcReadRequest.cpp
+ ../../src/main/cpp/org/apache/plc4x/cpp/base/messages/InternalPlcRequest.cpp
+ ../../src/main/cpp/org/apache/plc4x/cpp/base/messages/InternalPlcResponse.cpp
+ ../../src/main/cpp/org/apache/plc4x/cpp/base/messages/InternalPlcWriteRequest.cpp
+ ../../src/main/cpp/org/apache/plc4x/cpp/base/messages/PlcProprietaryRequest.cpp
+ ../../src/main/cpp/org/apache/plc4x/cpp/base/messages/PlcProprietaryResponse.cpp
+ ../../src/main/cpp/org/apache/plc4x/cpp/base/messages/PlcReader.cpp
+ ../../src/main/cpp/org/apache/plc4x/cpp/base/messages/PlcWriter.cpp
+ )
+
+#[[
+ Import the boost headers
+]]
+target_include_directories (api PUBLIC ../../../../../${boost.include-directory})
+
diff --git a/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/connection/AbstractPlcConnection.cpp b/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/connection/AbstractPlcConnection.cpp
new file mode 100644
index 00000000000..af47faa5432
--- /dev/null
+++ b/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/connection/AbstractPlcConnection.cpp
@@ -0,0 +1,55 @@
+/*
+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
+
+ http://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.
+*/
+
+#include "AbstractPlcConnection.h"
+
+namespace org
+{
+ namespace apache
+ {
+ namespace plc4x
+ {
+ namespace cpp
+ {
+ namespace base
+ {
+ namespace connection
+ {
+ PlcConnectionMetadata& AbstractPlcConnection::getMetadata()
+ {
+ return *this;
+ }
+ bool AbstractPlcConnection::canRead()
+ {
+ return false;
+ }
+ bool AbstractPlcConnection::canWrite()
+ {
+ return false;
+ }
+ bool AbstractPlcConnection::canSubscribe()
+ {
+ return false;
+ }
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/connection/AbstractPlcConnection.h b/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/connection/AbstractPlcConnection.h
new file mode 100644
index 00000000000..4f85192b7b7
--- /dev/null
+++ b/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/connection/AbstractPlcConnection.h
@@ -0,0 +1,79 @@
+/*
+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
+
+ http://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.
+*/
+
+#ifndef _ABSTRCT_PLC_HANDLER
+#define _ABSTRCT_PLC_HANDLER
+
+#include
+#include "../../../../../../../../../../../../api/src/main/cpp/org/apache/plc4x/cpp/api/PlcConnection.h"
+#include
+
+using namespace org::apache::plc4x::cpp::api;
+
+namespace org
+{
+ namespace apache
+ {
+ namespace plc4x
+ {
+ namespace cpp
+ {
+ namespace base
+ {
+ namespace connection
+ {
+ /**
+ * Base class for implementing connections.
+ * Per default, all operations (read, write, subscribe) are unsupported.
+ * Concrete implementations should override the methods indicating connection capabilities
+ * and for obtaining respective request builders.
+ */
+ class AbstractPlcConnection : public PlcConnection, PlcConnectionMetadata
+ {
+
+ public:
+ PlcConnectionMetadata& getMetadata();
+ bool canRead();
+ bool canWrite();
+ bool canSubscribe();
+
+ virtual void open() = 0;
+ virtual void close() = 0;
+ virtual bool send(unsigned char* pBytesToSend, int iNumBytesToSend) = 0;
+
+ // Todo: Check if required
+ //PlcReadRequest.Builder readRequestBuilder();
+ // PlcWriteRequest.Builder writeRequestBuilder();
+ // PlcSubscriptionRequest.Builder subscriptionRequestBuilder();
+ // PlcUnsubscriptionRequest.Builder nsubscriptionRequestBuilder();
+
+ protected:
+ virtual void onReceive(const boost::system::error_code& errorCode, std::size_t bytes_transferred) = 0;
+ private:
+
+ };
+ }
+ }
+ }
+ }
+ }
+}
+
+#endif
+
diff --git a/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/connection/ChannelFactory.cpp b/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/connection/ChannelFactory.cpp
new file mode 100644
index 00000000000..129dbb203b1
--- /dev/null
+++ b/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/connection/ChannelFactory.cpp
@@ -0,0 +1,39 @@
+/*
+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
+
+ http://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.
+*/
+
+#include "ChannelFactory.h"
+
+namespace org
+{
+ namespace apache
+ {
+ namespace plc4x
+ {
+ namespace cpp
+ {
+ namespace base
+ {
+ namespace connection
+ {
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/connection/ChannelFactory.h b/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/connection/ChannelFactory.h
new file mode 100644
index 00000000000..b44fa0a4da4
--- /dev/null
+++ b/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/connection/ChannelFactory.h
@@ -0,0 +1,59 @@
+/*
+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
+
+ http://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.
+*/
+
+#ifndef _CHANNEL_FACTORY
+#define _CHANNEL_FACTORY
+
+#include
+#include
+#include
+#include
+
+#include
+
+using namespace boost::asio;
+using namespace boost::asio::ip;
+using boost::asio::ip::address;
+
+namespace org
+{
+ namespace apache
+ {
+ namespace plc4x
+ {
+ namespace cpp
+ {
+ namespace base
+ {
+ namespace connection
+ {
+ class ChannelFactory
+ {
+
+ public:
+ virtual tcp::socket* createChannel() = 0;
+ };
+ }
+ }
+ }
+ }
+ }
+}
+
+#endif
\ No newline at end of file
diff --git a/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/connection/DefaultPlcFieldHandler.cpp b/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/connection/DefaultPlcFieldHandler.cpp
new file mode 100644
index 00000000000..af769a39952
--- /dev/null
+++ b/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/connection/DefaultPlcFieldHandler.cpp
@@ -0,0 +1,111 @@
+/*
+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
+
+ http://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.
+*/
+
+#include "DefaultPlcFieldHandler.h"
+
+namespace org
+{
+ namespace apache
+ {
+ namespace plc4x
+ {
+ namespace cpp
+ {
+ namespace base
+ {
+ namespace connection
+ {
+ BaseDefaultFieldItem* DefaultPlcFieldhandler::encodeBoolean(PlcField field, std::vector values)
+ {
+ throw new PlcRuntimeException("Invalid encoder for type "/*Todo: +std::string((field)*/);
+ }
+
+ BaseDefaultFieldItem* DefaultPlcFieldhandler::encodeByte(PlcField field, std::vector)
+ {
+ throw new PlcRuntimeException("Invalid encoder for type "/* Todo: + field*/);
+ }
+
+ BaseDefaultFieldItem* DefaultPlcFieldhandler::encodeShort(PlcField field, std::vector values)
+ {
+ throw new PlcRuntimeException("Invalid encoder for type "/* + field*/);
+ }
+
+ BaseDefaultFieldItem* DefaultPlcFieldhandler::encodeInteger(PlcField field, std::vector values)
+ {
+ throw new PlcRuntimeException("Invalid encoder for type "/* + field*/);
+ }
+
+ BaseDefaultFieldItem* DefaultPlcFieldhandler::encodeBigInteger(PlcField field, std::vector)
+ {
+ throw new PlcRuntimeException("Invalid encoder for type "/* + field*/);
+ }
+
+ BaseDefaultFieldItem* DefaultPlcFieldhandler::encodeLong(PlcField field, std::vector)
+ {
+ throw new PlcRuntimeException("Invalid encoder for type "/* + field*/);
+ }
+
+ BaseDefaultFieldItem* DefaultPlcFieldhandler::encodeFloat(PlcField field, std::vector)
+ {
+ throw new PlcRuntimeException("Invalid encoder for type " /*+ field*/);
+
+ }
+
+ BaseDefaultFieldItem* DefaultPlcFieldhandler::encodeBigDecimal(PlcField field, std::vector values)
+ {
+ throw new PlcRuntimeException("Invalid encoder for type "/* + field*/);
+ }
+
+ BaseDefaultFieldItem* DefaultPlcFieldhandler::encodeDouble(PlcField field, std::vector)
+ {
+ throw new PlcRuntimeException("Invalid encoder for type "/* + field*/);
+ }
+
+ BaseDefaultFieldItem* DefaultPlcFieldhandler::encodeString(PlcField field, std::vector values)
+ {
+ throw new PlcRuntimeException("Invalid encoder for type "/* + field*/);
+ }
+
+ BaseDefaultFieldItem* DefaultPlcFieldhandler::encodeTime(PlcField field, std::vector values)
+ {
+ throw new PlcRuntimeException("Invalid encoder for type "/* + field*/);
+ }
+
+ BaseDefaultFieldItem* DefaultPlcFieldhandler::encodeDate(PlcField field, std::vector values)
+ {
+ throw new PlcRuntimeException("Invalid encoder for type "/* + field*/);
+ }
+
+ BaseDefaultFieldItem* DefaultPlcFieldhandler::encodeDateTime(PlcField field, std::vector values)
+ {
+ throw new PlcRuntimeException("Invalid encoder for type "/* + field*/);
+ }
+
+ BaseDefaultFieldItem* DefaultPlcFieldhandler::encodeByteArray(PlcField field, std::vector values)
+ {
+ throw new PlcRuntimeException("Invalid encoder for type "/* + field*/);
+ }
+ }
+ }
+ }
+ }
+ }
+}
+
+
diff --git a/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/connection/DefaultPlcFieldHandler.h b/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/connection/DefaultPlcFieldHandler.h
new file mode 100644
index 00000000000..7cfad354031
--- /dev/null
+++ b/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/connection/DefaultPlcFieldHandler.h
@@ -0,0 +1,96 @@
+/*
+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
+
+ http://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.
+*/
+
+#ifndef _DEFAULT_PLC_FIELD_HANDLER
+#define _DEFAULT_PLC_FIELD_HANDLER
+
+#include
+#include "../../../../../../../../../../../../api/src/main/cpp/org/apache/plc4x/cpp/api/PlcConnection.h"
+#include
+#include
+#include
+#include
+#include
+#include
+
+#include "../../../../../../../../../../../../api/src/main/cpp/org/apache/plc4x/cpp/api/model/PlcField.h"
+#include "PlcFieldHandler.h"
+#include "../messages/items/BaseDefaultFieldItem.h"
+
+using namespace org::apache::plc4x::cpp::api::model;
+using namespace org::apache::plc4x::cpp::base::messages::items;
+
+namespace org
+{
+ namespace apache
+ {
+ namespace plc4x
+ {
+ namespace cpp
+ {
+ namespace base
+ {
+ namespace connection
+ {
+ /**
+ * Base Implementation of {@link PlcFieldHandler} which throws a {@link PlcRuntimeException} for all
+ * encodeXXX methods.
+ */
+ class DefaultPlcFieldhandler : public PlcFieldHandler
+ {
+
+ public:
+
+ BaseDefaultFieldItem* encodeBoolean(PlcField plcField, std::vector pValues) override;
+
+ BaseDefaultFieldItem* encodeByte(PlcField plcField, std::vector pValues) override;
+
+ BaseDefaultFieldItem* encodeShort(PlcField plcField, std::vector pValues) override;
+
+ BaseDefaultFieldItem* encodeInteger(PlcField plcField, std::vector pValues) override;
+
+ BaseDefaultFieldItem* encodeBigInteger(PlcField plcField, std::vector pValues) override;
+
+ BaseDefaultFieldItem* encodeLong(PlcField plcField, std::vector pValues) override;
+
+ BaseDefaultFieldItem* encodeFloat(PlcField plcField, std::vector pValues) override;
+
+ BaseDefaultFieldItem* encodeBigDecimal(PlcField plcField,std::vector pValues) override;
+
+ BaseDefaultFieldItem* encodeDouble(PlcField plcField, std::vector pValues) override;
+
+ BaseDefaultFieldItem* encodeString(PlcField plcField, std::vector pValues) override;
+
+ BaseDefaultFieldItem* encodeTime(PlcField plcField, std::vector pValues) override;
+
+ BaseDefaultFieldItem* encodeDate(PlcField plcField, std::vector pValues) override;
+
+ BaseDefaultFieldItem* encodeDateTime(PlcField plcField, std::vector pValues) override;
+
+ BaseDefaultFieldItem* encodeByteArray(PlcField plcField, std::vector pValues) override;
+
+ };
+ }
+ }
+ }
+ }
+ }
+}
+
+#endif
\ No newline at end of file
diff --git a/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/connection/PlcFieldHandler.cpp b/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/connection/PlcFieldHandler.cpp
new file mode 100644
index 00000000000..71f739b47b2
--- /dev/null
+++ b/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/connection/PlcFieldHandler.cpp
@@ -0,0 +1,39 @@
+/*
+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
+
+ http://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.
+*/
+
+#include "PlcFieldHandler.h"
+
+namespace org
+{
+ namespace apache
+ {
+ namespace plc4x
+ {
+ namespace cpp
+ {
+ namespace base
+ {
+ namespace connection
+ {
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/connection/PlcFieldHandler.h b/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/connection/PlcFieldHandler.h
new file mode 100644
index 00000000000..1d166d7e40c
--- /dev/null
+++ b/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/connection/PlcFieldHandler.h
@@ -0,0 +1,99 @@
+/*
+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
+
+ http://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.
+*/
+
+#ifndef _PLC_FIELD_HANDLER
+#define _PLC_FIELD_HANDLER
+
+#include
+#include "../../../../../../../../../../../../api/src/main/cpp/org/apache/plc4x/cpp/api/PlcConnection.h"
+#include
+#include
+#include
+
+#include "../../../../../../../../../../../../api/src/main/cpp/org/apache/plc4x/cpp/api/model/PlcField.h"
+#include "../messages/items/BaseDefaultFieldItem.h"
+
+using namespace org::apache::plc4x::cpp::api::model;
+using namespace org::apache::plc4x::cpp::base::messages;
+using namespace org::apache::plc4x::cpp::base::messages::items;
+using namespace boost::multiprecision;
+
+
+namespace org
+{
+ namespace apache
+ {
+ namespace plc4x
+ {
+ namespace cpp
+ {
+ namespace base
+ {
+ namespace connection
+ {
+ /**
+ * Base class for implementing connections.
+ * Per default, all operations (read, write, subscribe) are unsupported.
+ * Concrete implementations should override the methods indicating connection capabilities
+ * and for obtaining respective request builders.
+ */
+ class PlcFieldHandler
+ {
+
+ public:
+
+ virtual PlcField createField(std::string strFieldQuery) = 0;
+
+ virtual BaseDefaultFieldItem* encodeBoolean(PlcField plcField, std::vector pValues) = 0;
+
+ virtual BaseDefaultFieldItem* encodeByte(PlcField plcField, std::vector pValues)= 0;
+
+ virtual BaseDefaultFieldItem* encodeShort(PlcField plcField, std::vector pValues) = 0;
+
+ virtual BaseDefaultFieldItem* encodeInteger(PlcField plcField, std::vector pValues) = 0;
+
+ virtual BaseDefaultFieldItem* encodeBigInteger(PlcField plcField,std::vector pValues) = 0;
+
+ virtual BaseDefaultFieldItem* encodeLong(PlcField plcField, std::vector pValues) = 0;
+
+ virtual BaseDefaultFieldItem* encodeFloat(PlcField plcField, std::vector pValues) = 0;
+
+ virtual BaseDefaultFieldItem< cpp_dec_float_100>* encodeBigDecimal(PlcField plcField, std::vector pValues) = 0;
+
+ virtual BaseDefaultFieldItem* encodeDouble(PlcField plcField, std::vector pValues) = 0;
+
+ virtual BaseDefaultFieldItem* encodeString(PlcField plcField, std::vector pValues) = 0;
+
+ virtual BaseDefaultFieldItem* encodeTime(PlcField plcField, std::vector pValues) = 0;
+
+ virtual BaseDefaultFieldItem* encodeDate(PlcField plcField, std::vector pValues) = 0;
+
+ virtual BaseDefaultFieldItem* encodeDateTime(PlcField plcField, std::vector pValues)= 0;
+
+ virtual BaseDefaultFieldItem* encodeByteArray(PlcField fieplcFieldld,std::vector pValues) = 0;
+
+ };
+ }
+ }
+ }
+ }
+ }
+}
+
+#endif
\ No newline at end of file
diff --git a/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/events/ConnectEvent.cpp b/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/events/ConnectEvent.cpp
new file mode 100644
index 00000000000..585eae38bb5
--- /dev/null
+++ b/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/events/ConnectEvent.cpp
@@ -0,0 +1,39 @@
+/*
+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
+
+ http://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.
+*/
+
+#include "ConnectEvent.h"
+
+namespace org
+{
+ namespace apache
+ {
+ namespace plc4x
+ {
+ namespace cpp
+ {
+ namespace base
+ {
+ namespace events
+ {
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/events/ConnectEvent.h b/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/events/ConnectEvent.h
new file mode 100644
index 00000000000..77732dd940c
--- /dev/null
+++ b/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/events/ConnectEvent.h
@@ -0,0 +1,48 @@
+/*
+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
+
+ http://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.
+*/
+
+#ifndef _CONNECT_EVENT
+#define _CONNECT_EVENT
+
+#include
+
+namespace org
+{
+ namespace apache
+ {
+ namespace plc4x
+ {
+ namespace cpp
+ {
+ namespace base
+ {
+ namespace events
+ {
+
+ class ConnectEvent
+ {
+ };
+ }
+ }
+ }
+ }
+ }
+}
+
+#endif
diff --git a/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/events/ConnectedEvent.cpp b/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/events/ConnectedEvent.cpp
new file mode 100644
index 00000000000..84b5e4a6bf2
--- /dev/null
+++ b/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/events/ConnectedEvent.cpp
@@ -0,0 +1,39 @@
+/*
+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
+
+ http://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.
+*/
+
+#include "ConnectedEvent.h"
+
+namespace org
+{
+ namespace apache
+ {
+ namespace plc4x
+ {
+ namespace cpp
+ {
+ namespace base
+ {
+ namespace events
+ {
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/events/ConnectedEvent.h b/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/events/ConnectedEvent.h
new file mode 100644
index 00000000000..315b9c6286f
--- /dev/null
+++ b/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/events/ConnectedEvent.h
@@ -0,0 +1,47 @@
+/*
+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
+
+ http://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.
+*/
+
+#ifndef _CONNECTED_EVENT
+#define _CONNECTED_EVENT
+
+namespace org
+{
+ namespace apache
+ {
+ namespace plc4x
+ {
+ namespace cpp
+ {
+ namespace base
+ {
+ namespace events
+ {
+
+ class ConnectedEvent
+ {
+ };
+ }
+ }
+ }
+ }
+ }
+}
+
+#endif
+
diff --git a/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/messages/DefaultPlcReadRequest.cpp b/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/messages/DefaultPlcReadRequest.cpp
new file mode 100644
index 00000000000..21005b7c0b5
--- /dev/null
+++ b/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/messages/DefaultPlcReadRequest.cpp
@@ -0,0 +1,122 @@
+/*
+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
+
+ http://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.
+*/
+
+#include "DefaultPlcReadRequest.h"
+
+using namespace org::apache::plc4x::cpp::api::model;
+
+namespace org
+{
+ namespace apache
+ {
+ namespace plc4x
+ {
+ namespace cpp
+ {
+ namespace base
+ {
+ namespace messages
+ {
+ // =========================================================
+ DefaultPlcReadRequest::DefaultPlcReadRequest()
+ {
+ }
+
+ // =========================================================
+ DefaultPlcReadRequest::DefaultPlcReadRequest(PlcReader* reader, std::map fields)
+ {
+ this->_reader = reader;
+ this->_fields = fields;
+ }
+
+ // ==========================================================
+ int DefaultPlcReadRequest::getNumberOfFields()
+ {
+ return _fields.size();
+ }
+
+ // =========================================================
+ PlcField* DefaultPlcReadRequest::getField(std::string name)
+ {
+ // sgl: check 1st, whether the key is contained in vector
+ // (otherwise an exception is thrown)...
+ std::map::iterator iterator = _fields.find(name);
+
+ if (iterator == _fields.end())
+ {
+ return nullptr;
+ }
+
+ return &(iterator->second);
+
+ }
+
+ // ======================================================
+ std::map DefaultPlcReadRequest::getNamedFields()
+ {
+ // Todo:
+ /*return fields.entrySet()
+ .stream()
+ .map(stringPlcFieldEntry->Pair.of(stringPlcFieldEntry.getKey(), stringPlcFieldEntry.getValue()))
+ .collect(Collectors.toCollection(LinkedList::new));
+*/
+ return std::map();
+ }
+
+ // ====================================================
+ PlcReader* DefaultPlcReadRequest::getReader()
+ {
+ return _reader;
+ }
+
+ // =====================================================
+ std::vector DefaultPlcReadRequest::getFields()
+ {
+ // TODO: check if already exists...
+ std::pair me;
+ std::vector vNames;
+
+ BOOST_FOREACH(me, _fields)
+ {
+ vNames.push_back(me.second);
+ }
+
+ return vNames;
+ }
+
+ // =========================================================
+ std::vector DefaultPlcReadRequest::getFieldNames()
+ {
+ // TODO: check if already exists...
+ std::pair me;
+ std::vector vNames;
+
+ BOOST_FOREACH(me, _fields)
+ {
+ vNames.push_back(me.first);
+ }
+
+ return vNames;
+ }
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/messages/DefaultPlcReadRequest.h b/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/messages/DefaultPlcReadRequest.h
new file mode 100644
index 00000000000..f6047f19c21
--- /dev/null
+++ b/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/messages/DefaultPlcReadRequest.h
@@ -0,0 +1,81 @@
+/*
+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
+
+ http://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.
+*/
+
+#ifndef _DEFAULT_PLC_READ_REQUEST
+#define _DEFAULT_PLC_READ_REQUEST
+
+#include "InternalPlcReadRequest.h"
+#include "InternalPlcFieldRequest.h"
+#include "PlcReader.h"
+#include "../../../../../../../../../../../../api/src/main/cpp/org/apache/plc4x/cpp/api/model/PlcField.h"
+
+#include