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 class CCMessage extends BasePacket {
21 public enum CCMessageType {
22 CO_RD_VERSION((byte) 3, 1),
23 CO_WR_IDBASE((byte) 7, 5),
24 CO_RD_IDBASE((byte) 8, 1),
25 CO_WR_REPEATER((byte) 9, 3),
26 CO_RD_REPEATER((byte) 10, 1),
27 CO_RD_SECUREDEVICE_PSK((byte) 0x22, 1),
28 CO_RD_DUTYCYCLE_LIMIT((byte) 0x23, 1),
29 CO_GET_FREQUENCY_INFO((byte) 0x25, 1);
32 private int dataLength;
34 CCMessageType(byte value, int dataLength) {
36 this.dataLength = dataLength;
39 public byte getValue() {
43 public int getDataLength() {
48 private CCMessageType type;
50 public CCMessage(CCMessageType type) {
51 this(type, new byte[] { type.getValue() });
54 public CCMessage(CCMessageType type, byte[] payload) {
55 super(type.getDataLength(), 0, ESPPacketType.COMMON_COMMAND, payload);
60 public CCMessageType getCCMessageType() {