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.gap;
15 import org.eclipse.jdt.annotation.NonNullByDefault;
16 import org.openhab.binding.bluetooth.bluegiga.internal.BlueGigaResponse;
17 import org.openhab.binding.bluetooth.bluegiga.internal.enumeration.BgApiResponse;
20 * Class to implement the BlueGiga command <b>setAdvData</b>.
22 * This commands set advertisement or scan response data used in the advertisement and scan
23 * response packets. The command allows application specific data to be broadcasts either in
24 * advertisement or scan response packets. The data set with this command is only used when the
25 * GAP discoverable mode is set to gap_user_data. Notice that advertisement or scan response
26 * data must be formatted in accordance to the Bluetooth Core Specification. See BLUETOOTH
27 * SPECIFICATION Version 4.0 [Vol 3 - Part C - Chapter 11].
29 * This class provides methods for processing BlueGiga API commands.
31 * Note that this code is autogenerated. Manual changes may be overwritten.
33 * @author Chris Jackson - Initial contribution of Java code generator
36 public class BlueGigaSetAdvDataResponse extends BlueGigaResponse {
37 public static int COMMAND_CLASS = 0x06;
38 public static int COMMAND_METHOD = 0x09;
41 * 0: Command was successfully executed. Non-zero: An error occurred
43 * BlueGiga API type is <i>BgApiResponse</i> - Java type is {@link BgApiResponse}
45 private BgApiResponse result;
48 * Response constructor
50 public BlueGigaSetAdvDataResponse(int[] inputBuffer) {
51 // Super creates deserializer and reads header fields
54 event = (inputBuffer[0] & 0x80) != 0;
56 // Deserialize the fields
57 result = deserializeBgApiResponse();
61 * 0: Command was successfully executed. Non-zero: An error occurred
63 * BlueGiga API type is <i>BgApiResponse</i> - Java type is {@link BgApiResponse}
65 * @return the current result as {@link BgApiResponse}
67 public BgApiResponse getResult() {
72 public String toString() {
73 final StringBuilder builder = new StringBuilder();
74 builder.append("BlueGigaSetAdvDataResponse [result=");
75 builder.append(result);
77 return builder.toString();