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.bluetooth.daikinmadoka.internal.model.commands;
15 import java.util.concurrent.Executor;
17 import org.eclipse.jdt.annotation.NonNullByDefault;
18 import org.openhab.binding.bluetooth.daikinmadoka.internal.model.MadokaMessage;
19 import org.openhab.binding.bluetooth.daikinmadoka.internal.model.MadokaValue;
20 import org.openhab.core.util.HexUtils;
21 import org.slf4j.Logger;
22 import org.slf4j.LoggerFactory;
25 * This command enable privileged commands on remote device
27 * @author Benjamin Lafois - Initial contribution
31 public class EnterPrivilegedModeCommand extends BRC1HCommand {
33 private final Logger logger = LoggerFactory.getLogger(EnterPrivilegedModeCommand.class);
36 public byte[][] getRequest() {
37 MadokaValue privilegedMode = new MadokaValue(0xfe, 1, new byte[] { (byte) 0x01 });
38 return MadokaMessage.createRequest(this, privilegedMode);
42 public void handleResponse(Executor executor, ResponseListener listener, MadokaMessage mm) {
43 byte[] msg = mm.getRawMessage();
44 if (logger.isDebugEnabled() && msg != null) {
45 logger.debug("Got response for {} : {}", this.getClass().getSimpleName(), HexUtils.bytesToHex(msg));
48 setState(State.SUCCEEDED);
52 public int getCommandId() {