]> git.basschouten.com Git - openhab-addons.git/blob
6b9306d2f6cb3428cb119a52fc95d5ebac0fa8bf
[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.dsmr.internal.device.p1telegram;
14
15 import org.eclipse.jdt.annotation.NonNullByDefault;
16 import org.openhab.binding.dsmr.internal.device.connector.DSMRErrorStatus;
17
18 /**
19  * Interface for receiving CosemObjects that come from a P1 Telegram
20  *
21  * @author M. Volaart - Initial contribution
22  * @author Hilbrand Bouwkamp - Refactored interface to use single data object
23  */
24 @NonNullByDefault
25 public interface P1TelegramListener {
26
27     /**
28      * Called when reading the telegram failed. Passes the failed state and optional an additional error message.
29      *
30      * @param errorStatus error state
31      * @param message optional additional message
32      */
33     void onError(DSMRErrorStatus errorStatus, String message);
34
35     /**
36      * Callback on received telegram.
37      *
38      * @param telegram The received telegram
39      */
40     void telegramReceived(P1Telegram telegram);
41 }