2 * Copyright (c) 2010-2023 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.dsmr.internal.device.p1telegram;
15 import org.eclipse.jdt.annotation.NonNullByDefault;
16 import org.openhab.binding.dsmr.internal.device.connector.DSMRErrorStatus;
19 * Interface for receiving CosemObjects that come from a P1 Telegram
21 * @author M. Volaart - Initial contribution
22 * @author Hilbrand Bouwkamp - Refactored interface to use single data object
25 public interface P1TelegramListener {
28 * Called when reading the telegram failed. Passes the failed state and optional an additional error message.
30 * @param errorStatus error state
31 * @param message optional additional message
33 void onError(DSMRErrorStatus errorStatus, String message);
36 * Callback on received telegram.
38 * @param telegram The received telegram
40 void telegramReceived(P1Telegram telegram);