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.bluegiga.internal.command.system;
15 import org.eclipse.jdt.annotation.NonNullByDefault;
16 import org.openhab.binding.bluetooth.bluegiga.internal.BlueGigaResponse;
19 * Class to implement the BlueGiga command <b>getCounters</b>.
21 * Read packet counters and resets them, also returns available packet buffers.
23 * This class provides methods for processing BlueGiga API commands.
25 * Note that this code is autogenerated. Manual changes may be overwritten.
27 * @author Chris Jackson - Initial contribution of Java code generator
30 public class BlueGigaGetCountersResponse extends BlueGigaResponse {
31 public static int COMMAND_CLASS = 0x00;
32 public static int COMMAND_METHOD = 0x05;
35 * Number of transmitted packets
37 * BlueGiga API type is <i>uint8</i> - Java type is {@link int}
42 * Number of retransmitted packets
44 * BlueGiga API type is <i>uint8</i> - Java type is {@link int}
49 * Number of received packets where CRC was OK
51 * BlueGiga API type is <i>uint8</i> - Java type is {@link int}
56 * Number of received packets with CRC error
58 * BlueGiga API type is <i>uint8</i> - Java type is {@link int}
63 * Number of available packet buffers
65 * BlueGiga API type is <i>uint8</i> - Java type is {@link int}
70 * Response constructor
72 public BlueGigaGetCountersResponse(int[] inputBuffer) {
73 // Super creates deserializer and reads header fields
76 event = (inputBuffer[0] & 0x80) != 0;
78 // Deserialize the fields
79 txok = deserializeUInt8();
80 txretry = deserializeUInt8();
81 rxok = deserializeUInt8();
82 rxfail = deserializeUInt8();
83 mbuf = deserializeUInt8();
87 * Number of transmitted packets
89 * BlueGiga API type is <i>uint8</i> - Java type is {@link int}
91 * @return the current txok as {@link int}
93 public int getTxok() {
98 * Number of retransmitted packets
100 * BlueGiga API type is <i>uint8</i> - Java type is {@link int}
102 * @return the current txretry as {@link int}
104 public int getTxretry() {
109 * Number of received packets where CRC was OK
111 * BlueGiga API type is <i>uint8</i> - Java type is {@link int}
113 * @return the current rxok as {@link int}
115 public int getRxok() {
120 * Number of received packets with CRC error
122 * BlueGiga API type is <i>uint8</i> - Java type is {@link int}
124 * @return the current rxfail as {@link int}
126 public int getRxfail() {
131 * Number of available packet buffers
133 * BlueGiga API type is <i>uint8</i> - Java type is {@link int}
135 * @return the current mbuf as {@link int}
137 public int getMbuf() {
142 public String toString() {
143 final StringBuilder builder = new StringBuilder();
144 builder.append("BlueGigaGetCountersResponse [txok=");
145 builder.append(txok);
146 builder.append(", txretry=");
147 builder.append(txretry);
148 builder.append(", rxok=");
149 builder.append(rxok);
150 builder.append(", rxfail=");
151 builder.append(rxfail);
152 builder.append(", mbuf=");
153 builder.append(mbuf);
155 return builder.toString();