2 * Copyright (c) 2010-2020 Contributors to the openHAB project
4 * See the NOTICE file(s) distributed with this work for additional
7 * This program and the accompanying materials are made available under the
8 * terms of the Eclipse Public License 2.0 which is available at
9 * http://www.eclipse.org/legal/epl-2.0
11 * SPDX-License-Identifier: EPL-2.0
13 package org.openhab.io.transport.modbus;
15 import org.eclipse.jdt.annotation.NonNullByDefault;
16 import org.eclipse.jdt.annotation.Nullable;
17 import org.openhab.io.transport.modbus.endpoint.EndpointPoolConfiguration;
18 import org.openhab.io.transport.modbus.endpoint.ModbusSlaveEndpoint;
21 * ModbusManager is the main interface for interacting with Modbus slaves
23 * @author Sami Salonen - Initial contribution
26 public interface ModbusManager {
29 * Open communication interface to endpoint
31 * @param endpoint endpoint pointing to modbus slave
32 * @param configuration configuration for the endpoint
33 * @return Communication interface for interacting with the slave
34 * @throws IllegalArgumentException if there is already open communication interface with same endpoint but
35 * differing configuration
37 public ModbusCommunicationInterface newModbusCommunicationInterface(ModbusSlaveEndpoint endpoint,
38 @Nullable EndpointPoolConfiguration configuration) throws IllegalArgumentException;
41 * Get general configuration settings applied to a given endpoint
43 * Note that default configuration settings are returned in case the endpoint has not been configured.
45 * @param endpoint endpoint to query
46 * @return general connection settings of the given endpoint
48 public @Nullable EndpointPoolConfiguration getEndpointPoolConfiguration(ModbusSlaveEndpoint endpoint);