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.nibeheatpump.internal.protocol;
15 import java.nio.ByteBuffer;
18 * The {@link NibeHeatPumpProtocolDefaultContext} implements default Nibe protocol context.
21 * @author Pauli Anttila - Initial contribution
23 public class NibeHeatPumpProtocolDefaultContext implements NibeHeatPumpProtocolContext {
24 private NibeHeatPumpProtocolStates state = NibeHeatPumpProtocolStates.WAIT_START;
25 private final ByteBuffer buffer = ByteBuffer.allocate(1000);
26 private final ByteBuffer msg = ByteBuffer.allocate(100);
29 public NibeHeatPumpProtocolStates state() {
34 public void state(NibeHeatPumpProtocolStates state) {
39 public ByteBuffer buffer() {
44 public ByteBuffer msg() {
49 public void sendAck() {
53 public void sendNak() {
57 public void msgReceived(byte[] data) {
61 public void sendWriteMsg() {
65 public void sendReadMsg() {