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.velbus.internal.packets;
15 import static org.openhab.binding.velbus.internal.VelbusBindingConstants.COMMAND_READ_MEMORY_BLOCK;
17 import org.eclipse.jdt.annotation.NonNullByDefault;
20 * The {@link VelbusReadMemoryBlockPacket} represents a Velbus packet that can be used to
21 * request a block of 4 bytes from the memory of the given Velbus module.
23 * @author Cedric Boon - Initial contribution
26 public class VelbusReadMemoryBlockPacket extends VelbusPacket {
27 private byte highMemoryAddress;
28 private byte lowMemoryAddress;
30 public VelbusReadMemoryBlockPacket(byte address, int memoryAddress) {
31 super(address, PRIO_LOW);
33 highMemoryAddress = (byte) ((memoryAddress >> 8) & 0xFF);
34 lowMemoryAddress = (byte) (memoryAddress & 0xFF);
38 protected byte[] getDataBytes() {
39 return new byte[] { COMMAND_READ_MEMORY_BLOCK, highMemoryAddress, lowMemoryAddress };