]> git.basschouten.com Git - openhab-addons.git/blob
954c3f80a0f3822116a64c9cc2d45308d408e797
[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.discovery;
14
15 import java.util.Set;
16
17 import org.eclipse.jdt.annotation.NonNullByDefault;
18 import org.openhab.binding.modbus.handler.ModbusEndpointThingHandler;
19 import org.openhab.core.thing.ThingTypeUID;
20
21 /**
22  * Interface for participants of Modbus discovery
23  * This is an asynchronous process where a participant can discover
24  * multiple things on a Modbus endpoint.
25  *
26  * Results should be submitted using the ModbusDiscvoeryListener
27  * supplied at the begin of the scan.
28  *
29  * @author Nagy Attila Gabor - initial contribution
30  *
31  */
32 @NonNullByDefault
33 public interface ModbusDiscoveryParticipant {
34
35     /**
36      * Defines the list of thing types that this participant can identify
37      *
38      * @return a set of thing type UIDs for which results can be created
39      */
40     Set<ThingTypeUID> getSupportedThingTypeUIDs();
41
42     /**
43      * Start an asynchronous discovery process of a Modbus endpoint
44      *
45      * @param handler the endpoint that should be discovered
46      */
47     void startDiscovery(ModbusEndpointThingHandler handler, ModbusDiscoveryListener listener);
48 }