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 org.eclipse.jdt.annotation.NonNullByDefault;
16 import org.openhab.binding.velbus.internal.VelbusBindingConstants;
17 import org.openhab.binding.velbus.internal.VelbusChannelIdentifier;
20 * The {@link VelbusButtonPacket} represents a Velbus packet that can be used to
21 * simulate a pushed button.
23 * @author Daniel Rosengarten - Initial contribution
26 public class VelbusButtonPacket extends VelbusPacket {
30 public VelbusButtonPacket(VelbusChannelIdentifier velbusChannelIdentifier) {
31 super(velbusChannelIdentifier.getAddress(), PRIO_HI, false);
33 this.channel = velbusChannelIdentifier.getChannelByte();
34 this.data = new byte[] { VelbusBindingConstants.COMMAND_PUSH_BUTTON_STATUS, (byte) 0x00, (byte) 0x00,
38 public void Pressed() {
39 data = new byte[] { VelbusBindingConstants.COMMAND_PUSH_BUTTON_STATUS, channel, (byte) 0x00, (byte) 0x00 };
42 public void LongPressed() {
43 data = new byte[] { VelbusBindingConstants.COMMAND_PUSH_BUTTON_STATUS, (byte) 0x00, (byte) 0x00, channel };
46 public void Released() {
47 data = new byte[] { VelbusBindingConstants.COMMAND_PUSH_BUTTON_STATUS, (byte) 0x00, channel, (byte) 0x00 };
51 protected byte[] getDataBytes() {