]> git.basschouten.com Git - openhab-addons.git/blob
c2345a05c9e0e012cb01301767db99a2486b8592
[openhab-addons.git] /
1 /**
2  * Copyright (c) 2010-2023 Contributors to the openHAB project
3  *
4  * See the NOTICE file(s) distributed with this work for additional
5  * information.
6  *
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
10  *
11  * SPDX-License-Identifier: EPL-2.0
12  */
13 package org.openhab.binding.modbus.handler;
14
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;
20
21 /**
22  * Base interface for thing handlers of endpoint things
23  *
24  * @author Sami Salonen - Initial contribution
25  *
26  */
27 @NonNullByDefault
28 public interface ModbusEndpointThingHandler extends Identifiable<ThingUID> {
29
30     /**
31      * Gets the {@link ModbusCommunicationInterface} represented by the thing
32      *
33      * Note that this can be <code>null</code> in case of incomplete initialization
34      *
35      * @return communication interface represented by this thing handler
36      */
37     @Nullable
38     ModbusCommunicationInterface getCommunicationInterface();
39
40     /**
41      * Get Slave ID, also called as unit id, represented by the thing
42      *
43      * @return slave id represented by this thing handler
44      * @throws EndpointNotInitializedException in case the initialization is not complete
45      */
46     int getSlaveId() throws EndpointNotInitializedException;
47
48     /**
49      * Return true if auto discovery is enabled for this endpoint
50      *
51      * @return boolean true if the discovery is enabled
52      */
53     boolean isDiscoveryEnabled();
54 }