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.pentair.internal;
16 * Pentair pump status packet specialation of a PentairPacket. Includes public variables for many of the reverse
17 * engineered packet content.
19 * @author Jeff James - initial contribution
22 public class PentairPacketPumpStatus extends PentairPacket { // 15 byte packet format
24 protected static final int RUN = 4 + OFFSET;
25 protected static final int MODE = 5 + OFFSET; // Mode in pump status. Means something else in pump write/response?
26 protected static final int DRIVESTATE = 6 + OFFSET; // ?? Drivestate in pump status. Means something else in pump
28 protected static final int WATTSH = 7 + OFFSET;
29 protected static final int WATTSL = 8 + OFFSET;
30 protected static final int RPMH = 9 + OFFSET;
31 protected static final int RPML = 10 + OFFSET;
32 protected static final int PPC = 11 + OFFSET; // ??
33 protected static final int ERR = 13 + OFFSET;
34 protected static final int TIMER = 14 + OFFSET; // ?? Have to explore
35 protected static final int HOUR = 17 + OFFSET;
36 protected static final int MIN = 18 + OFFSET;
38 /** pump is running */
41 /** pump mode (1-4) */
44 /** pump drivestate - not sure what this specifically represents. */
45 public int drivestate;
46 /** pump power - in KW */
52 /** byte in packet indicating an error condition */
54 /** current timer for pump */
56 /** hour or packet (based on Intelliflo time setting) */
58 /** minute of packet (based on Intelliflo time setting) */
62 * Constructor to create a specialized packet representing the generic packet. Note, the internal buffer array is
64 * duplicated. Fills in public class members appropriate with the correct values.
66 * @param p Generic PentairPacket to create specific Status packet
68 public PentairPacketPumpStatus(PentairPacket p) {
71 run = (buf[RUN] == (byte) 0x0A);
73 drivestate = buf[DRIVESTATE];
74 power = (buf[WATTSH] << 8) + buf[WATTSL];
75 rpm = (buf[RPMH] << 8) + buf[RPML];
84 * Constructure to create an empty status packet
86 public PentairPacketPumpStatus() {