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 class CCMessage extends BasePacket {
24 public enum CCMessageType {
25 CO_RD_VERSION((byte) 3, 1),
26 CO_WR_IDBASE((byte) 7, 5),
27 CO_RD_IDBASE((byte) 8, 1),
28 CO_WR_REPEATER((byte) 9, 3),
29 CO_RD_REPEATER((byte) 10, 1),
30 CO_RD_SECUREDEVICE_PSK((byte) 0x22, 1),
31 CO_RD_DUTYCYCLE_LIMIT((byte) 0x23, 1),
32 CO_GET_FREQUENCY_INFO((byte) 0x25, 1);
35 private int dataLength;
37 CCMessageType(byte value, int dataLength) {
39 this.dataLength = dataLength;
42 public byte getValue() {
46 public int getDataLength() {
51 private CCMessageType type;
53 public CCMessage(CCMessageType type) {
54 this(type, new byte[] { type.getValue() });
57 public CCMessage(CCMessageType type, byte[] payload) {
58 super(type.getDataLength(), 0, ESPPacketType.COMMON_COMMAND, payload);
63 public CCMessageType getCCMessageType() {