]> git.basschouten.com Git - openhab-addons.git/blob
e08ddfbb6eef257aa0797e24b6c428e53ed4bc1c
[openhab-addons.git] /
1 /**
2  * Copyright (c) 2010-2022 Contributors to the openHAB project
3  *
4  * See the NOTICE file(s) distributed with this work for additional
5  * information.
6  *
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
10  *
11  * SPDX-License-Identifier: EPL-2.0
12  */
13 package org.openhab.binding.velbus.internal.packets;
14
15 import static org.openhab.binding.velbus.internal.VelbusBindingConstants.COMMAND_SENSOR_READOUT_REQUEST;
16
17 import org.eclipse.jdt.annotation.NonNullByDefault;
18
19 /**
20  * The {@link VelbusSensorReadoutRequestPacket} represents a Velbus packet that can be used to
21  * request the value of a sensor channel of the given Velbus module.
22  *
23  * @author Cedric Boon - Initial contribution
24  */
25 @NonNullByDefault
26 public class VelbusSensorReadoutRequestPacket extends VelbusPacket {
27
28     private final byte autosendTimeInterval = 0x00;
29
30     private byte channel;
31
32     public VelbusSensorReadoutRequestPacket(byte address, byte channel) {
33         super(address, PRIO_LOW);
34
35         this.channel = channel;
36     }
37
38     @Override
39     protected byte[] getDataBytes() {
40         return new byte[] { COMMAND_SENSOR_READOUT_REQUEST, channel, autosendTimeInterval };
41     }
42 }