2 * Copyright (c) 2010-2022 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.binding.modbus.handler;
15 import org.eclipse.jdt.annotation.NonNullByDefault;
16 import org.eclipse.jdt.annotation.Nullable;
17 import org.openhab.core.common.registry.Identifiable;
18 import org.openhab.core.io.transport.modbus.ModbusCommunicationInterface;
19 import org.openhab.core.thing.ThingUID;
22 * Base interface for thing handlers of endpoint things
24 * @author Sami Salonen - Initial contribution
28 public interface ModbusEndpointThingHandler extends Identifiable<ThingUID> {
31 * Gets the {@link ModbusCommunicationInterface} represented by the thing
33 * Note that this can be <code>null</code> in case of incomplete initialization
35 * @return communication interface represented by this thing handler
37 public @Nullable ModbusCommunicationInterface getCommunicationInterface();
40 * Get Slave ID, also called as unit id, represented by the thing
42 * @return slave id represented by this thing handler
43 * @throws EndpointNotInitializedException in case the initialization is not complete
45 public int getSlaveId() throws EndpointNotInitializedException;
48 * Return true if auto discovery is enabled for this endpoint
50 * @return boolean true if the discovery is enabled
52 public boolean isDiscoveryEnabled();