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.enocean.internal.messages;
15 import org.eclipse.jdt.annotation.NonNullByDefault;
19 * @author Daniel Weber - Initial contribution
22 public class SAMessage extends BasePacket {
24 public enum SAMessageType {
25 SA_WR_LEARNMODE((byte) 0x01, 7),
26 SA_RD_LEARNMODE((byte) 0x02, 1),
27 SA_WR_LEARNCONFIRM((byte) 0x03, 1),
28 SA_WR_CLIENTLEARNRQ((byte) 0x04, 6),
29 SA_WR_RESET((byte) 0x05, 1),
30 SA_RD_LEARNEDCLIENTS((byte) 0x06, 1),
31 SA_WR_RECLAIMS((byte) 0x07, 1),
32 SA_WR_POSTMASTER((byte) 0x08, 2),
33 SA_RD_MAILBOX_STATUS((byte) 0x09, 9);
36 private int dataLength;
38 SAMessageType(byte value, int dataLength) {
40 this.dataLength = dataLength;
43 public byte getValue() {
47 public int getDataLength() {
52 private SAMessageType type;
54 public SAMessage(SAMessageType type) {
55 this(type, new byte[] { type.getValue() });
58 public SAMessage(SAMessageType type, byte[] payload) {
59 super(type.getDataLength(), 0, ESPPacketType.SMART_ACK_COMMAND, payload);
64 public SAMessageType getSAMessageType() {