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>endpointWatermarkTxEvent</b>.
21 * This event is generated when the transmit (outgoing) buffer of the endpoint has free space
22 * for a number of bytes equal or higher than the value defined by the command Endpoint Set
23 * Watermarks. When there is enough free space, data can be sent out of the endpoint by the
24 * command Endpoint Tx.
26 * This class provides methods for processing BlueGiga API commands.
28 * Note that this code is autogenerated. Manual changes may be overwritten.
30 * @author Chris Jackson - Initial contribution of Java code generator
33 public class BlueGigaEndpointWatermarkTxEvent extends BlueGigaResponse {
34 public static final int COMMAND_CLASS = 0x00;
35 public static final int COMMAND_METHOD = 0x03;
38 * Endpoint index where data was sent
40 * BlueGiga API type is <i>uint8</i> - Java type is {@link int}
47 * BlueGiga API type is <i>uint8</i> - Java type is {@link int}
54 public BlueGigaEndpointWatermarkTxEvent(int[] inputBuffer) {
55 // Super creates deserializer and reads header fields
58 event = (inputBuffer[0] & 0x80) != 0;
60 // Deserialize the fields
61 endpoint = deserializeUInt8();
62 data = deserializeUInt8();
66 * Endpoint index where data was sent
68 * BlueGiga API type is <i>uint8</i> - Java type is {@link int}
70 * @return the current endpoint as {@link int}
72 public int getEndpoint() {
79 * BlueGiga API type is <i>uint8</i> - Java type is {@link int}
81 * @return the current data as {@link int}
83 public int getData() {
88 public String toString() {
89 final StringBuilder builder = new StringBuilder();
90 builder.append("BlueGigaEndpointWatermarkTxEvent [endpoint=");
91 builder.append(endpoint);
92 builder.append(", data=");
95 return builder.toString();