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;
17 * @author Daniel Weber - Initial contribution
19 public class SAMessage extends BasePacket {
21 public enum SAMessageType {
22 SA_WR_LEARNMODE((byte) 0x01, 7),
23 SA_RD_LEARNMODE((byte) 0x02, 1),
24 SA_WR_LEARNCONFIRM((byte) 0x03, 1),
25 SA_WR_CLIENTLEARNRQ((byte) 0x04, 6),
26 SA_WR_RESET((byte) 0x05, 1),
27 SA_RD_LEARNEDCLIENTS((byte) 0x06, 1),
28 SA_WR_RECLAIMS((byte) 0x07, 1),
29 SA_WR_POSTMASTER((byte) 0x08, 2),
30 SA_RD_MAILBOX_STATUS((byte) 0x09, 9);
33 private int dataLength;
35 SAMessageType(byte value, int dataLength) {
37 this.dataLength = dataLength;
40 public byte getValue() {
44 public int getDataLength() {
49 private SAMessageType type;
51 public SAMessage(SAMessageType type) {
52 this(type, new byte[] { type.getValue() });
55 public SAMessage(SAMessageType type, byte[] payload) {
56 super(type.getDataLength(), 0, ESPPacketType.SMART_ACK_COMMAND, payload);
61 public SAMessageType getSAMessageType() {