]> git.basschouten.com Git - openhab-addons.git/blob
a87373b02486ce01b1dcb764df050d7d10306824
[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.gpio.internal.handler;
14
15 import org.eclipse.jdt.annotation.NonNullByDefault;
16 import org.eclipse.jdt.annotation.Nullable;
17 import org.openhab.core.types.Command;
18
19 import eu.xeli.jpigpio.JPigpio;
20 import eu.xeli.jpigpio.PigpioException;
21
22 /**
23  * The {@link ChannelHandler} provides an interface for different pin
24  * configuration handlers
25  *
26  * @author Jan N. Klug - Initial contribution
27  */
28 @NonNullByDefault
29 public interface ChannelHandler {
30
31     /**
32      * Handles a Command being sent from the
33      * Openhab framework.
34      */
35     void handleCommand(Command command) throws PigpioException;
36
37     /**
38      * (Re)Establishes the JPigpio listeners.
39      */
40     void listen(@Nullable JPigpio jPigpio) throws PigpioException;
41
42     /**
43      * Terminates sending Channels status updates and
44      * shuts down any JPigpio listeners.
45      */
46     void dispose();
47 }