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.modbus.sunspec.internal.parser;
15 import org.eclipse.jdt.annotation.NonNullByDefault;
16 import org.openhab.core.io.transport.modbus.ModbusRegisterArray;
19 * General interface for sunspec parsers
21 * Parsers are responsible to take the raw register array
22 * that was read from the device and to parse them into a SunSpecMessageBlock
23 * They should parse all reasonable fields into separate properties
24 * in the message block.
26 * Fields with unsupported values should be parsed as null values.
28 * In no way should a parser handle value scaling or device specific
29 * workarounds. These should be done in the handler.
31 * @author Nagy Attila Gabor - Initial contribution
35 public interface SunspecParser<T> {
38 * This method should parser an incoming register array and
39 * return a not-null sunspec block
41 T parse(ModbusRegisterArray raw);