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.plugwise.internal.protocol;
15 import static org.openhab.binding.plugwise.internal.protocol.field.MessageType.POWER_BUFFER_REQUEST;
17 import org.openhab.binding.plugwise.internal.protocol.field.MACAddress;
20 * Requests the historical pulse measurements at a certain log address from a device (Circle, Circle+, Stealth). This
21 * message is answered by a {@link PowerBufferResponseMessage}.
23 * @author Wouter Born, Karel Goderis - Initial contribution
25 public class PowerBufferRequestMessage extends Message {
27 private int logAddress;
29 public PowerBufferRequestMessage(MACAddress macAddress, int logAddress) {
30 super(POWER_BUFFER_REQUEST, macAddress);
31 this.logAddress = logAddress;
35 protected String payloadToHexString() {
36 return String.format("%08X", (logAddress * 32 + 278528));