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.ihc.internal.ws.datatypes;
16 * Class for WSRFDevice complex type.
18 * @author Pauli Anttila - Initial contribution
20 public class WSRFDevice {
22 private int batteryLevel;
23 private int deviceType;
24 private long serialNumber;
25 private int signalStrength;
27 private boolean detected;
32 public WSRFDevice(int batteryLevel, int deviceType, long serialNumber, int signalStrength, int version,
34 this.batteryLevel = batteryLevel;
35 this.deviceType = deviceType;
36 this.serialNumber = serialNumber;
37 this.signalStrength = signalStrength;
38 this.version = version;
39 this.detected = detected;
43 * Gets the battery level value for this WSRFDevice.
45 * @return Battery Level
47 public int getBatteryLevel() {
52 * Sets the battery level value for this WSRFDevice.
54 * @param batteryLevel battery level
56 public void setBatteryLevel(int batteryLevel) {
57 this.batteryLevel = batteryLevel;
61 * Gets the device type value for this WSRFDevice.
65 public int getDeviceType() {
70 * Sets the device type value for this WSRFDevice.
72 * @param deviceType device type
74 public void setDeviceType(int deviceType) {
75 this.deviceType = deviceType;
79 * Gets the serial number value for this WSRFDevice.
81 * @return Serial number
83 public long getSerialNumber() {
88 * Sets the serial number value for this WSRFDevice.
90 * @param serialNumber Serial number
92 public void setSerialNumber(long serialNumber) {
93 this.serialNumber = serialNumber;
97 * Gets the signal strength value for this WSRFDevice.
99 * @return Signal strength
101 public int getSignalStrength() {
102 return signalStrength;
106 * Sets the signal strength value for this WSRFDevice.
108 * @param signalStrength Signal strength
110 public void setSignalStrength(int signalStrength) {
111 this.signalStrength = signalStrength;
115 * Gets the version value for this WSRFDevice.
119 public int getVersion() {
124 * Sets the version value for this WSRFDevice.
128 public void setVersion(int version) {
129 this.version = version;
133 * Gets the detected value for this WSRFDevice.
137 public boolean getDetected() {
142 * Sets the detected value for this WSRFDevice.
146 public void setdetected(boolean detected) {
147 this.detected = detected;
151 public String toString() {
152 return String.format(
153 "[ batteryLevel=%d, deviceType=%d, serialNumber=%d, signalStrength=%d, version=%d, detected=%b ]",
154 batteryLevel, deviceType, serialNumber, signalStrength, version, detected);