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.lcn.internal.connection;
15 import java.time.Instant;
17 import org.eclipse.jdt.annotation.NonNullByDefault;
18 import org.openhab.binding.lcn.internal.common.LcnAddr;
21 * Holds data of one PCK command with the target address and the date when the item has been enqueued.
23 * @author Fabian Wolter - Initial Contribution
26 public class PckQueueItem {
27 private final Instant enqueued;
28 private final LcnAddr addr;
29 private final boolean wantsAck;
30 private final byte[] data;
32 public PckQueueItem(LcnAddr addr, boolean wantsAck, byte[] data) {
33 this.enqueued = Instant.now();
35 this.wantsAck = wantsAck;
40 * Gets the time when this message has been enqueued.
44 public Instant getEnqueued() {
49 * Gets the address of the destination LCN module.
53 public LcnAddr getAddr() {
58 * Checks whether an Ack is requested.
60 * @return true, if an Ack is requested
62 public boolean isWantsAck() {
67 * Gets the raw PCK message to be sent.
69 * @return message as ByteBuffer
71 public byte[] getData() {