+ * The handler provides the serial interface to the dongle via the BlueGiga BG-API library. + *
+ * In the BlueGiga dongle, we leave scanning enabled most of the time. Normally, it's just passive scanning, and active
+ * scanning is enabled when we want to include new devices. Passive scanning is enough for us to receive beacons etc
+ * that are transmitted periodically, and active scanning will get more information which may be useful when we are
+ * including new devices.
+ *
+ * @author Chris Jackson - Initial contribution
+ * @author Kai Kreuzer - Made handler implement BlueGigaHandlerListener
+ */
+@NonNullByDefault({ DefaultLocation.PARAMETER, DefaultLocation.RETURN_TYPE, DefaultLocation.ARRAY_CONTENTS,
+ DefaultLocation.TYPE_ARGUMENT, DefaultLocation.TYPE_BOUND, DefaultLocation.TYPE_PARAMETER })
+public class BlueGigaBridgeHandler extends BaseBridgeHandler
+ implements BluetoothAdapter, BlueGigaEventListener, BlueGigaHandlerListener {
+
+ private final Logger logger = LoggerFactory.getLogger(BlueGigaBridgeHandler.class);
+
+ // The serial port.
+ private SerialPort serialPort;
+
+ // The serial port input stream.
+ private InputStream inputStream;
+
+ // The serial port output stream.
+ private OutputStream outputStream;
+
+ // The BlueGiga API handler
+ private BlueGigaSerialHandler bgHandler;
+
+ // The maximum number of connections this interface supports
+ private int maxConnections = 0;
+
+ private final int passiveScanInterval = 0x40;
+ private final int passiveScanWindow = 0x08;
+
+ private final int activeScanInterval = 0x40;
+ private final int activeScanWindow = 0x20;
+
+ // Our BT address
+ private BluetoothAddress address;
+
+ // internal flag for the discovery configuration
+ private boolean discoveryActive = true;
+
+ // Map of Bluetooth devices known to this bridge.
+ // This is all devices we have heard on the network - not just things bound to the bridge
+ private final Map
+ * If the device is already connected, or the attempt to connect failed, then we return false. If we have reached
+ * the maximum number of connections supported by this dongle, then we return false.
+ *
+ * @param address the device {@link BluetoothAddress} to connect to
+ * @param addressType the {@link BluetoothAddressType} of the device
+ * @return true if the connection was started
+ */
+ public boolean bgConnect(BluetoothAddress address, BluetoothAddressType addressType) {
+ // Check the connection to make sure we're not already connected to this device
+ if (connections.containsValue(address)) {
+ return false;
+ }
+
+ // FIXME: When getting here, I always found all connections to be already taken and thus the code never
+ // proceeded. Relaxing this condition did not do any obvious harm, but now guaranteed that the services are
+ // queried from the device.
+ if (connections.size() == maxConnections + 1) {
+ logger.debug("BlueGiga: Attempt to connect to {} but no connections available.", address);
+ return false;
+ }
+
+ bgSetMode();
+
+ // Connect...
+ int connIntervalMin = 60;
+ int connIntervalMax = 100;
+ int latency = 0;
+ int timeout = 100;
+
+ BlueGigaConnectDirectCommand connect = new BlueGigaConnectDirectCommand();
+ connect.setAddress(address.toString());
+ connect.setAddrType(addressType);
+ connect.setConnIntervalMin(connIntervalMin);
+ connect.setConnIntervalMax(connIntervalMax);
+ connect.setLatency(latency);
+ connect.setTimeout(timeout);
+ BlueGigaConnectDirectResponse connectResponse = (BlueGigaConnectDirectResponse) bgHandler
+ .sendTransaction(connect);
+ if (connectResponse.getResult() != BgApiResponse.SUCCESS) {
+ return false;
+ }
+
+ return true;
+ }
+
+ /**
+ * Close a connection using {@link BlueGigaDisconnectCommand}
+ *
+ * @param connectionHandle
+ * @return
+ */
+ public boolean bgDisconnect(int connectionHandle) {
+ BlueGigaDisconnectCommand command = new BlueGigaDisconnectCommand();
+ command.setConnection(connectionHandle);
+ BlueGigaDisconnectResponse response = (BlueGigaDisconnectResponse) bgHandler.sendTransaction(command);
+
+ return response.getResult() == BgApiResponse.SUCCESS;
+ }
+
+ /**
+ * Device discovered. This simply passes the discover information to the discovery service for processing.
+ */
+ public void deviceDiscovered(BluetoothDevice device) {
+ if (discoveryActive) {
+ for (BluetoothDiscoveryListener listener : discoveryListeners) {
+ listener.deviceDiscovered(device);
+ }
+ }
+ }
+
+ /**
+ * Start a read of all primary services using {@link BlueGigaReadByGroupTypeCommand}
+ *
+ * @param connectionHandle
+ * @return true if successful
+ */
+ public boolean bgFindPrimaryServices(int connectionHandle) {
+ logger.debug("BlueGiga FindPrimary: connection {}", connectionHandle);
+ BlueGigaReadByGroupTypeCommand command = new BlueGigaReadByGroupTypeCommand();
+ command.setConnection(connectionHandle);
+ command.setStart(1);
+ command.setEnd(65535);
+ command.setUuid(UUID.fromString("00002800-0000-0000-0000-000000000000"));
+ BlueGigaReadByGroupTypeResponse response = (BlueGigaReadByGroupTypeResponse) bgHandler.sendTransaction(command);
+ return response.getResult() == BgApiResponse.SUCCESS;
+ }
+
+ /**
+ * Start a read of all characteristics using {@link BlueGigaFindInformationCommand}
+ *
+ * @param connectionHandle
+ * @return true if successful
+ */
+ public boolean bgFindCharacteristics(int connectionHandle) {
+ logger.debug("BlueGiga Find: connection {}", connectionHandle);
+ BlueGigaFindInformationCommand command = new BlueGigaFindInformationCommand();
+ command.setConnection(connectionHandle);
+ command.setStart(1);
+ command.setEnd(65535);
+ BlueGigaFindInformationResponse response = (BlueGigaFindInformationResponse) bgHandler.sendTransaction(command);
+
+ return response.getResult() == BgApiResponse.SUCCESS;
+ }
+
+ /**
+ * Read a characteristic using {@link BlueGigaReadByHandleCommand}
+ *
+ * @param connectionHandle
+ * @param handle
+ * @return true if successful
+ */
+ public boolean bgReadCharacteristic(int connectionHandle, int handle) {
+ logger.debug("BlueGiga Read: connection {}, handle {}", connectionHandle, handle);
+ BlueGigaReadByHandleCommand command = new BlueGigaReadByHandleCommand();
+ command.setConnection(connectionHandle);
+ command.setChrHandle(handle);
+ BlueGigaReadByHandleResponse response = (BlueGigaReadByHandleResponse) bgHandler.sendTransaction(command);
+
+ return response.getResult() == BgApiResponse.SUCCESS;
+ }
+
+ /**
+ * Write a characteristic using {@link BlueGigaAttributeWriteCommand}
+ *
+ * @param connectionHandle
+ * @param handle
+ * @param value
+ * @return true if successful
+ */
+ public boolean bgWriteCharacteristic(int connectionHandle, int handle, int[] value) {
+ logger.debug("BlueGiga Write: connection {}, handle {}", connectionHandle, handle);
+ BlueGigaAttributeWriteCommand command = new BlueGigaAttributeWriteCommand();
+ command.setConnection(connectionHandle);
+ command.setAttHandle(handle);
+ command.setData(value);
+ BlueGigaAttributeWriteResponse response = (BlueGigaAttributeWriteResponse) bgHandler.sendTransaction(command);
+
+ return response.getResult() == BgApiResponse.SUCCESS;
+ }
+
+ /*
+ * The following methods are private methods for handling the BlueGiga protocol
+ */
+ private boolean bgStopProcedure() {
+ BlueGigaCommand command = new BlueGigaEndProcedureCommand();
+ BlueGigaEndProcedureResponse response = (BlueGigaEndProcedureResponse) bgHandler.sendTransaction(command);
+
+ return response.getResult() == BgApiResponse.SUCCESS;
+ }
+
+ private boolean bgSetMode() {
+ BlueGigaSetModeCommand command = new BlueGigaSetModeCommand();
+ command.setConnect(GapConnectableMode.GAP_NON_CONNECTABLE);
+ command.setDiscover(GapDiscoverableMode.GAP_NON_DISCOVERABLE);
+ BlueGigaSetModeResponse response = (BlueGigaSetModeResponse) bgHandler.sendTransaction(command);
+
+ return response.getResult() == BgApiResponse.SUCCESS;
+ }
+
+ /**
+ * Starts scanning on the dongle
+ *
+ * @param active true for active scanning
+ */
+ private void bgStartScanning(boolean active, int interval, int window) {
+ BlueGigaSetScanParametersCommand scanCommand = new BlueGigaSetScanParametersCommand();
+ scanCommand.setActiveScanning(active);
+ scanCommand.setScanInterval(interval);
+ scanCommand.setScanWindow(window);
+ bgHandler.sendTransaction(scanCommand);
+
+ BlueGigaDiscoverCommand discoverCommand = new BlueGigaDiscoverCommand();
+ discoverCommand.setMode(GapDiscoverMode.GAP_DISCOVER_OBSERVATION);
+ bgHandler.sendTransaction(discoverCommand);
+ }
+
+ /**
+ * Add an event listener for the BlueGiga events
+ *
+ * @param listener the {@link BlueGigaEventListener} to add
+ */
+ public void addEventListener(BlueGigaEventListener listener) {
+ bgHandler.addEventListener(listener);
+ }
+
+ /**
+ * Remove an event listener for the BlueGiga events
+ *
+ * @param listener the {@link BlueGigaEventListener} to remove
+ */
+ public void removeEventListener(BlueGigaEventListener listener) {
+ bgHandler.removeEventListener(listener);
+ }
+
+ @Override
+ public void addDiscoveryListener(@NonNull BluetoothDiscoveryListener listener) {
+ discoveryListeners.add(listener);
+ }
+
+ @Override
+ public void removeDiscoveryListener(@Nullable BluetoothDiscoveryListener listener) {
+ discoveryListeners.remove(listener);
+ }
+
+ @Override
+ public void bluegigaClosed(Exception reason) {
+ updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR, reason.getMessage());
+ }
+
+}
diff --git a/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/BlueGigaCommand.java b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/BlueGigaCommand.java
new file mode 100644
index 00000000000..75dc9c7654c
--- /dev/null
+++ b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/BlueGigaCommand.java
@@ -0,0 +1,147 @@
+/**
+ * Copyright (c) 2014,2017 Contributors to the Eclipse Foundation
+ *
+ * See the NOTICE file(s) distributed with this work for additional
+ * information regarding copyright ownership.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ */
+package org.eclipse.smarthome.binding.bluetooth.bluegiga.internal;
+
+import java.util.Arrays;
+import java.util.UUID;
+
+import org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.enumeration.BluetoothAddressType;
+import org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.enumeration.GapConnectableMode;
+import org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.enumeration.GapDiscoverMode;
+import org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.enumeration.GapDiscoverableMode;
+import org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.enumeration.SmpIoCapabilities;
+
+/**
+ * Abstract base class for all commands. This provides the serialisation methods for converting parameters from Java
+ * classes to wire data.
+ *
+ * @author Chris Jackson
+ *
+ */
+public abstract class BlueGigaCommand extends BlueGigaPacket {
+ protected int[] buffer = new int[131];
+ protected int length = 0;
+
+ protected void serializeHeader(int classId, int commandId) {
+ // Octet 0 7 1 bit Message Type (MT) 0: Command
+ // -------6:3 4 bits Technology Type (TT) 0000: Smart Bluetooth
+ // -------2:0 3 bits Length High (LH) Payload length (high bits)
+ buffer[length++] = 0;
+
+ // Octet 1 7:0 8 bits Length Low (LL) Payload length (low bits)
+ buffer[length++] = 0;
+
+ // Octet 2 7:0 8 bits Class ID (CID) Command class ID
+ buffer[length++] = classId;
+
+ // Octet 3 7:0 8 bits Command ID (CMD) Command ID
+ buffer[length++] = commandId;
+ }
+
+ /**
+ * Adds a uint8 into the output stream
+ *
+ * @param val
+ */
+ protected void serializeUInt8(int val) {
+ buffer[length++] = val & 0xFF;
+ }
+
+ protected void serializeBoolean(boolean val) {
+ buffer[length++] = val ? 1 : 0;
+ }
+
+ /**
+ * Adds a uint16 into the output stream
+ *
+ * @param val
+ */
+ protected void serializeUInt16(int val) {
+ buffer[length++] = val & 0xFF;
+ buffer[length++] = (val >> 8) & 0xFF;
+ }
+
+ /**
+ * Adds a uint32 into the output stream
+ *
+ * @param passkey
+ */
+ protected void serializeUInt32(long passkey) {
+ buffer[length++] = (int) (passkey & 0xFF);
+ buffer[length++] = (int) ((passkey >> 8) & 0xFF);
+ buffer[length++] = (int) ((passkey >> 16) & 0xFF);
+ buffer[length++] = (int) ((passkey >> 24) & 0xFF);
+ }
+
+ protected void serializeUInt8Array(int[] array) {
+ serializeUInt8(array.length);
+
+ for (int val : array) {
+ serializeUInt8(val);
+ }
+ }
+
+ protected void serializeUuid(UUID uuid) {
+ // TODO this probably needs to support longer UUIDs?
+ buffer[length++] = 2;
+ long high = uuid.getMostSignificantBits();
+
+ buffer[length++] = (int) ((high >> 32) & 0xff);
+ buffer[length++] = (int) ((high >> 40) & 0xff);
+ }
+
+ protected void serializeAddress(String address) {
+ String[] bytes = address.split(":");
+ if (bytes.length == 0) {
+ serializeUInt8(0);
+ serializeUInt8(0);
+ serializeUInt8(0);
+ serializeUInt8(0);
+ serializeUInt8(0);
+ serializeUInt8(0);
+
+ return;
+ }
+
+ for (int cnt = 5; cnt >= 0; cnt--) {
+ serializeUInt8(Integer.parseInt(bytes[cnt], 16));
+ }
+ }
+
+ protected void serializeSmpIoCapabilities(SmpIoCapabilities capabilities) {
+ serializeUInt8(capabilities.getKey());
+ }
+
+ protected void serializeBluetoothAddressType(BluetoothAddressType addrType) {
+ serializeUInt8(addrType.getKey());
+ }
+
+ protected void serializeGapDiscoverableMode(GapDiscoverableMode mode) {
+ serializeUInt8(mode.getKey());
+ }
+
+ protected void serializeGapConnectableMode(GapConnectableMode mode) {
+ serializeUInt8(mode.getKey());
+ }
+
+ protected void serializeGapDiscoverMode(GapDiscoverMode mode) {
+ serializeUInt8(mode.getKey());
+ }
+
+ protected int[] getPayload() {
+ buffer[1] = length - 4;
+ return Arrays.copyOfRange(buffer, 0, length);
+ }
+
+ public abstract int[] serialize();
+}
diff --git a/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/BlueGigaEventListener.java b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/BlueGigaEventListener.java
new file mode 100644
index 00000000000..c570db4172d
--- /dev/null
+++ b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/BlueGigaEventListener.java
@@ -0,0 +1,27 @@
+/**
+ * Copyright (c) 2014,2017 Contributors to the Eclipse Foundation
+ *
+ * See the NOTICE file(s) distributed with this work for additional
+ * information regarding copyright ownership.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ */
+package org.eclipse.smarthome.binding.bluetooth.bluegiga.internal;
+
+/**
+ *
+ * @author Chris Jackson
+ *
+ */
+public interface BlueGigaEventListener {
+ /**
+ * Called when an event is received
+ *
+ * @param event the {@link BlueGigaResponse} just received
+ */
+ void bluegigaEventReceived(BlueGigaResponse event);
+}
diff --git a/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/BlueGigaHandlerListener.java b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/BlueGigaHandlerListener.java
new file mode 100644
index 00000000000..a3cc6ae1584
--- /dev/null
+++ b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/BlueGigaHandlerListener.java
@@ -0,0 +1,32 @@
+/**
+ * Copyright (c) 2014,2017 Contributors to the Eclipse Foundation
+ *
+ * See the NOTICE file(s) distributed with this work for additional
+ * information regarding copyright ownership.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ */
+package org.eclipse.smarthome.binding.bluetooth.bluegiga.internal;
+
+import org.eclipse.jdt.annotation.NonNullByDefault;
+
+/**
+ * A listener to track {@link BlueGigaSerialHandler} life cycle events.
+ *
+ * @author Chris Jackson - Initial contribution and API
+ */
+@NonNullByDefault
+public interface BlueGigaHandlerListener {
+
+ /**
+ * Notifies when the handler gets closed because of the reason specified as an argument.
+ *
+ * @param reason a reason caused to be closed
+ */
+ void bluegigaClosed(Exception reason);
+
+}
diff --git a/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/BlueGigaPacket.java b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/BlueGigaPacket.java
new file mode 100644
index 00000000000..b766471e6fe
--- /dev/null
+++ b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/BlueGigaPacket.java
@@ -0,0 +1,23 @@
+/**
+ * Copyright (c) 2014,2017 Contributors to the Eclipse Foundation
+ *
+ * See the NOTICE file(s) distributed with this work for additional
+ * information regarding copyright ownership.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ */
+package org.eclipse.smarthome.binding.bluetooth.bluegiga.internal;
+
+/**
+ * Base class from which both commands and responses (and events) are derived.
+ *
+ * @author Chris Jackson
+ *
+ */
+public class BlueGigaPacket {
+
+}
diff --git a/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/BlueGigaResponse.java b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/BlueGigaResponse.java
new file mode 100644
index 00000000000..0775a5ae0b8
--- /dev/null
+++ b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/BlueGigaResponse.java
@@ -0,0 +1,185 @@
+/**
+ * Copyright (c) 2014,2017 Contributors to the Eclipse Foundation
+ *
+ * See the NOTICE file(s) distributed with this work for additional
+ * information regarding copyright ownership.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ */
+package org.eclipse.smarthome.binding.bluetooth.bluegiga.internal;
+
+import java.util.HashSet;
+import java.util.Set;
+import java.util.UUID;
+
+import org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.enumeration.AttributeChangeReason;
+import org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.enumeration.AttributeValueType;
+import org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.enumeration.BgApiResponse;
+import org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.enumeration.BluetoothAddressType;
+import org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.enumeration.ConnectionStatusFlag;
+import org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.enumeration.ScanResponseType;
+
+/**
+ * Abstract class for response and event packets. This provides the deserialization methods to convert wire data to Java
+ * classes.
+ *
+ * @author Chris Jackson
+ *
+ */
+public class BlueGigaResponse extends BlueGigaPacket {
+ private int[] buffer = new int[131];
+ private int position = 0;
+ protected boolean event = false;
+
+ protected BlueGigaResponse(int[] inputBuffer) {
+ // TODO Auto-generated constructor stub
+ buffer = inputBuffer;
+ position = 4;
+ }
+
+ /**
+ * Returns true if this response is an event, or false if it is a response to a command
+ *
+ * @return true if this is an event
+ */
+ public boolean isEvent() {
+ return event;
+ }
+
+ /**
+ * Reads a int8 from the output stream
+ *
+ * @return value read from input
+ */
+ protected int deserializeInt8() {
+ if (buffer[position] >= 128) {
+ return buffer[position++] - 256;
+ } else {
+ return buffer[position++];
+ }
+ }
+
+ /**
+ * Reads a uint8 from the output stream
+ *
+ * @return value read from input
+ */
+ protected int deserializeUInt8() {
+ return buffer[position++];
+ }
+
+ protected boolean deserializeBoolean() {
+ return buffer[position++] != 0;
+ }
+
+ /**
+ * Reads a uint16 from the output stream
+ *
+ * @return value read from input
+ */
+ protected int deserializeUInt16() {
+ return buffer[position++] + (buffer[position++] << 8);
+ }
+
+ protected UUID deserializeUuid() {
+ long low;
+ long high;
+
+ // This is a uint8array type so first byte is the length
+ int length = buffer[position++];
+ switch (length) {
+ case 2:
+ low = 0;
+ high = ((long) buffer[position++] << 32) + ((long) buffer[position++] << 40);
+ break;
+ case 4:
+ low = 0;
+ high = ((long) buffer[position++] << 32) + ((long) buffer[position++] << 40)
+ + ((long) buffer[position++] << 48) + ((long) buffer[position++] << 56);
+ break;
+ case 16:
+ low = (buffer[position++]) + ((long) buffer[position++] << 8) + ((long) buffer[position++] << 16)
+ + ((long) buffer[position++] << 24) + ((long) buffer[position++] << 32)
+ + ((long) buffer[position++] << 40) + ((long) buffer[position++] << 48)
+ + ((long) buffer[position++] << 56);
+ high = (buffer[position++]) + ((long) buffer[position++] << 8) + ((long) buffer[position++] << 16)
+ + ((long) buffer[position++] << 24) + ((long) buffer[position++] << 32)
+ + ((long) buffer[position++] << 40) + ((long) buffer[position++] << 48)
+ + ((long) buffer[position++] << 56);
+ break;
+ default:
+ low = 0;
+ high = 0;
+ position += length;
+ break;
+ }
+ return new UUID(high, low);
+ }
+
+ protected BgApiResponse deserializeBgApiResponse() {
+ return BgApiResponse.getBgApiResponse(deserializeUInt16());
+ }
+
+ public Set
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ *
+ * @author Chris Jackson - Initial contribution of Java code generator
+ */
+class BlueGigaResponsePackets {
+
+ private static Logger logger = LoggerFactory.getLogger(BlueGigaResponsePackets.class);
+
+ final private static Map
+ * This event is produced at the GATT client side when an attribute value is passed from the GATT
+ * server to the GATT client. This event is for example produced after a successful Read by
+ * Handle operation or when an attribute is indicated or notified by the remote device.
+ *
+ * This class provides methods for processing BlueGiga API commands.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ *
+ * @author Chris Jackson - Initial contribution of Java code generator
+ */
+public class BlueGigaAttributeValueEvent extends BlueGigaResponse {
+ public static int COMMAND_CLASS = 0x04;
+ public static int COMMAND_METHOD = 0x05;
+
+ /**
+ * Connection handle
+ *
+ * BlueGiga API type is uint8 - Java type is {@link int}
+ */
+ private int connection;
+
+ /**
+ * Attribute handle
+ *
+ * BlueGiga API type is uint16 - Java type is {@link int}
+ */
+ private int attHandle;
+
+ /**
+ * Attribute type
+ *
+ * BlueGiga API type is AttributeValueType - Java type is {@link AttributeValueType}
+ */
+ private AttributeValueType type;
+
+ /**
+ * Attribute value (data)
+ *
+ * BlueGiga API type is uint8array - Java type is {@link int[]}
+ */
+ private int[] value;
+
+ /**
+ * Event constructor
+ */
+ public BlueGigaAttributeValueEvent(int[] inputBuffer) {
+ // Super creates deserializer and reads header fields
+ super(inputBuffer);
+
+ event = (inputBuffer[0] & 0x80) != 0;
+
+ // Deserialize the fields
+ connection = deserializeUInt8();
+ attHandle = deserializeUInt16();
+ type = deserializeAttributeValueType();
+ value = deserializeUInt8Array();
+ }
+
+ /**
+ * Connection handle
+ *
+ * BlueGiga API type is uint8 - Java type is {@link int}
+ *
+ * @return the current connection as {@link int}
+ */
+ public int getConnection() {
+ return connection;
+ }
+ /**
+ * Attribute handle
+ *
+ * BlueGiga API type is uint16 - Java type is {@link int}
+ *
+ * @return the current att_handle as {@link int}
+ */
+ public int getAttHandle() {
+ return attHandle;
+ }
+ /**
+ * Attribute type
+ *
+ * BlueGiga API type is AttributeValueType - Java type is {@link AttributeValueType}
+ *
+ * @return the current type as {@link AttributeValueType}
+ */
+ public AttributeValueType getType() {
+ return type;
+ }
+ /**
+ * Attribute value (data)
+ *
+ * BlueGiga API type is uint8array - Java type is {@link int[]}
+ *
+ * @return the current value as {@link int[]}
+ */
+ public int[] getValue() {
+ return value;
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder builder = new StringBuilder();
+ builder.append("BlueGigaAttributeValueEvent [connection=");
+ builder.append(connection);
+ builder.append(", attHandle=");
+ builder.append(attHandle);
+ builder.append(", type=");
+ builder.append(type);
+ builder.append(", value=");
+ for (int c = 0; c < value.length; c++) {
+ if (c > 0) {
+ builder.append(' ');
+ }
+ builder.append(String.format("%02X", value[c]));
+ }
+ builder.append(']');
+ return builder.toString();
+ }
+}
diff --git a/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaAttributeWriteCommand.java b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaAttributeWriteCommand.java
new file mode 100644
index 00000000000..3a13d3fa728
--- /dev/null
+++ b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaAttributeWriteCommand.java
@@ -0,0 +1,110 @@
+/**
+ * Copyright (c) 2014,2017 Contributors to the Eclipse Foundation
+ *
+ * See the NOTICE file(s) distributed with this work for additional
+ * information regarding copyright ownership.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ */
+package org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.command.attributeclient;
+
+import org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.BlueGigaCommand;
+
+/**
+ * Class to implement the BlueGiga command attributeWrite.
+ *
+ * This command can be used to write an attributes value on a remote device. In order to write the
+ * value of an attribute a connection must exists and you need to know the handle of the attribute
+ * you want to write
+ *
+ * This class provides methods for processing BlueGiga API commands.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ *
+ * @author Chris Jackson - Initial contribution of Java code generator
+ */
+public class BlueGigaAttributeWriteCommand extends BlueGigaCommand {
+ public static int COMMAND_CLASS = 0x04;
+ public static int COMMAND_METHOD = 0x05;
+
+ /**
+ * Connection handle
+ *
+ * BlueGiga API type is uint8 - Java type is {@link int}
+ */
+ private int connection;
+
+ /**
+ * Attribute handle to write to
+ *
+ * BlueGiga API type is uint16 - Java type is {@link int}
+ */
+ private int attHandle;
+
+ /**
+ * Attribute value
+ *
+ * BlueGiga API type is uint8array - Java type is {@link int[]}
+ */
+ private int[] data;
+
+ /**
+ * Connection handle
+ *
+ * @param connection the connection to set as {@link int}
+ */
+ public void setConnection(int connection) {
+ this.connection = connection;
+ }
+ /**
+ * Attribute handle to write to
+ *
+ * @param attHandle the attHandle to set as {@link int}
+ */
+ public void setAttHandle(int attHandle) {
+ this.attHandle = attHandle;
+ }
+ /**
+ * Attribute value
+ *
+ * @param data the data to set as {@link int[]}
+ */
+ public void setData(int[] data) {
+ this.data = data;
+ }
+
+ @Override
+ public int[] serialize() {
+ // Serialize the header
+ serializeHeader(COMMAND_CLASS, COMMAND_METHOD);
+
+ // Serialize the fields
+ serializeUInt8(connection);
+ serializeUInt16(attHandle);
+ serializeUInt8Array(data);
+
+ return getPayload();
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder builder = new StringBuilder();
+ builder.append("BlueGigaAttributeWriteCommand [connection=");
+ builder.append(connection);
+ builder.append(", attHandle=");
+ builder.append(attHandle);
+ builder.append(", data=");
+ for (int c = 0; c < data.length; c++) {
+ if (c > 0) {
+ builder.append(' ');
+ }
+ builder.append(String.format("%02X", data[c]));
+ }
+ builder.append(']');
+ return builder.toString();
+ }
+}
diff --git a/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaAttributeWriteResponse.java b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaAttributeWriteResponse.java
new file mode 100644
index 00000000000..7c4f9a53a11
--- /dev/null
+++ b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaAttributeWriteResponse.java
@@ -0,0 +1,94 @@
+/**
+ * Copyright (c) 2014,2017 Contributors to the Eclipse Foundation
+ *
+ * See the NOTICE file(s) distributed with this work for additional
+ * information regarding copyright ownership.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ */
+package org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.command.attributeclient;
+
+import org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.BlueGigaResponse;
+import org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.enumeration.BgApiResponse;
+
+/**
+ * Class to implement the BlueGiga command attributeWrite.
+ *
+ * This command can be used to write an attributes value on a remote device. In order to write the
+ * value of an attribute a connection must exists and you need to know the handle of the attribute
+ * you want to write
+ *
+ * This class provides methods for processing BlueGiga API commands.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ *
+ * @author Chris Jackson - Initial contribution of Java code generator
+ */
+public class BlueGigaAttributeWriteResponse extends BlueGigaResponse {
+ public static int COMMAND_CLASS = 0x04;
+ public static int COMMAND_METHOD = 0x05;
+
+ /**
+ * Connection handle
+ *
+ * BlueGiga API type is uint8 - Java type is {@link int}
+ */
+ private int connection;
+
+ /**
+ * 0 : write was successful. Otherwise error occurred
+ *
+ * BlueGiga API type is BgApiResponse - Java type is {@link BgApiResponse}
+ */
+ private BgApiResponse result;
+
+ /**
+ * Response constructor
+ */
+ public BlueGigaAttributeWriteResponse(int[] inputBuffer) {
+ // Super creates deserializer and reads header fields
+ super(inputBuffer);
+
+ event = (inputBuffer[0] & 0x80) != 0;
+
+ // Deserialize the fields
+ connection = deserializeUInt8();
+ result = deserializeBgApiResponse();
+ }
+
+ /**
+ * Connection handle
+ *
+ * BlueGiga API type is uint8 - Java type is {@link int}
+ *
+ * @return the current connection as {@link int}
+ */
+ public int getConnection() {
+ return connection;
+ }
+ /**
+ * 0 : write was successful. Otherwise error occurred
+ *
+ * BlueGiga API type is BgApiResponse - Java type is {@link BgApiResponse}
+ *
+ * @return the current result as {@link BgApiResponse}
+ */
+ public BgApiResponse getResult() {
+ return result;
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder builder = new StringBuilder();
+ builder.append("BlueGigaAttributeWriteResponse [connection=");
+ builder.append(connection);
+ builder.append(", result=");
+ builder.append(result);
+ builder.append(']');
+ return builder.toString();
+ }
+}
diff --git a/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaExecuteWriteCommand.java b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaExecuteWriteCommand.java
new file mode 100644
index 00000000000..4c737aac841
--- /dev/null
+++ b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaExecuteWriteCommand.java
@@ -0,0 +1,86 @@
+/**
+ * Copyright (c) 2014,2017 Contributors to the Eclipse Foundation
+ *
+ * See the NOTICE file(s) distributed with this work for additional
+ * information regarding copyright ownership.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ */
+package org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.command.attributeclient;
+
+import org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.BlueGigaCommand;
+
+/**
+ * Class to implement the BlueGiga command executeWrite.
+ *
+ * This command can be used to execute or cancel a previously queued prepare_write command on a
+ * remote device
+ *
+ * This class provides methods for processing BlueGiga API commands.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ *
+ * @author Chris Jackson - Initial contribution of Java code generator
+ */
+public class BlueGigaExecuteWriteCommand extends BlueGigaCommand {
+ public static int COMMAND_CLASS = 0x04;
+ public static int COMMAND_METHOD = 0x0A;
+
+ /**
+ * Connection handle
+ *
+ * BlueGiga API type is uint8 - Java type is {@link int}
+ */
+ private int connection;
+
+ /**
+ * 1: commits queued writes, 0: cancels queued writes
+ *
+ * BlueGiga API type is uint8 - Java type is {@link int}
+ */
+ private int commit;
+
+ /**
+ * Connection handle
+ *
+ * @param connection the connection to set as {@link int}
+ */
+ public void setConnection(int connection) {
+ this.connection = connection;
+ }
+ /**
+ * 1: commits queued writes, 0: cancels queued writes
+ *
+ * @param commit the commit to set as {@link int}
+ */
+ public void setCommit(int commit) {
+ this.commit = commit;
+ }
+
+ @Override
+ public int[] serialize() {
+ // Serialize the header
+ serializeHeader(COMMAND_CLASS, COMMAND_METHOD);
+
+ // Serialize the fields
+ serializeUInt8(connection);
+ serializeUInt8(commit);
+
+ return getPayload();
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder builder = new StringBuilder();
+ builder.append("BlueGigaExecuteWriteCommand [connection=");
+ builder.append(connection);
+ builder.append(", commit=");
+ builder.append(commit);
+ builder.append(']');
+ return builder.toString();
+ }
+}
diff --git a/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaExecuteWriteResponse.java b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaExecuteWriteResponse.java
new file mode 100644
index 00000000000..0e6f24d4820
--- /dev/null
+++ b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaExecuteWriteResponse.java
@@ -0,0 +1,93 @@
+/**
+ * Copyright (c) 2014,2017 Contributors to the Eclipse Foundation
+ *
+ * See the NOTICE file(s) distributed with this work for additional
+ * information regarding copyright ownership.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ */
+package org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.command.attributeclient;
+
+import org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.BlueGigaResponse;
+import org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.enumeration.BgApiResponse;
+
+/**
+ * Class to implement the BlueGiga command executeWrite.
+ *
+ * This command can be used to execute or cancel a previously queued prepare_write command on a
+ * remote device
+ *
+ * This class provides methods for processing BlueGiga API commands.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ *
+ * @author Chris Jackson - Initial contribution of Java code generator
+ */
+public class BlueGigaExecuteWriteResponse extends BlueGigaResponse {
+ public static int COMMAND_CLASS = 0x04;
+ public static int COMMAND_METHOD = 0x0A;
+
+ /**
+ * Connection handle
+ *
+ * BlueGiga API type is uint8 - Java type is {@link int}
+ */
+ private int connection;
+
+ /**
+ * 0 : write was successful. Otherwise error occurred
+ *
+ * BlueGiga API type is BgApiResponse - Java type is {@link BgApiResponse}
+ */
+ private BgApiResponse result;
+
+ /**
+ * Response constructor
+ */
+ public BlueGigaExecuteWriteResponse(int[] inputBuffer) {
+ // Super creates deserializer and reads header fields
+ super(inputBuffer);
+
+ event = (inputBuffer[0] & 0x80) != 0;
+
+ // Deserialize the fields
+ connection = deserializeUInt8();
+ result = deserializeBgApiResponse();
+ }
+
+ /**
+ * Connection handle
+ *
+ * BlueGiga API type is uint8 - Java type is {@link int}
+ *
+ * @return the current connection as {@link int}
+ */
+ public int getConnection() {
+ return connection;
+ }
+ /**
+ * 0 : write was successful. Otherwise error occurred
+ *
+ * BlueGiga API type is BgApiResponse - Java type is {@link BgApiResponse}
+ *
+ * @return the current result as {@link BgApiResponse}
+ */
+ public BgApiResponse getResult() {
+ return result;
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder builder = new StringBuilder();
+ builder.append("BlueGigaExecuteWriteResponse [connection=");
+ builder.append(connection);
+ builder.append(", result=");
+ builder.append(result);
+ builder.append(']');
+ return builder.toString();
+ }
+}
diff --git a/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaFindByTypeValueCommand.java b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaFindByTypeValueCommand.java
new file mode 100644
index 00000000000..5f7c9458ea1
--- /dev/null
+++ b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaFindByTypeValueCommand.java
@@ -0,0 +1,147 @@
+/**
+ * Copyright (c) 2014,2017 Contributors to the Eclipse Foundation
+ *
+ * See the NOTICE file(s) distributed with this work for additional
+ * information regarding copyright ownership.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ */
+package org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.command.attributeclient;
+
+import java.util.UUID;
+
+import org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.BlueGigaCommand;
+
+/**
+ * Class to implement the BlueGiga command findByTypeValue.
+ *
+ * This command can be used to find specific attributes on a remote device based on their 16-bit
+ * UUID value and value. The search can be limited by a starting and ending handle values.
+ *
+ * This class provides methods for processing BlueGiga API commands.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ *
+ * @author Chris Jackson - Initial contribution of Java code generator
+ */
+public class BlueGigaFindByTypeValueCommand extends BlueGigaCommand {
+ public static int COMMAND_CLASS = 0x04;
+ public static int COMMAND_METHOD = 0x00;
+
+ /**
+ * Connection handle
+ *
+ * BlueGiga API type is uint8 - Java type is {@link int}
+ */
+ private int connection;
+
+ /**
+ * First requested handle number
+ *
+ * BlueGiga API type is uint16 - Java type is {@link int}
+ */
+ private int start;
+
+ /**
+ * Last requested handle number
+ *
+ * BlueGiga API type is uint16 - Java type is {@link int}
+ */
+ private int end;
+
+ /**
+ * 2 octet UUID to find
+ *
+ * BlueGiga API type is uuid - Java type is {@link UUID}
+ */
+ private UUID uuid;
+
+ /**
+ * Attribute value to find
+ *
+ * BlueGiga API type is uint8array - Java type is {@link int[]}
+ */
+ private int[] value;
+
+ /**
+ * Connection handle
+ *
+ * @param connection the connection to set as {@link int}
+ */
+ public void setConnection(int connection) {
+ this.connection = connection;
+ }
+ /**
+ * First requested handle number
+ *
+ * @param start the start to set as {@link int}
+ */
+ public void setStart(int start) {
+ this.start = start;
+ }
+ /**
+ * Last requested handle number
+ *
+ * @param end the end to set as {@link int}
+ */
+ public void setEnd(int end) {
+ this.end = end;
+ }
+ /**
+ * 2 octet UUID to find
+ *
+ * @param uuid the uuid to set as {@link UUID}
+ */
+ public void setUuid(UUID uuid) {
+ this.uuid = uuid;
+ }
+ /**
+ * Attribute value to find
+ *
+ * @param value the value to set as {@link int[]}
+ */
+ public void setValue(int[] value) {
+ this.value = value;
+ }
+
+ @Override
+ public int[] serialize() {
+ // Serialize the header
+ serializeHeader(COMMAND_CLASS, COMMAND_METHOD);
+
+ // Serialize the fields
+ serializeUInt8(connection);
+ serializeUInt16(start);
+ serializeUInt16(end);
+ serializeUuid(uuid);
+ serializeUInt8Array(value);
+
+ return getPayload();
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder builder = new StringBuilder();
+ builder.append("BlueGigaFindByTypeValueCommand [connection=");
+ builder.append(connection);
+ builder.append(", start=");
+ builder.append(start);
+ builder.append(", end=");
+ builder.append(end);
+ builder.append(", uuid=");
+ builder.append(uuid);
+ builder.append(", value=");
+ for (int c = 0; c < value.length; c++) {
+ if (c > 0) {
+ builder.append(' ');
+ }
+ builder.append(String.format("%02X", value[c]));
+ }
+ builder.append(']');
+ return builder.toString();
+ }
+}
diff --git a/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaFindByTypeValueResponse.java b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaFindByTypeValueResponse.java
new file mode 100644
index 00000000000..8e476308cd8
--- /dev/null
+++ b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaFindByTypeValueResponse.java
@@ -0,0 +1,93 @@
+/**
+ * Copyright (c) 2014,2017 Contributors to the Eclipse Foundation
+ *
+ * See the NOTICE file(s) distributed with this work for additional
+ * information regarding copyright ownership.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ */
+package org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.command.attributeclient;
+
+import org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.BlueGigaResponse;
+import org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.enumeration.BgApiResponse;
+
+/**
+ * Class to implement the BlueGiga command findByTypeValue.
+ *
+ * This command can be used to find specific attributes on a remote device based on their 16-bit
+ * UUID value and value. The search can be limited by a starting and ending handle values.
+ *
+ * This class provides methods for processing BlueGiga API commands.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ *
+ * @author Chris Jackson - Initial contribution of Java code generator
+ */
+public class BlueGigaFindByTypeValueResponse extends BlueGigaResponse {
+ public static int COMMAND_CLASS = 0x04;
+ public static int COMMAND_METHOD = 0x00;
+
+ /**
+ * Connection handle
+ *
+ * BlueGiga API type is uint8 - Java type is {@link int}
+ */
+ private int connection;
+
+ /**
+ * 0 : the operation was successful. Otherwise error occurred
+ *
+ * BlueGiga API type is BgApiResponse - Java type is {@link BgApiResponse}
+ */
+ private BgApiResponse result;
+
+ /**
+ * Response constructor
+ */
+ public BlueGigaFindByTypeValueResponse(int[] inputBuffer) {
+ // Super creates deserializer and reads header fields
+ super(inputBuffer);
+
+ event = (inputBuffer[0] & 0x80) != 0;
+
+ // Deserialize the fields
+ connection = deserializeUInt8();
+ result = deserializeBgApiResponse();
+ }
+
+ /**
+ * Connection handle
+ *
+ * BlueGiga API type is uint8 - Java type is {@link int}
+ *
+ * @return the current connection as {@link int}
+ */
+ public int getConnection() {
+ return connection;
+ }
+ /**
+ * 0 : the operation was successful. Otherwise error occurred
+ *
+ * BlueGiga API type is BgApiResponse - Java type is {@link BgApiResponse}
+ *
+ * @return the current result as {@link BgApiResponse}
+ */
+ public BgApiResponse getResult() {
+ return result;
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder builder = new StringBuilder();
+ builder.append("BlueGigaFindByTypeValueResponse [connection=");
+ builder.append(connection);
+ builder.append(", result=");
+ builder.append(result);
+ builder.append(']');
+ return builder.toString();
+ }
+}
diff --git a/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaFindInformationCommand.java b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaFindInformationCommand.java
new file mode 100644
index 00000000000..82fb3ee51b9
--- /dev/null
+++ b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaFindInformationCommand.java
@@ -0,0 +1,104 @@
+/**
+ * Copyright (c) 2014,2017 Contributors to the Eclipse Foundation
+ *
+ * See the NOTICE file(s) distributed with this work for additional
+ * information regarding copyright ownership.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ */
+package org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.command.attributeclient;
+
+import org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.BlueGigaCommand;
+
+/**
+ * Class to implement the BlueGiga command findInformation.
+ *
+ * This command can be used to find specific attributes on a remote device based on their 16-bit
+ * UUID value and value. The search can be limited by a starting and ending handle values.
+ *
+ * This class provides methods for processing BlueGiga API commands.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ *
+ * @author Chris Jackson - Initial contribution of Java code generator
+ */
+public class BlueGigaFindInformationCommand extends BlueGigaCommand {
+ public static int COMMAND_CLASS = 0x04;
+ public static int COMMAND_METHOD = 0x03;
+
+ /**
+ * Connection handle
+ *
+ * BlueGiga API type is uint8 - Java type is {@link int}
+ */
+ private int connection;
+
+ /**
+ * First attribute handle
+ *
+ * BlueGiga API type is uint16 - Java type is {@link int}
+ */
+ private int start;
+
+ /**
+ * Last attribute handle
+ *
+ * BlueGiga API type is uint16 - Java type is {@link int}
+ */
+ private int end;
+
+ /**
+ * Connection handle
+ *
+ * @param connection the connection to set as {@link int}
+ */
+ public void setConnection(int connection) {
+ this.connection = connection;
+ }
+ /**
+ * First attribute handle
+ *
+ * @param start the start to set as {@link int}
+ */
+ public void setStart(int start) {
+ this.start = start;
+ }
+ /**
+ * Last attribute handle
+ *
+ * @param end the end to set as {@link int}
+ */
+ public void setEnd(int end) {
+ this.end = end;
+ }
+
+ @Override
+ public int[] serialize() {
+ // Serialize the header
+ serializeHeader(COMMAND_CLASS, COMMAND_METHOD);
+
+ // Serialize the fields
+ serializeUInt8(connection);
+ serializeUInt16(start);
+ serializeUInt16(end);
+
+ return getPayload();
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder builder = new StringBuilder();
+ builder.append("BlueGigaFindInformationCommand [connection=");
+ builder.append(connection);
+ builder.append(", start=");
+ builder.append(start);
+ builder.append(", end=");
+ builder.append(end);
+ builder.append(']');
+ return builder.toString();
+ }
+}
diff --git a/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaFindInformationFoundEvent.java b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaFindInformationFoundEvent.java
new file mode 100644
index 00000000000..758b00ce02e
--- /dev/null
+++ b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaFindInformationFoundEvent.java
@@ -0,0 +1,115 @@
+/**
+ * Copyright (c) 2014,2017 Contributors to the Eclipse Foundation
+ *
+ * See the NOTICE file(s) distributed with this work for additional
+ * information regarding copyright ownership.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ */
+package org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.command.attributeclient;
+
+import java.util.UUID;
+
+import org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.BlueGigaResponse;
+
+/**
+ * Class to implement the BlueGiga command findInformationFoundEvent.
+ *
+ * This event is generated when characteristics type mappings are found. This happens
+ * typically after Find Information command has been issued to discover all attributes of a
+ * service.
+ *
+ * This class provides methods for processing BlueGiga API commands.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ *
+ * @author Chris Jackson - Initial contribution of Java code generator
+ */
+public class BlueGigaFindInformationFoundEvent extends BlueGigaResponse {
+ public static int COMMAND_CLASS = 0x04;
+ public static int COMMAND_METHOD = 0x04;
+
+ /**
+ * Connection handle
+ *
+ * BlueGiga API type is uint8 - Java type is {@link int}
+ */
+ private int connection;
+
+ /**
+ * Characteristics handle
+ *
+ * BlueGiga API type is uint16 - Java type is {@link int}
+ */
+ private int chrHandle;
+
+ /**
+ * Characteristics type (UUID)
+ *
+ * BlueGiga API type is uuid - Java type is {@link UUID}
+ */
+ private UUID uuid;
+
+ /**
+ * Event constructor
+ */
+ public BlueGigaFindInformationFoundEvent(int[] inputBuffer) {
+ // Super creates deserializer and reads header fields
+ super(inputBuffer);
+
+ event = (inputBuffer[0] & 0x80) != 0;
+
+ // Deserialize the fields
+ connection = deserializeUInt8();
+ chrHandle = deserializeUInt16();
+ uuid = deserializeUuid();
+ }
+
+ /**
+ * Connection handle
+ *
+ * BlueGiga API type is uint8 - Java type is {@link int}
+ *
+ * @return the current connection as {@link int}
+ */
+ public int getConnection() {
+ return connection;
+ }
+ /**
+ * Characteristics handle
+ *
+ * BlueGiga API type is uint16 - Java type is {@link int}
+ *
+ * @return the current chr_handle as {@link int}
+ */
+ public int getChrHandle() {
+ return chrHandle;
+ }
+ /**
+ * Characteristics type (UUID)
+ *
+ * BlueGiga API type is uuid - Java type is {@link UUID}
+ *
+ * @return the current uuid as {@link UUID}
+ */
+ public UUID getUuid() {
+ return uuid;
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder builder = new StringBuilder();
+ builder.append("BlueGigaFindInformationFoundEvent [connection=");
+ builder.append(connection);
+ builder.append(", chrHandle=");
+ builder.append(chrHandle);
+ builder.append(", uuid=");
+ builder.append(uuid);
+ builder.append(']');
+ return builder.toString();
+ }
+}
diff --git a/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaFindInformationResponse.java b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaFindInformationResponse.java
new file mode 100644
index 00000000000..bdb298a0b45
--- /dev/null
+++ b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaFindInformationResponse.java
@@ -0,0 +1,93 @@
+/**
+ * Copyright (c) 2014,2017 Contributors to the Eclipse Foundation
+ *
+ * See the NOTICE file(s) distributed with this work for additional
+ * information regarding copyright ownership.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ */
+package org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.command.attributeclient;
+
+import org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.BlueGigaResponse;
+import org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.enumeration.BgApiResponse;
+
+/**
+ * Class to implement the BlueGiga command findInformation.
+ *
+ * This command can be used to find specific attributes on a remote device based on their 16-bit
+ * UUID value and value. The search can be limited by a starting and ending handle values.
+ *
+ * This class provides methods for processing BlueGiga API commands.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ *
+ * @author Chris Jackson - Initial contribution of Java code generator
+ */
+public class BlueGigaFindInformationResponse extends BlueGigaResponse {
+ public static int COMMAND_CLASS = 0x04;
+ public static int COMMAND_METHOD = 0x03;
+
+ /**
+ * Connection handle
+ *
+ * BlueGiga API type is uint8 - Java type is {@link int}
+ */
+ private int connection;
+
+ /**
+ * 0 : the operation was successful. Otherwise error occurred
+ *
+ * BlueGiga API type is BgApiResponse - Java type is {@link BgApiResponse}
+ */
+ private BgApiResponse result;
+
+ /**
+ * Response constructor
+ */
+ public BlueGigaFindInformationResponse(int[] inputBuffer) {
+ // Super creates deserializer and reads header fields
+ super(inputBuffer);
+
+ event = (inputBuffer[0] & 0x80) != 0;
+
+ // Deserialize the fields
+ connection = deserializeUInt8();
+ result = deserializeBgApiResponse();
+ }
+
+ /**
+ * Connection handle
+ *
+ * BlueGiga API type is uint8 - Java type is {@link int}
+ *
+ * @return the current connection as {@link int}
+ */
+ public int getConnection() {
+ return connection;
+ }
+ /**
+ * 0 : the operation was successful. Otherwise error occurred
+ *
+ * BlueGiga API type is BgApiResponse - Java type is {@link BgApiResponse}
+ *
+ * @return the current result as {@link BgApiResponse}
+ */
+ public BgApiResponse getResult() {
+ return result;
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder builder = new StringBuilder();
+ builder.append("BlueGigaFindInformationResponse [connection=");
+ builder.append(connection);
+ builder.append(", result=");
+ builder.append(result);
+ builder.append(']');
+ return builder.toString();
+ }
+}
diff --git a/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaGroupFoundEvent.java b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaGroupFoundEvent.java
new file mode 100644
index 00000000000..8379a3d2a36
--- /dev/null
+++ b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaGroupFoundEvent.java
@@ -0,0 +1,134 @@
+/**
+ * Copyright (c) 2014,2017 Contributors to the Eclipse Foundation
+ *
+ * See the NOTICE file(s) distributed with this work for additional
+ * information regarding copyright ownership.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ */
+package org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.command.attributeclient;
+
+import java.util.UUID;
+
+import org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.BlueGigaResponse;
+
+/**
+ * Class to implement the BlueGiga command groupFoundEvent.
+ *
+ * This event is produced when an attribute group (a service) is found. Typically this event is
+ * produced after Read by Group Type command.
+ *
+ * This class provides methods for processing BlueGiga API commands.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ *
+ * @author Chris Jackson - Initial contribution of Java code generator
+ */
+public class BlueGigaGroupFoundEvent extends BlueGigaResponse {
+ public static int COMMAND_CLASS = 0x04;
+ public static int COMMAND_METHOD = 0x02;
+
+ /**
+ * Connection handle
+ *
+ * BlueGiga API type is uint8 - Java type is {@link int}
+ */
+ private int connection;
+
+ /**
+ * Starting handle
+ *
+ * BlueGiga API type is uint16 - Java type is {@link int}
+ */
+ private int start;
+
+ /**
+ * Ending handle
+ *
+ * BlueGiga API type is uint16 - Java type is {@link int}
+ */
+ private int end;
+
+ /**
+ * UUID of a service. Length is 0 if no services are found.
+ *
+ * BlueGiga API type is uuid - Java type is {@link UUID}
+ */
+ private UUID uuid;
+
+ /**
+ * Event constructor
+ */
+ public BlueGigaGroupFoundEvent(int[] inputBuffer) {
+ // Super creates deserializer and reads header fields
+ super(inputBuffer);
+
+ event = (inputBuffer[0] & 0x80) != 0;
+
+ // Deserialize the fields
+ connection = deserializeUInt8();
+ start = deserializeUInt16();
+ end = deserializeUInt16();
+ uuid = deserializeUuid();
+ }
+
+ /**
+ * Connection handle
+ *
+ * BlueGiga API type is uint8 - Java type is {@link int}
+ *
+ * @return the current connection as {@link int}
+ */
+ public int getConnection() {
+ return connection;
+ }
+ /**
+ * Starting handle
+ *
+ * BlueGiga API type is uint16 - Java type is {@link int}
+ *
+ * @return the current start as {@link int}
+ */
+ public int getStart() {
+ return start;
+ }
+ /**
+ * Ending handle
+ *
+ * BlueGiga API type is uint16 - Java type is {@link int}
+ *
+ * @return the current end as {@link int}
+ */
+ public int getEnd() {
+ return end;
+ }
+ /**
+ * UUID of a service. Length is 0 if no services are found.
+ *
+ * BlueGiga API type is uuid - Java type is {@link UUID}
+ *
+ * @return the current uuid as {@link UUID}
+ */
+ public UUID getUuid() {
+ return uuid;
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder builder = new StringBuilder();
+ builder.append("BlueGigaGroupFoundEvent [connection=");
+ builder.append(connection);
+ builder.append(", start=");
+ builder.append(start);
+ builder.append(", end=");
+ builder.append(end);
+ builder.append(", uuid=");
+ builder.append(uuid);
+ builder.append(']');
+ return builder.toString();
+ }
+}
diff --git a/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaIndicateConfirmCommand.java b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaIndicateConfirmCommand.java
new file mode 100644
index 00000000000..5cd83fd5c8e
--- /dev/null
+++ b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaIndicateConfirmCommand.java
@@ -0,0 +1,71 @@
+/**
+ * Copyright (c) 2014,2017 Contributors to the Eclipse Foundation
+ *
+ * See the NOTICE file(s) distributed with this work for additional
+ * information regarding copyright ownership.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ */
+package org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.command.attributeclient;
+
+import org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.BlueGigaCommand;
+
+/**
+ * Class to implement the BlueGiga command indicateConfirm.
+ *
+ * This command can be used to send a acknowledge a received indication from a remote device.
+ * This function allows the application to manually confirm the indicated values instead of
+ * the smart stack Bluetooth automatically doing it. The benefit of this is extra reliability
+ * since the application can for example store the received value on the flash memory before
+ * confirming the indication to the remote device.
+ *
+ * This class provides methods for processing BlueGiga API commands.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ *
+ * @author Chris Jackson - Initial contribution of Java code generator
+ */
+public class BlueGigaIndicateConfirmCommand extends BlueGigaCommand {
+ public static int COMMAND_CLASS = 0x04;
+ public static int COMMAND_METHOD = 0x07;
+
+ /**
+ * Connection handle
+ *
+ * BlueGiga API type is uint8 - Java type is {@link int}
+ */
+ private int connection;
+
+ /**
+ * Connection handle
+ *
+ * @param connection the connection to set as {@link int}
+ */
+ public void setConnection(int connection) {
+ this.connection = connection;
+ }
+
+ @Override
+ public int[] serialize() {
+ // Serialize the header
+ serializeHeader(COMMAND_CLASS, COMMAND_METHOD);
+
+ // Serialize the fields
+ serializeUInt8(connection);
+
+ return getPayload();
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder builder = new StringBuilder();
+ builder.append("BlueGigaIndicateConfirmCommand [connection=");
+ builder.append(connection);
+ builder.append(']');
+ return builder.toString();
+ }
+}
diff --git a/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaIndicateConfirmResponse.java b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaIndicateConfirmResponse.java
new file mode 100644
index 00000000000..474f49ba27b
--- /dev/null
+++ b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaIndicateConfirmResponse.java
@@ -0,0 +1,96 @@
+/**
+ * Copyright (c) 2014,2017 Contributors to the Eclipse Foundation
+ *
+ * See the NOTICE file(s) distributed with this work for additional
+ * information regarding copyright ownership.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ */
+package org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.command.attributeclient;
+
+import org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.BlueGigaResponse;
+import org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.enumeration.BgApiResponse;
+
+/**
+ * Class to implement the BlueGiga command indicateConfirm.
+ *
+ * This command can be used to send a acknowledge a received indication from a remote device.
+ * This function allows the application to manually confirm the indicated values instead of
+ * the smart stack Bluetooth automatically doing it. The benefit of this is extra reliability
+ * since the application can for example store the received value on the flash memory before
+ * confirming the indication to the remote device.
+ *
+ * This class provides methods for processing BlueGiga API commands.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ *
+ * @author Chris Jackson - Initial contribution of Java code generator
+ */
+public class BlueGigaIndicateConfirmResponse extends BlueGigaResponse {
+ public static int COMMAND_CLASS = 0x04;
+ public static int COMMAND_METHOD = 0x07;
+
+ /**
+ * Connection handle
+ *
+ * BlueGiga API type is uint8 - Java type is {@link int}
+ */
+ private int connection;
+
+ /**
+ * Command result.
+ *
+ * BlueGiga API type is BgApiResponse - Java type is {@link BgApiResponse}
+ */
+ private BgApiResponse result;
+
+ /**
+ * Response constructor
+ */
+ public BlueGigaIndicateConfirmResponse(int[] inputBuffer) {
+ // Super creates deserializer and reads header fields
+ super(inputBuffer);
+
+ event = (inputBuffer[0] & 0x80) != 0;
+
+ // Deserialize the fields
+ connection = deserializeUInt8();
+ result = deserializeBgApiResponse();
+ }
+
+ /**
+ * Connection handle
+ *
+ * BlueGiga API type is uint8 - Java type is {@link int}
+ *
+ * @return the current connection as {@link int}
+ */
+ public int getConnection() {
+ return connection;
+ }
+ /**
+ * Command result.
+ *
+ * BlueGiga API type is BgApiResponse - Java type is {@link BgApiResponse}
+ *
+ * @return the current result as {@link BgApiResponse}
+ */
+ public BgApiResponse getResult() {
+ return result;
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder builder = new StringBuilder();
+ builder.append("BlueGigaIndicateConfirmResponse [connection=");
+ builder.append(connection);
+ builder.append(", result=");
+ builder.append(result);
+ builder.append(']');
+ return builder.toString();
+ }
+}
diff --git a/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaIndicatedEvent.java b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaIndicatedEvent.java
new file mode 100644
index 00000000000..ab6f088d383
--- /dev/null
+++ b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaIndicatedEvent.java
@@ -0,0 +1,93 @@
+/**
+ * Copyright (c) 2014,2017 Contributors to the Eclipse Foundation
+ *
+ * See the NOTICE file(s) distributed with this work for additional
+ * information regarding copyright ownership.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ */
+package org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.command.attributeclient;
+
+import org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.BlueGigaResponse;
+
+/**
+ * Class to implement the BlueGiga command indicatedEvent.
+ *
+ * This event is produced at the GATT server side when an attribute is successfully indicated to
+ * the GATT client. This means the event is only produced at the GATT server if the indication is
+ * acknowledged by the GATT client (the remote device).
+ *
+ * This class provides methods for processing BlueGiga API commands.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ *
+ * @author Chris Jackson - Initial contribution of Java code generator
+ */
+public class BlueGigaIndicatedEvent extends BlueGigaResponse {
+ public static int COMMAND_CLASS = 0x04;
+ public static int COMMAND_METHOD = 0x00;
+
+ /**
+ * Connection handle
+ *
+ * BlueGiga API type is uint8 - Java type is {@link int}
+ */
+ private int connection;
+
+ /**
+ * Attribute handle
+ *
+ * BlueGiga API type is uint16 - Java type is {@link int}
+ */
+ private int attrhandle;
+
+ /**
+ * Event constructor
+ */
+ public BlueGigaIndicatedEvent(int[] inputBuffer) {
+ // Super creates deserializer and reads header fields
+ super(inputBuffer);
+
+ event = (inputBuffer[0] & 0x80) != 0;
+
+ // Deserialize the fields
+ connection = deserializeUInt8();
+ attrhandle = deserializeUInt16();
+ }
+
+ /**
+ * Connection handle
+ *
+ * BlueGiga API type is uint8 - Java type is {@link int}
+ *
+ * @return the current connection as {@link int}
+ */
+ public int getConnection() {
+ return connection;
+ }
+ /**
+ * Attribute handle
+ *
+ * BlueGiga API type is uint16 - Java type is {@link int}
+ *
+ * @return the current attrhandle as {@link int}
+ */
+ public int getAttrhandle() {
+ return attrhandle;
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder builder = new StringBuilder();
+ builder.append("BlueGigaIndicatedEvent [connection=");
+ builder.append(connection);
+ builder.append(", attrhandle=");
+ builder.append(attrhandle);
+ builder.append(']');
+ return builder.toString();
+ }
+}
diff --git a/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaPrepareWriteCommand.java b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaPrepareWriteCommand.java
new file mode 100644
index 00000000000..5165076a908
--- /dev/null
+++ b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaPrepareWriteCommand.java
@@ -0,0 +1,130 @@
+/**
+ * Copyright (c) 2014,2017 Contributors to the Eclipse Foundation
+ *
+ * See the NOTICE file(s) distributed with this work for additional
+ * information regarding copyright ownership.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ */
+package org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.command.attributeclient;
+
+import org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.BlueGigaCommand;
+
+/**
+ * Class to implement the BlueGiga command prepareWrite.
+ *
+ * This command will send a prepare write request to a remote device for queued writes. Queued
+ * writes can for example be used to write large attribute values by transmitting the data in
+ * chunks using prepare write command. Once the data has been transmitted with multiple
+ * prepare write commands the write must then be executed or canceled with Execute Write
+ * command, which if acknowledged by the remote device triggers a Procedure Completed event.
+ *
+ * This class provides methods for processing BlueGiga API commands.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ *
+ * @author Chris Jackson - Initial contribution of Java code generator
+ */
+public class BlueGigaPrepareWriteCommand extends BlueGigaCommand {
+ public static int COMMAND_CLASS = 0x04;
+ public static int COMMAND_METHOD = 0x09;
+
+ /**
+ * Connection handle
+ *
+ * BlueGiga API type is uint8 - Java type is {@link int}
+ */
+ private int connection;
+
+ /**
+ * Attribute handle
+ *
+ * BlueGiga API type is uint16 - Java type is {@link int}
+ */
+ private int attHandle;
+
+ /**
+ * Offset to write to
+ *
+ * BlueGiga API type is uint16 - Java type is {@link int}
+ */
+ private int offset;
+
+ /**
+ * Data to write. Maximum amount of data that can be sent in single command is 18 bytes.
+ *
+ * BlueGiga API type is uint8array - Java type is {@link int[]}
+ */
+ private int[] data;
+
+ /**
+ * Connection handle
+ *
+ * @param connection the connection to set as {@link int}
+ */
+ public void setConnection(int connection) {
+ this.connection = connection;
+ }
+ /**
+ * Attribute handle
+ *
+ * @param attHandle the attHandle to set as {@link int}
+ */
+ public void setAttHandle(int attHandle) {
+ this.attHandle = attHandle;
+ }
+ /**
+ * Offset to write to
+ *
+ * @param offset the offset to set as {@link int}
+ */
+ public void setOffset(int offset) {
+ this.offset = offset;
+ }
+ /**
+ * Data to write. Maximum amount of data that can be sent in single command is 18 bytes.
+ *
+ * @param data the data to set as {@link int[]}
+ */
+ public void setData(int[] data) {
+ this.data = data;
+ }
+
+ @Override
+ public int[] serialize() {
+ // Serialize the header
+ serializeHeader(COMMAND_CLASS, COMMAND_METHOD);
+
+ // Serialize the fields
+ serializeUInt8(connection);
+ serializeUInt16(attHandle);
+ serializeUInt16(offset);
+ serializeUInt8Array(data);
+
+ return getPayload();
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder builder = new StringBuilder();
+ builder.append("BlueGigaPrepareWriteCommand [connection=");
+ builder.append(connection);
+ builder.append(", attHandle=");
+ builder.append(attHandle);
+ builder.append(", offset=");
+ builder.append(offset);
+ builder.append(", data=");
+ for (int c = 0; c < data.length; c++) {
+ if (c > 0) {
+ builder.append(' ');
+ }
+ builder.append(String.format("%02X", data[c]));
+ }
+ builder.append(']');
+ return builder.toString();
+ }
+}
diff --git a/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaPrepareWriteResponse.java b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaPrepareWriteResponse.java
new file mode 100644
index 00000000000..5bcd7ee53ff
--- /dev/null
+++ b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaPrepareWriteResponse.java
@@ -0,0 +1,96 @@
+/**
+ * Copyright (c) 2014,2017 Contributors to the Eclipse Foundation
+ *
+ * See the NOTICE file(s) distributed with this work for additional
+ * information regarding copyright ownership.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ */
+package org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.command.attributeclient;
+
+import org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.BlueGigaResponse;
+import org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.enumeration.BgApiResponse;
+
+/**
+ * Class to implement the BlueGiga command prepareWrite.
+ *
+ * This command will send a prepare write request to a remote device for queued writes. Queued
+ * writes can for example be used to write large attribute values by transmitting the data in
+ * chunks using prepare write command. Once the data has been transmitted with multiple
+ * prepare write commands the write must then be executed or canceled with Execute Write
+ * command, which if acknowledged by the remote device triggers a Procedure Completed event.
+ *
+ * This class provides methods for processing BlueGiga API commands.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ *
+ * @author Chris Jackson - Initial contribution of Java code generator
+ */
+public class BlueGigaPrepareWriteResponse extends BlueGigaResponse {
+ public static int COMMAND_CLASS = 0x04;
+ public static int COMMAND_METHOD = 0x09;
+
+ /**
+ * Connection handle
+ *
+ * BlueGiga API type is uint8 - Java type is {@link int}
+ */
+ private int connection;
+
+ /**
+ * Command result.
+ *
+ * BlueGiga API type is BgApiResponse - Java type is {@link BgApiResponse}
+ */
+ private BgApiResponse result;
+
+ /**
+ * Response constructor
+ */
+ public BlueGigaPrepareWriteResponse(int[] inputBuffer) {
+ // Super creates deserializer and reads header fields
+ super(inputBuffer);
+
+ event = (inputBuffer[0] & 0x80) != 0;
+
+ // Deserialize the fields
+ connection = deserializeUInt8();
+ result = deserializeBgApiResponse();
+ }
+
+ /**
+ * Connection handle
+ *
+ * BlueGiga API type is uint8 - Java type is {@link int}
+ *
+ * @return the current connection as {@link int}
+ */
+ public int getConnection() {
+ return connection;
+ }
+ /**
+ * Command result.
+ *
+ * BlueGiga API type is BgApiResponse - Java type is {@link BgApiResponse}
+ *
+ * @return the current result as {@link BgApiResponse}
+ */
+ public BgApiResponse getResult() {
+ return result;
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder builder = new StringBuilder();
+ builder.append("BlueGigaPrepareWriteResponse [connection=");
+ builder.append(connection);
+ builder.append(", result=");
+ builder.append(result);
+ builder.append(']');
+ return builder.toString();
+ }
+}
diff --git a/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaProcedureCompletedEvent.java b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaProcedureCompletedEvent.java
new file mode 100644
index 00000000000..5b7bf5c3980
--- /dev/null
+++ b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaProcedureCompletedEvent.java
@@ -0,0 +1,115 @@
+/**
+ * Copyright (c) 2014,2017 Contributors to the Eclipse Foundation
+ *
+ * See the NOTICE file(s) distributed with this work for additional
+ * information regarding copyright ownership.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ */
+package org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.command.attributeclient;
+
+import org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.BlueGigaResponse;
+import org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.enumeration.BgApiResponse;
+
+/**
+ * Class to implement the BlueGiga command procedureCompletedEvent.
+ *
+ * This event is produced at the GATT client when an attribute protocol event is completed a and
+ * new operation can be issued
+ *
+ * This class provides methods for processing BlueGiga API commands.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ *
+ * @author Chris Jackson - Initial contribution of Java code generator
+ */
+public class BlueGigaProcedureCompletedEvent extends BlueGigaResponse {
+ public static int COMMAND_CLASS = 0x04;
+ public static int COMMAND_METHOD = 0x01;
+
+ /**
+ * Connection handle
+ *
+ * BlueGiga API type is uint8 - Java type is {@link int}
+ */
+ private int connection;
+
+ /**
+ * 0: The operation was successful. Otherwise: attribute protocol error code returned by
+ * remote device
+ *
+ * BlueGiga API type is BgApiResponse - Java type is {@link BgApiResponse}
+ */
+ private BgApiResponse result;
+
+ /**
+ * Characteristic handle at which the event ended
+ *
+ * BlueGiga API type is uint16 - Java type is {@link int}
+ */
+ private int chrHandle;
+
+ /**
+ * Event constructor
+ */
+ public BlueGigaProcedureCompletedEvent(int[] inputBuffer) {
+ // Super creates deserializer and reads header fields
+ super(inputBuffer);
+
+ event = (inputBuffer[0] & 0x80) != 0;
+
+ // Deserialize the fields
+ connection = deserializeUInt8();
+ result = deserializeBgApiResponse();
+ chrHandle = deserializeUInt16();
+ }
+
+ /**
+ * Connection handle
+ *
+ * BlueGiga API type is uint8 - Java type is {@link int}
+ *
+ * @return the current connection as {@link int}
+ */
+ public int getConnection() {
+ return connection;
+ }
+ /**
+ * 0: The operation was successful. Otherwise: attribute protocol error code returned by
+ * remote device
+ *
+ * BlueGiga API type is BgApiResponse - Java type is {@link BgApiResponse}
+ *
+ * @return the current result as {@link BgApiResponse}
+ */
+ public BgApiResponse getResult() {
+ return result;
+ }
+ /**
+ * Characteristic handle at which the event ended
+ *
+ * BlueGiga API type is uint16 - Java type is {@link int}
+ *
+ * @return the current chr_handle as {@link int}
+ */
+ public int getChrHandle() {
+ return chrHandle;
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder builder = new StringBuilder();
+ builder.append("BlueGigaProcedureCompletedEvent [connection=");
+ builder.append(connection);
+ builder.append(", result=");
+ builder.append(result);
+ builder.append(", chrHandle=");
+ builder.append(chrHandle);
+ builder.append(']');
+ return builder.toString();
+ }
+}
diff --git a/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaReadByGroupTypeCommand.java b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaReadByGroupTypeCommand.java
new file mode 100644
index 00000000000..6fe79b8a918
--- /dev/null
+++ b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaReadByGroupTypeCommand.java
@@ -0,0 +1,126 @@
+/**
+ * Copyright (c) 2014,2017 Contributors to the Eclipse Foundation
+ *
+ * See the NOTICE file(s) distributed with this work for additional
+ * information regarding copyright ownership.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ */
+package org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.command.attributeclient;
+
+import java.util.UUID;
+
+import org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.BlueGigaCommand;
+
+/**
+ * Class to implement the BlueGiga command readByGroupType.
+ *
+ * This command reads the value of each attribute of a given type and in a given handle range. The
+ * command is typically used for primary (UUID: 0x2800) and secondary (UUID: 0x2801) service
+ * discovery. Discovered services are reported by Group Found event. Finally when the
+ * procedure is completed a Procedure Completed event is generated.
+ *
+ * This class provides methods for processing BlueGiga API commands.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ *
+ * @author Chris Jackson - Initial contribution of Java code generator
+ */
+public class BlueGigaReadByGroupTypeCommand extends BlueGigaCommand {
+ public static int COMMAND_CLASS = 0x04;
+ public static int COMMAND_METHOD = 0x01;
+
+ /**
+ * Connection handle
+ *
+ * BlueGiga API type is uint8 - Java type is {@link int}
+ */
+ private int connection;
+
+ /**
+ * First requested handle number
+ *
+ * BlueGiga API type is uint16 - Java type is {@link int}
+ */
+ private int start;
+
+ /**
+ * Last requested handle number
+ *
+ * BlueGiga API type is uint16 - Java type is {@link int}
+ */
+ private int end;
+
+ /**
+ * Group UUID to find
+ *
+ * BlueGiga API type is uuid - Java type is {@link UUID}
+ */
+ private UUID uuid;
+
+ /**
+ * Connection handle
+ *
+ * @param connection the connection to set as {@link int}
+ */
+ public void setConnection(int connection) {
+ this.connection = connection;
+ }
+ /**
+ * First requested handle number
+ *
+ * @param start the start to set as {@link int}
+ */
+ public void setStart(int start) {
+ this.start = start;
+ }
+ /**
+ * Last requested handle number
+ *
+ * @param end the end to set as {@link int}
+ */
+ public void setEnd(int end) {
+ this.end = end;
+ }
+ /**
+ * Group UUID to find
+ *
+ * @param uuid the uuid to set as {@link UUID}
+ */
+ public void setUuid(UUID uuid) {
+ this.uuid = uuid;
+ }
+
+ @Override
+ public int[] serialize() {
+ // Serialize the header
+ serializeHeader(COMMAND_CLASS, COMMAND_METHOD);
+
+ // Serialize the fields
+ serializeUInt8(connection);
+ serializeUInt16(start);
+ serializeUInt16(end);
+ serializeUuid(uuid);
+
+ return getPayload();
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder builder = new StringBuilder();
+ builder.append("BlueGigaReadByGroupTypeCommand [connection=");
+ builder.append(connection);
+ builder.append(", start=");
+ builder.append(start);
+ builder.append(", end=");
+ builder.append(end);
+ builder.append(", uuid=");
+ builder.append(uuid);
+ builder.append(']');
+ return builder.toString();
+ }
+}
diff --git a/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaReadByGroupTypeResponse.java b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaReadByGroupTypeResponse.java
new file mode 100644
index 00000000000..b80c7a92dff
--- /dev/null
+++ b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaReadByGroupTypeResponse.java
@@ -0,0 +1,95 @@
+/**
+ * Copyright (c) 2014,2017 Contributors to the Eclipse Foundation
+ *
+ * See the NOTICE file(s) distributed with this work for additional
+ * information regarding copyright ownership.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ */
+package org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.command.attributeclient;
+
+import org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.BlueGigaResponse;
+import org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.enumeration.BgApiResponse;
+
+/**
+ * Class to implement the BlueGiga command readByGroupType.
+ *
+ * This command reads the value of each attribute of a given type and in a given handle range. The
+ * command is typically used for primary (UUID: 0x2800) and secondary (UUID: 0x2801) service
+ * discovery. Discovered services are reported by Group Found event. Finally when the
+ * procedure is completed a Procedure Completed event is generated.
+ *
+ * This class provides methods for processing BlueGiga API commands.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ *
+ * @author Chris Jackson - Initial contribution of Java code generator
+ */
+public class BlueGigaReadByGroupTypeResponse extends BlueGigaResponse {
+ public static int COMMAND_CLASS = 0x04;
+ public static int COMMAND_METHOD = 0x01;
+
+ /**
+ * Connection handle
+ *
+ * BlueGiga API type is uint8 - Java type is {@link int}
+ */
+ private int connection;
+
+ /**
+ * Command result.
+ *
+ * BlueGiga API type is BgApiResponse - Java type is {@link BgApiResponse}
+ */
+ private BgApiResponse result;
+
+ /**
+ * Response constructor
+ */
+ public BlueGigaReadByGroupTypeResponse(int[] inputBuffer) {
+ // Super creates deserializer and reads header fields
+ super(inputBuffer);
+
+ event = (inputBuffer[0] & 0x80) != 0;
+
+ // Deserialize the fields
+ connection = deserializeUInt8();
+ result = deserializeBgApiResponse();
+ }
+
+ /**
+ * Connection handle
+ *
+ * BlueGiga API type is uint8 - Java type is {@link int}
+ *
+ * @return the current connection as {@link int}
+ */
+ public int getConnection() {
+ return connection;
+ }
+ /**
+ * Command result.
+ *
+ * BlueGiga API type is BgApiResponse - Java type is {@link BgApiResponse}
+ *
+ * @return the current result as {@link BgApiResponse}
+ */
+ public BgApiResponse getResult() {
+ return result;
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder builder = new StringBuilder();
+ builder.append("BlueGigaReadByGroupTypeResponse [connection=");
+ builder.append(connection);
+ builder.append(", result=");
+ builder.append(result);
+ builder.append(']');
+ return builder.toString();
+ }
+}
diff --git a/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaReadByHandleCommand.java b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaReadByHandleCommand.java
new file mode 100644
index 00000000000..e111d2dbc29
--- /dev/null
+++ b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaReadByHandleCommand.java
@@ -0,0 +1,86 @@
+/**
+ * Copyright (c) 2014,2017 Contributors to the Eclipse Foundation
+ *
+ * See the NOTICE file(s) distributed with this work for additional
+ * information regarding copyright ownership.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ */
+package org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.command.attributeclient;
+
+import org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.BlueGigaCommand;
+
+/**
+ * Class to implement the BlueGiga command readByHandle.
+ *
+ * This command reads a remote attribute's value with the given handle. Read by handle can be
+ * used to read attributes up to 22 bytes long. For longer attributes command must be used.
+ *
+ * This class provides methods for processing BlueGiga API commands.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ *
+ * @author Chris Jackson - Initial contribution of Java code generator
+ */
+public class BlueGigaReadByHandleCommand extends BlueGigaCommand {
+ public static int COMMAND_CLASS = 0x04;
+ public static int COMMAND_METHOD = 0x04;
+
+ /**
+ * Connection handle
+ *
+ * BlueGiga API type is uint8 - Java type is {@link int}
+ */
+ private int connection;
+
+ /**
+ * Attribute handle
+ *
+ * BlueGiga API type is uint16 - Java type is {@link int}
+ */
+ private int chrHandle;
+
+ /**
+ * Connection handle
+ *
+ * @param connection the connection to set as {@link int}
+ */
+ public void setConnection(int connection) {
+ this.connection = connection;
+ }
+ /**
+ * Attribute handle
+ *
+ * @param chrHandle the chrHandle to set as {@link int}
+ */
+ public void setChrHandle(int chrHandle) {
+ this.chrHandle = chrHandle;
+ }
+
+ @Override
+ public int[] serialize() {
+ // Serialize the header
+ serializeHeader(COMMAND_CLASS, COMMAND_METHOD);
+
+ // Serialize the fields
+ serializeUInt8(connection);
+ serializeUInt16(chrHandle);
+
+ return getPayload();
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder builder = new StringBuilder();
+ builder.append("BlueGigaReadByHandleCommand [connection=");
+ builder.append(connection);
+ builder.append(", chrHandle=");
+ builder.append(chrHandle);
+ builder.append(']');
+ return builder.toString();
+ }
+}
diff --git a/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaReadByHandleResponse.java b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaReadByHandleResponse.java
new file mode 100644
index 00000000000..e7f93f86f0c
--- /dev/null
+++ b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaReadByHandleResponse.java
@@ -0,0 +1,93 @@
+/**
+ * Copyright (c) 2014,2017 Contributors to the Eclipse Foundation
+ *
+ * See the NOTICE file(s) distributed with this work for additional
+ * information regarding copyright ownership.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ */
+package org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.command.attributeclient;
+
+import org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.BlueGigaResponse;
+import org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.enumeration.BgApiResponse;
+
+/**
+ * Class to implement the BlueGiga command readByHandle.
+ *
+ * This command reads a remote attribute's value with the given handle. Read by handle can be
+ * used to read attributes up to 22 bytes long. For longer attributes command must be used.
+ *
+ * This class provides methods for processing BlueGiga API commands.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ *
+ * @author Chris Jackson - Initial contribution of Java code generator
+ */
+public class BlueGigaReadByHandleResponse extends BlueGigaResponse {
+ public static int COMMAND_CLASS = 0x04;
+ public static int COMMAND_METHOD = 0x04;
+
+ /**
+ * Connection handle
+ *
+ * BlueGiga API type is uint8 - Java type is {@link int}
+ */
+ private int connection;
+
+ /**
+ * 0 : the command was successful. Otherwise an error occurred
+ *
+ * BlueGiga API type is BgApiResponse - Java type is {@link BgApiResponse}
+ */
+ private BgApiResponse result;
+
+ /**
+ * Response constructor
+ */
+ public BlueGigaReadByHandleResponse(int[] inputBuffer) {
+ // Super creates deserializer and reads header fields
+ super(inputBuffer);
+
+ event = (inputBuffer[0] & 0x80) != 0;
+
+ // Deserialize the fields
+ connection = deserializeUInt8();
+ result = deserializeBgApiResponse();
+ }
+
+ /**
+ * Connection handle
+ *
+ * BlueGiga API type is uint8 - Java type is {@link int}
+ *
+ * @return the current connection as {@link int}
+ */
+ public int getConnection() {
+ return connection;
+ }
+ /**
+ * 0 : the command was successful. Otherwise an error occurred
+ *
+ * BlueGiga API type is BgApiResponse - Java type is {@link BgApiResponse}
+ *
+ * @return the current result as {@link BgApiResponse}
+ */
+ public BgApiResponse getResult() {
+ return result;
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder builder = new StringBuilder();
+ builder.append("BlueGigaReadByHandleResponse [connection=");
+ builder.append(connection);
+ builder.append(", result=");
+ builder.append(result);
+ builder.append(']');
+ return builder.toString();
+ }
+}
diff --git a/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaReadByTypeCommand.java b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaReadByTypeCommand.java
new file mode 100644
index 00000000000..6e57ec2d976
--- /dev/null
+++ b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaReadByTypeCommand.java
@@ -0,0 +1,125 @@
+/**
+ * Copyright (c) 2014,2017 Contributors to the Eclipse Foundation
+ *
+ * See the NOTICE file(s) distributed with this work for additional
+ * information regarding copyright ownership.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ */
+package org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.command.attributeclient;
+
+import java.util.UUID;
+
+import org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.BlueGigaCommand;
+
+/**
+ * Class to implement the BlueGiga command readByType.
+ *
+ * The command reads the value of each attribute of a given type (UUID) and in a given attribute
+ * handle range. The command can for example be used to discover the characteristic
+ * declarations (UUID: 0x2803) within a service.
+ *
+ * This class provides methods for processing BlueGiga API commands.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ *
+ * @author Chris Jackson - Initial contribution of Java code generator
+ */
+public class BlueGigaReadByTypeCommand extends BlueGigaCommand {
+ public static int COMMAND_CLASS = 0x04;
+ public static int COMMAND_METHOD = 0x02;
+
+ /**
+ * Connection handle
+ *
+ * BlueGiga API type is uint8 - Java type is {@link int}
+ */
+ private int connection;
+
+ /**
+ * First attribute handle
+ *
+ * BlueGiga API type is uint16 - Java type is {@link int}
+ */
+ private int start;
+
+ /**
+ * Last attribute handle
+ *
+ * BlueGiga API type is uint16 - Java type is {@link int}
+ */
+ private int end;
+
+ /**
+ * Attribute type (UUID)
+ *
+ * BlueGiga API type is uuid - Java type is {@link UUID}
+ */
+ private UUID uuid;
+
+ /**
+ * Connection handle
+ *
+ * @param connection the connection to set as {@link int}
+ */
+ public void setConnection(int connection) {
+ this.connection = connection;
+ }
+ /**
+ * First attribute handle
+ *
+ * @param start the start to set as {@link int}
+ */
+ public void setStart(int start) {
+ this.start = start;
+ }
+ /**
+ * Last attribute handle
+ *
+ * @param end the end to set as {@link int}
+ */
+ public void setEnd(int end) {
+ this.end = end;
+ }
+ /**
+ * Attribute type (UUID)
+ *
+ * @param uuid the uuid to set as {@link UUID}
+ */
+ public void setUuid(UUID uuid) {
+ this.uuid = uuid;
+ }
+
+ @Override
+ public int[] serialize() {
+ // Serialize the header
+ serializeHeader(COMMAND_CLASS, COMMAND_METHOD);
+
+ // Serialize the fields
+ serializeUInt8(connection);
+ serializeUInt16(start);
+ serializeUInt16(end);
+ serializeUuid(uuid);
+
+ return getPayload();
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder builder = new StringBuilder();
+ builder.append("BlueGigaReadByTypeCommand [connection=");
+ builder.append(connection);
+ builder.append(", start=");
+ builder.append(start);
+ builder.append(", end=");
+ builder.append(end);
+ builder.append(", uuid=");
+ builder.append(uuid);
+ builder.append(']');
+ return builder.toString();
+ }
+}
diff --git a/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaReadByTypeResponse.java b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaReadByTypeResponse.java
new file mode 100644
index 00000000000..234537c64eb
--- /dev/null
+++ b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaReadByTypeResponse.java
@@ -0,0 +1,94 @@
+/**
+ * Copyright (c) 2014,2017 Contributors to the Eclipse Foundation
+ *
+ * See the NOTICE file(s) distributed with this work for additional
+ * information regarding copyright ownership.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ */
+package org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.command.attributeclient;
+
+import org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.BlueGigaResponse;
+import org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.enumeration.BgApiResponse;
+
+/**
+ * Class to implement the BlueGiga command readByType.
+ *
+ * The command reads the value of each attribute of a given type (UUID) and in a given attribute
+ * handle range. The command can for example be used to discover the characteristic
+ * declarations (UUID: 0x2803) within a service.
+ *
+ * This class provides methods for processing BlueGiga API commands.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ *
+ * @author Chris Jackson - Initial contribution of Java code generator
+ */
+public class BlueGigaReadByTypeResponse extends BlueGigaResponse {
+ public static int COMMAND_CLASS = 0x04;
+ public static int COMMAND_METHOD = 0x02;
+
+ /**
+ * Connection handle
+ *
+ * BlueGiga API type is uint8 - Java type is {@link int}
+ */
+ private int connection;
+
+ /**
+ * 0 : the command was successful. Otherwise an error occurred
+ *
+ * BlueGiga API type is BgApiResponse - Java type is {@link BgApiResponse}
+ */
+ private BgApiResponse result;
+
+ /**
+ * Response constructor
+ */
+ public BlueGigaReadByTypeResponse(int[] inputBuffer) {
+ // Super creates deserializer and reads header fields
+ super(inputBuffer);
+
+ event = (inputBuffer[0] & 0x80) != 0;
+
+ // Deserialize the fields
+ connection = deserializeUInt8();
+ result = deserializeBgApiResponse();
+ }
+
+ /**
+ * Connection handle
+ *
+ * BlueGiga API type is uint8 - Java type is {@link int}
+ *
+ * @return the current connection as {@link int}
+ */
+ public int getConnection() {
+ return connection;
+ }
+ /**
+ * 0 : the command was successful. Otherwise an error occurred
+ *
+ * BlueGiga API type is BgApiResponse - Java type is {@link BgApiResponse}
+ *
+ * @return the current result as {@link BgApiResponse}
+ */
+ public BgApiResponse getResult() {
+ return result;
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder builder = new StringBuilder();
+ builder.append("BlueGigaReadByTypeResponse [connection=");
+ builder.append(connection);
+ builder.append(", result=");
+ builder.append(result);
+ builder.append(']');
+ return builder.toString();
+ }
+}
diff --git a/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaReadLongCommand.java b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaReadLongCommand.java
new file mode 100644
index 00000000000..dd1ea3650b4
--- /dev/null
+++ b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaReadLongCommand.java
@@ -0,0 +1,89 @@
+/**
+ * Copyright (c) 2014,2017 Contributors to the Eclipse Foundation
+ *
+ * See the NOTICE file(s) distributed with this work for additional
+ * information regarding copyright ownership.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ */
+package org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.command.attributeclient;
+
+import org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.BlueGigaCommand;
+
+/**
+ * Class to implement the BlueGiga command readLong.
+ *
+ * This command can be used to read long attribute values, which are longer than 22 bytes and
+ * cannot be read with a simple Read by Handle command. The command starts a procedure, where the
+ * client first sends a normal read command to the server and if the returned attribute value
+ * length is equal to MTU, the client will send further read long read requests until rest of the
+ * attribute is read.
+ *
+ * This class provides methods for processing BlueGiga API commands.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ *
+ * @author Chris Jackson - Initial contribution of Java code generator
+ */
+public class BlueGigaReadLongCommand extends BlueGigaCommand {
+ public static int COMMAND_CLASS = 0x04;
+ public static int COMMAND_METHOD = 0x08;
+
+ /**
+ * Connection handle
+ *
+ * BlueGiga API type is uint8 - Java type is {@link int}
+ */
+ private int connection;
+
+ /**
+ * Attribute handle
+ *
+ * BlueGiga API type is uint16 - Java type is {@link int}
+ */
+ private int chrHandle;
+
+ /**
+ * Connection handle
+ *
+ * @param connection the connection to set as {@link int}
+ */
+ public void setConnection(int connection) {
+ this.connection = connection;
+ }
+ /**
+ * Attribute handle
+ *
+ * @param chrHandle the chrHandle to set as {@link int}
+ */
+ public void setChrHandle(int chrHandle) {
+ this.chrHandle = chrHandle;
+ }
+
+ @Override
+ public int[] serialize() {
+ // Serialize the header
+ serializeHeader(COMMAND_CLASS, COMMAND_METHOD);
+
+ // Serialize the fields
+ serializeUInt8(connection);
+ serializeUInt16(chrHandle);
+
+ return getPayload();
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder builder = new StringBuilder();
+ builder.append("BlueGigaReadLongCommand [connection=");
+ builder.append(connection);
+ builder.append(", chrHandle=");
+ builder.append(chrHandle);
+ builder.append(']');
+ return builder.toString();
+ }
+}
diff --git a/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaReadLongResponse.java b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaReadLongResponse.java
new file mode 100644
index 00000000000..47a5439557e
--- /dev/null
+++ b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaReadLongResponse.java
@@ -0,0 +1,96 @@
+/**
+ * Copyright (c) 2014,2017 Contributors to the Eclipse Foundation
+ *
+ * See the NOTICE file(s) distributed with this work for additional
+ * information regarding copyright ownership.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ */
+package org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.command.attributeclient;
+
+import org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.BlueGigaResponse;
+import org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.enumeration.BgApiResponse;
+
+/**
+ * Class to implement the BlueGiga command readLong.
+ *
+ * This command can be used to read long attribute values, which are longer than 22 bytes and
+ * cannot be read with a simple Read by Handle command. The command starts a procedure, where the
+ * client first sends a normal read command to the server and if the returned attribute value
+ * length is equal to MTU, the client will send further read long read requests until rest of the
+ * attribute is read.
+ *
+ * This class provides methods for processing BlueGiga API commands.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ *
+ * @author Chris Jackson - Initial contribution of Java code generator
+ */
+public class BlueGigaReadLongResponse extends BlueGigaResponse {
+ public static int COMMAND_CLASS = 0x04;
+ public static int COMMAND_METHOD = 0x08;
+
+ /**
+ * Connection handle
+ *
+ * BlueGiga API type is uint8 - Java type is {@link int}
+ */
+ private int connection;
+
+ /**
+ * 0 : the command was successful. Otherwise an error occurred
+ *
+ * BlueGiga API type is BgApiResponse - Java type is {@link BgApiResponse}
+ */
+ private BgApiResponse result;
+
+ /**
+ * Response constructor
+ */
+ public BlueGigaReadLongResponse(int[] inputBuffer) {
+ // Super creates deserializer and reads header fields
+ super(inputBuffer);
+
+ event = (inputBuffer[0] & 0x80) != 0;
+
+ // Deserialize the fields
+ connection = deserializeUInt8();
+ result = deserializeBgApiResponse();
+ }
+
+ /**
+ * Connection handle
+ *
+ * BlueGiga API type is uint8 - Java type is {@link int}
+ *
+ * @return the current connection as {@link int}
+ */
+ public int getConnection() {
+ return connection;
+ }
+ /**
+ * 0 : the command was successful. Otherwise an error occurred
+ *
+ * BlueGiga API type is BgApiResponse - Java type is {@link BgApiResponse}
+ *
+ * @return the current result as {@link BgApiResponse}
+ */
+ public BgApiResponse getResult() {
+ return result;
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder builder = new StringBuilder();
+ builder.append("BlueGigaReadLongResponse [connection=");
+ builder.append(connection);
+ builder.append(", result=");
+ builder.append(result);
+ builder.append(']');
+ return builder.toString();
+ }
+}
diff --git a/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaReadMultipleCommand.java b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaReadMultipleCommand.java
new file mode 100644
index 00000000000..01f4da12495
--- /dev/null
+++ b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaReadMultipleCommand.java
@@ -0,0 +1,90 @@
+/**
+ * Copyright (c) 2014,2017 Contributors to the Eclipse Foundation
+ *
+ * See the NOTICE file(s) distributed with this work for additional
+ * information regarding copyright ownership.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ */
+package org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.command.attributeclient;
+
+import org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.BlueGigaCommand;
+
+/**
+ * Class to implement the BlueGiga command readMultiple.
+ *
+ * This command can be used to read multiple attributes from a server.
+ *
+ * This class provides methods for processing BlueGiga API commands.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ *
+ * @author Chris Jackson - Initial contribution of Java code generator
+ */
+public class BlueGigaReadMultipleCommand extends BlueGigaCommand {
+ public static int COMMAND_CLASS = 0x04;
+ public static int COMMAND_METHOD = 0x0B;
+
+ /**
+ * Connection handle
+ *
+ * BlueGiga API type is uint8 - Java type is {@link int}
+ */
+ private int connection;
+
+ /**
+ * List of attribute handles to read from the remote device
+ *
+ * BlueGiga API type is uint8array - Java type is {@link int[]}
+ */
+ private int[] handles;
+
+ /**
+ * Connection handle
+ *
+ * @param connection the connection to set as {@link int}
+ */
+ public void setConnection(int connection) {
+ this.connection = connection;
+ }
+ /**
+ * List of attribute handles to read from the remote device
+ *
+ * @param handles the handles to set as {@link int[]}
+ */
+ public void setHandles(int[] handles) {
+ this.handles = handles;
+ }
+
+ @Override
+ public int[] serialize() {
+ // Serialize the header
+ serializeHeader(COMMAND_CLASS, COMMAND_METHOD);
+
+ // Serialize the fields
+ serializeUInt8(connection);
+ serializeUInt8Array(handles);
+
+ return getPayload();
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder builder = new StringBuilder();
+ builder.append("BlueGigaReadMultipleCommand [connection=");
+ builder.append(connection);
+ builder.append(", handles=");
+ for (int c = 0; c < handles.length; c++) {
+ if (c > 0) {
+ builder.append(' ');
+ }
+ builder.append(String.format("%02X", handles[c]));
+ }
+ builder.append(']');
+ return builder.toString();
+ }
+}
diff --git a/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaReadMultipleResponse.java b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaReadMultipleResponse.java
new file mode 100644
index 00000000000..6deaa68e75f
--- /dev/null
+++ b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaReadMultipleResponse.java
@@ -0,0 +1,92 @@
+/**
+ * Copyright (c) 2014,2017 Contributors to the Eclipse Foundation
+ *
+ * See the NOTICE file(s) distributed with this work for additional
+ * information regarding copyright ownership.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ */
+package org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.command.attributeclient;
+
+import org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.BlueGigaResponse;
+import org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.enumeration.BgApiResponse;
+
+/**
+ * Class to implement the BlueGiga command readMultiple.
+ *
+ * This command can be used to read multiple attributes from a server.
+ *
+ * This class provides methods for processing BlueGiga API commands.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ *
+ * @author Chris Jackson - Initial contribution of Java code generator
+ */
+public class BlueGigaReadMultipleResponse extends BlueGigaResponse {
+ public static int COMMAND_CLASS = 0x04;
+ public static int COMMAND_METHOD = 0x0B;
+
+ /**
+ * Connection handle
+ *
+ * BlueGiga API type is uint8 - Java type is {@link int}
+ */
+ private int connection;
+
+ /**
+ * 0 : the command was successful. Otherwise an error occurred
+ *
+ * BlueGiga API type is BgApiResponse - Java type is {@link BgApiResponse}
+ */
+ private BgApiResponse result;
+
+ /**
+ * Response constructor
+ */
+ public BlueGigaReadMultipleResponse(int[] inputBuffer) {
+ // Super creates deserializer and reads header fields
+ super(inputBuffer);
+
+ event = (inputBuffer[0] & 0x80) != 0;
+
+ // Deserialize the fields
+ connection = deserializeUInt8();
+ result = deserializeBgApiResponse();
+ }
+
+ /**
+ * Connection handle
+ *
+ * BlueGiga API type is uint8 - Java type is {@link int}
+ *
+ * @return the current connection as {@link int}
+ */
+ public int getConnection() {
+ return connection;
+ }
+ /**
+ * 0 : the command was successful. Otherwise an error occurred
+ *
+ * BlueGiga API type is BgApiResponse - Java type is {@link BgApiResponse}
+ *
+ * @return the current result as {@link BgApiResponse}
+ */
+ public BgApiResponse getResult() {
+ return result;
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder builder = new StringBuilder();
+ builder.append("BlueGigaReadMultipleResponse [connection=");
+ builder.append(connection);
+ builder.append(", result=");
+ builder.append(result);
+ builder.append(']');
+ return builder.toString();
+ }
+}
diff --git a/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaReadMultipleResponseEvent.java b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaReadMultipleResponseEvent.java
new file mode 100644
index 00000000000..9f8e8c70299
--- /dev/null
+++ b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaReadMultipleResponseEvent.java
@@ -0,0 +1,98 @@
+/**
+ * Copyright (c) 2014,2017 Contributors to the Eclipse Foundation
+ *
+ * See the NOTICE file(s) distributed with this work for additional
+ * information regarding copyright ownership.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ */
+package org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.command.attributeclient;
+
+import org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.BlueGigaResponse;
+
+/**
+ * Class to implement the BlueGiga command readMultipleResponseEvent.
+ *
+ * This event is a response to a Read Multiple request.
+ *
+ * This class provides methods for processing BlueGiga API commands.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ *
+ * @author Chris Jackson - Initial contribution of Java code generator
+ */
+public class BlueGigaReadMultipleResponseEvent extends BlueGigaResponse {
+ public static int COMMAND_CLASS = 0x04;
+ public static int COMMAND_METHOD = 0x00;
+
+ /**
+ * Connection handle
+ *
+ * BlueGiga API type is uint8 - Java type is {@link int}
+ */
+ private int connection;
+
+ /**
+ * This array contains the concatenated data from the multiple attributes that have been read,
+ * up to 22 bytes.
+ *
+ * BlueGiga API type is uint8array - Java type is {@link int[]}
+ */
+ private int[] handles;
+
+ /**
+ * Event constructor
+ */
+ public BlueGigaReadMultipleResponseEvent(int[] inputBuffer) {
+ // Super creates deserializer and reads header fields
+ super(inputBuffer);
+
+ event = (inputBuffer[0] & 0x80) != 0;
+
+ // Deserialize the fields
+ connection = deserializeUInt8();
+ handles = deserializeUInt8Array();
+ }
+
+ /**
+ * Connection handle
+ *
+ * BlueGiga API type is uint8 - Java type is {@link int}
+ *
+ * @return the current connection as {@link int}
+ */
+ public int getConnection() {
+ return connection;
+ }
+ /**
+ * This array contains the concatenated data from the multiple attributes that have been read,
+ * up to 22 bytes.
+ *
+ * BlueGiga API type is uint8array - Java type is {@link int[]}
+ *
+ * @return the current handles as {@link int[]}
+ */
+ public int[] getHandles() {
+ return handles;
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder builder = new StringBuilder();
+ builder.append("BlueGigaReadMultipleResponseEvent [connection=");
+ builder.append(connection);
+ builder.append(", handles=");
+ for (int c = 0; c < handles.length; c++) {
+ if (c > 0) {
+ builder.append(' ');
+ }
+ builder.append(String.format("%02X", handles[c]));
+ }
+ builder.append(']');
+ return builder.toString();
+ }
+}
diff --git a/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaWriteCommandCommand.java b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaWriteCommandCommand.java
new file mode 100644
index 00000000000..2c345e4c506
--- /dev/null
+++ b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaWriteCommandCommand.java
@@ -0,0 +1,109 @@
+/**
+ * Copyright (c) 2014,2017 Contributors to the Eclipse Foundation
+ *
+ * See the NOTICE file(s) distributed with this work for additional
+ * information regarding copyright ownership.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ */
+package org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.command.attributeclient;
+
+import org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.BlueGigaCommand;
+
+/**
+ * Class to implement the BlueGiga command writeCommand.
+ *
+ * Writes the value of a remote devices attribute. The handle and the new value of the attribute
+ * are gives as parameters.
+ *
+ * This class provides methods for processing BlueGiga API commands.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ *
+ * @author Chris Jackson - Initial contribution of Java code generator
+ */
+public class BlueGigaWriteCommandCommand extends BlueGigaCommand {
+ public static int COMMAND_CLASS = 0x04;
+ public static int COMMAND_METHOD = 0x06;
+
+ /**
+ * Connection handle
+ *
+ * BlueGiga API type is uint8 - Java type is {@link int}
+ */
+ private int connection;
+
+ /**
+ * Attribute handle to write
+ *
+ * BlueGiga API type is uint16 - Java type is {@link int}
+ */
+ private int attHandle;
+
+ /**
+ * Value for the attribute
+ *
+ * BlueGiga API type is uint8array - Java type is {@link int[]}
+ */
+ private int[] data;
+
+ /**
+ * Connection handle
+ *
+ * @param connection the connection to set as {@link int}
+ */
+ public void setConnection(int connection) {
+ this.connection = connection;
+ }
+ /**
+ * Attribute handle to write
+ *
+ * @param attHandle the attHandle to set as {@link int}
+ */
+ public void setAttHandle(int attHandle) {
+ this.attHandle = attHandle;
+ }
+ /**
+ * Value for the attribute
+ *
+ * @param data the data to set as {@link int[]}
+ */
+ public void setData(int[] data) {
+ this.data = data;
+ }
+
+ @Override
+ public int[] serialize() {
+ // Serialize the header
+ serializeHeader(COMMAND_CLASS, COMMAND_METHOD);
+
+ // Serialize the fields
+ serializeUInt8(connection);
+ serializeUInt16(attHandle);
+ serializeUInt8Array(data);
+
+ return getPayload();
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder builder = new StringBuilder();
+ builder.append("BlueGigaWriteCommandCommand [connection=");
+ builder.append(connection);
+ builder.append(", attHandle=");
+ builder.append(attHandle);
+ builder.append(", data=");
+ for (int c = 0; c < data.length; c++) {
+ if (c > 0) {
+ builder.append(' ');
+ }
+ builder.append(String.format("%02X", data[c]));
+ }
+ builder.append(']');
+ return builder.toString();
+ }
+}
diff --git a/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaWriteCommandResponse.java b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaWriteCommandResponse.java
new file mode 100644
index 00000000000..f563d31d436
--- /dev/null
+++ b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaWriteCommandResponse.java
@@ -0,0 +1,93 @@
+/**
+ * Copyright (c) 2014,2017 Contributors to the Eclipse Foundation
+ *
+ * See the NOTICE file(s) distributed with this work for additional
+ * information regarding copyright ownership.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ */
+package org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.command.attributeclient;
+
+import org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.BlueGigaResponse;
+import org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.enumeration.BgApiResponse;
+
+/**
+ * Class to implement the BlueGiga command writeCommand.
+ *
+ * Writes the value of a remote devices attribute. The handle and the new value of the attribute
+ * are gives as parameters.
+ *
+ * This class provides methods for processing BlueGiga API commands.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ *
+ * @author Chris Jackson - Initial contribution of Java code generator
+ */
+public class BlueGigaWriteCommandResponse extends BlueGigaResponse {
+ public static int COMMAND_CLASS = 0x04;
+ public static int COMMAND_METHOD = 0x06;
+
+ /**
+ * Connection handle
+ *
+ * BlueGiga API type is uint8 - Java type is {@link int}
+ */
+ private int connection;
+
+ /**
+ * 0 : the command was successful. Otherwise an error occurred
+ *
+ * BlueGiga API type is BgApiResponse - Java type is {@link BgApiResponse}
+ */
+ private BgApiResponse result;
+
+ /**
+ * Response constructor
+ */
+ public BlueGigaWriteCommandResponse(int[] inputBuffer) {
+ // Super creates deserializer and reads header fields
+ super(inputBuffer);
+
+ event = (inputBuffer[0] & 0x80) != 0;
+
+ // Deserialize the fields
+ connection = deserializeUInt8();
+ result = deserializeBgApiResponse();
+ }
+
+ /**
+ * Connection handle
+ *
+ * BlueGiga API type is uint8 - Java type is {@link int}
+ *
+ * @return the current connection as {@link int}
+ */
+ public int getConnection() {
+ return connection;
+ }
+ /**
+ * 0 : the command was successful. Otherwise an error occurred
+ *
+ * BlueGiga API type is BgApiResponse - Java type is {@link BgApiResponse}
+ *
+ * @return the current result as {@link BgApiResponse}
+ */
+ public BgApiResponse getResult() {
+ return result;
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder builder = new StringBuilder();
+ builder.append("BlueGigaWriteCommandResponse [connection=");
+ builder.append(connection);
+ builder.append(", result=");
+ builder.append(result);
+ builder.append(']');
+ return builder.toString();
+ }
+}
diff --git a/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/attributedb/BlueGigaAttributeStatusEvent.java b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/attributedb/BlueGigaAttributeStatusEvent.java
new file mode 100644
index 00000000000..7030184d874
--- /dev/null
+++ b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/attributedb/BlueGigaAttributeStatusEvent.java
@@ -0,0 +1,94 @@
+/**
+ * Copyright (c) 2014,2017 Contributors to the Eclipse Foundation
+ *
+ * See the NOTICE file(s) distributed with this work for additional
+ * information regarding copyright ownership.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ */
+package org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.command.attributedb;
+
+import org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.BlueGigaResponse;
+
+/**
+ * Class to implement the BlueGiga command attributeStatusEvent.
+ *
+ * This event indicates attribute status flags have changed. For example, this even is
+ * generated at the module acting as the GATT Server whenever the remote GATT Client changes the
+ * Client Characteristic Configuration to start or stop notification or indications from the
+ * Server.
+ *
+ * This class provides methods for processing BlueGiga API commands.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ *
+ * @author Chris Jackson - Initial contribution of Java code generator
+ */
+public class BlueGigaAttributeStatusEvent extends BlueGigaResponse {
+ public static int COMMAND_CLASS = 0x02;
+ public static int COMMAND_METHOD = 0x02;
+
+ /**
+ * Attribute handle
+ *
+ * BlueGiga API type is uint16 - Java type is {@link int}
+ */
+ private int handle;
+
+ /**
+ * Attribute status flags. See: Attribute Status Flags
+ *
+ * BlueGiga API type is uint8 - Java type is {@link int}
+ */
+ private int flags;
+
+ /**
+ * Event constructor
+ */
+ public BlueGigaAttributeStatusEvent(int[] inputBuffer) {
+ // Super creates deserializer and reads header fields
+ super(inputBuffer);
+
+ event = (inputBuffer[0] & 0x80) != 0;
+
+ // Deserialize the fields
+ handle = deserializeUInt16();
+ flags = deserializeUInt8();
+ }
+
+ /**
+ * Attribute handle
+ *
+ * BlueGiga API type is uint16 - Java type is {@link int}
+ *
+ * @return the current handle as {@link int}
+ */
+ public int getHandle() {
+ return handle;
+ }
+ /**
+ * Attribute status flags. See: Attribute Status Flags
+ *
+ * BlueGiga API type is uint8 - Java type is {@link int}
+ *
+ * @return the current flags as {@link int}
+ */
+ public int getFlags() {
+ return flags;
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder builder = new StringBuilder();
+ builder.append("BlueGigaAttributeStatusEvent [handle=");
+ builder.append(handle);
+ builder.append(", flags=");
+ builder.append(flags);
+ builder.append(']');
+ return builder.toString();
+ }
+}
diff --git a/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/attributedb/BlueGigaReadCommand.java b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/attributedb/BlueGigaReadCommand.java
new file mode 100644
index 00000000000..e6f3d5fadad
--- /dev/null
+++ b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/attributedb/BlueGigaReadCommand.java
@@ -0,0 +1,87 @@
+/**
+ * Copyright (c) 2014,2017 Contributors to the Eclipse Foundation
+ *
+ * See the NOTICE file(s) distributed with this work for additional
+ * information regarding copyright ownership.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ */
+package org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.command.attributedb;
+
+import org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.BlueGigaCommand;
+
+/**
+ * Class to implement the BlueGiga command read.
+ *
+ * The command reads the given attribute's value from the local database. There is a 32-byte
+ * limit in the amount of data that can be read at a time. In order to read larger values multiple
+ * read commands must be used with the offset properly used.
+ *
+ * This class provides methods for processing BlueGiga API commands.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ *
+ * @author Chris Jackson - Initial contribution of Java code generator
+ */
+public class BlueGigaReadCommand extends BlueGigaCommand {
+ public static int COMMAND_CLASS = 0x02;
+ public static int COMMAND_METHOD = 0x01;
+
+ /**
+ * Handle of the attribute to read
+ *
+ * BlueGiga API type is uint16 - Java type is {@link int}
+ */
+ private int handle;
+
+ /**
+ * Offset to read from. Maximum of 32 bytes can be read at a time.
+ *
+ * BlueGiga API type is uint16 - Java type is {@link int}
+ */
+ private int offset;
+
+ /**
+ * Handle of the attribute to read
+ *
+ * @param handle the handle to set as {@link int}
+ */
+ public void setHandle(int handle) {
+ this.handle = handle;
+ }
+ /**
+ * Offset to read from. Maximum of 32 bytes can be read at a time.
+ *
+ * @param offset the offset to set as {@link int}
+ */
+ public void setOffset(int offset) {
+ this.offset = offset;
+ }
+
+ @Override
+ public int[] serialize() {
+ // Serialize the header
+ serializeHeader(COMMAND_CLASS, COMMAND_METHOD);
+
+ // Serialize the fields
+ serializeUInt16(handle);
+ serializeUInt16(offset);
+
+ return getPayload();
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder builder = new StringBuilder();
+ builder.append("BlueGigaReadCommand [handle=");
+ builder.append(handle);
+ builder.append(", offset=");
+ builder.append(offset);
+ builder.append(']');
+ return builder.toString();
+ }
+}
diff --git a/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/attributedb/BlueGigaReadResponse.java b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/attributedb/BlueGigaReadResponse.java
new file mode 100644
index 00000000000..d0f45b87f10
--- /dev/null
+++ b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/attributedb/BlueGigaReadResponse.java
@@ -0,0 +1,139 @@
+/**
+ * Copyright (c) 2014,2017 Contributors to the Eclipse Foundation
+ *
+ * See the NOTICE file(s) distributed with this work for additional
+ * information regarding copyright ownership.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ */
+package org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.command.attributedb;
+
+import org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.BlueGigaResponse;
+import org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.enumeration.BgApiResponse;
+
+/**
+ * Class to implement the BlueGiga command read.
+ *
+ * The command reads the given attribute's value from the local database. There is a 32-byte
+ * limit in the amount of data that can be read at a time. In order to read larger values multiple
+ * read commands must be used with the offset properly used.
+ *
+ * This class provides methods for processing BlueGiga API commands.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ *
+ * @author Chris Jackson - Initial contribution of Java code generator
+ */
+public class BlueGigaReadResponse extends BlueGigaResponse {
+ public static int COMMAND_CLASS = 0x02;
+ public static int COMMAND_METHOD = 0x01;
+
+ /**
+ * Handle of the attribute which was read
+ *
+ * BlueGiga API type is uint16 - Java type is {@link int}
+ */
+ private int handle;
+
+ /**
+ * Offset read from
+ *
+ * BlueGiga API type is uint16 - Java type is {@link int}
+ */
+ private int offset;
+
+ /**
+ * 0 : the command was successful. Otherwise an error occurred
+ *
+ * BlueGiga API type is BgApiResponse - Java type is {@link BgApiResponse}
+ */
+ private BgApiResponse result;
+
+ /**
+ * Value of the attribute
+ *
+ * BlueGiga API type is uint8array - Java type is {@link int[]}
+ */
+ private int[] value;
+
+ /**
+ * Response constructor
+ */
+ public BlueGigaReadResponse(int[] inputBuffer) {
+ // Super creates deserializer and reads header fields
+ super(inputBuffer);
+
+ event = (inputBuffer[0] & 0x80) != 0;
+
+ // Deserialize the fields
+ handle = deserializeUInt16();
+ offset = deserializeUInt16();
+ result = deserializeBgApiResponse();
+ value = deserializeUInt8Array();
+ }
+
+ /**
+ * Handle of the attribute which was read
+ *
+ * BlueGiga API type is uint16 - Java type is {@link int}
+ *
+ * @return the current handle as {@link int}
+ */
+ public int getHandle() {
+ return handle;
+ }
+ /**
+ * Offset read from
+ *
+ * BlueGiga API type is uint16 - Java type is {@link int}
+ *
+ * @return the current offset as {@link int}
+ */
+ public int getOffset() {
+ return offset;
+ }
+ /**
+ * 0 : the command was successful. Otherwise an error occurred
+ *
+ * BlueGiga API type is BgApiResponse - Java type is {@link BgApiResponse}
+ *
+ * @return the current result as {@link BgApiResponse}
+ */
+ public BgApiResponse getResult() {
+ return result;
+ }
+ /**
+ * Value of the attribute
+ *
+ * BlueGiga API type is uint8array - Java type is {@link int[]}
+ *
+ * @return the current value as {@link int[]}
+ */
+ public int[] getValue() {
+ return value;
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder builder = new StringBuilder();
+ builder.append("BlueGigaReadResponse [handle=");
+ builder.append(handle);
+ builder.append(", offset=");
+ builder.append(offset);
+ builder.append(", result=");
+ builder.append(result);
+ builder.append(", value=");
+ for (int c = 0; c < value.length; c++) {
+ if (c > 0) {
+ builder.append(' ');
+ }
+ builder.append(String.format("%02X", value[c]));
+ }
+ builder.append(']');
+ return builder.toString();
+ }
+}
diff --git a/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/attributedb/BlueGigaReadTypeCommand.java b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/attributedb/BlueGigaReadTypeCommand.java
new file mode 100644
index 00000000000..e0243ee4774
--- /dev/null
+++ b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/attributedb/BlueGigaReadTypeCommand.java
@@ -0,0 +1,67 @@
+/**
+ * Copyright (c) 2014,2017 Contributors to the Eclipse Foundation
+ *
+ * See the NOTICE file(s) distributed with this work for additional
+ * information regarding copyright ownership.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ */
+package org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.command.attributedb;
+
+import org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.BlueGigaCommand;
+
+/**
+ * Class to implement the BlueGiga command readType.
+ *
+ * This command reads the given attribute's type (UUID) from the local database.
+ *
+ * This class provides methods for processing BlueGiga API commands.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ *
+ * @author Chris Jackson - Initial contribution of Java code generator
+ */
+public class BlueGigaReadTypeCommand extends BlueGigaCommand {
+ public static int COMMAND_CLASS = 0x02;
+ public static int COMMAND_METHOD = 0x02;
+
+ /**
+ * Handle of the attribute to read
+ *
+ * BlueGiga API type is uint16 - Java type is {@link int}
+ */
+ private int handle;
+
+ /**
+ * Handle of the attribute to read
+ *
+ * @param handle the handle to set as {@link int}
+ */
+ public void setHandle(int handle) {
+ this.handle = handle;
+ }
+
+ @Override
+ public int[] serialize() {
+ // Serialize the header
+ serializeHeader(COMMAND_CLASS, COMMAND_METHOD);
+
+ // Serialize the fields
+ serializeUInt16(handle);
+
+ return getPayload();
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder builder = new StringBuilder();
+ builder.append("BlueGigaReadTypeCommand [handle=");
+ builder.append(handle);
+ builder.append(']');
+ return builder.toString();
+ }
+}
diff --git a/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/attributedb/BlueGigaReadTypeResponse.java b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/attributedb/BlueGigaReadTypeResponse.java
new file mode 100644
index 00000000000..2eee68493cf
--- /dev/null
+++ b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/attributedb/BlueGigaReadTypeResponse.java
@@ -0,0 +1,117 @@
+/**
+ * Copyright (c) 2014,2017 Contributors to the Eclipse Foundation
+ *
+ * See the NOTICE file(s) distributed with this work for additional
+ * information regarding copyright ownership.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ */
+package org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.command.attributedb;
+
+import org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.BlueGigaResponse;
+import org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.enumeration.BgApiResponse;
+
+/**
+ * Class to implement the BlueGiga command readType.
+ *
+ * This command reads the given attribute's type (UUID) from the local database.
+ *
+ * This class provides methods for processing BlueGiga API commands.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ *
+ * @author Chris Jackson - Initial contribution of Java code generator
+ */
+public class BlueGigaReadTypeResponse extends BlueGigaResponse {
+ public static int COMMAND_CLASS = 0x02;
+ public static int COMMAND_METHOD = 0x02;
+
+ /**
+ * Handle of the attribute which was read
+ *
+ * BlueGiga API type is uint16 - Java type is {@link int}
+ */
+ private int handle;
+
+ /**
+ * 0 : the command was successful. Otherwise an error occurred
+ *
+ * BlueGiga API type is BgApiResponse - Java type is {@link BgApiResponse}
+ */
+ private BgApiResponse result;
+
+ /**
+ * Value of the attribute type (UUID)
+ *
+ * BlueGiga API type is uint8array - Java type is {@link int[]}
+ */
+ private int[] value;
+
+ /**
+ * Response constructor
+ */
+ public BlueGigaReadTypeResponse(int[] inputBuffer) {
+ // Super creates deserializer and reads header fields
+ super(inputBuffer);
+
+ event = (inputBuffer[0] & 0x80) != 0;
+
+ // Deserialize the fields
+ handle = deserializeUInt16();
+ result = deserializeBgApiResponse();
+ value = deserializeUInt8Array();
+ }
+
+ /**
+ * Handle of the attribute which was read
+ *
+ * BlueGiga API type is uint16 - Java type is {@link int}
+ *
+ * @return the current handle as {@link int}
+ */
+ public int getHandle() {
+ return handle;
+ }
+ /**
+ * 0 : the command was successful. Otherwise an error occurred
+ *
+ * BlueGiga API type is BgApiResponse - Java type is {@link BgApiResponse}
+ *
+ * @return the current result as {@link BgApiResponse}
+ */
+ public BgApiResponse getResult() {
+ return result;
+ }
+ /**
+ * Value of the attribute type (UUID)
+ *
+ * BlueGiga API type is uint8array - Java type is {@link int[]}
+ *
+ * @return the current value as {@link int[]}
+ */
+ public int[] getValue() {
+ return value;
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder builder = new StringBuilder();
+ builder.append("BlueGigaReadTypeResponse [handle=");
+ builder.append(handle);
+ builder.append(", result=");
+ builder.append(result);
+ builder.append(", value=");
+ for (int c = 0; c < value.length; c++) {
+ if (c > 0) {
+ builder.append(' ');
+ }
+ builder.append(String.format("%02X", value[c]));
+ }
+ builder.append(']');
+ return builder.toString();
+ }
+}
diff --git a/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/attributedb/BlueGigaSendAttributesCommand.java b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/attributedb/BlueGigaSendAttributesCommand.java
new file mode 100644
index 00000000000..1be271dc75d
--- /dev/null
+++ b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/attributedb/BlueGigaSendAttributesCommand.java
@@ -0,0 +1,116 @@
+/**
+ * Copyright (c) 2014,2017 Contributors to the Eclipse Foundation
+ *
+ * See the NOTICE file(s) distributed with this work for additional
+ * information regarding copyright ownership.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ */
+package org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.command.attributedb;
+
+import org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.BlueGigaCommand;
+
+/**
+ * Class to implement the BlueGiga command sendAttributes.
+ *
+ * This command will send an attribute value, identified by handle, via a notification or an
+ * indication to a remote device, but does not modify the current corresponding value in the
+ * local GATT database. If this attribute, identified by handle, does not have notification or
+ * indication property, or no remote device has registered for notifications or indications
+ * of this attribute, then an error will be returned.
+ *
+ * This class provides methods for processing BlueGiga API commands.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ *
+ * @author Chris Jackson - Initial contribution of Java code generator
+ */
+public class BlueGigaSendAttributesCommand extends BlueGigaCommand {
+ public static int COMMAND_CLASS = 0x02;
+ public static int COMMAND_METHOD = 0x02;
+
+ /**
+ * Connection handle to send to. Use 0xFF to send to all connected clients which have subscribed
+ * to receive the notifications or indications. An error is returned as soon as the first failed
+ * transmission occurs.
+ *
+ * BlueGiga API type is uint8 - Java type is {@link int}
+ */
+ private int connection;
+
+ /**
+ * Attribute handle to send.
+ *
+ * BlueGiga API type is uint16 - Java type is {@link int}
+ */
+ private int handle;
+
+ /**
+ * Data to send
+ *
+ * BlueGiga API type is uint8array - Java type is {@link int[]}
+ */
+ private int[] value;
+
+ /**
+ * Connection handle to send to. Use 0xFF to send to all connected clients which have subscribed
+ * to receive the notifications or indications. An error is returned as soon as the first failed
+ * transmission occurs.
+ *
+ * @param connection the connection to set as {@link int}
+ */
+ public void setConnection(int connection) {
+ this.connection = connection;
+ }
+ /**
+ * Attribute handle to send.
+ *
+ * @param handle the handle to set as {@link int}
+ */
+ public void setHandle(int handle) {
+ this.handle = handle;
+ }
+ /**
+ * Data to send
+ *
+ * @param value the value to set as {@link int[]}
+ */
+ public void setValue(int[] value) {
+ this.value = value;
+ }
+
+ @Override
+ public int[] serialize() {
+ // Serialize the header
+ serializeHeader(COMMAND_CLASS, COMMAND_METHOD);
+
+ // Serialize the fields
+ serializeUInt8(connection);
+ serializeUInt16(handle);
+ serializeUInt8Array(value);
+
+ return getPayload();
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder builder = new StringBuilder();
+ builder.append("BlueGigaSendAttributesCommand [connection=");
+ builder.append(connection);
+ builder.append(", handle=");
+ builder.append(handle);
+ builder.append(", value=");
+ for (int c = 0; c < value.length; c++) {
+ if (c > 0) {
+ builder.append(' ');
+ }
+ builder.append(String.format("%02X", value[c]));
+ }
+ builder.append(']');
+ return builder.toString();
+ }
+}
diff --git a/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/attributedb/BlueGigaSendAttributesResponse.java b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/attributedb/BlueGigaSendAttributesResponse.java
new file mode 100644
index 00000000000..c80e2e951f1
--- /dev/null
+++ b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/attributedb/BlueGigaSendAttributesResponse.java
@@ -0,0 +1,76 @@
+/**
+ * Copyright (c) 2014,2017 Contributors to the Eclipse Foundation
+ *
+ * See the NOTICE file(s) distributed with this work for additional
+ * information regarding copyright ownership.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ */
+package org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.command.attributedb;
+
+import org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.BlueGigaResponse;
+import org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.enumeration.BgApiResponse;
+
+/**
+ * Class to implement the BlueGiga command sendAttributes.
+ *
+ * This command will send an attribute value, identified by handle, via a notification or an
+ * indication to a remote device, but does not modify the current corresponding value in the
+ * local GATT database. If this attribute, identified by handle, does not have notification or
+ * indication property, or no remote device has registered for notifications or indications
+ * of this attribute, then an error will be returned.
+ *
+ * This class provides methods for processing BlueGiga API commands.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ *
+ * @author Chris Jackson - Initial contribution of Java code generator
+ */
+public class BlueGigaSendAttributesResponse extends BlueGigaResponse {
+ public static int COMMAND_CLASS = 0x02;
+ public static int COMMAND_METHOD = 0x02;
+
+ /**
+ * 0 : the command was successful. Otherwise an error occurred
+ *
+ * BlueGiga API type is BgApiResponse - Java type is {@link BgApiResponse}
+ */
+ private BgApiResponse result;
+
+ /**
+ * Response constructor
+ */
+ public BlueGigaSendAttributesResponse(int[] inputBuffer) {
+ // Super creates deserializer and reads header fields
+ super(inputBuffer);
+
+ event = (inputBuffer[0] & 0x80) != 0;
+
+ // Deserialize the fields
+ result = deserializeBgApiResponse();
+ }
+
+ /**
+ * 0 : the command was successful. Otherwise an error occurred
+ *
+ * BlueGiga API type is BgApiResponse - Java type is {@link BgApiResponse}
+ *
+ * @return the current result as {@link BgApiResponse}
+ */
+ public BgApiResponse getResult() {
+ return result;
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder builder = new StringBuilder();
+ builder.append("BlueGigaSendAttributesResponse [result=");
+ builder.append(result);
+ builder.append(']');
+ return builder.toString();
+ }
+}
diff --git a/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/attributedb/BlueGigaUserReadRequestEvent.java b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/attributedb/BlueGigaUserReadRequestEvent.java
new file mode 100644
index 00000000000..5c507936753
--- /dev/null
+++ b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/attributedb/BlueGigaUserReadRequestEvent.java
@@ -0,0 +1,135 @@
+/**
+ * Copyright (c) 2014,2017 Contributors to the Eclipse Foundation
+ *
+ * See the NOTICE file(s) distributed with this work for additional
+ * information regarding copyright ownership.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ */
+package org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.command.attributedb;
+
+import org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.BlueGigaResponse;
+
+/**
+ * Class to implement the BlueGiga command userReadRequestEvent.
+ *
+ * This event is generated when a remote device tries to read an attribute which has the user
+ * property enabled. This event should be responded within 30 seconds with User Read Response
+ * command either containing the data or an error code.
+ *
+ * This class provides methods for processing BlueGiga API commands.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ *
+ * @author Chris Jackson - Initial contribution of Java code generator
+ */
+public class BlueGigaUserReadRequestEvent extends BlueGigaResponse {
+ public static int COMMAND_CLASS = 0x02;
+ public static int COMMAND_METHOD = 0x01;
+
+ /**
+ * Connection ID which requested attribute
+ *
+ * BlueGiga API type is uint8 - Java type is {@link int}
+ */
+ private int connection;
+
+ /**
+ * Attribute handle requested
+ *
+ * BlueGiga API type is uint16 - Java type is {@link int}
+ */
+ private int handle;
+
+ /**
+ * Attribute offset to send data from
+ *
+ * BlueGiga API type is uint16 - Java type is {@link int}
+ */
+ private int offset;
+
+ /**
+ * Maximum data size to respond with. If more data is sent than indicated by this parameter, the
+ * extra bytes will be ignored.
+ *
+ * BlueGiga API type is uint8 - Java type is {@link int}
+ */
+ private int maxsize;
+
+ /**
+ * Event constructor
+ */
+ public BlueGigaUserReadRequestEvent(int[] inputBuffer) {
+ // Super creates deserializer and reads header fields
+ super(inputBuffer);
+
+ event = (inputBuffer[0] & 0x80) != 0;
+
+ // Deserialize the fields
+ connection = deserializeUInt8();
+ handle = deserializeUInt16();
+ offset = deserializeUInt16();
+ maxsize = deserializeUInt8();
+ }
+
+ /**
+ * Connection ID which requested attribute
+ *
+ * BlueGiga API type is uint8 - Java type is {@link int}
+ *
+ * @return the current connection as {@link int}
+ */
+ public int getConnection() {
+ return connection;
+ }
+ /**
+ * Attribute handle requested
+ *
+ * BlueGiga API type is uint16 - Java type is {@link int}
+ *
+ * @return the current handle as {@link int}
+ */
+ public int getHandle() {
+ return handle;
+ }
+ /**
+ * Attribute offset to send data from
+ *
+ * BlueGiga API type is uint16 - Java type is {@link int}
+ *
+ * @return the current offset as {@link int}
+ */
+ public int getOffset() {
+ return offset;
+ }
+ /**
+ * Maximum data size to respond with. If more data is sent than indicated by this parameter, the
+ * extra bytes will be ignored.
+ *
+ * BlueGiga API type is uint8 - Java type is {@link int}
+ *
+ * @return the current maxsize as {@link int}
+ */
+ public int getMaxsize() {
+ return maxsize;
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder builder = new StringBuilder();
+ builder.append("BlueGigaUserReadRequestEvent [connection=");
+ builder.append(connection);
+ builder.append(", handle=");
+ builder.append(handle);
+ builder.append(", offset=");
+ builder.append(offset);
+ builder.append(", maxsize=");
+ builder.append(maxsize);
+ builder.append(']');
+ return builder.toString();
+ }
+}
diff --git a/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/attributedb/BlueGigaUserReadResponseCommand.java b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/attributedb/BlueGigaUserReadResponseCommand.java
new file mode 100644
index 00000000000..ec314072f7c
--- /dev/null
+++ b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/attributedb/BlueGigaUserReadResponseCommand.java
@@ -0,0 +1,117 @@
+/**
+ * Copyright (c) 2014,2017 Contributors to the Eclipse Foundation
+ *
+ * See the NOTICE file(s) distributed with this work for additional
+ * information regarding copyright ownership.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ */
+package org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.command.attributedb;
+
+import org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.BlueGigaCommand;
+
+/**
+ * Class to implement the BlueGiga command userReadResponse.
+ *
+ * This command is used to respond to an attribute Read request by a remote device, but only for
+ * attributes which have been configured with the user property. Attributes which have the
+ * user property enabled allow the attribute value to be requested from the application
+ * instead of the Smart stack automatically responding with Bluetooth the data in it's local
+ * GATT database. This command is normally used in response to a User Read Request event, which
+ * is generated when a remote device tries to read an attribute with a user property enabled. The
+ * response to User Read Request events must happen within 30 seconds or otherwise a timeout
+ * will occur.
+ *
+ * This class provides methods for processing BlueGiga API commands.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ *
+ * @author Chris Jackson - Initial contribution of Java code generator
+ */
+public class BlueGigaUserReadResponseCommand extends BlueGigaCommand {
+ public static int COMMAND_CLASS = 0x02;
+ public static int COMMAND_METHOD = 0x03;
+
+ /**
+ * Connection handle to response to.
+ *
+ * BlueGiga API type is uint8 - Java type is {@link int}
+ */
+ private int connection;
+
+ /**
+ * 0: User Read Request is responded with data. In case of an error an application specific error
+ * code can be sent.
+ *
+ * BlueGiga API type is uint8 - Java type is {@link int}
+ */
+ private int attError;
+
+ /**
+ * Data to send
+ *
+ * BlueGiga API type is uint8array - Java type is {@link int[]}
+ */
+ private int[] value;
+
+ /**
+ * Connection handle to response to.
+ *
+ * @param connection the connection to set as {@link int}
+ */
+ public void setConnection(int connection) {
+ this.connection = connection;
+ }
+ /**
+ * 0: User Read Request is responded with data. In case of an error an application specific error
+ * code can be sent.
+ *
+ * @param attError the attError to set as {@link int}
+ */
+ public void setAttError(int attError) {
+ this.attError = attError;
+ }
+ /**
+ * Data to send
+ *
+ * @param value the value to set as {@link int[]}
+ */
+ public void setValue(int[] value) {
+ this.value = value;
+ }
+
+ @Override
+ public int[] serialize() {
+ // Serialize the header
+ serializeHeader(COMMAND_CLASS, COMMAND_METHOD);
+
+ // Serialize the fields
+ serializeUInt8(connection);
+ serializeUInt8(attError);
+ serializeUInt8Array(value);
+
+ return getPayload();
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder builder = new StringBuilder();
+ builder.append("BlueGigaUserReadResponseCommand [connection=");
+ builder.append(connection);
+ builder.append(", attError=");
+ builder.append(attError);
+ builder.append(", value=");
+ for (int c = 0; c < value.length; c++) {
+ if (c > 0) {
+ builder.append(' ');
+ }
+ builder.append(String.format("%02X", value[c]));
+ }
+ builder.append(']');
+ return builder.toString();
+ }
+}
diff --git a/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/attributedb/BlueGigaUserReadResponseResponse.java b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/attributedb/BlueGigaUserReadResponseResponse.java
new file mode 100644
index 00000000000..0597f878786
--- /dev/null
+++ b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/attributedb/BlueGigaUserReadResponseResponse.java
@@ -0,0 +1,56 @@
+/**
+ * Copyright (c) 2014,2017 Contributors to the Eclipse Foundation
+ *
+ * See the NOTICE file(s) distributed with this work for additional
+ * information regarding copyright ownership.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ */
+package org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.command.attributedb;
+
+import org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.BlueGigaResponse;
+
+/**
+ * Class to implement the BlueGiga command userReadResponse.
+ *
+ * This command is used to respond to an attribute Read request by a remote device, but only for
+ * attributes which have been configured with the user property. Attributes which have the
+ * user property enabled allow the attribute value to be requested from the application
+ * instead of the Smart stack automatically responding with Bluetooth the data in it's local
+ * GATT database. This command is normally used in response to a User Read Request event, which
+ * is generated when a remote device tries to read an attribute with a user property enabled. The
+ * response to User Read Request events must happen within 30 seconds or otherwise a timeout
+ * will occur.
+ *
+ * This class provides methods for processing BlueGiga API commands.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ *
+ * @author Chris Jackson - Initial contribution of Java code generator
+ */
+public class BlueGigaUserReadResponseResponse extends BlueGigaResponse {
+ public static int COMMAND_CLASS = 0x02;
+ public static int COMMAND_METHOD = 0x03;
+
+ /**
+ * Response constructor
+ */
+ public BlueGigaUserReadResponseResponse(int[] inputBuffer) {
+ // Super creates deserializer and reads header fields
+ super(inputBuffer);
+
+ event = (inputBuffer[0] & 0x80) != 0;
+
+ // Deserialize the fields
+ }
+
+
+ @Override
+ public String toString() {
+ return "BlueGigaUserReadResponseResponse []";
+ }
+}
diff --git a/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/attributedb/BlueGigaUserWriteResponseCommand.java b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/attributedb/BlueGigaUserWriteResponseCommand.java
new file mode 100644
index 00000000000..f5c816a93dc
--- /dev/null
+++ b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/attributedb/BlueGigaUserWriteResponseCommand.java
@@ -0,0 +1,93 @@
+/**
+ * Copyright (c) 2014,2017 Contributors to the Eclipse Foundation
+ *
+ * See the NOTICE file(s) distributed with this work for additional
+ * information regarding copyright ownership.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ */
+package org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.command.attributedb;
+
+import org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.BlueGigaCommand;
+
+/**
+ * Class to implement the BlueGiga command userWriteResponse.
+ *
+ * This command is used by the GATT server to acknowledge to the remote device that the
+ * attribute's value was written. This feature again allows the user application to
+ * acknowledged the attribute write operations instead of the Smart stack doing it
+ * automatically. Bluetooth The command should be used when a event is received where the
+ * reason why value has changed Value corresponds to
+ * attributes_attribute_change_reason_write_request_user. This response must be sent
+ * within 30 seconds or otherwise a timeout will occur.
+ *
+ * This class provides methods for processing BlueGiga API commands.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ *
+ * @author Chris Jackson - Initial contribution of Java code generator
+ */
+public class BlueGigaUserWriteResponseCommand extends BlueGigaCommand {
+ public static int COMMAND_CLASS = 0x02;
+ public static int COMMAND_METHOD = 0x04;
+
+ /**
+ * Connection handle to response to.
+ *
+ * BlueGiga API type is uint8 - Java type is {@link int}
+ */
+ private int connection;
+
+ /**
+ * 0: User Read Request is responded with data. In case of an error an application specific error
+ * code can be sent.
+ *
+ * BlueGiga API type is uint8 - Java type is {@link int}
+ */
+ private int attError;
+
+ /**
+ * Connection handle to response to.
+ *
+ * @param connection the connection to set as {@link int}
+ */
+ public void setConnection(int connection) {
+ this.connection = connection;
+ }
+ /**
+ * 0: User Read Request is responded with data. In case of an error an application specific error
+ * code can be sent.
+ *
+ * @param attError the attError to set as {@link int}
+ */
+ public void setAttError(int attError) {
+ this.attError = attError;
+ }
+
+ @Override
+ public int[] serialize() {
+ // Serialize the header
+ serializeHeader(COMMAND_CLASS, COMMAND_METHOD);
+
+ // Serialize the fields
+ serializeUInt8(connection);
+ serializeUInt8(attError);
+
+ return getPayload();
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder builder = new StringBuilder();
+ builder.append("BlueGigaUserWriteResponseCommand [connection=");
+ builder.append(connection);
+ builder.append(", attError=");
+ builder.append(attError);
+ builder.append(']');
+ return builder.toString();
+ }
+}
diff --git a/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/attributedb/BlueGigaUserWriteResponseResponse.java b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/attributedb/BlueGigaUserWriteResponseResponse.java
new file mode 100644
index 00000000000..72289f6228e
--- /dev/null
+++ b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/attributedb/BlueGigaUserWriteResponseResponse.java
@@ -0,0 +1,55 @@
+/**
+ * Copyright (c) 2014,2017 Contributors to the Eclipse Foundation
+ *
+ * See the NOTICE file(s) distributed with this work for additional
+ * information regarding copyright ownership.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ */
+package org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.command.attributedb;
+
+import org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.BlueGigaResponse;
+
+/**
+ * Class to implement the BlueGiga command userWriteResponse.
+ *
+ * This command is used by the GATT server to acknowledge to the remote device that the
+ * attribute's value was written. This feature again allows the user application to
+ * acknowledged the attribute write operations instead of the Smart stack doing it
+ * automatically. Bluetooth The command should be used when a event is received where the
+ * reason why value has changed Value corresponds to
+ * attributes_attribute_change_reason_write_request_user. This response must be sent
+ * within 30 seconds or otherwise a timeout will occur.
+ *
+ * This class provides methods for processing BlueGiga API commands.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ *
+ * @author Chris Jackson - Initial contribution of Java code generator
+ */
+public class BlueGigaUserWriteResponseResponse extends BlueGigaResponse {
+ public static int COMMAND_CLASS = 0x02;
+ public static int COMMAND_METHOD = 0x04;
+
+ /**
+ * Response constructor
+ */
+ public BlueGigaUserWriteResponseResponse(int[] inputBuffer) {
+ // Super creates deserializer and reads header fields
+ super(inputBuffer);
+
+ event = (inputBuffer[0] & 0x80) != 0;
+
+ // Deserialize the fields
+ }
+
+
+ @Override
+ public String toString() {
+ return "BlueGigaUserWriteResponseResponse []";
+ }
+}
diff --git a/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/attributedb/BlueGigaValueEvent.java b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/attributedb/BlueGigaValueEvent.java
new file mode 100644
index 00000000000..95d02396786
--- /dev/null
+++ b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/attributedb/BlueGigaValueEvent.java
@@ -0,0 +1,158 @@
+/**
+ * Copyright (c) 2014,2017 Contributors to the Eclipse Foundation
+ *
+ * See the NOTICE file(s) distributed with this work for additional
+ * information regarding copyright ownership.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ */
+package org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.command.attributedb;
+
+import org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.BlueGigaResponse;
+import org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.enumeration.AttributeChangeReason;
+
+/**
+ * Class to implement the BlueGiga command valueEvent.
+ *
+ * This event is produced at the GATT server when a local attribute value was written by a remote
+ * device.
+ *
+ * This class provides methods for processing BlueGiga API commands.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ *
+ * @author Chris Jackson - Initial contribution of Java code generator
+ */
+public class BlueGigaValueEvent extends BlueGigaResponse {
+ public static int COMMAND_CLASS = 0x02;
+ public static int COMMAND_METHOD = 0x00;
+
+ /**
+ * Connection handle
+ *
+ * BlueGiga API type is uint8 - Java type is {@link int}
+ */
+ private int connection;
+
+ /**
+ * Reason why value has changed see: enum Attribute Change Reason
+ *
+ * BlueGiga API type is AttributeChangeReason - Java type is {@link AttributeChangeReason}
+ */
+ private AttributeChangeReason reason;
+
+ /**
+ * Attribute handle, which was changed
+ *
+ * BlueGiga API type is uint16 - Java type is {@link int}
+ */
+ private int handle;
+
+ /**
+ * Offset into attribute value where data starts
+ *
+ * BlueGiga API type is uint16 - Java type is {@link int}
+ */
+ private int offset;
+
+ /**
+ * Attribute value
+ *
+ * BlueGiga API type is uint8array - Java type is {@link int[]}
+ */
+ private int[] value;
+
+ /**
+ * Event constructor
+ */
+ public BlueGigaValueEvent(int[] inputBuffer) {
+ // Super creates deserializer and reads header fields
+ super(inputBuffer);
+
+ event = (inputBuffer[0] & 0x80) != 0;
+
+ // Deserialize the fields
+ connection = deserializeUInt8();
+ reason = deserializeAttributeChangeReason();
+ handle = deserializeUInt16();
+ offset = deserializeUInt16();
+ value = deserializeUInt8Array();
+ }
+
+ /**
+ * Connection handle
+ *
+ * BlueGiga API type is uint8 - Java type is {@link int}
+ *
+ * @return the current connection as {@link int}
+ */
+ public int getConnection() {
+ return connection;
+ }
+ /**
+ * Reason why value has changed see: enum Attribute Change Reason
+ *
+ * BlueGiga API type is AttributeChangeReason - Java type is {@link AttributeChangeReason}
+ *
+ * @return the current reason as {@link AttributeChangeReason}
+ */
+ public AttributeChangeReason getReason() {
+ return reason;
+ }
+ /**
+ * Attribute handle, which was changed
+ *
+ * BlueGiga API type is uint16 - Java type is {@link int}
+ *
+ * @return the current handle as {@link int}
+ */
+ public int getHandle() {
+ return handle;
+ }
+ /**
+ * Offset into attribute value where data starts
+ *
+ * BlueGiga API type is uint16 - Java type is {@link int}
+ *
+ * @return the current offset as {@link int}
+ */
+ public int getOffset() {
+ return offset;
+ }
+ /**
+ * Attribute value
+ *
+ * BlueGiga API type is uint8array - Java type is {@link int[]}
+ *
+ * @return the current value as {@link int[]}
+ */
+ public int[] getValue() {
+ return value;
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder builder = new StringBuilder();
+ builder.append("BlueGigaValueEvent [connection=");
+ builder.append(connection);
+ builder.append(", reason=");
+ builder.append(reason);
+ builder.append(", handle=");
+ builder.append(handle);
+ builder.append(", offset=");
+ builder.append(offset);
+ builder.append(", value=");
+ for (int c = 0; c < value.length; c++) {
+ if (c > 0) {
+ builder.append(' ');
+ }
+ builder.append(String.format("%02X", value[c]));
+ }
+ builder.append(']');
+ return builder.toString();
+ }
+}
diff --git a/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/attributedb/BlueGigaWriteCommand.java b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/attributedb/BlueGigaWriteCommand.java
new file mode 100644
index 00000000000..865211ce1d4
--- /dev/null
+++ b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/attributedb/BlueGigaWriteCommand.java
@@ -0,0 +1,108 @@
+/**
+ * Copyright (c) 2014,2017 Contributors to the Eclipse Foundation
+ *
+ * See the NOTICE file(s) distributed with this work for additional
+ * information regarding copyright ownership.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ */
+package org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.command.attributedb;
+
+import org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.BlueGigaCommand;
+
+/**
+ * Class to implement the BlueGiga command write.
+ *
+ * This command writes an attribute's value to the local database.
+ *
+ * This class provides methods for processing BlueGiga API commands.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ *
+ * @author Chris Jackson - Initial contribution of Java code generator
+ */
+public class BlueGigaWriteCommand extends BlueGigaCommand {
+ public static int COMMAND_CLASS = 0x02;
+ public static int COMMAND_METHOD = 0x00;
+
+ /**
+ * Handle of the attribute to write.
+ *
+ * BlueGiga API type is uint16 - Java type is {@link int}
+ */
+ private int handle;
+
+ /**
+ * Attribute offset to write data
+ *
+ * BlueGiga API type is uint8 - Java type is {@link int}
+ */
+ private int offset;
+
+ /**
+ * Value of the attribute to write
+ *
+ * BlueGiga API type is uint8array - Java type is {@link int[]}
+ */
+ private int[] value;
+
+ /**
+ * Handle of the attribute to write.
+ *
+ * @param handle the handle to set as {@link int}
+ */
+ public void setHandle(int handle) {
+ this.handle = handle;
+ }
+ /**
+ * Attribute offset to write data
+ *
+ * @param offset the offset to set as {@link int}
+ */
+ public void setOffset(int offset) {
+ this.offset = offset;
+ }
+ /**
+ * Value of the attribute to write
+ *
+ * @param value the value to set as {@link int[]}
+ */
+ public void setValue(int[] value) {
+ this.value = value;
+ }
+
+ @Override
+ public int[] serialize() {
+ // Serialize the header
+ serializeHeader(COMMAND_CLASS, COMMAND_METHOD);
+
+ // Serialize the fields
+ serializeUInt16(handle);
+ serializeUInt8(offset);
+ serializeUInt8Array(value);
+
+ return getPayload();
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder builder = new StringBuilder();
+ builder.append("BlueGigaWriteCommand [handle=");
+ builder.append(handle);
+ builder.append(", offset=");
+ builder.append(offset);
+ builder.append(", value=");
+ for (int c = 0; c < value.length; c++) {
+ if (c > 0) {
+ builder.append(' ');
+ }
+ builder.append(String.format("%02X", value[c]));
+ }
+ builder.append(']');
+ return builder.toString();
+ }
+}
diff --git a/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/attributedb/BlueGigaWriteResponse.java b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/attributedb/BlueGigaWriteResponse.java
new file mode 100644
index 00000000000..719ac56d984
--- /dev/null
+++ b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/attributedb/BlueGigaWriteResponse.java
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2014,2017 Contributors to the Eclipse Foundation
+ *
+ * See the NOTICE file(s) distributed with this work for additional
+ * information regarding copyright ownership.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ */
+package org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.command.attributedb;
+
+import org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.BlueGigaResponse;
+import org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.enumeration.BgApiResponse;
+
+/**
+ * Class to implement the BlueGiga command write.
+ *
+ * This command writes an attribute's value to the local database.
+ *
+ * This class provides methods for processing BlueGiga API commands.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ *
+ * @author Chris Jackson - Initial contribution of Java code generator
+ */
+public class BlueGigaWriteResponse extends BlueGigaResponse {
+ public static int COMMAND_CLASS = 0x02;
+ public static int COMMAND_METHOD = 0x00;
+
+ /**
+ * 0: the write was successful. Non-zero: An error occurred
+ *
+ * BlueGiga API type is BgApiResponse - Java type is {@link BgApiResponse}
+ */
+ private BgApiResponse result;
+
+ /**
+ * Response constructor
+ */
+ public BlueGigaWriteResponse(int[] inputBuffer) {
+ // Super creates deserializer and reads header fields
+ super(inputBuffer);
+
+ event = (inputBuffer[0] & 0x80) != 0;
+
+ // Deserialize the fields
+ result = deserializeBgApiResponse();
+ }
+
+ /**
+ * 0: the write was successful. Non-zero: An error occurred
+ *
+ * BlueGiga API type is BgApiResponse - Java type is {@link BgApiResponse}
+ *
+ * @return the current result as {@link BgApiResponse}
+ */
+ public BgApiResponse getResult() {
+ return result;
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder builder = new StringBuilder();
+ builder.append("BlueGigaWriteResponse [result=");
+ builder.append(result);
+ builder.append(']');
+ return builder.toString();
+ }
+}
diff --git a/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/connection/BlueGigaChannelMapGetCommand.java b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/connection/BlueGigaChannelMapGetCommand.java
new file mode 100644
index 00000000000..aea6ab44252
--- /dev/null
+++ b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/connection/BlueGigaChannelMapGetCommand.java
@@ -0,0 +1,67 @@
+/**
+ * Copyright (c) 2014,2017 Contributors to the Eclipse Foundation
+ *
+ * See the NOTICE file(s) distributed with this work for additional
+ * information regarding copyright ownership.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ */
+package org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.command.connection;
+
+import org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.BlueGigaCommand;
+
+/**
+ * Class to implement the BlueGiga command channelMapGet.
+ *
+ * This command can be used to read the current Channel Map.
+ *
+ * This class provides methods for processing BlueGiga API commands.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ *
+ * @author Chris Jackson - Initial contribution of Java code generator
+ */
+public class BlueGigaChannelMapGetCommand extends BlueGigaCommand {
+ public static int COMMAND_CLASS = 0x03;
+ public static int COMMAND_METHOD = 0x04;
+
+ /**
+ * Connection handle.
+ *
+ * BlueGiga API type is uint8 - Java type is {@link int}
+ */
+ private int connection;
+
+ /**
+ * Connection handle.
+ *
+ * @param connection the connection to set as {@link int}
+ */
+ public void setConnection(int connection) {
+ this.connection = connection;
+ }
+
+ @Override
+ public int[] serialize() {
+ // Serialize the header
+ serializeHeader(COMMAND_CLASS, COMMAND_METHOD);
+
+ // Serialize the fields
+ serializeUInt8(connection);
+
+ return getPayload();
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder builder = new StringBuilder();
+ builder.append("BlueGigaChannelMapGetCommand [connection=");
+ builder.append(connection);
+ builder.append(']');
+ return builder.toString();
+ }
+}
diff --git a/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/connection/BlueGigaChannelMapGetResponse.java b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/connection/BlueGigaChannelMapGetResponse.java
new file mode 100644
index 00000000000..1f9c2462838
--- /dev/null
+++ b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/connection/BlueGigaChannelMapGetResponse.java
@@ -0,0 +1,98 @@
+/**
+ * Copyright (c) 2014,2017 Contributors to the Eclipse Foundation
+ *
+ * See the NOTICE file(s) distributed with this work for additional
+ * information regarding copyright ownership.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ */
+package org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.command.connection;
+
+import org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.BlueGigaResponse;
+
+/**
+ * Class to implement the BlueGiga command channelMapGet.
+ *
+ * This command can be used to read the current Channel Map.
+ *
+ * This class provides methods for processing BlueGiga API commands.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ *
+ * @author Chris Jackson - Initial contribution of Java code generator
+ */
+public class BlueGigaChannelMapGetResponse extends BlueGigaResponse {
+ public static int COMMAND_CLASS = 0x03;
+ public static int COMMAND_METHOD = 0x04;
+
+ /**
+ * Connection handle.
+ *
+ * BlueGiga API type is uint8 - Java type is {@link int}
+ */
+ private int connection;
+
+ /**
+ * Current Channel Map. Each bit corresponds to one channel. 0-bit corresponds to 0 channel.
+ * Size of Channel Map is 5 bytes. Channel range: 0-36
+ *
+ * BlueGiga API type is uint8array - Java type is {@link int[]}
+ */
+ private int[] map;
+
+ /**
+ * Response constructor
+ */
+ public BlueGigaChannelMapGetResponse(int[] inputBuffer) {
+ // Super creates deserializer and reads header fields
+ super(inputBuffer);
+
+ event = (inputBuffer[0] & 0x80) != 0;
+
+ // Deserialize the fields
+ connection = deserializeUInt8();
+ map = deserializeUInt8Array();
+ }
+
+ /**
+ * Connection handle.
+ *
+ * BlueGiga API type is uint8 - Java type is {@link int}
+ *
+ * @return the current connection as {@link int}
+ */
+ public int getConnection() {
+ return connection;
+ }
+ /**
+ * Current Channel Map. Each bit corresponds to one channel. 0-bit corresponds to 0 channel.
+ * Size of Channel Map is 5 bytes. Channel range: 0-36
+ *
+ * BlueGiga API type is uint8array - Java type is {@link int[]}
+ *
+ * @return the current map as {@link int[]}
+ */
+ public int[] getMap() {
+ return map;
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder builder = new StringBuilder();
+ builder.append("BlueGigaChannelMapGetResponse [connection=");
+ builder.append(connection);
+ builder.append(", map=");
+ for (int c = 0; c < map.length; c++) {
+ if (c > 0) {
+ builder.append(' ');
+ }
+ builder.append(String.format("%02X", map[c]));
+ }
+ builder.append(']');
+ return builder.toString();
+ }
+}
diff --git a/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/connection/BlueGigaConnectionStatusEvent.java b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/connection/BlueGigaConnectionStatusEvent.java
new file mode 100644
index 00000000000..029669d1cba
--- /dev/null
+++ b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/connection/BlueGigaConnectionStatusEvent.java
@@ -0,0 +1,217 @@
+/**
+ * Copyright (c) 2014,2017 Contributors to the Eclipse Foundation
+ *
+ * See the NOTICE file(s) distributed with this work for additional
+ * information regarding copyright ownership.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ */
+package org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.command.connection;
+
+import java.util.HashSet;
+import java.util.Set;
+
+import org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.BlueGigaResponse;
+import org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.enumeration.BluetoothAddressType;
+import org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.enumeration.ConnectionStatusFlag;
+
+/**
+ * Class to implement the BlueGiga command connectionStatusEvent.
+ *
+ * This event indicates the connection status and parameters.
+ *
+ * This class provides methods for processing BlueGiga API commands.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ *
+ * @author Chris Jackson - Initial contribution of Java code generator
+ */
+public class BlueGigaConnectionStatusEvent extends BlueGigaResponse {
+ public static int COMMAND_CLASS = 0x03;
+ public static int COMMAND_METHOD = 0x00;
+
+ /**
+ * Connection handle
+ *
+ * BlueGiga API type is uint8 - Java type is {@link int}
+ */
+ private int connection;
+
+ /**
+ * Connection status flags use connstatus-enumerator
+ *
+ * BlueGiga API type is ConnectionStatusFlag - Java type is {@link ConnectionStatusFlag}
+ * Parameter allows multiple options so implemented as a {@link Set}.
+ */
+ private Set
+ * BlueGiga API type is bd_addr - Java type is {@link String}
+ */
+ private String address;
+
+ /**
+ * Remote address type see: Bluetooth Address Types--gap
+ *
+ * BlueGiga API type is BluetoothAddressType - Java type is {@link BluetoothAddressType}
+ */
+ private BluetoothAddressType addressType;
+
+ /**
+ * Current connection interval (units of 1.25ms)
+ *
+ * BlueGiga API type is uint16 - Java type is {@link int}
+ */
+ private int connInterval;
+
+ /**
+ * Current supervision timeout (units of 10ms)
+ *
+ * BlueGiga API type is uint16 - Java type is {@link int}
+ */
+ private int timeout;
+
+ /**
+ * Slave latency which tells how many connection intervals the slave may skip.
+ *
+ * BlueGiga API type is uint16 - Java type is {@link int}
+ */
+ private int latency;
+
+ /**
+ * Bonding handle if the device has been bonded with. Otherwise: 0xFF
+ *
+ * BlueGiga API type is uint8 - Java type is {@link int}
+ */
+ private int bonding;
+
+ /**
+ * Event constructor
+ */
+ public BlueGigaConnectionStatusEvent(int[] inputBuffer) {
+ // Super creates deserializer and reads header fields
+ super(inputBuffer);
+
+ event = (inputBuffer[0] & 0x80) != 0;
+
+ // Deserialize the fields
+ connection = deserializeUInt8();
+ flags = deserializeConnectionStatusFlag();
+ address = deserializeAddress();
+ addressType = deserializeBluetoothAddressType();
+ connInterval = deserializeUInt16();
+ timeout = deserializeUInt16();
+ latency = deserializeUInt16();
+ bonding = deserializeUInt8();
+ }
+
+ /**
+ * Connection handle
+ *
+ * BlueGiga API type is uint8 - Java type is {@link int}
+ *
+ * @return the current connection as {@link int}
+ */
+ public int getConnection() {
+ return connection;
+ }
+ /**
+ * Connection status flags use connstatus-enumerator
+ *
+ * BlueGiga API type is ConnectionStatusFlag - Java type is {@link ConnectionStatusFlag}
+ *
+ * @return the current flags as {@link Set} of {@link ConnectionStatusFlag}
+ */
+ public Set
+ * BlueGiga API type is bd_addr - Java type is {@link String}
+ *
+ * @return the current address as {@link String}
+ */
+ public String getAddress() {
+ return address;
+ }
+ /**
+ * Remote address type see: Bluetooth Address Types--gap
+ *
+ * BlueGiga API type is BluetoothAddressType - Java type is {@link BluetoothAddressType}
+ *
+ * @return the current address_type as {@link BluetoothAddressType}
+ */
+ public BluetoothAddressType getAddressType() {
+ return addressType;
+ }
+ /**
+ * Current connection interval (units of 1.25ms)
+ *
+ * BlueGiga API type is uint16 - Java type is {@link int}
+ *
+ * @return the current conn_interval as {@link int}
+ */
+ public int getConnInterval() {
+ return connInterval;
+ }
+ /**
+ * Current supervision timeout (units of 10ms)
+ *
+ * BlueGiga API type is uint16 - Java type is {@link int}
+ *
+ * @return the current timeout as {@link int}
+ */
+ public int getTimeout() {
+ return timeout;
+ }
+ /**
+ * Slave latency which tells how many connection intervals the slave may skip.
+ *
+ * BlueGiga API type is uint16 - Java type is {@link int}
+ *
+ * @return the current latency as {@link int}
+ */
+ public int getLatency() {
+ return latency;
+ }
+ /**
+ * Bonding handle if the device has been bonded with. Otherwise: 0xFF
+ *
+ * BlueGiga API type is uint8 - Java type is {@link int}
+ *
+ * @return the current bonding as {@link int}
+ */
+ public int getBonding() {
+ return bonding;
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder builder = new StringBuilder();
+ builder.append("BlueGigaConnectionStatusEvent [connection=");
+ builder.append(connection);
+ builder.append(", flags=");
+ builder.append(flags);
+ builder.append(", address=");
+ builder.append(address);
+ builder.append(", addressType=");
+ builder.append(addressType);
+ builder.append(", connInterval=");
+ builder.append(connInterval);
+ builder.append(", timeout=");
+ builder.append(timeout);
+ builder.append(", latency=");
+ builder.append(latency);
+ builder.append(", bonding=");
+ builder.append(bonding);
+ builder.append(']');
+ return builder.toString();
+ }
+}
diff --git a/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/connection/BlueGigaDisconnectCommand.java b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/connection/BlueGigaDisconnectCommand.java
new file mode 100644
index 00000000000..3b5c2f9eb92
--- /dev/null
+++ b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/connection/BlueGigaDisconnectCommand.java
@@ -0,0 +1,68 @@
+/**
+ * Copyright (c) 2014,2017 Contributors to the Eclipse Foundation
+ *
+ * See the NOTICE file(s) distributed with this work for additional
+ * information regarding copyright ownership.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ */
+package org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.command.connection;
+
+import org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.BlueGigaCommand;
+
+/**
+ * Class to implement the BlueGiga command disconnect.
+ *
+ * This command disconnects an active connection. Bluetooth When link is disconnected a
+ * Disconnected event is produced.
+ *
+ * This class provides methods for processing BlueGiga API commands.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ *
+ * @author Chris Jackson - Initial contribution of Java code generator
+ */
+public class BlueGigaDisconnectCommand extends BlueGigaCommand {
+ public static int COMMAND_CLASS = 0x03;
+ public static int COMMAND_METHOD = 0x00;
+
+ /**
+ * Connection handle to close.
+ *
+ * BlueGiga API type is uint8 - Java type is {@link int}
+ */
+ private int connection;
+
+ /**
+ * Connection handle to close.
+ *
+ * @param connection the connection to set as {@link int}
+ */
+ public void setConnection(int connection) {
+ this.connection = connection;
+ }
+
+ @Override
+ public int[] serialize() {
+ // Serialize the header
+ serializeHeader(COMMAND_CLASS, COMMAND_METHOD);
+
+ // Serialize the fields
+ serializeUInt8(connection);
+
+ return getPayload();
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder builder = new StringBuilder();
+ builder.append("BlueGigaDisconnectCommand [connection=");
+ builder.append(connection);
+ builder.append(']');
+ return builder.toString();
+ }
+}
diff --git a/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/connection/BlueGigaDisconnectResponse.java b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/connection/BlueGigaDisconnectResponse.java
new file mode 100644
index 00000000000..ea994dce85b
--- /dev/null
+++ b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/connection/BlueGigaDisconnectResponse.java
@@ -0,0 +1,93 @@
+/**
+ * Copyright (c) 2014,2017 Contributors to the Eclipse Foundation
+ *
+ * See the NOTICE file(s) distributed with this work for additional
+ * information regarding copyright ownership.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ */
+package org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.command.connection;
+
+import org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.BlueGigaResponse;
+import org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.enumeration.BgApiResponse;
+
+/**
+ * Class to implement the BlueGiga command disconnect.
+ *
+ * This command disconnects an active connection. Bluetooth When link is disconnected a
+ * Disconnected event is produced.
+ *
+ * This class provides methods for processing BlueGiga API commands.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ *
+ * @author Chris Jackson - Initial contribution of Java code generator
+ */
+public class BlueGigaDisconnectResponse extends BlueGigaResponse {
+ public static int COMMAND_CLASS = 0x03;
+ public static int COMMAND_METHOD = 0x00;
+
+ /**
+ * Connection handle.
+ *
+ * BlueGiga API type is uint8 - Java type is {@link int}
+ */
+ private int connection;
+
+ /**
+ * 0 : the update was successful. Non-zero: An error occurred.
+ *
+ * BlueGiga API type is BgApiResponse - Java type is {@link BgApiResponse}
+ */
+ private BgApiResponse result;
+
+ /**
+ * Response constructor
+ */
+ public BlueGigaDisconnectResponse(int[] inputBuffer) {
+ // Super creates deserializer and reads header fields
+ super(inputBuffer);
+
+ event = (inputBuffer[0] & 0x80) != 0;
+
+ // Deserialize the fields
+ connection = deserializeUInt8();
+ result = deserializeBgApiResponse();
+ }
+
+ /**
+ * Connection handle.
+ *
+ * BlueGiga API type is uint8 - Java type is {@link int}
+ *
+ * @return the current connection as {@link int}
+ */
+ public int getConnection() {
+ return connection;
+ }
+ /**
+ * 0 : the update was successful. Non-zero: An error occurred.
+ *
+ * BlueGiga API type is BgApiResponse - Java type is {@link BgApiResponse}
+ *
+ * @return the current result as {@link BgApiResponse}
+ */
+ public BgApiResponse getResult() {
+ return result;
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder builder = new StringBuilder();
+ builder.append("BlueGigaDisconnectResponse [connection=");
+ builder.append(connection);
+ builder.append(", result=");
+ builder.append(result);
+ builder.append(']');
+ return builder.toString();
+ }
+}
diff --git a/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/connection/BlueGigaDisconnectedEvent.java b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/connection/BlueGigaDisconnectedEvent.java
new file mode 100644
index 00000000000..d8771b97d1e
--- /dev/null
+++ b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/connection/BlueGigaDisconnectedEvent.java
@@ -0,0 +1,92 @@
+/**
+ * Copyright (c) 2014,2017 Contributors to the Eclipse Foundation
+ *
+ * See the NOTICE file(s) distributed with this work for additional
+ * information regarding copyright ownership.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ */
+package org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.command.connection;
+
+import org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.BlueGigaResponse;
+import org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.enumeration.BgApiResponse;
+
+/**
+ * Class to implement the BlueGiga command disconnectedEvent.
+ *
+ * This event is produced when a connection is disconnected.
+ *
+ * This class provides methods for processing BlueGiga API commands.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ *
+ * @author Chris Jackson - Initial contribution of Java code generator
+ */
+public class BlueGigaDisconnectedEvent extends BlueGigaResponse {
+ public static int COMMAND_CLASS = 0x03;
+ public static int COMMAND_METHOD = 0x04;
+
+ /**
+ * Connection handle
+ *
+ * BlueGiga API type is uint8 - Java type is {@link int}
+ */
+ private int connection;
+
+ /**
+ * Disconnection reason code. 0 : disconnected by local user
+ *
+ * BlueGiga API type is BgApiResponse - Java type is {@link BgApiResponse}
+ */
+ private BgApiResponse reason;
+
+ /**
+ * Event constructor
+ */
+ public BlueGigaDisconnectedEvent(int[] inputBuffer) {
+ // Super creates deserializer and reads header fields
+ super(inputBuffer);
+
+ event = (inputBuffer[0] & 0x80) != 0;
+
+ // Deserialize the fields
+ connection = deserializeUInt8();
+ reason = deserializeBgApiResponse();
+ }
+
+ /**
+ * Connection handle
+ *
+ * BlueGiga API type is uint8 - Java type is {@link int}
+ *
+ * @return the current connection as {@link int}
+ */
+ public int getConnection() {
+ return connection;
+ }
+ /**
+ * Disconnection reason code. 0 : disconnected by local user
+ *
+ * BlueGiga API type is BgApiResponse - Java type is {@link BgApiResponse}
+ *
+ * @return the current reason as {@link BgApiResponse}
+ */
+ public BgApiResponse getReason() {
+ return reason;
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder builder = new StringBuilder();
+ builder.append("BlueGigaDisconnectedEvent [connection=");
+ builder.append(connection);
+ builder.append(", reason=");
+ builder.append(reason);
+ builder.append(']');
+ return builder.toString();
+ }
+}
diff --git a/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/connection/BlueGigaFeatureIndEvent.java b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/connection/BlueGigaFeatureIndEvent.java
new file mode 100644
index 00000000000..e56a5b4a2d5
--- /dev/null
+++ b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/connection/BlueGigaFeatureIndEvent.java
@@ -0,0 +1,96 @@
+/**
+ * Copyright (c) 2014,2017 Contributors to the Eclipse Foundation
+ *
+ * See the NOTICE file(s) distributed with this work for additional
+ * information regarding copyright ownership.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ */
+package org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.command.connection;
+
+import org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.BlueGigaResponse;
+
+/**
+ * Class to implement the BlueGiga command featureIndEvent.
+ *
+ * This event indicates the remote devices features.
+ *
+ * This class provides methods for processing BlueGiga API commands.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ *
+ * @author Chris Jackson - Initial contribution of Java code generator
+ */
+public class BlueGigaFeatureIndEvent extends BlueGigaResponse {
+ public static int COMMAND_CLASS = 0x03;
+ public static int COMMAND_METHOD = 0x02;
+
+ /**
+ * Connection handle
+ *
+ * BlueGiga API type is uint8 - Java type is {@link int}
+ */
+ private int connection;
+
+ /**
+ * CtrData field from LL_FEATURE_RSP - packet
+ *
+ * BlueGiga API type is uint8array - Java type is {@link int[]}
+ */
+ private int[] features;
+
+ /**
+ * Event constructor
+ */
+ public BlueGigaFeatureIndEvent(int[] inputBuffer) {
+ // Super creates deserializer and reads header fields
+ super(inputBuffer);
+
+ event = (inputBuffer[0] & 0x80) != 0;
+
+ // Deserialize the fields
+ connection = deserializeUInt8();
+ features = deserializeUInt8Array();
+ }
+
+ /**
+ * Connection handle
+ *
+ * BlueGiga API type is uint8 - Java type is {@link int}
+ *
+ * @return the current connection as {@link int}
+ */
+ public int getConnection() {
+ return connection;
+ }
+ /**
+ * CtrData field from LL_FEATURE_RSP - packet
+ *
+ * BlueGiga API type is uint8array - Java type is {@link int[]}
+ *
+ * @return the current features as {@link int[]}
+ */
+ public int[] getFeatures() {
+ return features;
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder builder = new StringBuilder();
+ builder.append("BlueGigaFeatureIndEvent [connection=");
+ builder.append(connection);
+ builder.append(", features=");
+ for (int c = 0; c < features.length; c++) {
+ if (c > 0) {
+ builder.append(' ');
+ }
+ builder.append(String.format("%02X", features[c]));
+ }
+ builder.append(']');
+ return builder.toString();
+ }
+}
diff --git a/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/connection/BlueGigaGetRssiCommand.java b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/connection/BlueGigaGetRssiCommand.java
new file mode 100644
index 00000000000..c866f0c195d
--- /dev/null
+++ b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/connection/BlueGigaGetRssiCommand.java
@@ -0,0 +1,68 @@
+/**
+ * Copyright (c) 2014,2017 Contributors to the Eclipse Foundation
+ *
+ * See the NOTICE file(s) distributed with this work for additional
+ * information regarding copyright ownership.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ */
+package org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.command.connection;
+
+import org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.BlueGigaCommand;
+
+/**
+ * Class to implement the BlueGiga command getRssi.
+ *
+ * This command disconnects an active connection. Bluetooth When link is disconnected a
+ * Disconnected event is produced.
+ *
+ * This class provides methods for processing BlueGiga API commands.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ *
+ * @author Chris Jackson - Initial contribution of Java code generator
+ */
+public class BlueGigaGetRssiCommand extends BlueGigaCommand {
+ public static int COMMAND_CLASS = 0x03;
+ public static int COMMAND_METHOD = 0x01;
+
+ /**
+ * Connection handle to close.
+ *
+ * BlueGiga API type is uint8 - Java type is {@link int}
+ */
+ private int connection;
+
+ /**
+ * Connection handle to close.
+ *
+ * @param connection the connection to set as {@link int}
+ */
+ public void setConnection(int connection) {
+ this.connection = connection;
+ }
+
+ @Override
+ public int[] serialize() {
+ // Serialize the header
+ serializeHeader(COMMAND_CLASS, COMMAND_METHOD);
+
+ // Serialize the fields
+ serializeUInt8(connection);
+
+ return getPayload();
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder builder = new StringBuilder();
+ builder.append("BlueGigaGetRssiCommand [connection=");
+ builder.append(connection);
+ builder.append(']');
+ return builder.toString();
+ }
+}
diff --git a/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/connection/BlueGigaGetRssiResponse.java b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/connection/BlueGigaGetRssiResponse.java
new file mode 100644
index 00000000000..362cb8ba0ba
--- /dev/null
+++ b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/connection/BlueGigaGetRssiResponse.java
@@ -0,0 +1,92 @@
+/**
+ * Copyright (c) 2014,2017 Contributors to the Eclipse Foundation
+ *
+ * See the NOTICE file(s) distributed with this work for additional
+ * information regarding copyright ownership.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ */
+package org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.command.connection;
+
+import org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.BlueGigaResponse;
+
+/**
+ * Class to implement the BlueGiga command getRssi.
+ *
+ * This command disconnects an active connection. Bluetooth When link is disconnected a
+ * Disconnected event is produced.
+ *
+ * This class provides methods for processing BlueGiga API commands.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ *
+ * @author Chris Jackson - Initial contribution of Java code generator
+ */
+public class BlueGigaGetRssiResponse extends BlueGigaResponse {
+ public static int COMMAND_CLASS = 0x03;
+ public static int COMMAND_METHOD = 0x01;
+
+ /**
+ * Connection handle.
+ *
+ * BlueGiga API type is uint8 - Java type is {@link int}
+ */
+ private int connection;
+
+ /**
+ * RSSI value of the connection in dBm. Range: -103 to -38
+ *
+ * BlueGiga API type is int8 - Java type is {@link int}
+ */
+ private int rssi;
+
+ /**
+ * Response constructor
+ */
+ public BlueGigaGetRssiResponse(int[] inputBuffer) {
+ // Super creates deserializer and reads header fields
+ super(inputBuffer);
+
+ event = (inputBuffer[0] & 0x80) != 0;
+
+ // Deserialize the fields
+ connection = deserializeUInt8();
+ rssi = deserializeInt8();
+ }
+
+ /**
+ * Connection handle.
+ *
+ * BlueGiga API type is uint8 - Java type is {@link int}
+ *
+ * @return the current connection as {@link int}
+ */
+ public int getConnection() {
+ return connection;
+ }
+ /**
+ * RSSI value of the connection in dBm. Range: -103 to -38
+ *
+ * BlueGiga API type is int8 - Java type is {@link int}
+ *
+ * @return the current rssi as {@link int}
+ */
+ public int getRssi() {
+ return rssi;
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder builder = new StringBuilder();
+ builder.append("BlueGigaGetRssiResponse [connection=");
+ builder.append(connection);
+ builder.append(", rssi=");
+ builder.append(rssi);
+ builder.append(']');
+ return builder.toString();
+ }
+}
diff --git a/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/connection/BlueGigaGetStatusCommand.java b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/connection/BlueGigaGetStatusCommand.java
new file mode 100644
index 00000000000..f62ac7f44db
--- /dev/null
+++ b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/connection/BlueGigaGetStatusCommand.java
@@ -0,0 +1,67 @@
+/**
+ * Copyright (c) 2014,2017 Contributors to the Eclipse Foundation
+ *
+ * See the NOTICE file(s) distributed with this work for additional
+ * information regarding copyright ownership.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ */
+package org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.command.connection;
+
+import org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.BlueGigaCommand;
+
+/**
+ * Class to implement the BlueGiga command getStatus.
+ *
+ * This command returns the status of the given connection. Status is returned in a event.
+ *
+ * This class provides methods for processing BlueGiga API commands.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ *
+ * @author Chris Jackson - Initial contribution of Java code generator
+ */
+public class BlueGigaGetStatusCommand extends BlueGigaCommand {
+ public static int COMMAND_CLASS = 0x03;
+ public static int COMMAND_METHOD = 0x07;
+
+ /**
+ * Connection handle to close.
+ *
+ * BlueGiga API type is uint8 - Java type is {@link int}
+ */
+ private int connection;
+
+ /**
+ * Connection handle to close.
+ *
+ * @param connection the connection to set as {@link int}
+ */
+ public void setConnection(int connection) {
+ this.connection = connection;
+ }
+
+ @Override
+ public int[] serialize() {
+ // Serialize the header
+ serializeHeader(COMMAND_CLASS, COMMAND_METHOD);
+
+ // Serialize the fields
+ serializeUInt8(connection);
+
+ return getPayload();
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder builder = new StringBuilder();
+ builder.append("BlueGigaGetStatusCommand [connection=");
+ builder.append(connection);
+ builder.append(']');
+ return builder.toString();
+ }
+}
diff --git a/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/connection/BlueGigaGetStatusResponse.java b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/connection/BlueGigaGetStatusResponse.java
new file mode 100644
index 00000000000..03bac93da93
--- /dev/null
+++ b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/connection/BlueGigaGetStatusResponse.java
@@ -0,0 +1,71 @@
+/**
+ * Copyright (c) 2014,2017 Contributors to the Eclipse Foundation
+ *
+ * See the NOTICE file(s) distributed with this work for additional
+ * information regarding copyright ownership.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ */
+package org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.command.connection;
+
+import org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.BlueGigaResponse;
+
+/**
+ * Class to implement the BlueGiga command getStatus.
+ *
+ * This command returns the status of the given connection. Status is returned in a event.
+ *
+ * This class provides methods for processing BlueGiga API commands.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ *
+ * @author Chris Jackson - Initial contribution of Java code generator
+ */
+public class BlueGigaGetStatusResponse extends BlueGigaResponse {
+ public static int COMMAND_CLASS = 0x03;
+ public static int COMMAND_METHOD = 0x07;
+
+ /**
+ * Connection handle.
+ *
+ * BlueGiga API type is uint8 - Java type is {@link int}
+ */
+ private int connection;
+
+ /**
+ * Response constructor
+ */
+ public BlueGigaGetStatusResponse(int[] inputBuffer) {
+ // Super creates deserializer and reads header fields
+ super(inputBuffer);
+
+ event = (inputBuffer[0] & 0x80) != 0;
+
+ // Deserialize the fields
+ connection = deserializeUInt8();
+ }
+
+ /**
+ * Connection handle.
+ *
+ * BlueGiga API type is uint8 - Java type is {@link int}
+ *
+ * @return the current connection as {@link int}
+ */
+ public int getConnection() {
+ return connection;
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder builder = new StringBuilder();
+ builder.append("BlueGigaGetStatusResponse [connection=");
+ builder.append(connection);
+ builder.append(']');
+ return builder.toString();
+ }
+}
diff --git a/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/connection/BlueGigaUpdateCommand.java b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/connection/BlueGigaUpdateCommand.java
new file mode 100644
index 00000000000..5adc9912d1c
--- /dev/null
+++ b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/connection/BlueGigaUpdateCommand.java
@@ -0,0 +1,145 @@
+/**
+ * Copyright (c) 2014,2017 Contributors to the Eclipse Foundation
+ *
+ * See the NOTICE file(s) distributed with this work for additional
+ * information regarding copyright ownership.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ */
+package org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.command.connection;
+
+import org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.BlueGigaCommand;
+
+/**
+ * Class to implement the BlueGiga command update.
+ *
+ * This command updates the connection parameters of a given connection. The parameters have
+ * the same meaning and follow the same rules as for the GAP class command: Connect Direct. If
+ * this command is issued at a master device, it will send parameter update request to the link
+ * layer. Bluetooth On the other hand if this command is issued at a slave device, it will send
+ * L2CAP connection parameter update request to the master, which may either accept or reject
+ * it. It will take an amount of time corresponding to at least six times the current connection
+ * interval before the new connection parameters will become active.
+ *
+ * This class provides methods for processing BlueGiga API commands.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ *
+ * @author Chris Jackson - Initial contribution of Java code generator
+ */
+public class BlueGigaUpdateCommand extends BlueGigaCommand {
+ public static int COMMAND_CLASS = 0x03;
+ public static int COMMAND_METHOD = 0x02;
+
+ /**
+ * Connection handle.
+ *
+ * BlueGiga API type is uint8 - Java type is {@link int}
+ */
+ private int connection;
+
+ /**
+ * Minimum connection interval (units of 1.25ms)
+ *
+ * BlueGiga API type is uint16 - Java type is {@link int}
+ */
+ private int intervalMin;
+
+ /**
+ * Maximum connection interval (units of 1.25ms)
+ *
+ * BlueGiga API type is uint16 - Java type is {@link int}
+ */
+ private int intervalMax;
+
+ /**
+ * Slave latency which defines how many connections intervals a slave may skip.
+ *
+ * BlueGiga API type is uint16 - Java type is {@link int}
+ */
+ private int latency;
+
+ /**
+ * Supervision timeout (units of 10ms)
+ *
+ * BlueGiga API type is uint16 - Java type is {@link int}
+ */
+ private int timeout;
+
+ /**
+ * Connection handle.
+ *
+ * @param connection the connection to set as {@link int}
+ */
+ public void setConnection(int connection) {
+ this.connection = connection;
+ }
+ /**
+ * Minimum connection interval (units of 1.25ms)
+ *
+ * @param intervalMin the intervalMin to set as {@link int}
+ */
+ public void setIntervalMin(int intervalMin) {
+ this.intervalMin = intervalMin;
+ }
+ /**
+ * Maximum connection interval (units of 1.25ms)
+ *
+ * @param intervalMax the intervalMax to set as {@link int}
+ */
+ public void setIntervalMax(int intervalMax) {
+ this.intervalMax = intervalMax;
+ }
+ /**
+ * Slave latency which defines how many connections intervals a slave may skip.
+ *
+ * @param latency the latency to set as {@link int}
+ */
+ public void setLatency(int latency) {
+ this.latency = latency;
+ }
+ /**
+ * Supervision timeout (units of 10ms)
+ *
+ * @param timeout the timeout to set as {@link int}
+ */
+ public void setTimeout(int timeout) {
+ this.timeout = timeout;
+ }
+
+ @Override
+ public int[] serialize() {
+ // Serialize the header
+ serializeHeader(COMMAND_CLASS, COMMAND_METHOD);
+
+ // Serialize the fields
+ serializeUInt8(connection);
+ serializeUInt16(intervalMin);
+ serializeUInt16(intervalMax);
+ serializeUInt16(latency);
+ serializeUInt16(timeout);
+
+ return getPayload();
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder builder = new StringBuilder();
+ builder.append("BlueGigaUpdateCommand [connection=");
+ builder.append(connection);
+ builder.append(", intervalMin=");
+ builder.append(intervalMin);
+ builder.append(", intervalMax=");
+ builder.append(intervalMax);
+ builder.append(", latency=");
+ builder.append(latency);
+ builder.append(", timeout=");
+ builder.append(timeout);
+ builder.append(']');
+ return builder.toString();
+ }
+}
diff --git a/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/connection/BlueGigaUpdateResponse.java b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/connection/BlueGigaUpdateResponse.java
new file mode 100644
index 00000000000..a5f38582c8c
--- /dev/null
+++ b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/connection/BlueGigaUpdateResponse.java
@@ -0,0 +1,98 @@
+/**
+ * Copyright (c) 2014,2017 Contributors to the Eclipse Foundation
+ *
+ * See the NOTICE file(s) distributed with this work for additional
+ * information regarding copyright ownership.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ */
+package org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.command.connection;
+
+import org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.BlueGigaResponse;
+import org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.enumeration.BgApiResponse;
+
+/**
+ * Class to implement the BlueGiga command update.
+ *
+ * This command updates the connection parameters of a given connection. The parameters have
+ * the same meaning and follow the same rules as for the GAP class command: Connect Direct. If
+ * this command is issued at a master device, it will send parameter update request to the link
+ * layer. Bluetooth On the other hand if this command is issued at a slave device, it will send
+ * L2CAP connection parameter update request to the master, which may either accept or reject
+ * it. It will take an amount of time corresponding to at least six times the current connection
+ * interval before the new connection parameters will become active.
+ *
+ * This class provides methods for processing BlueGiga API commands.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ *
+ * @author Chris Jackson - Initial contribution of Java code generator
+ */
+public class BlueGigaUpdateResponse extends BlueGigaResponse {
+ public static int COMMAND_CLASS = 0x03;
+ public static int COMMAND_METHOD = 0x02;
+
+ /**
+ * Connection handle.
+ *
+ * BlueGiga API type is uint8 - Java type is {@link int}
+ */
+ private int connection;
+
+ /**
+ * 0 : the update was successful. Non-zero: An error occurred.
+ *
+ * BlueGiga API type is BgApiResponse - Java type is {@link BgApiResponse}
+ */
+ private BgApiResponse result;
+
+ /**
+ * Response constructor
+ */
+ public BlueGigaUpdateResponse(int[] inputBuffer) {
+ // Super creates deserializer and reads header fields
+ super(inputBuffer);
+
+ event = (inputBuffer[0] & 0x80) != 0;
+
+ // Deserialize the fields
+ connection = deserializeUInt8();
+ result = deserializeBgApiResponse();
+ }
+
+ /**
+ * Connection handle.
+ *
+ * BlueGiga API type is uint8 - Java type is {@link int}
+ *
+ * @return the current connection as {@link int}
+ */
+ public int getConnection() {
+ return connection;
+ }
+ /**
+ * 0 : the update was successful. Non-zero: An error occurred.
+ *
+ * BlueGiga API type is BgApiResponse - Java type is {@link BgApiResponse}
+ *
+ * @return the current result as {@link BgApiResponse}
+ */
+ public BgApiResponse getResult() {
+ return result;
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder builder = new StringBuilder();
+ builder.append("BlueGigaUpdateResponse [connection=");
+ builder.append(connection);
+ builder.append(", result=");
+ builder.append(result);
+ builder.append(']');
+ return builder.toString();
+ }
+}
diff --git a/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/connection/BlueGigaVersionIndEvent.java b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/connection/BlueGigaVersionIndEvent.java
new file mode 100644
index 00000000000..3b65257a73c
--- /dev/null
+++ b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/connection/BlueGigaVersionIndEvent.java
@@ -0,0 +1,131 @@
+/**
+ * Copyright (c) 2014,2017 Contributors to the Eclipse Foundation
+ *
+ * See the NOTICE file(s) distributed with this work for additional
+ * information regarding copyright ownership.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ */
+package org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.command.connection;
+
+import org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.BlueGigaResponse;
+
+/**
+ * Class to implement the BlueGiga command versionIndEvent.
+ *
+ * This event indicates the remote devices version.
+ *
+ * This class provides methods for processing BlueGiga API commands.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ *
+ * @author Chris Jackson - Initial contribution of Java code generator
+ */
+public class BlueGigaVersionIndEvent extends BlueGigaResponse {
+ public static int COMMAND_CLASS = 0x03;
+ public static int COMMAND_METHOD = 0x01;
+
+ /**
+ * Connection handle
+ *
+ * BlueGiga API type is uint8 - Java type is {@link int}
+ */
+ private int connection;
+
+ /**
+ * Bluetooth controller specification version
+ *
+ * BlueGiga API type is uint8 - Java type is {@link int}
+ */
+ private int versNr;
+
+ /**
+ * Manufacturer of the controller
+ *
+ * BlueGiga API type is uint16 - Java type is {@link int}
+ */
+ private int compId;
+
+ /**
+ * Bluetooth controller version
+ *
+ * BlueGiga API type is uint16 - Java type is {@link int}
+ */
+ private int subVersNr;
+
+ /**
+ * Event constructor
+ */
+ public BlueGigaVersionIndEvent(int[] inputBuffer) {
+ // Super creates deserializer and reads header fields
+ super(inputBuffer);
+
+ event = (inputBuffer[0] & 0x80) != 0;
+
+ // Deserialize the fields
+ connection = deserializeUInt8();
+ versNr = deserializeUInt8();
+ compId = deserializeUInt16();
+ subVersNr = deserializeUInt16();
+ }
+
+ /**
+ * Connection handle
+ *
+ * BlueGiga API type is uint8 - Java type is {@link int}
+ *
+ * @return the current connection as {@link int}
+ */
+ public int getConnection() {
+ return connection;
+ }
+ /**
+ * Bluetooth controller specification version
+ *
+ * BlueGiga API type is uint8 - Java type is {@link int}
+ *
+ * @return the current vers_nr as {@link int}
+ */
+ public int getVersNr() {
+ return versNr;
+ }
+ /**
+ * Manufacturer of the controller
+ *
+ * BlueGiga API type is uint16 - Java type is {@link int}
+ *
+ * @return the current comp_id as {@link int}
+ */
+ public int getCompId() {
+ return compId;
+ }
+ /**
+ * Bluetooth controller version
+ *
+ * BlueGiga API type is uint16 - Java type is {@link int}
+ *
+ * @return the current sub_vers_nr as {@link int}
+ */
+ public int getSubVersNr() {
+ return subVersNr;
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder builder = new StringBuilder();
+ builder.append("BlueGigaVersionIndEvent [connection=");
+ builder.append(connection);
+ builder.append(", versNr=");
+ builder.append(versNr);
+ builder.append(", compId=");
+ builder.append(compId);
+ builder.append(", subVersNr=");
+ builder.append(subVersNr);
+ builder.append(']');
+ return builder.toString();
+ }
+}
diff --git a/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/gap/BlueGigaConnectDirectCommand.java b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/gap/BlueGigaConnectDirectCommand.java
new file mode 100644
index 00000000000..2bd80f17910
--- /dev/null
+++ b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/gap/BlueGigaConnectDirectCommand.java
@@ -0,0 +1,190 @@
+/**
+ * Copyright (c) 2014,2017 Contributors to the Eclipse Foundation
+ *
+ * See the NOTICE file(s) distributed with this work for additional
+ * information regarding copyright ownership.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ */
+package org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.command.gap;
+
+import org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.BlueGigaCommand;
+import org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.enumeration.BluetoothAddressType;
+
+/**
+ * Class to implement the BlueGiga command connectDirect.
+ *
+ * This command will start the GAP direct connection establishment procedure to a dedicated
+ * Smart Bluetooth device. The module will enter a state where it continuously scans for the
+ * connectable advertisement packets Bluetooth from the remote device which matches the
+ * Bluetooth address gives as a parameter. Upon receiving the advertisement packet, the
+ * module will send a connection request packet to the target device to imitate a Bluetooth
+ * connection. A successful connection will bi indicated by a event. Status If the device is
+ * configured to support more than one connection, the smallest connection interval which is
+ * divisible by maximum_connections * 2.5ms will be selected. Thus, it is important to provide
+ * minimum and maximum connection intervals so that such a connection interval is available
+ * within the range. The connection establishment procedure can be cancelled with End
+ * Procedure command.
+ *
+ * This class provides methods for processing BlueGiga API commands.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ *
+ * @author Chris Jackson - Initial contribution of Java code generator
+ */
+public class BlueGigaConnectDirectCommand extends BlueGigaCommand {
+ public static int COMMAND_CLASS = 0x06;
+ public static int COMMAND_METHOD = 0x03;
+
+ /**
+ * Bluetooth address of the target device.
+ *
+ * BlueGiga API type is bd_addr - Java type is {@link String}
+ */
+ private String address;
+
+ /**
+ * see: Bluetooth Address Types.
+ *
+ * BlueGiga API type is BluetoothAddressType - Java type is {@link BluetoothAddressType}
+ */
+ private BluetoothAddressType addrType;
+
+ /**
+ * Minimum Connection Interval (in units of 1.25ms). Range: 6 - 3200 The lowest possible
+ * Connection Interval is 7.50ms and the largest is 4000ms.
+ *
+ * BlueGiga API type is uint16 - Java type is {@link int}
+ */
+ private int connIntervalMin;
+
+ /**
+ * Maximum Connection Interval (in units of 1.25ms). Range: 6 - 3200 Must be equal or bigger than
+ * minimum Connection Interval.
+ *
+ * BlueGiga API type is uint16 - Java type is {@link int}
+ */
+ private int connIntervalMax;
+
+ /**
+ * Supervision Timeout (in units of 10ms). The Supervision Timeout defines how long the
+ * devices can be out of range before the connection is closed. Range: 10 - 3200 Minimum time for
+ * the Supervision Timeout is 100ms and maximum value is 32000ms. According to the
+ * specification, the Supervision Timeout in milliseconds shall be larger than (1 + latency) *
+ * conn_interval_max * 2, where conn_interval_max is given in milliseconds.
+ *
+ * BlueGiga API type is uint16 - Java type is {@link int}
+ */
+ private int timeout;
+
+ /**
+ * This parameter configures the slave latency. Slave latency defines how many connection
+ * intervals a slave device can skip. Increasing slave latency will decrease the energy
+ * consumption of the slave in scenarios where slave does not have data to send at every
+ * connection interval. Range: 0 - 500 0 : Slave latency is disabled. Example: Connection
+ * interval is 10ms and slave latency is 9: this means that the slave is allowed to communicate
+ * every 100ms, but it can communicate every 10ms if needed.
+ *
+ * BlueGiga API type is uint16 - Java type is {@link int}
+ */
+ private int latency;
+
+ /**
+ * Bluetooth address of the target device.
+ *
+ * @param address the address to set as {@link String}
+ */
+ public void setAddress(String address) {
+ this.address = address;
+ }
+ /**
+ * see: Bluetooth Address Types.
+ *
+ * @param addrType the addrType to set as {@link BluetoothAddressType}
+ */
+ public void setAddrType(BluetoothAddressType addrType) {
+ this.addrType = addrType;
+ }
+ /**
+ * Minimum Connection Interval (in units of 1.25ms). Range: 6 - 3200 The lowest possible
+ * Connection Interval is 7.50ms and the largest is 4000ms.
+ *
+ * @param connIntervalMin the connIntervalMin to set as {@link int}
+ */
+ public void setConnIntervalMin(int connIntervalMin) {
+ this.connIntervalMin = connIntervalMin;
+ }
+ /**
+ * Maximum Connection Interval (in units of 1.25ms). Range: 6 - 3200 Must be equal or bigger than
+ * minimum Connection Interval.
+ *
+ * @param connIntervalMax the connIntervalMax to set as {@link int}
+ */
+ public void setConnIntervalMax(int connIntervalMax) {
+ this.connIntervalMax = connIntervalMax;
+ }
+ /**
+ * Supervision Timeout (in units of 10ms). The Supervision Timeout defines how long the
+ * devices can be out of range before the connection is closed. Range: 10 - 3200 Minimum time for
+ * the Supervision Timeout is 100ms and maximum value is 32000ms. According to the
+ * specification, the Supervision Timeout in milliseconds shall be larger than (1 + latency) *
+ * conn_interval_max * 2, where conn_interval_max is given in milliseconds.
+ *
+ * @param timeout the timeout to set as {@link int}
+ */
+ public void setTimeout(int timeout) {
+ this.timeout = timeout;
+ }
+ /**
+ * This parameter configures the slave latency. Slave latency defines how many connection
+ * intervals a slave device can skip. Increasing slave latency will decrease the energy
+ * consumption of the slave in scenarios where slave does not have data to send at every
+ * connection interval. Range: 0 - 500 0 : Slave latency is disabled. Example: Connection
+ * interval is 10ms and slave latency is 9: this means that the slave is allowed to communicate
+ * every 100ms, but it can communicate every 10ms if needed.
+ *
+ * @param latency the latency to set as {@link int}
+ */
+ public void setLatency(int latency) {
+ this.latency = latency;
+ }
+
+ @Override
+ public int[] serialize() {
+ // Serialize the header
+ serializeHeader(COMMAND_CLASS, COMMAND_METHOD);
+
+ // Serialize the fields
+ serializeAddress(address);
+ serializeBluetoothAddressType(addrType);
+ serializeUInt16(connIntervalMin);
+ serializeUInt16(connIntervalMax);
+ serializeUInt16(timeout);
+ serializeUInt16(latency);
+
+ return getPayload();
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder builder = new StringBuilder();
+ builder.append("BlueGigaConnectDirectCommand [address=");
+ builder.append(address);
+ builder.append(", addrType=");
+ builder.append(addrType);
+ builder.append(", connIntervalMin=");
+ builder.append(connIntervalMin);
+ builder.append(", connIntervalMax=");
+ builder.append(connIntervalMax);
+ builder.append(", timeout=");
+ builder.append(timeout);
+ builder.append(", latency=");
+ builder.append(latency);
+ builder.append(']');
+ return builder.toString();
+ }
+}
diff --git a/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/gap/BlueGigaConnectDirectResponse.java b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/gap/BlueGigaConnectDirectResponse.java
new file mode 100644
index 00000000000..5189a20232c
--- /dev/null
+++ b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/gap/BlueGigaConnectDirectResponse.java
@@ -0,0 +1,102 @@
+/**
+ * Copyright (c) 2014,2017 Contributors to the Eclipse Foundation
+ *
+ * See the NOTICE file(s) distributed with this work for additional
+ * information regarding copyright ownership.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ */
+package org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.command.gap;
+
+import org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.BlueGigaResponse;
+import org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.enumeration.BgApiResponse;
+
+/**
+ * Class to implement the BlueGiga command connectDirect.
+ *
+ * This command will start the GAP direct connection establishment procedure to a dedicated
+ * Smart Bluetooth device. The module will enter a state where it continuously scans for the
+ * connectable advertisement packets Bluetooth from the remote device which matches the
+ * Bluetooth address gives as a parameter. Upon receiving the advertisement packet, the
+ * module will send a connection request packet to the target device to imitate a Bluetooth
+ * connection. A successful connection will bi indicated by a event. Status If the device is
+ * configured to support more than one connection, the smallest connection interval which is
+ * divisible by maximum_connections * 2.5ms will be selected. Thus, it is important to provide
+ * minimum and maximum connection intervals so that such a connection interval is available
+ * within the range. The connection establishment procedure can be cancelled with End
+ * Procedure command.
+ *
+ * This class provides methods for processing BlueGiga API commands.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ *
+ * @author Chris Jackson - Initial contribution of Java code generator
+ */
+public class BlueGigaConnectDirectResponse extends BlueGigaResponse {
+ public static int COMMAND_CLASS = 0x06;
+ public static int COMMAND_METHOD = 0x03;
+
+ /**
+ * 0 : procedure was successfully started Non-zero: An error occurred
+ *
+ * BlueGiga API type is BgApiResponse - Java type is {@link BgApiResponse}
+ */
+ private BgApiResponse result;
+
+ /**
+ * Connection handle that is reserved for new connection
+ *
+ * BlueGiga API type is uint8 - Java type is {@link int}
+ */
+ private int connectionHandle;
+
+ /**
+ * Response constructor
+ */
+ public BlueGigaConnectDirectResponse(int[] inputBuffer) {
+ // Super creates deserializer and reads header fields
+ super(inputBuffer);
+
+ event = (inputBuffer[0] & 0x80) != 0;
+
+ // Deserialize the fields
+ result = deserializeBgApiResponse();
+ connectionHandle = deserializeUInt8();
+ }
+
+ /**
+ * 0 : procedure was successfully started Non-zero: An error occurred
+ *
+ * BlueGiga API type is BgApiResponse - Java type is {@link BgApiResponse}
+ *
+ * @return the current result as {@link BgApiResponse}
+ */
+ public BgApiResponse getResult() {
+ return result;
+ }
+ /**
+ * Connection handle that is reserved for new connection
+ *
+ * BlueGiga API type is uint8 - Java type is {@link int}
+ *
+ * @return the current connection_handle as {@link int}
+ */
+ public int getConnectionHandle() {
+ return connectionHandle;
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder builder = new StringBuilder();
+ builder.append("BlueGigaConnectDirectResponse [result=");
+ builder.append(result);
+ builder.append(", connectionHandle=");
+ builder.append(connectionHandle);
+ builder.append(']');
+ return builder.toString();
+ }
+}
diff --git a/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/gap/BlueGigaConnectSelectiveCommand.java b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/gap/BlueGigaConnectSelectiveCommand.java
new file mode 100644
index 00000000000..2c99378dd0a
--- /dev/null
+++ b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/gap/BlueGigaConnectSelectiveCommand.java
@@ -0,0 +1,150 @@
+/**
+ * Copyright (c) 2014,2017 Contributors to the Eclipse Foundation
+ *
+ * See the NOTICE file(s) distributed with this work for additional
+ * information regarding copyright ownership.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ */
+package org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.command.gap;
+
+import org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.BlueGigaCommand;
+
+/**
+ * Class to implement the BlueGiga command connectSelective.
+ *
+ * This command will start the GAP direct connection establishment procedure to a set of
+ * dedicated Bluetooth Smart devices. When this command is issued the the module will enter a
+ * state where it scans connectable Bluetooth advertisement packets from the remote devices
+ * which are registered in the local white list. Upon receiving an advertisement packet from
+ * one of the registered devices, the module will send a connection request to this device, and a
+ * successful connection will produce a connection status event. The connect selective
+ * command can be cancelled with End Procedure command. When in Initiating State there are no
+ * scan response events.
+ *
+ * This class provides methods for processing BlueGiga API commands.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ *
+ * @author Chris Jackson - Initial contribution of Java code generator
+ */
+public class BlueGigaConnectSelectiveCommand extends BlueGigaCommand {
+ public static int COMMAND_CLASS = 0x06;
+ public static int COMMAND_METHOD = 0x05;
+
+ /**
+ * Minimum Connection Interval (in units of 1.25ms). Range: 6 - 3200 The lowest possible
+ * Connection Interval is 7.50ms and the largest is 4000ms.
+ *
+ * BlueGiga API type is uint16 - Java type is {@link int}
+ */
+ private int connIntervalMin;
+
+ /**
+ * Maximum Connection Interval (in units of 1.25ms). Range: 6 - 3200 Must be equal or bigger than
+ * minimum Connection Interval.
+ *
+ * BlueGiga API type is uint16 - Java type is {@link int}
+ */
+ private int connIntervalMax;
+
+ /**
+ * Supervision Timeout (in units of 10ms). The Supervision Timeout defines how long the
+ * devices can be out of range before the connection is closed. Range: 10 - 3200 Minimum time for
+ * the Supervision Timeout is 100ms and maximum value is 32000ms. According to the
+ * specification, the Supervision Timeout in milliseconds shall be larger than (1 + latency) *
+ * conn_interval_max * 2, where conn_interval_max is given in milliseconds.
+ *
+ * BlueGiga API type is uint16 - Java type is {@link int}
+ */
+ private int timeout;
+
+ /**
+ * This parameter configures the slave latency. Slave latency defines how many connection
+ * intervals a slave device can skip. Increasing slave latency will decrease the energy
+ * consumption of the slave in scenarios where slave does not have data to send at every
+ * connection interval. Range: 0 - 500 0 : Slave latency is disabled. Example: Connection
+ * interval is 10ms and slave latency is 9: this means that the slave is allowed to communicate
+ * every 100ms, but it can communicate every 10ms if needed.
+ *
+ * BlueGiga API type is uint16 - Java type is {@link int}
+ */
+ private int latency;
+
+ /**
+ * Minimum Connection Interval (in units of 1.25ms). Range: 6 - 3200 The lowest possible
+ * Connection Interval is 7.50ms and the largest is 4000ms.
+ *
+ * @param connIntervalMin the connIntervalMin to set as {@link int}
+ */
+ public void setConnIntervalMin(int connIntervalMin) {
+ this.connIntervalMin = connIntervalMin;
+ }
+ /**
+ * Maximum Connection Interval (in units of 1.25ms). Range: 6 - 3200 Must be equal or bigger than
+ * minimum Connection Interval.
+ *
+ * @param connIntervalMax the connIntervalMax to set as {@link int}
+ */
+ public void setConnIntervalMax(int connIntervalMax) {
+ this.connIntervalMax = connIntervalMax;
+ }
+ /**
+ * Supervision Timeout (in units of 10ms). The Supervision Timeout defines how long the
+ * devices can be out of range before the connection is closed. Range: 10 - 3200 Minimum time for
+ * the Supervision Timeout is 100ms and maximum value is 32000ms. According to the
+ * specification, the Supervision Timeout in milliseconds shall be larger than (1 + latency) *
+ * conn_interval_max * 2, where conn_interval_max is given in milliseconds.
+ *
+ * @param timeout the timeout to set as {@link int}
+ */
+ public void setTimeout(int timeout) {
+ this.timeout = timeout;
+ }
+ /**
+ * This parameter configures the slave latency. Slave latency defines how many connection
+ * intervals a slave device can skip. Increasing slave latency will decrease the energy
+ * consumption of the slave in scenarios where slave does not have data to send at every
+ * connection interval. Range: 0 - 500 0 : Slave latency is disabled. Example: Connection
+ * interval is 10ms and slave latency is 9: this means that the slave is allowed to communicate
+ * every 100ms, but it can communicate every 10ms if needed.
+ *
+ * @param latency the latency to set as {@link int}
+ */
+ public void setLatency(int latency) {
+ this.latency = latency;
+ }
+
+ @Override
+ public int[] serialize() {
+ // Serialize the header
+ serializeHeader(COMMAND_CLASS, COMMAND_METHOD);
+
+ // Serialize the fields
+ serializeUInt16(connIntervalMin);
+ serializeUInt16(connIntervalMax);
+ serializeUInt16(timeout);
+ serializeUInt16(latency);
+
+ return getPayload();
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder builder = new StringBuilder();
+ builder.append("BlueGigaConnectSelectiveCommand [connIntervalMin=");
+ builder.append(connIntervalMin);
+ builder.append(", connIntervalMax=");
+ builder.append(connIntervalMax);
+ builder.append(", timeout=");
+ builder.append(timeout);
+ builder.append(", latency=");
+ builder.append(latency);
+ builder.append(']');
+ return builder.toString();
+ }
+}
diff --git a/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/gap/BlueGigaConnectSelectiveResponse.java b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/gap/BlueGigaConnectSelectiveResponse.java
new file mode 100644
index 00000000000..6ab1282249e
--- /dev/null
+++ b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/gap/BlueGigaConnectSelectiveResponse.java
@@ -0,0 +1,99 @@
+/**
+ * Copyright (c) 2014,2017 Contributors to the Eclipse Foundation
+ *
+ * See the NOTICE file(s) distributed with this work for additional
+ * information regarding copyright ownership.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ */
+package org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.command.gap;
+
+import org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.BlueGigaResponse;
+import org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.enumeration.BgApiResponse;
+
+/**
+ * Class to implement the BlueGiga command connectSelective.
+ *
+ * This command will start the GAP direct connection establishment procedure to a set of
+ * dedicated Bluetooth Smart devices. When this command is issued the the module will enter a
+ * state where it scans connectable Bluetooth advertisement packets from the remote devices
+ * which are registered in the local white list. Upon receiving an advertisement packet from
+ * one of the registered devices, the module will send a connection request to this device, and a
+ * successful connection will produce a connection status event. The connect selective
+ * command can be cancelled with End Procedure command. When in Initiating State there are no
+ * scan response events.
+ *
+ * This class provides methods for processing BlueGiga API commands.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ *
+ * @author Chris Jackson - Initial contribution of Java code generator
+ */
+public class BlueGigaConnectSelectiveResponse extends BlueGigaResponse {
+ public static int COMMAND_CLASS = 0x06;
+ public static int COMMAND_METHOD = 0x05;
+
+ /**
+ * 0 : procedure was successfully started Non-zero: An error occurred
+ *
+ * BlueGiga API type is BgApiResponse - Java type is {@link BgApiResponse}
+ */
+ private BgApiResponse result;
+
+ /**
+ * Connection handle that is reserved for new connection
+ *
+ * BlueGiga API type is uint8 - Java type is {@link int}
+ */
+ private int connectionHandle;
+
+ /**
+ * Response constructor
+ */
+ public BlueGigaConnectSelectiveResponse(int[] inputBuffer) {
+ // Super creates deserializer and reads header fields
+ super(inputBuffer);
+
+ event = (inputBuffer[0] & 0x80) != 0;
+
+ // Deserialize the fields
+ result = deserializeBgApiResponse();
+ connectionHandle = deserializeUInt8();
+ }
+
+ /**
+ * 0 : procedure was successfully started Non-zero: An error occurred
+ *
+ * BlueGiga API type is BgApiResponse - Java type is {@link BgApiResponse}
+ *
+ * @return the current result as {@link BgApiResponse}
+ */
+ public BgApiResponse getResult() {
+ return result;
+ }
+ /**
+ * Connection handle that is reserved for new connection
+ *
+ * BlueGiga API type is uint8 - Java type is {@link int}
+ *
+ * @return the current connection_handle as {@link int}
+ */
+ public int getConnectionHandle() {
+ return connectionHandle;
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder builder = new StringBuilder();
+ builder.append("BlueGigaConnectSelectiveResponse [result=");
+ builder.append(result);
+ builder.append(", connectionHandle=");
+ builder.append(connectionHandle);
+ builder.append(']');
+ return builder.toString();
+ }
+}
diff --git a/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/gap/BlueGigaDiscoverCommand.java b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/gap/BlueGigaDiscoverCommand.java
new file mode 100644
index 00000000000..e3c44bb008d
--- /dev/null
+++ b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/gap/BlueGigaDiscoverCommand.java
@@ -0,0 +1,71 @@
+/**
+ * Copyright (c) 2014,2017 Contributors to the Eclipse Foundation
+ *
+ * See the NOTICE file(s) distributed with this work for additional
+ * information regarding copyright ownership.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ */
+package org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.command.gap;
+
+import org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.BlueGigaCommand;
+import org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.enumeration.GapDiscoverMode;
+
+/**
+ * Class to implement the BlueGiga command discover.
+ *
+ * This command starts the GAP discovery procedure to scan for advertising devices i.e. to
+ * perform a device discovery. Scanning parameters can be configured with the Set Scan
+ * Parameters command before issuing this command. To cancel on an ongoing discovery process
+ * use the End Procedure command.
+ *
+ * This class provides methods for processing BlueGiga API commands.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ *
+ * @author Chris Jackson - Initial contribution of Java code generator
+ */
+public class BlueGigaDiscoverCommand extends BlueGigaCommand {
+ public static int COMMAND_CLASS = 0x06;
+ public static int COMMAND_METHOD = 0x02;
+
+ /**
+ * see:GAP Discover Mode.
+ *
+ * BlueGiga API type is GapDiscoverMode - Java type is {@link GapDiscoverMode}
+ */
+ private GapDiscoverMode mode;
+
+ /**
+ * see:GAP Discover Mode.
+ *
+ * @param mode the mode to set as {@link GapDiscoverMode}
+ */
+ public void setMode(GapDiscoverMode mode) {
+ this.mode = mode;
+ }
+
+ @Override
+ public int[] serialize() {
+ // Serialize the header
+ serializeHeader(COMMAND_CLASS, COMMAND_METHOD);
+
+ // Serialize the fields
+ serializeGapDiscoverMode(mode);
+
+ return getPayload();
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder builder = new StringBuilder();
+ builder.append("BlueGigaDiscoverCommand [mode=");
+ builder.append(mode);
+ builder.append(']');
+ return builder.toString();
+ }
+}
diff --git a/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/gap/BlueGigaDiscoverResponse.java b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/gap/BlueGigaDiscoverResponse.java
new file mode 100644
index 00000000000..d6cc13af393
--- /dev/null
+++ b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/gap/BlueGigaDiscoverResponse.java
@@ -0,0 +1,75 @@
+/**
+ * Copyright (c) 2014,2017 Contributors to the Eclipse Foundation
+ *
+ * See the NOTICE file(s) distributed with this work for additional
+ * information regarding copyright ownership.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ */
+package org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.command.gap;
+
+import org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.BlueGigaResponse;
+import org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.enumeration.BgApiResponse;
+
+/**
+ * Class to implement the BlueGiga command discover.
+ *
+ * This command starts the GAP discovery procedure to scan for advertising devices i.e. to
+ * perform a device discovery. Scanning parameters can be configured with the Set Scan
+ * Parameters command before issuing this command. To cancel on an ongoing discovery process
+ * use the End Procedure command.
+ *
+ * This class provides methods for processing BlueGiga API commands.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ *
+ * @author Chris Jackson - Initial contribution of Java code generator
+ */
+public class BlueGigaDiscoverResponse extends BlueGigaResponse {
+ public static int COMMAND_CLASS = 0x06;
+ public static int COMMAND_METHOD = 0x02;
+
+ /**
+ * 0: Scan procedure was successfully started Non-zero: An error occurred.
+ *
+ * BlueGiga API type is BgApiResponse - Java type is {@link BgApiResponse}
+ */
+ private BgApiResponse result;
+
+ /**
+ * Response constructor
+ */
+ public BlueGigaDiscoverResponse(int[] inputBuffer) {
+ // Super creates deserializer and reads header fields
+ super(inputBuffer);
+
+ event = (inputBuffer[0] & 0x80) != 0;
+
+ // Deserialize the fields
+ result = deserializeBgApiResponse();
+ }
+
+ /**
+ * 0: Scan procedure was successfully started Non-zero: An error occurred.
+ *
+ * BlueGiga API type is BgApiResponse - Java type is {@link BgApiResponse}
+ *
+ * @return the current result as {@link BgApiResponse}
+ */
+ public BgApiResponse getResult() {
+ return result;
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder builder = new StringBuilder();
+ builder.append("BlueGigaDiscoverResponse [result=");
+ builder.append(result);
+ builder.append(']');
+ return builder.toString();
+ }
+}
diff --git a/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/gap/BlueGigaEndProcedureCommand.java b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/gap/BlueGigaEndProcedureCommand.java
new file mode 100644
index 00000000000..29923350404
--- /dev/null
+++ b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/gap/BlueGigaEndProcedureCommand.java
@@ -0,0 +1,46 @@
+/**
+ * Copyright (c) 2014,2017 Contributors to the Eclipse Foundation
+ *
+ * See the NOTICE file(s) distributed with this work for additional
+ * information regarding copyright ownership.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ */
+package org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.command.gap;
+
+import org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.BlueGigaCommand;
+
+/**
+ * Class to implement the BlueGiga command endProcedure.
+ *
+ * This command ends the current GAP discovery procedure and stop the scanning of advertising
+ * devices.
+ *
+ * This class provides methods for processing BlueGiga API commands.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ *
+ * @author Chris Jackson - Initial contribution of Java code generator
+ */
+public class BlueGigaEndProcedureCommand extends BlueGigaCommand {
+ public static int COMMAND_CLASS = 0x06;
+ public static int COMMAND_METHOD = 0x04;
+
+
+ @Override
+ public int[] serialize() {
+ // Serialize the header
+ serializeHeader(COMMAND_CLASS, COMMAND_METHOD);
+
+ return getPayload();
+ }
+
+ @Override
+ public String toString() {
+ return "BlueGigaEndProcedureCommand []";
+ }
+}
diff --git a/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/gap/BlueGigaEndProcedureResponse.java b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/gap/BlueGigaEndProcedureResponse.java
new file mode 100644
index 00000000000..93f603c1ec1
--- /dev/null
+++ b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/gap/BlueGigaEndProcedureResponse.java
@@ -0,0 +1,73 @@
+/**
+ * Copyright (c) 2014,2017 Contributors to the Eclipse Foundation
+ *
+ * See the NOTICE file(s) distributed with this work for additional
+ * information regarding copyright ownership.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ */
+package org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.command.gap;
+
+import org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.BlueGigaResponse;
+import org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.enumeration.BgApiResponse;
+
+/**
+ * Class to implement the BlueGiga command endProcedure.
+ *
+ * This command ends the current GAP discovery procedure and stop the scanning of advertising
+ * devices.
+ *
+ * This class provides methods for processing BlueGiga API commands.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ *
+ * @author Chris Jackson - Initial contribution of Java code generator
+ */
+public class BlueGigaEndProcedureResponse extends BlueGigaResponse {
+ public static int COMMAND_CLASS = 0x06;
+ public static int COMMAND_METHOD = 0x04;
+
+ /**
+ * 0: the command was successful. Non-zero: An error occurred
+ *
+ * BlueGiga API type is BgApiResponse - Java type is {@link BgApiResponse}
+ */
+ private BgApiResponse result;
+
+ /**
+ * Response constructor
+ */
+ public BlueGigaEndProcedureResponse(int[] inputBuffer) {
+ // Super creates deserializer and reads header fields
+ super(inputBuffer);
+
+ event = (inputBuffer[0] & 0x80) != 0;
+
+ // Deserialize the fields
+ result = deserializeBgApiResponse();
+ }
+
+ /**
+ * 0: the command was successful. Non-zero: An error occurred
+ *
+ * BlueGiga API type is BgApiResponse - Java type is {@link BgApiResponse}
+ *
+ * @return the current result as {@link BgApiResponse}
+ */
+ public BgApiResponse getResult() {
+ return result;
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder builder = new StringBuilder();
+ builder.append("BlueGigaEndProcedureResponse [result=");
+ builder.append(result);
+ builder.append(']');
+ return builder.toString();
+ }
+}
diff --git a/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/gap/BlueGigaScanResponseEvent.java b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/gap/BlueGigaScanResponseEvent.java
new file mode 100644
index 00000000000..72b5607e6e3
--- /dev/null
+++ b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/gap/BlueGigaScanResponseEvent.java
@@ -0,0 +1,181 @@
+/**
+ * Copyright (c) 2014,2017 Contributors to the Eclipse Foundation
+ *
+ * See the NOTICE file(s) distributed with this work for additional
+ * information regarding copyright ownership.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ */
+package org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.command.gap;
+
+import org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.BlueGigaResponse;
+import org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.enumeration.BluetoothAddressType;
+import org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.enumeration.ScanResponseType;
+
+/**
+ * Class to implement the BlueGiga command scanResponseEvent.
+ *
+ * This is a scan response event. This event is normally received by a Master which is scanning
+ * for advertisement and scan response packets from Slaves.
+ *
+ * This class provides methods for processing BlueGiga API commands.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ *
+ * @author Chris Jackson - Initial contribution of Java code generator
+ */
+public class BlueGigaScanResponseEvent extends BlueGigaResponse {
+ public static int COMMAND_CLASS = 0x06;
+ public static int COMMAND_METHOD = 0x00;
+
+ /**
+ * RSSI value (dBm). Range: -103 to -38
+ *
+ * BlueGiga API type is int8 - Java type is {@link int}
+ */
+ private int rssi;
+
+ /**
+ * Scan response header. 0: Connectable Advertisement packet. 2: Non Connectable
+ * Advertisement packet. 4: Scan response packet. 6: Discoverable advertisement packet
+ *
+ * BlueGiga API type is ScanResponseType - Java type is {@link ScanResponseType}
+ */
+ private ScanResponseType packetType;
+
+ /**
+ * Advertisers address
+ *
+ * BlueGiga API type is bd_addr - Java type is {@link String}
+ */
+ private String sender;
+
+ /**
+ * Advertiser address type. 1: random address. 0: public address
+ *
+ * BlueGiga API type is BluetoothAddressType - Java type is {@link BluetoothAddressType}
+ */
+ private BluetoothAddressType addressType;
+
+ /**
+ * Bond handle if there is known bond for this device, 0xff otherwise
+ *
+ * BlueGiga API type is uint8 - Java type is {@link int}
+ */
+ private int bond;
+
+ /**
+ * Scan response data
+ *
+ * BlueGiga API type is uint8array - Java type is {@link int[]}
+ */
+ private int[] data;
+
+ /**
+ * Event constructor
+ */
+ public BlueGigaScanResponseEvent(int[] inputBuffer) {
+ // Super creates deserializer and reads header fields
+ super(inputBuffer);
+
+ event = (inputBuffer[0] & 0x80) != 0;
+
+ // Deserialize the fields
+ rssi = deserializeInt8();
+ packetType = deserializeScanResponseType();
+ sender = deserializeAddress();
+ addressType = deserializeBluetoothAddressType();
+ bond = deserializeUInt8();
+ data = deserializeUInt8Array();
+ }
+
+ /**
+ * RSSI value (dBm). Range: -103 to -38
+ *
+ * BlueGiga API type is int8 - Java type is {@link int}
+ *
+ * @return the current rssi as {@link int}
+ */
+ public int getRssi() {
+ return rssi;
+ }
+ /**
+ * Scan response header. 0: Connectable Advertisement packet. 2: Non Connectable
+ * Advertisement packet. 4: Scan response packet. 6: Discoverable advertisement packet
+ *
+ * BlueGiga API type is ScanResponseType - Java type is {@link ScanResponseType}
+ *
+ * @return the current packet_type as {@link ScanResponseType}
+ */
+ public ScanResponseType getPacketType() {
+ return packetType;
+ }
+ /**
+ * Advertisers address
+ *
+ * BlueGiga API type is bd_addr - Java type is {@link String}
+ *
+ * @return the current sender as {@link String}
+ */
+ public String getSender() {
+ return sender;
+ }
+ /**
+ * Advertiser address type. 1: random address. 0: public address
+ *
+ * BlueGiga API type is BluetoothAddressType - Java type is {@link BluetoothAddressType}
+ *
+ * @return the current address_type as {@link BluetoothAddressType}
+ */
+ public BluetoothAddressType getAddressType() {
+ return addressType;
+ }
+ /**
+ * Bond handle if there is known bond for this device, 0xff otherwise
+ *
+ * BlueGiga API type is uint8 - Java type is {@link int}
+ *
+ * @return the current bond as {@link int}
+ */
+ public int getBond() {
+ return bond;
+ }
+ /**
+ * Scan response data
+ *
+ * BlueGiga API type is uint8array - Java type is {@link int[]}
+ *
+ * @return the current data as {@link int[]}
+ */
+ public int[] getData() {
+ return data;
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder builder = new StringBuilder();
+ builder.append("BlueGigaScanResponseEvent [rssi=");
+ builder.append(rssi);
+ builder.append(", packetType=");
+ builder.append(packetType);
+ builder.append(", sender=");
+ builder.append(sender);
+ builder.append(", addressType=");
+ builder.append(addressType);
+ builder.append(", bond=");
+ builder.append(bond);
+ builder.append(", data=");
+ for (int c = 0; c < data.length; c++) {
+ if (c > 0) {
+ builder.append(' ');
+ }
+ builder.append(String.format("%02X", data[c]));
+ }
+ builder.append(']');
+ return builder.toString();
+ }
+}
diff --git a/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/gap/BlueGigaSetAdvDataCommand.java b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/gap/BlueGigaSetAdvDataCommand.java
new file mode 100644
index 00000000000..96c2b066a65
--- /dev/null
+++ b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/gap/BlueGigaSetAdvDataCommand.java
@@ -0,0 +1,95 @@
+/**
+ * Copyright (c) 2014,2017 Contributors to the Eclipse Foundation
+ *
+ * See the NOTICE file(s) distributed with this work for additional
+ * information regarding copyright ownership.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ */
+package org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.command.gap;
+
+import org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.BlueGigaCommand;
+
+/**
+ * Class to implement the BlueGiga command setAdvData.
+ *
+ * This commands set advertisement or scan response data used in the advertisement and scan
+ * response packets. The command allows application specific data to be broadcasts either in
+ * advertisement or scan response packets. The data set with this command is only used when the
+ * GAP discoverable mode is set to gap_user_data. Notice that advertisement or scan response
+ * data must be formatted in accordance to the Bluetooth Core Specification. See BLUETOOTH
+ * SPECIFICATION Version 4.0 [Vol 3 - Part C - Chapter 11].
+ *
+ * This class provides methods for processing BlueGiga API commands.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ *
+ * @author Chris Jackson - Initial contribution of Java code generator
+ */
+public class BlueGigaSetAdvDataCommand extends BlueGigaCommand {
+ public static int COMMAND_CLASS = 0x06;
+ public static int COMMAND_METHOD = 0x09;
+
+ /**
+ * Advertisement data type. 0 : sets advertisement data. 1 : sets scan response data
+ *
+ * BlueGiga API type is uint8 - Java type is {@link int}
+ */
+ private int setScanrsp;
+
+ /**
+ * Advertisement data to send
+ *
+ * BlueGiga API type is uint8array - Java type is {@link int[]}
+ */
+ private int[] advData;
+
+ /**
+ * Advertisement data type. 0 : sets advertisement data. 1 : sets scan response data
+ *
+ * @param setScanrsp the setScanrsp to set as {@link int}
+ */
+ public void setSetScanrsp(int setScanrsp) {
+ this.setScanrsp = setScanrsp;
+ }
+ /**
+ * Advertisement data to send
+ *
+ * @param advData the advData to set as {@link int[]}
+ */
+ public void setAdvData(int[] advData) {
+ this.advData = advData;
+ }
+
+ @Override
+ public int[] serialize() {
+ // Serialize the header
+ serializeHeader(COMMAND_CLASS, COMMAND_METHOD);
+
+ // Serialize the fields
+ serializeUInt8(setScanrsp);
+ serializeUInt8Array(advData);
+
+ return getPayload();
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder builder = new StringBuilder();
+ builder.append("BlueGigaSetAdvDataCommand [setScanrsp=");
+ builder.append(setScanrsp);
+ builder.append(", advData=");
+ for (int c = 0; c < advData.length; c++) {
+ if (c > 0) {
+ builder.append(' ');
+ }
+ builder.append(String.format("%02X", advData[c]));
+ }
+ builder.append(']');
+ return builder.toString();
+ }
+}
diff --git a/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/gap/BlueGigaSetAdvDataResponse.java b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/gap/BlueGigaSetAdvDataResponse.java
new file mode 100644
index 00000000000..9476f807463
--- /dev/null
+++ b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/gap/BlueGigaSetAdvDataResponse.java
@@ -0,0 +1,77 @@
+/**
+ * Copyright (c) 2014,2017 Contributors to the Eclipse Foundation
+ *
+ * See the NOTICE file(s) distributed with this work for additional
+ * information regarding copyright ownership.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ */
+package org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.command.gap;
+
+import org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.BlueGigaResponse;
+import org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.enumeration.BgApiResponse;
+
+/**
+ * Class to implement the BlueGiga command setAdvData.
+ *
+ * This commands set advertisement or scan response data used in the advertisement and scan
+ * response packets. The command allows application specific data to be broadcasts either in
+ * advertisement or scan response packets. The data set with this command is only used when the
+ * GAP discoverable mode is set to gap_user_data. Notice that advertisement or scan response
+ * data must be formatted in accordance to the Bluetooth Core Specification. See BLUETOOTH
+ * SPECIFICATION Version 4.0 [Vol 3 - Part C - Chapter 11].
+ *
+ * This class provides methods for processing BlueGiga API commands.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ *
+ * @author Chris Jackson - Initial contribution of Java code generator
+ */
+public class BlueGigaSetAdvDataResponse extends BlueGigaResponse {
+ public static int COMMAND_CLASS = 0x06;
+ public static int COMMAND_METHOD = 0x09;
+
+ /**
+ * 0: Command was successfully executed. Non-zero: An error occurred
+ *
+ * BlueGiga API type is BgApiResponse - Java type is {@link BgApiResponse}
+ */
+ private BgApiResponse result;
+
+ /**
+ * Response constructor
+ */
+ public BlueGigaSetAdvDataResponse(int[] inputBuffer) {
+ // Super creates deserializer and reads header fields
+ super(inputBuffer);
+
+ event = (inputBuffer[0] & 0x80) != 0;
+
+ // Deserialize the fields
+ result = deserializeBgApiResponse();
+ }
+
+ /**
+ * 0: Command was successfully executed. Non-zero: An error occurred
+ *
+ * BlueGiga API type is BgApiResponse - Java type is {@link BgApiResponse}
+ *
+ * @return the current result as {@link BgApiResponse}
+ */
+ public BgApiResponse getResult() {
+ return result;
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder builder = new StringBuilder();
+ builder.append("BlueGigaSetAdvDataResponse [result=");
+ builder.append(result);
+ builder.append(']');
+ return builder.toString();
+ }
+}
diff --git a/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/gap/BlueGigaSetAdvParametersCommand.java b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/gap/BlueGigaSetAdvParametersCommand.java
new file mode 100644
index 00000000000..d01ee607dcd
--- /dev/null
+++ b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/gap/BlueGigaSetAdvParametersCommand.java
@@ -0,0 +1,114 @@
+/**
+ * Copyright (c) 2014,2017 Contributors to the Eclipse Foundation
+ *
+ * See the NOTICE file(s) distributed with this work for additional
+ * information regarding copyright ownership.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ */
+package org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.command.gap;
+
+import org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.BlueGigaCommand;
+
+/**
+ * Class to implement the BlueGiga command setAdvParameters.
+ *
+ * This command is used to set the advertising parameters. Example: If the minimum
+ * advertisement interval is 40ms and the maximum advertisement interval is 100ms then the
+ * real advertisement interval will be mostly the middle value (70ms) plus a randomly added
+ * 20ms delay, which needs to be added according to the Bluetooth specification.
+ *
+ * This class provides methods for processing BlueGiga API commands.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ *
+ * @author Chris Jackson - Initial contribution of Java code generator
+ */
+public class BlueGigaSetAdvParametersCommand extends BlueGigaCommand {
+ public static int COMMAND_CLASS = 0x06;
+ public static int COMMAND_METHOD = 0x08;
+
+ /**
+ * Minimum advertisement interval in units of 625us. Range: 0x20 to 0x4000. Default: 0x200
+ * (320ms) Explanation: 0x200 = 512 512 * 625us = 320000us = 320ms
+ *
+ * BlueGiga API type is uint16 - Java type is {@link int}
+ */
+ private int advIntervalMin;
+
+ /**
+ * Maximum advertisement interval in units of 625us. Range: 0x20 to 0x4000. Default: 0x200
+ * (320ms)
+ *
+ * BlueGiga API type is uint16 - Java type is {@link int}
+ */
+ private int advIntervalMax;
+
+ /**
+ * A bit mask to identify which of the three advertisement channels are used. Examples: 0x07:
+ * All three channels are used 0x03: Advertisement channels 37 and 38 are used. 0x04: Only
+ * advertisement channel 39 is used
+ *
+ * BlueGiga API type is uint8 - Java type is {@link int}
+ */
+ private int advChannels;
+
+ /**
+ * Minimum advertisement interval in units of 625us. Range: 0x20 to 0x4000. Default: 0x200
+ * (320ms) Explanation: 0x200 = 512 512 * 625us = 320000us = 320ms
+ *
+ * @param advIntervalMin the advIntervalMin to set as {@link int}
+ */
+ public void setAdvIntervalMin(int advIntervalMin) {
+ this.advIntervalMin = advIntervalMin;
+ }
+ /**
+ * Maximum advertisement interval in units of 625us. Range: 0x20 to 0x4000. Default: 0x200
+ * (320ms)
+ *
+ * @param advIntervalMax the advIntervalMax to set as {@link int}
+ */
+ public void setAdvIntervalMax(int advIntervalMax) {
+ this.advIntervalMax = advIntervalMax;
+ }
+ /**
+ * A bit mask to identify which of the three advertisement channels are used. Examples: 0x07:
+ * All three channels are used 0x03: Advertisement channels 37 and 38 are used. 0x04: Only
+ * advertisement channel 39 is used
+ *
+ * @param advChannels the advChannels to set as {@link int}
+ */
+ public void setAdvChannels(int advChannels) {
+ this.advChannels = advChannels;
+ }
+
+ @Override
+ public int[] serialize() {
+ // Serialize the header
+ serializeHeader(COMMAND_CLASS, COMMAND_METHOD);
+
+ // Serialize the fields
+ serializeUInt16(advIntervalMin);
+ serializeUInt16(advIntervalMax);
+ serializeUInt8(advChannels);
+
+ return getPayload();
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder builder = new StringBuilder();
+ builder.append("BlueGigaSetAdvParametersCommand [advIntervalMin=");
+ builder.append(advIntervalMin);
+ builder.append(", advIntervalMax=");
+ builder.append(advIntervalMax);
+ builder.append(", advChannels=");
+ builder.append(advChannels);
+ builder.append(']');
+ return builder.toString();
+ }
+}
diff --git a/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/gap/BlueGigaSetAdvParametersResponse.java b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/gap/BlueGigaSetAdvParametersResponse.java
new file mode 100644
index 00000000000..e02a3f5752a
--- /dev/null
+++ b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/gap/BlueGigaSetAdvParametersResponse.java
@@ -0,0 +1,75 @@
+/**
+ * Copyright (c) 2014,2017 Contributors to the Eclipse Foundation
+ *
+ * See the NOTICE file(s) distributed with this work for additional
+ * information regarding copyright ownership.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ */
+package org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.command.gap;
+
+import org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.BlueGigaResponse;
+import org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.enumeration.BgApiResponse;
+
+/**
+ * Class to implement the BlueGiga command setAdvParameters.
+ *
+ * This command is used to set the advertising parameters. Example: If the minimum
+ * advertisement interval is 40ms and the maximum advertisement interval is 100ms then the
+ * real advertisement interval will be mostly the middle value (70ms) plus a randomly added
+ * 20ms delay, which needs to be added according to the Bluetooth specification.
+ *
+ * This class provides methods for processing BlueGiga API commands.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ *
+ * @author Chris Jackson - Initial contribution of Java code generator
+ */
+public class BlueGigaSetAdvParametersResponse extends BlueGigaResponse {
+ public static int COMMAND_CLASS = 0x06;
+ public static int COMMAND_METHOD = 0x08;
+
+ /**
+ * 0: Command was successfully executed. Non-zero: An error occurred
+ *
+ * BlueGiga API type is BgApiResponse - Java type is {@link BgApiResponse}
+ */
+ private BgApiResponse result;
+
+ /**
+ * Response constructor
+ */
+ public BlueGigaSetAdvParametersResponse(int[] inputBuffer) {
+ // Super creates deserializer and reads header fields
+ super(inputBuffer);
+
+ event = (inputBuffer[0] & 0x80) != 0;
+
+ // Deserialize the fields
+ result = deserializeBgApiResponse();
+ }
+
+ /**
+ * 0: Command was successfully executed. Non-zero: An error occurred
+ *
+ * BlueGiga API type is BgApiResponse - Java type is {@link BgApiResponse}
+ *
+ * @return the current result as {@link BgApiResponse}
+ */
+ public BgApiResponse getResult() {
+ return result;
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder builder = new StringBuilder();
+ builder.append("BlueGigaSetAdvParametersResponse [result=");
+ builder.append(result);
+ builder.append(']');
+ return builder.toString();
+ }
+}
diff --git a/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/gap/BlueGigaSetModeCommand.java b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/gap/BlueGigaSetModeCommand.java
new file mode 100644
index 00000000000..accc3c3cf16
--- /dev/null
+++ b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/gap/BlueGigaSetModeCommand.java
@@ -0,0 +1,89 @@
+/**
+ * Copyright (c) 2014,2017 Contributors to the Eclipse Foundation
+ *
+ * See the NOTICE file(s) distributed with this work for additional
+ * information regarding copyright ownership.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ */
+package org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.command.gap;
+
+import org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.BlueGigaCommand;
+import org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.enumeration.GapConnectableMode;
+import org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.enumeration.GapDiscoverableMode;
+
+/**
+ * Class to implement the BlueGiga command setMode.
+ *
+ * This command configures the current GAP discoverability and connectability modes. It can
+ * be used to enable advertisements and/or allow connection. The command is also meant to fully
+ * stop advertising, when using gap_non_discoverable and gap_non_connectable.
+ *
+ * This class provides methods for processing BlueGiga API commands.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ *
+ * @author Chris Jackson - Initial contribution of Java code generator
+ */
+public class BlueGigaSetModeCommand extends BlueGigaCommand {
+ public static int COMMAND_CLASS = 0x06;
+ public static int COMMAND_METHOD = 0x01;
+
+ /**
+ * see:GAP Discoverable Mode
+ *
+ * BlueGiga API type is GapDiscoverableMode - Java type is {@link GapDiscoverableMode}
+ */
+ private GapDiscoverableMode discover;
+
+ /**
+ * see:GAP Connectable Mode
+ *
+ * BlueGiga API type is GapConnectableMode - Java type is {@link GapConnectableMode}
+ */
+ private GapConnectableMode connect;
+
+ /**
+ * see:GAP Discoverable Mode
+ *
+ * @param discover the discover to set as {@link GapDiscoverableMode}
+ */
+ public void setDiscover(GapDiscoverableMode discover) {
+ this.discover = discover;
+ }
+ /**
+ * see:GAP Connectable Mode
+ *
+ * @param connect the connect to set as {@link GapConnectableMode}
+ */
+ public void setConnect(GapConnectableMode connect) {
+ this.connect = connect;
+ }
+
+ @Override
+ public int[] serialize() {
+ // Serialize the header
+ serializeHeader(COMMAND_CLASS, COMMAND_METHOD);
+
+ // Serialize the fields
+ serializeGapDiscoverableMode(discover);
+ serializeGapConnectableMode(connect);
+
+ return getPayload();
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder builder = new StringBuilder();
+ builder.append("BlueGigaSetModeCommand [discover=");
+ builder.append(discover);
+ builder.append(", connect=");
+ builder.append(connect);
+ builder.append(']');
+ return builder.toString();
+ }
+}
diff --git a/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/gap/BlueGigaSetModeResponse.java b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/gap/BlueGigaSetModeResponse.java
new file mode 100644
index 00000000000..82a27c32331
--- /dev/null
+++ b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/gap/BlueGigaSetModeResponse.java
@@ -0,0 +1,74 @@
+/**
+ * Copyright (c) 2014,2017 Contributors to the Eclipse Foundation
+ *
+ * See the NOTICE file(s) distributed with this work for additional
+ * information regarding copyright ownership.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ */
+package org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.command.gap;
+
+import org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.BlueGigaResponse;
+import org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.enumeration.BgApiResponse;
+
+/**
+ * Class to implement the BlueGiga command setMode.
+ *
+ * This command configures the current GAP discoverability and connectability modes. It can
+ * be used to enable advertisements and/or allow connection. The command is also meant to fully
+ * stop advertising, when using gap_non_discoverable and gap_non_connectable.
+ *
+ * This class provides methods for processing BlueGiga API commands.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ *
+ * @author Chris Jackson - Initial contribution of Java code generator
+ */
+public class BlueGigaSetModeResponse extends BlueGigaResponse {
+ public static int COMMAND_CLASS = 0x06;
+ public static int COMMAND_METHOD = 0x01;
+
+ /**
+ * 0: the command was successful. Non-zero: An error occurred
+ *
+ * BlueGiga API type is BgApiResponse - Java type is {@link BgApiResponse}
+ */
+ private BgApiResponse result;
+
+ /**
+ * Response constructor
+ */
+ public BlueGigaSetModeResponse(int[] inputBuffer) {
+ // Super creates deserializer and reads header fields
+ super(inputBuffer);
+
+ event = (inputBuffer[0] & 0x80) != 0;
+
+ // Deserialize the fields
+ result = deserializeBgApiResponse();
+ }
+
+ /**
+ * 0: the command was successful. Non-zero: An error occurred
+ *
+ * BlueGiga API type is BgApiResponse - Java type is {@link BgApiResponse}
+ *
+ * @return the current result as {@link BgApiResponse}
+ */
+ public BgApiResponse getResult() {
+ return result;
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder builder = new StringBuilder();
+ builder.append("BlueGigaSetModeResponse [result=");
+ builder.append(result);
+ builder.append(']');
+ return builder.toString();
+ }
+}
diff --git a/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/gap/BlueGigaSetScanParametersCommand.java b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/gap/BlueGigaSetScanParametersCommand.java
new file mode 100644
index 00000000000..7c000e680e8
--- /dev/null
+++ b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/gap/BlueGigaSetScanParametersCommand.java
@@ -0,0 +1,125 @@
+/**
+ * Copyright (c) 2014,2017 Contributors to the Eclipse Foundation
+ *
+ * See the NOTICE file(s) distributed with this work for additional
+ * information regarding copyright ownership.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ */
+package org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.command.gap;
+
+import org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.BlueGigaCommand;
+
+/**
+ * Class to implement the BlueGiga command setScanParameters.
+ *
+ * This command sets the scan parameters which affect how other Smart devices are discovered.
+ *
+ * This class provides methods for processing BlueGiga API commands.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ *
+ * @author Chris Jackson - Initial contribution of Java code generator
+ */
+public class BlueGigaSetScanParametersCommand extends BlueGigaCommand {
+ public static int COMMAND_CLASS = 0x06;
+ public static int COMMAND_METHOD = 0x07;
+
+ /**
+ * Scan interval defines the interval when scanning is re-started in units of 625us. Range: 0x4
+ * - 0x4000. Default: (46,875ms) 0x4B After every scan interval the scanner will change the
+ * frequency it operates at at it will cycle through all the three advertisements channels in a
+ * round robin fashion. According to the specification all three channels must be Bluetooth
+ * used by a scanner.
+ *
+ * BlueGiga API type is uint16 - Java type is {@link int}
+ */
+ private int scanInterval;
+
+ /**
+ * Scan Window defines how long time the scanner will listen on a certain frequency and try to
+ * pick up advertisement packets. Scan window is defined as units of 625us. Range: 0x4 - 0x4000.
+ * Default: 0x32 (31,25 ms). Scan windows must be equal or smaller than scan interval If scan
+ * window is equal to the scan interval value, then the module Bluetooth will be scanning at a
+ * 100% duty cycle. If scan window is half of the scan interval value, then the module Bluetooth
+ * will be scanning at a 50% duty cycle.
+ *
+ * BlueGiga API type is uint16 - Java type is {@link int}
+ */
+ private int scanWindow;
+
+ /**
+ * 1: Active scanning is used. When an advertisement packet is received the Bluetooth stack
+ * will send a scan request packet to the advertiser to try and read the scan response data. 0:
+ * Passive scanning is used. No scan request is made.
+ *
+ * BlueGiga API type is boolean - Java type is {@link boolean}
+ */
+ private boolean activeScanning;
+
+ /**
+ * Scan interval defines the interval when scanning is re-started in units of 625us. Range: 0x4
+ * - 0x4000. Default: (46,875ms) 0x4B After every scan interval the scanner will change the
+ * frequency it operates at at it will cycle through all the three advertisements channels in a
+ * round robin fashion. According to the specification all three channels must be Bluetooth
+ * used by a scanner.
+ *
+ * @param scanInterval the scanInterval to set as {@link int}
+ */
+ public void setScanInterval(int scanInterval) {
+ this.scanInterval = scanInterval;
+ }
+ /**
+ * Scan Window defines how long time the scanner will listen on a certain frequency and try to
+ * pick up advertisement packets. Scan window is defined as units of 625us. Range: 0x4 - 0x4000.
+ * Default: 0x32 (31,25 ms). Scan windows must be equal or smaller than scan interval If scan
+ * window is equal to the scan interval value, then the module Bluetooth will be scanning at a
+ * 100% duty cycle. If scan window is half of the scan interval value, then the module Bluetooth
+ * will be scanning at a 50% duty cycle.
+ *
+ * @param scanWindow the scanWindow to set as {@link int}
+ */
+ public void setScanWindow(int scanWindow) {
+ this.scanWindow = scanWindow;
+ }
+ /**
+ * 1: Active scanning is used. When an advertisement packet is received the Bluetooth stack
+ * will send a scan request packet to the advertiser to try and read the scan response data. 0:
+ * Passive scanning is used. No scan request is made.
+ *
+ * @param activeScanning the activeScanning to set as {@link boolean}
+ */
+ public void setActiveScanning(boolean activeScanning) {
+ this.activeScanning = activeScanning;
+ }
+
+ @Override
+ public int[] serialize() {
+ // Serialize the header
+ serializeHeader(COMMAND_CLASS, COMMAND_METHOD);
+
+ // Serialize the fields
+ serializeUInt16(scanInterval);
+ serializeUInt16(scanWindow);
+ serializeBoolean(activeScanning);
+
+ return getPayload();
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder builder = new StringBuilder();
+ builder.append("BlueGigaSetScanParametersCommand [scanInterval=");
+ builder.append(scanInterval);
+ builder.append(", scanWindow=");
+ builder.append(scanWindow);
+ builder.append(", activeScanning=");
+ builder.append(activeScanning);
+ builder.append(']');
+ return builder.toString();
+ }
+}
diff --git a/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/gap/BlueGigaSetScanParametersResponse.java b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/gap/BlueGigaSetScanParametersResponse.java
new file mode 100644
index 00000000000..016350c3eb2
--- /dev/null
+++ b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/gap/BlueGigaSetScanParametersResponse.java
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2014,2017 Contributors to the Eclipse Foundation
+ *
+ * See the NOTICE file(s) distributed with this work for additional
+ * information regarding copyright ownership.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ */
+package org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.command.gap;
+
+import org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.BlueGigaResponse;
+import org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.enumeration.BgApiResponse;
+
+/**
+ * Class to implement the BlueGiga command setScanParameters.
+ *
+ * This command sets the scan parameters which affect how other Smart devices are discovered.
+ *
+ * This class provides methods for processing BlueGiga API commands.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ *
+ * @author Chris Jackson - Initial contribution of Java code generator
+ */
+public class BlueGigaSetScanParametersResponse extends BlueGigaResponse {
+ public static int COMMAND_CLASS = 0x06;
+ public static int COMMAND_METHOD = 0x07;
+
+ /**
+ * 0: The command was executed successfully. Non-zero: An error occurred
+ *
+ * BlueGiga API type is BgApiResponse - Java type is {@link BgApiResponse}
+ */
+ private BgApiResponse result;
+
+ /**
+ * Response constructor
+ */
+ public BlueGigaSetScanParametersResponse(int[] inputBuffer) {
+ // Super creates deserializer and reads header fields
+ super(inputBuffer);
+
+ event = (inputBuffer[0] & 0x80) != 0;
+
+ // Deserialize the fields
+ result = deserializeBgApiResponse();
+ }
+
+ /**
+ * 0: The command was executed successfully. Non-zero: An error occurred
+ *
+ * BlueGiga API type is BgApiResponse - Java type is {@link BgApiResponse}
+ *
+ * @return the current result as {@link BgApiResponse}
+ */
+ public BgApiResponse getResult() {
+ return result;
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder builder = new StringBuilder();
+ builder.append("BlueGigaSetScanParametersResponse [result=");
+ builder.append(result);
+ builder.append(']');
+ return builder.toString();
+ }
+}
diff --git a/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/security/BlueGigaBondStatusEvent.java b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/security/BlueGigaBondStatusEvent.java
new file mode 100644
index 00000000000..9ca01b967e0
--- /dev/null
+++ b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/security/BlueGigaBondStatusEvent.java
@@ -0,0 +1,131 @@
+/**
+ * Copyright (c) 2014,2017 Contributors to the Eclipse Foundation
+ *
+ * See the NOTICE file(s) distributed with this work for additional
+ * information regarding copyright ownership.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ */
+package org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.command.security;
+
+import org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.BlueGigaResponse;
+
+/**
+ * Class to implement the BlueGiga command bondStatusEvent.
+ *
+ * This event outputs bonding status information.
+ *
+ * This class provides methods for processing BlueGiga API commands.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ *
+ * @author Chris Jackson - Initial contribution of Java code generator
+ */
+public class BlueGigaBondStatusEvent extends BlueGigaResponse {
+ public static int COMMAND_CLASS = 0x05;
+ public static int COMMAND_METHOD = 0x04;
+
+ /**
+ * Bonding handle
+ *
+ * BlueGiga API type is uint8 - Java type is {@link int}
+ */
+ private int bond;
+
+ /**
+ * Encryption key size used in long-term key
+ *
+ * BlueGiga API type is uint8 - Java type is {@link int}
+ */
+ private int keysize;
+
+ /**
+ * Was Man-in-the-Middle mode was used in pairing. 0: No MITM used. 1: MITM was used
+ *
+ * BlueGiga API type is uint8 - Java type is {@link int}
+ */
+ private int mitm;
+
+ /**
+ * Keys stored for bonding. See: Bonding Keys
+ *
+ * BlueGiga API type is uint8 - Java type is {@link int}
+ */
+ private int keys;
+
+ /**
+ * Event constructor
+ */
+ public BlueGigaBondStatusEvent(int[] inputBuffer) {
+ // Super creates deserializer and reads header fields
+ super(inputBuffer);
+
+ event = (inputBuffer[0] & 0x80) != 0;
+
+ // Deserialize the fields
+ bond = deserializeUInt8();
+ keysize = deserializeUInt8();
+ mitm = deserializeUInt8();
+ keys = deserializeUInt8();
+ }
+
+ /**
+ * Bonding handle
+ *
+ * BlueGiga API type is uint8 - Java type is {@link int}
+ *
+ * @return the current bond as {@link int}
+ */
+ public int getBond() {
+ return bond;
+ }
+ /**
+ * Encryption key size used in long-term key
+ *
+ * BlueGiga API type is uint8 - Java type is {@link int}
+ *
+ * @return the current keysize as {@link int}
+ */
+ public int getKeysize() {
+ return keysize;
+ }
+ /**
+ * Was Man-in-the-Middle mode was used in pairing. 0: No MITM used. 1: MITM was used
+ *
+ * BlueGiga API type is uint8 - Java type is {@link int}
+ *
+ * @return the current mitm as {@link int}
+ */
+ public int getMitm() {
+ return mitm;
+ }
+ /**
+ * Keys stored for bonding. See: Bonding Keys
+ *
+ * BlueGiga API type is uint8 - Java type is {@link int}
+ *
+ * @return the current keys as {@link int}
+ */
+ public int getKeys() {
+ return keys;
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder builder = new StringBuilder();
+ builder.append("BlueGigaBondStatusEvent [bond=");
+ builder.append(bond);
+ builder.append(", keysize=");
+ builder.append(keysize);
+ builder.append(", mitm=");
+ builder.append(mitm);
+ builder.append(", keys=");
+ builder.append(keys);
+ builder.append(']');
+ return builder.toString();
+ }
+}
diff --git a/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/security/BlueGigaBondingFailEvent.java b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/security/BlueGigaBondingFailEvent.java
new file mode 100644
index 00000000000..e511edea45d
--- /dev/null
+++ b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/security/BlueGigaBondingFailEvent.java
@@ -0,0 +1,94 @@
+/**
+ * Copyright (c) 2014,2017 Contributors to the Eclipse Foundation
+ *
+ * See the NOTICE file(s) distributed with this work for additional
+ * information regarding copyright ownership.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ */
+package org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.command.security;
+
+import org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.BlueGigaResponse;
+import org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.enumeration.BgApiResponse;
+
+/**
+ * Class to implement the BlueGiga command bondingFailEvent.
+ *
+ * This event indicates the bonding has failed for a connection.
+ *
+ * This class provides methods for processing BlueGiga API commands.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ *
+ * @author Chris Jackson - Initial contribution of Java code generator
+ */
+public class BlueGigaBondingFailEvent extends BlueGigaResponse {
+ public static int COMMAND_CLASS = 0x05;
+ public static int COMMAND_METHOD = 0x01;
+
+ /**
+ * Connection handle
+ *
+ * BlueGiga API type is uint8 - Java type is {@link int}
+ */
+ private int handle;
+
+ /**
+ * Encryption status, describes error that occurred during bonding. See: Security Manager
+ * Protocol Errors
+ *
+ * BlueGiga API type is BgApiResponse - Java type is {@link BgApiResponse}
+ */
+ private BgApiResponse result;
+
+ /**
+ * Event constructor
+ */
+ public BlueGigaBondingFailEvent(int[] inputBuffer) {
+ // Super creates deserializer and reads header fields
+ super(inputBuffer);
+
+ event = (inputBuffer[0] & 0x80) != 0;
+
+ // Deserialize the fields
+ handle = deserializeUInt8();
+ result = deserializeBgApiResponse();
+ }
+
+ /**
+ * Connection handle
+ *
+ * BlueGiga API type is uint8 - Java type is {@link int}
+ *
+ * @return the current handle as {@link int}
+ */
+ public int getHandle() {
+ return handle;
+ }
+ /**
+ * Encryption status, describes error that occurred during bonding. See: Security Manager
+ * Protocol Errors
+ *
+ * BlueGiga API type is BgApiResponse - Java type is {@link BgApiResponse}
+ *
+ * @return the current result as {@link BgApiResponse}
+ */
+ public BgApiResponse getResult() {
+ return result;
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder builder = new StringBuilder();
+ builder.append("BlueGigaBondingFailEvent [handle=");
+ builder.append(handle);
+ builder.append(", result=");
+ builder.append(result);
+ builder.append(']');
+ return builder.toString();
+ }
+}
diff --git a/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/security/BlueGigaDeleteBondingCommand.java b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/security/BlueGigaDeleteBondingCommand.java
new file mode 100644
index 00000000000..2691ec9bb63
--- /dev/null
+++ b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/security/BlueGigaDeleteBondingCommand.java
@@ -0,0 +1,71 @@
+/**
+ * Copyright (c) 2014,2017 Contributors to the Eclipse Foundation
+ *
+ * See the NOTICE file(s) distributed with this work for additional
+ * information regarding copyright ownership.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ */
+package org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.command.security;
+
+import org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.BlueGigaCommand;
+
+/**
+ * Class to implement the BlueGiga command deleteBonding.
+ *
+ * This command deletes a bonding from the local security database. There can be a maximum of 8
+ * bonded devices stored at the same time, and one of them must be deleted if you need bonding with
+ * a 9th device.
+ *
+ * This class provides methods for processing BlueGiga API commands.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ *
+ * @author Chris Jackson - Initial contribution of Java code generator
+ */
+public class BlueGigaDeleteBondingCommand extends BlueGigaCommand {
+ public static int COMMAND_CLASS = 0x05;
+ public static int COMMAND_METHOD = 0x02;
+
+ /**
+ * Bonding handle of a device. This handle can be obtained for example from events like: Scan
+ * Response Status - If handle is 0xFF, all bondings will be deleted
+ *
+ * BlueGiga API type is uint8 - Java type is {@link int}
+ */
+ private int handle;
+
+ /**
+ * Bonding handle of a device. This handle can be obtained for example from events like: Scan
+ * Response Status - If handle is 0xFF, all bondings will be deleted
+ *
+ * @param handle the handle to set as {@link int}
+ */
+ public void setHandle(int handle) {
+ this.handle = handle;
+ }
+
+ @Override
+ public int[] serialize() {
+ // Serialize the header
+ serializeHeader(COMMAND_CLASS, COMMAND_METHOD);
+
+ // Serialize the fields
+ serializeUInt8(handle);
+
+ return getPayload();
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder builder = new StringBuilder();
+ builder.append("BlueGigaDeleteBondingCommand [handle=");
+ builder.append(handle);
+ builder.append(']');
+ return builder.toString();
+ }
+}
diff --git a/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/security/BlueGigaDeleteBondingResponse.java b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/security/BlueGigaDeleteBondingResponse.java
new file mode 100644
index 00000000000..2c107f0d6ff
--- /dev/null
+++ b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/security/BlueGigaDeleteBondingResponse.java
@@ -0,0 +1,74 @@
+/**
+ * Copyright (c) 2014,2017 Contributors to the Eclipse Foundation
+ *
+ * See the NOTICE file(s) distributed with this work for additional
+ * information regarding copyright ownership.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ */
+package org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.command.security;
+
+import org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.BlueGigaResponse;
+import org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.enumeration.BgApiResponse;
+
+/**
+ * Class to implement the BlueGiga command deleteBonding.
+ *
+ * This command deletes a bonding from the local security database. There can be a maximum of 8
+ * bonded devices stored at the same time, and one of them must be deleted if you need bonding with
+ * a 9th device.
+ *
+ * This class provides methods for processing BlueGiga API commands.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ *
+ * @author Chris Jackson - Initial contribution of Java code generator
+ */
+public class BlueGigaDeleteBondingResponse extends BlueGigaResponse {
+ public static int COMMAND_CLASS = 0x05;
+ public static int COMMAND_METHOD = 0x02;
+
+ /**
+ * 0: the command was successful. Non-zero: An error occurred
+ *
+ * BlueGiga API type is BgApiResponse - Java type is {@link BgApiResponse}
+ */
+ private BgApiResponse result;
+
+ /**
+ * Response constructor
+ */
+ public BlueGigaDeleteBondingResponse(int[] inputBuffer) {
+ // Super creates deserializer and reads header fields
+ super(inputBuffer);
+
+ event = (inputBuffer[0] & 0x80) != 0;
+
+ // Deserialize the fields
+ result = deserializeBgApiResponse();
+ }
+
+ /**
+ * 0: the command was successful. Non-zero: An error occurred
+ *
+ * BlueGiga API type is BgApiResponse - Java type is {@link BgApiResponse}
+ *
+ * @return the current result as {@link BgApiResponse}
+ */
+ public BgApiResponse getResult() {
+ return result;
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder builder = new StringBuilder();
+ builder.append("BlueGigaDeleteBondingResponse [result=");
+ builder.append(result);
+ builder.append(']');
+ return builder.toString();
+ }
+}
diff --git a/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/security/BlueGigaEncryptStartCommand.java b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/security/BlueGigaEncryptStartCommand.java
new file mode 100644
index 00000000000..31aad7abd75
--- /dev/null
+++ b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/security/BlueGigaEncryptStartCommand.java
@@ -0,0 +1,89 @@
+/**
+ * Copyright (c) 2014,2017 Contributors to the Eclipse Foundation
+ *
+ * See the NOTICE file(s) distributed with this work for additional
+ * information regarding copyright ownership.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ */
+package org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.command.security;
+
+import org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.BlueGigaCommand;
+
+/**
+ * Class to implement the BlueGiga command encryptStart.
+ *
+ * This command starts the encryption for a given connection.
+ *
+ * This class provides methods for processing BlueGiga API commands.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ *
+ * @author Chris Jackson - Initial contribution of Java code generator
+ */
+public class BlueGigaEncryptStartCommand extends BlueGigaCommand {
+ public static int COMMAND_CLASS = 0x05;
+ public static int COMMAND_METHOD = 0x00;
+
+ /**
+ * Bonding handle of a device. This handle can be obtained for example from events like: Scan
+ * Response Status - If handle is 0xFF, all bondings will be deleted
+ *
+ * BlueGiga API type is uint8 - Java type is {@link int}
+ */
+ private int handle;
+
+ /**
+ * Create bonding if devices are not already bonded. 0: Do not create bonding. 1: Creating
+ * bonding
+ *
+ * BlueGiga API type is boolean - Java type is {@link boolean}
+ */
+ private boolean bonding;
+
+ /**
+ * Bonding handle of a device. This handle can be obtained for example from events like: Scan
+ * Response Status - If handle is 0xFF, all bondings will be deleted
+ *
+ * @param handle the handle to set as {@link int}
+ */
+ public void setHandle(int handle) {
+ this.handle = handle;
+ }
+ /**
+ * Create bonding if devices are not already bonded. 0: Do not create bonding. 1: Creating
+ * bonding
+ *
+ * @param bonding the bonding to set as {@link boolean}
+ */
+ public void setBonding(boolean bonding) {
+ this.bonding = bonding;
+ }
+
+ @Override
+ public int[] serialize() {
+ // Serialize the header
+ serializeHeader(COMMAND_CLASS, COMMAND_METHOD);
+
+ // Serialize the fields
+ serializeUInt8(handle);
+ serializeBoolean(bonding);
+
+ return getPayload();
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder builder = new StringBuilder();
+ builder.append("BlueGigaEncryptStartCommand [handle=");
+ builder.append(handle);
+ builder.append(", bonding=");
+ builder.append(bonding);
+ builder.append(']');
+ return builder.toString();
+ }
+}
diff --git a/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/security/BlueGigaEncryptStartResponse.java b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/security/BlueGigaEncryptStartResponse.java
new file mode 100644
index 00000000000..3eb391e0b97
--- /dev/null
+++ b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/security/BlueGigaEncryptStartResponse.java
@@ -0,0 +1,92 @@
+/**
+ * Copyright (c) 2014,2017 Contributors to the Eclipse Foundation
+ *
+ * See the NOTICE file(s) distributed with this work for additional
+ * information regarding copyright ownership.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ */
+package org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.command.security;
+
+import org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.BlueGigaResponse;
+import org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.enumeration.BgApiResponse;
+
+/**
+ * Class to implement the BlueGiga command encryptStart.
+ *
+ * This command starts the encryption for a given connection.
+ *
+ * This class provides methods for processing BlueGiga API commands.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ *
+ * @author Chris Jackson - Initial contribution of Java code generator
+ */
+public class BlueGigaEncryptStartResponse extends BlueGigaResponse {
+ public static int COMMAND_CLASS = 0x05;
+ public static int COMMAND_METHOD = 0x00;
+
+ /**
+ * Connection handle
+ *
+ * BlueGiga API type is uint8 - Java type is {@link int}
+ */
+ private int handle;
+
+ /**
+ * 0 : the encryption was started successfully
+ *
+ * BlueGiga API type is BgApiResponse - Java type is {@link BgApiResponse}
+ */
+ private BgApiResponse result;
+
+ /**
+ * Response constructor
+ */
+ public BlueGigaEncryptStartResponse(int[] inputBuffer) {
+ // Super creates deserializer and reads header fields
+ super(inputBuffer);
+
+ event = (inputBuffer[0] & 0x80) != 0;
+
+ // Deserialize the fields
+ handle = deserializeUInt8();
+ result = deserializeBgApiResponse();
+ }
+
+ /**
+ * Connection handle
+ *
+ * BlueGiga API type is uint8 - Java type is {@link int}
+ *
+ * @return the current handle as {@link int}
+ */
+ public int getHandle() {
+ return handle;
+ }
+ /**
+ * 0 : the encryption was started successfully
+ *
+ * BlueGiga API type is BgApiResponse - Java type is {@link BgApiResponse}
+ *
+ * @return the current result as {@link BgApiResponse}
+ */
+ public BgApiResponse getResult() {
+ return result;
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder builder = new StringBuilder();
+ builder.append("BlueGigaEncryptStartResponse [handle=");
+ builder.append(handle);
+ builder.append(", result=");
+ builder.append(result);
+ builder.append(']');
+ return builder.toString();
+ }
+}
diff --git a/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/security/BlueGigaGetBondsCommand.java b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/security/BlueGigaGetBondsCommand.java
new file mode 100644
index 00000000000..b1ed7d0efca
--- /dev/null
+++ b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/security/BlueGigaGetBondsCommand.java
@@ -0,0 +1,47 @@
+/**
+ * Copyright (c) 2014,2017 Contributors to the Eclipse Foundation
+ *
+ * See the NOTICE file(s) distributed with this work for additional
+ * information regarding copyright ownership.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ */
+package org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.command.security;
+
+import org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.BlueGigaCommand;
+
+/**
+ * Class to implement the BlueGiga command getBonds.
+ *
+ * This command lists all bonded devices. There can be a maximum of 8 bonded devices. The
+ * information related to the bonded devices is stored in the Flash memory, so it is persistent
+ * across resets and power-cycles.
+ *
+ * This class provides methods for processing BlueGiga API commands.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ *
+ * @author Chris Jackson - Initial contribution of Java code generator
+ */
+public class BlueGigaGetBondsCommand extends BlueGigaCommand {
+ public static int COMMAND_CLASS = 0x05;
+ public static int COMMAND_METHOD = 0x05;
+
+
+ @Override
+ public int[] serialize() {
+ // Serialize the header
+ serializeHeader(COMMAND_CLASS, COMMAND_METHOD);
+
+ return getPayload();
+ }
+
+ @Override
+ public String toString() {
+ return "BlueGigaGetBondsCommand []";
+ }
+}
diff --git a/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/security/BlueGigaGetBondsResponse.java b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/security/BlueGigaGetBondsResponse.java
new file mode 100644
index 00000000000..671446afa04
--- /dev/null
+++ b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/security/BlueGigaGetBondsResponse.java
@@ -0,0 +1,73 @@
+/**
+ * Copyright (c) 2014,2017 Contributors to the Eclipse Foundation
+ *
+ * See the NOTICE file(s) distributed with this work for additional
+ * information regarding copyright ownership.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ */
+package org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.command.security;
+
+import org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.BlueGigaResponse;
+
+/**
+ * Class to implement the BlueGiga command getBonds.
+ *
+ * This command lists all bonded devices. There can be a maximum of 8 bonded devices. The
+ * information related to the bonded devices is stored in the Flash memory, so it is persistent
+ * across resets and power-cycles.
+ *
+ * This class provides methods for processing BlueGiga API commands.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ *
+ * @author Chris Jackson - Initial contribution of Java code generator
+ */
+public class BlueGigaGetBondsResponse extends BlueGigaResponse {
+ public static int COMMAND_CLASS = 0x05;
+ public static int COMMAND_METHOD = 0x05;
+
+ /**
+ * Num of currently bonded devices
+ *
+ * BlueGiga API type is uint8 - Java type is {@link int}
+ */
+ private int bonds;
+
+ /**
+ * Response constructor
+ */
+ public BlueGigaGetBondsResponse(int[] inputBuffer) {
+ // Super creates deserializer and reads header fields
+ super(inputBuffer);
+
+ event = (inputBuffer[0] & 0x80) != 0;
+
+ // Deserialize the fields
+ bonds = deserializeUInt8();
+ }
+
+ /**
+ * Num of currently bonded devices
+ *
+ * BlueGiga API type is uint8 - Java type is {@link int}
+ *
+ * @return the current bonds as {@link int}
+ */
+ public int getBonds() {
+ return bonds;
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder builder = new StringBuilder();
+ builder.append("BlueGigaGetBondsResponse [bonds=");
+ builder.append(bonds);
+ builder.append(']');
+ return builder.toString();
+ }
+}
diff --git a/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/security/BlueGigaPassKeyCommand.java b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/security/BlueGigaPassKeyCommand.java
new file mode 100644
index 00000000000..38890ddda48
--- /dev/null
+++ b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/security/BlueGigaPassKeyCommand.java
@@ -0,0 +1,86 @@
+/**
+ * Copyright (c) 2014,2017 Contributors to the Eclipse Foundation
+ *
+ * See the NOTICE file(s) distributed with this work for additional
+ * information regarding copyright ownership.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ */
+package org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.command.security;
+
+import org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.BlueGigaCommand;
+
+/**
+ * Class to implement the BlueGiga command passKey.
+ *
+ * This command is used to enter a passkey required for Man-in-the-Middle pairing. It should be
+ * sent as a response to Passkey Request event.
+ *
+ * This class provides methods for processing BlueGiga API commands.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ *
+ * @author Chris Jackson - Initial contribution of Java code generator
+ */
+public class BlueGigaPassKeyCommand extends BlueGigaCommand {
+ public static int COMMAND_CLASS = 0x05;
+ public static int COMMAND_METHOD = 0x04;
+
+ /**
+ * Connection handle
+ *
+ * BlueGiga API type is uint8 - Java type is {@link int}
+ */
+ private int handle;
+
+ /**
+ * Passkey. Range: 000000-999999
+ *
+ * BlueGiga API type is uint32 - Java type is {@link long}
+ */
+ private long passkey;
+
+ /**
+ * Connection handle
+ *
+ * @param handle the handle to set as {@link int}
+ */
+ public void setHandle(int handle) {
+ this.handle = handle;
+ }
+ /**
+ * Passkey. Range: 000000-999999
+ *
+ * @param passkey the passkey to set as {@link long}
+ */
+ public void setPasskey(long passkey) {
+ this.passkey = passkey;
+ }
+
+ @Override
+ public int[] serialize() {
+ // Serialize the header
+ serializeHeader(COMMAND_CLASS, COMMAND_METHOD);
+
+ // Serialize the fields
+ serializeUInt8(handle);
+ serializeUInt32(passkey);
+
+ return getPayload();
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder builder = new StringBuilder();
+ builder.append("BlueGigaPassKeyCommand [handle=");
+ builder.append(handle);
+ builder.append(", passkey=");
+ builder.append(passkey);
+ builder.append(']');
+ return builder.toString();
+ }
+}
diff --git a/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/security/BlueGigaPassKeyResponse.java b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/security/BlueGigaPassKeyResponse.java
new file mode 100644
index 00000000000..9ff065eb0dd
--- /dev/null
+++ b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/security/BlueGigaPassKeyResponse.java
@@ -0,0 +1,73 @@
+/**
+ * Copyright (c) 2014,2017 Contributors to the Eclipse Foundation
+ *
+ * See the NOTICE file(s) distributed with this work for additional
+ * information regarding copyright ownership.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ */
+package org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.command.security;
+
+import org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.BlueGigaResponse;
+import org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.enumeration.BgApiResponse;
+
+/**
+ * Class to implement the BlueGiga command passKey.
+ *
+ * This command is used to enter a passkey required for Man-in-the-Middle pairing. It should be
+ * sent as a response to Passkey Request event.
+ *
+ * This class provides methods for processing BlueGiga API commands.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ *
+ * @author Chris Jackson - Initial contribution of Java code generator
+ */
+public class BlueGigaPassKeyResponse extends BlueGigaResponse {
+ public static int COMMAND_CLASS = 0x05;
+ public static int COMMAND_METHOD = 0x04;
+
+ /**
+ * Command Result
+ *
+ * BlueGiga API type is BgApiResponse - Java type is {@link BgApiResponse}
+ */
+ private BgApiResponse result;
+
+ /**
+ * Response constructor
+ */
+ public BlueGigaPassKeyResponse(int[] inputBuffer) {
+ // Super creates deserializer and reads header fields
+ super(inputBuffer);
+
+ event = (inputBuffer[0] & 0x80) != 0;
+
+ // Deserialize the fields
+ result = deserializeBgApiResponse();
+ }
+
+ /**
+ * Command Result
+ *
+ * BlueGiga API type is BgApiResponse - Java type is {@link BgApiResponse}
+ *
+ * @return the current result as {@link BgApiResponse}
+ */
+ public BgApiResponse getResult() {
+ return result;
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder builder = new StringBuilder();
+ builder.append("BlueGigaPassKeyResponse [result=");
+ builder.append(result);
+ builder.append(']');
+ return builder.toString();
+ }
+}
diff --git a/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/security/BlueGigaPasskeyDisplayEvent.java b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/security/BlueGigaPasskeyDisplayEvent.java
new file mode 100644
index 00000000000..83d6adfdcda
--- /dev/null
+++ b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/security/BlueGigaPasskeyDisplayEvent.java
@@ -0,0 +1,92 @@
+/**
+ * Copyright (c) 2014,2017 Contributors to the Eclipse Foundation
+ *
+ * See the NOTICE file(s) distributed with this work for additional
+ * information regarding copyright ownership.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ */
+package org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.command.security;
+
+import org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.BlueGigaResponse;
+
+/**
+ * Class to implement the BlueGiga command passkeyDisplayEvent.
+ *
+ * This event tells a passkey should be printed to the user for bonding. This passkey must be
+ * entered in the remote device for bonding to be successful.
+ *
+ * This class provides methods for processing BlueGiga API commands.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ *
+ * @author Chris Jackson - Initial contribution of Java code generator
+ */
+public class BlueGigaPasskeyDisplayEvent extends BlueGigaResponse {
+ public static int COMMAND_CLASS = 0x05;
+ public static int COMMAND_METHOD = 0x02;
+
+ /**
+ * Bluetooth connection handle
+ *
+ * BlueGiga API type is uint8 - Java type is {@link int}
+ */
+ private int handle;
+
+ /**
+ * Passkey range: 000000-999999
+ *
+ * BlueGiga API type is uint32 - Java type is {@link long}
+ */
+ private long passkey;
+
+ /**
+ * Event constructor
+ */
+ public BlueGigaPasskeyDisplayEvent(int[] inputBuffer) {
+ // Super creates deserializer and reads header fields
+ super(inputBuffer);
+
+ event = (inputBuffer[0] & 0x80) != 0;
+
+ // Deserialize the fields
+ handle = deserializeUInt8();
+ passkey = deserializeUInt32();
+ }
+
+ /**
+ * Bluetooth connection handle
+ *
+ * BlueGiga API type is uint8 - Java type is {@link int}
+ *
+ * @return the current handle as {@link int}
+ */
+ public int getHandle() {
+ return handle;
+ }
+ /**
+ * Passkey range: 000000-999999
+ *
+ * BlueGiga API type is uint32 - Java type is {@link long}
+ *
+ * @return the current passkey as {@link long}
+ */
+ public long getPasskey() {
+ return passkey;
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder builder = new StringBuilder();
+ builder.append("BlueGigaPasskeyDisplayEvent [handle=");
+ builder.append(handle);
+ builder.append(", passkey=");
+ builder.append(passkey);
+ builder.append(']');
+ return builder.toString();
+ }
+}
diff --git a/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/security/BlueGigaPasskeyRequestEvent.java b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/security/BlueGigaPasskeyRequestEvent.java
new file mode 100644
index 00000000000..738c239c69c
--- /dev/null
+++ b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/security/BlueGigaPasskeyRequestEvent.java
@@ -0,0 +1,73 @@
+/**
+ * Copyright (c) 2014,2017 Contributors to the Eclipse Foundation
+ *
+ * See the NOTICE file(s) distributed with this work for additional
+ * information regarding copyright ownership.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ */
+package org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.command.security;
+
+import org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.BlueGigaResponse;
+
+/**
+ * Class to implement the BlueGiga command passkeyRequestEvent.
+ *
+ * This event indicates the Security Manager requests the user to enter passkey. The passkey
+ * the user needs to enter is displayed by the remote device. Use Passkey Entry command to
+ * respond to request
+ *
+ * This class provides methods for processing BlueGiga API commands.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ *
+ * @author Chris Jackson - Initial contribution of Java code generator
+ */
+public class BlueGigaPasskeyRequestEvent extends BlueGigaResponse {
+ public static int COMMAND_CLASS = 0x05;
+ public static int COMMAND_METHOD = 0x03;
+
+ /**
+ * Bluetooth connection handle
+ *
+ * BlueGiga API type is uint8 - Java type is {@link int}
+ */
+ private int handle;
+
+ /**
+ * Event constructor
+ */
+ public BlueGigaPasskeyRequestEvent(int[] inputBuffer) {
+ // Super creates deserializer and reads header fields
+ super(inputBuffer);
+
+ event = (inputBuffer[0] & 0x80) != 0;
+
+ // Deserialize the fields
+ handle = deserializeUInt8();
+ }
+
+ /**
+ * Bluetooth connection handle
+ *
+ * BlueGiga API type is uint8 - Java type is {@link int}
+ *
+ * @return the current handle as {@link int}
+ */
+ public int getHandle() {
+ return handle;
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder builder = new StringBuilder();
+ builder.append("BlueGigaPasskeyRequestEvent [handle=");
+ builder.append(handle);
+ builder.append(']');
+ return builder.toString();
+ }
+}
diff --git a/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/security/BlueGigaSetBondableModeCommand.java b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/security/BlueGigaSetBondableModeCommand.java
new file mode 100644
index 00000000000..b5493946fbd
--- /dev/null
+++ b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/security/BlueGigaSetBondableModeCommand.java
@@ -0,0 +1,68 @@
+/**
+ * Copyright (c) 2014,2017 Contributors to the Eclipse Foundation
+ *
+ * See the NOTICE file(s) distributed with this work for additional
+ * information regarding copyright ownership.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ */
+package org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.command.security;
+
+import org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.BlueGigaCommand;
+
+/**
+ * Class to implement the BlueGiga command setBondableMode.
+ *
+ * This command is used to enter a passkey required for Man-in-the-Middle pairing. It should be
+ * sent as a response to Passkey Request event.
+ *
+ * This class provides methods for processing BlueGiga API commands.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ *
+ * @author Chris Jackson - Initial contribution of Java code generator
+ */
+public class BlueGigaSetBondableModeCommand extends BlueGigaCommand {
+ public static int COMMAND_CLASS = 0x05;
+ public static int COMMAND_METHOD = 0x01;
+
+ /**
+ * Enables or disables bonding mode. 0 : the device is not bondable. 1 : the device is bondable
+ *
+ * BlueGiga API type is boolean - Java type is {@link boolean}
+ */
+ private boolean bondable;
+
+ /**
+ * Enables or disables bonding mode. 0 : the device is not bondable. 1 : the device is bondable
+ *
+ * @param bondable the bondable to set as {@link boolean}
+ */
+ public void setBondable(boolean bondable) {
+ this.bondable = bondable;
+ }
+
+ @Override
+ public int[] serialize() {
+ // Serialize the header
+ serializeHeader(COMMAND_CLASS, COMMAND_METHOD);
+
+ // Serialize the fields
+ serializeBoolean(bondable);
+
+ return getPayload();
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder builder = new StringBuilder();
+ builder.append("BlueGigaSetBondableModeCommand [bondable=");
+ builder.append(bondable);
+ builder.append(']');
+ return builder.toString();
+ }
+}
diff --git a/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/security/BlueGigaSetBondableModeResponse.java b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/security/BlueGigaSetBondableModeResponse.java
new file mode 100644
index 00000000000..c69cf475875
--- /dev/null
+++ b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/security/BlueGigaSetBondableModeResponse.java
@@ -0,0 +1,50 @@
+/**
+ * Copyright (c) 2014,2017 Contributors to the Eclipse Foundation
+ *
+ * See the NOTICE file(s) distributed with this work for additional
+ * information regarding copyright ownership.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ */
+package org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.command.security;
+
+import org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.BlueGigaResponse;
+
+/**
+ * Class to implement the BlueGiga command setBondableMode.
+ *
+ * This command is used to enter a passkey required for Man-in-the-Middle pairing. It should be
+ * sent as a response to Passkey Request event.
+ *
+ * This class provides methods for processing BlueGiga API commands.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ *
+ * @author Chris Jackson - Initial contribution of Java code generator
+ */
+public class BlueGigaSetBondableModeResponse extends BlueGigaResponse {
+ public static int COMMAND_CLASS = 0x05;
+ public static int COMMAND_METHOD = 0x01;
+
+ /**
+ * Response constructor
+ */
+ public BlueGigaSetBondableModeResponse(int[] inputBuffer) {
+ // Super creates deserializer and reads header fields
+ super(inputBuffer);
+
+ event = (inputBuffer[0] & 0x80) != 0;
+
+ // Deserialize the fields
+ }
+
+
+ @Override
+ public String toString() {
+ return "BlueGigaSetBondableModeResponse []";
+ }
+}
diff --git a/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/security/BlueGigaSetParametersCommand.java b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/security/BlueGigaSetParametersCommand.java
new file mode 100644
index 00000000000..8cb40799a04
--- /dev/null
+++ b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/security/BlueGigaSetParametersCommand.java
@@ -0,0 +1,108 @@
+/**
+ * Copyright (c) 2014,2017 Contributors to the Eclipse Foundation
+ *
+ * See the NOTICE file(s) distributed with this work for additional
+ * information regarding copyright ownership.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ */
+package org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.command.security;
+
+import org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.BlueGigaCommand;
+import org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.enumeration.SmpIoCapabilities;
+
+/**
+ * Class to implement the BlueGiga command setParameters.
+ *
+ * This command is used to configure the local Security Manager and its features
+ *
+ * This class provides methods for processing BlueGiga API commands.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ *
+ * @author Chris Jackson - Initial contribution of Java code generator
+ */
+public class BlueGigaSetParametersCommand extends BlueGigaCommand {
+ public static int COMMAND_CLASS = 0x05;
+ public static int COMMAND_METHOD = 0x03;
+
+ /**
+ * 1: Man-in-the-middle protection required. 0: No Man-in-the-middle protection. Default:
+ * 0
+ *
+ * BlueGiga API type is boolean - Java type is {@link boolean}
+ */
+ private boolean requireMitm;
+
+ /**
+ * Minimum key size in Bytes. Range: 7-16. Default: 7 (56bits)
+ *
+ * BlueGiga API type is uint8 - Java type is {@link int}
+ */
+ private int minKeySize;
+
+ /**
+ * Configures the local devices I/O capabilities. See: SMP IO Capabilities for options.
+ * Default: No Input and No Output
+ *
+ * BlueGiga API type is SmpIoCapabilities - Java type is {@link SmpIoCapabilities}
+ */
+ private SmpIoCapabilities ioCapabilities;
+
+ /**
+ * 1: Man-in-the-middle protection required. 0: No Man-in-the-middle protection. Default:
+ * 0
+ *
+ * @param requireMitm the requireMitm to set as {@link boolean}
+ */
+ public void setRequireMitm(boolean requireMitm) {
+ this.requireMitm = requireMitm;
+ }
+ /**
+ * Minimum key size in Bytes. Range: 7-16. Default: 7 (56bits)
+ *
+ * @param minKeySize the minKeySize to set as {@link int}
+ */
+ public void setMinKeySize(int minKeySize) {
+ this.minKeySize = minKeySize;
+ }
+ /**
+ * Configures the local devices I/O capabilities. See: SMP IO Capabilities for options.
+ * Default: No Input and No Output
+ *
+ * @param ioCapabilities the ioCapabilities to set as {@link SmpIoCapabilities}
+ */
+ public void setIoCapabilities(SmpIoCapabilities ioCapabilities) {
+ this.ioCapabilities = ioCapabilities;
+ }
+
+ @Override
+ public int[] serialize() {
+ // Serialize the header
+ serializeHeader(COMMAND_CLASS, COMMAND_METHOD);
+
+ // Serialize the fields
+ serializeBoolean(requireMitm);
+ serializeUInt8(minKeySize);
+ serializeSmpIoCapabilities(ioCapabilities);
+
+ return getPayload();
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder builder = new StringBuilder();
+ builder.append("BlueGigaSetParametersCommand [requireMitm=");
+ builder.append(requireMitm);
+ builder.append(", minKeySize=");
+ builder.append(minKeySize);
+ builder.append(", ioCapabilities=");
+ builder.append(ioCapabilities);
+ builder.append(']');
+ return builder.toString();
+ }
+}
diff --git a/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/security/BlueGigaSetParametersResponse.java b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/security/BlueGigaSetParametersResponse.java
new file mode 100644
index 00000000000..758718ed943
--- /dev/null
+++ b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/security/BlueGigaSetParametersResponse.java
@@ -0,0 +1,49 @@
+/**
+ * Copyright (c) 2014,2017 Contributors to the Eclipse Foundation
+ *
+ * See the NOTICE file(s) distributed with this work for additional
+ * information regarding copyright ownership.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ */
+package org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.command.security;
+
+import org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.BlueGigaResponse;
+
+/**
+ * Class to implement the BlueGiga command setParameters.
+ *
+ * This command is used to configure the local Security Manager and its features
+ *
+ * This class provides methods for processing BlueGiga API commands.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ *
+ * @author Chris Jackson - Initial contribution of Java code generator
+ */
+public class BlueGigaSetParametersResponse extends BlueGigaResponse {
+ public static int COMMAND_CLASS = 0x05;
+ public static int COMMAND_METHOD = 0x03;
+
+ /**
+ * Response constructor
+ */
+ public BlueGigaSetParametersResponse(int[] inputBuffer) {
+ // Super creates deserializer and reads header fields
+ super(inputBuffer);
+
+ event = (inputBuffer[0] & 0x80) != 0;
+
+ // Deserialize the fields
+ }
+
+
+ @Override
+ public String toString() {
+ return "BlueGigaSetParametersResponse []";
+ }
+}
diff --git a/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/security/BlueGigaWhitelistBondsCommand.java b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/security/BlueGigaWhitelistBondsCommand.java
new file mode 100644
index 00000000000..777829b6d71
--- /dev/null
+++ b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/security/BlueGigaWhitelistBondsCommand.java
@@ -0,0 +1,47 @@
+/**
+ * Copyright (c) 2014,2017 Contributors to the Eclipse Foundation
+ *
+ * See the NOTICE file(s) distributed with this work for additional
+ * information regarding copyright ownership.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ */
+package org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.command.security;
+
+import org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.BlueGigaCommand;
+
+/**
+ * Class to implement the BlueGiga command whitelistBonds.
+ *
+ * This command will add all bonded devices with a known public or static address to the local
+ * devices white list. Previous entries in the white list will be first cleared. This command
+ * can't be used while advertising, scanning or being connected.
+ *
+ * This class provides methods for processing BlueGiga API commands.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ *
+ * @author Chris Jackson - Initial contribution of Java code generator
+ */
+public class BlueGigaWhitelistBondsCommand extends BlueGigaCommand {
+ public static int COMMAND_CLASS = 0x05;
+ public static int COMMAND_METHOD = 0x07;
+
+
+ @Override
+ public int[] serialize() {
+ // Serialize the header
+ serializeHeader(COMMAND_CLASS, COMMAND_METHOD);
+
+ return getPayload();
+ }
+
+ @Override
+ public String toString() {
+ return "BlueGigaWhitelistBondsCommand []";
+ }
+}
diff --git a/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/security/BlueGigaWhitelistBondsResponse.java b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/security/BlueGigaWhitelistBondsResponse.java
new file mode 100644
index 00000000000..463adf6cbd5
--- /dev/null
+++ b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/security/BlueGigaWhitelistBondsResponse.java
@@ -0,0 +1,94 @@
+/**
+ * Copyright (c) 2014,2017 Contributors to the Eclipse Foundation
+ *
+ * See the NOTICE file(s) distributed with this work for additional
+ * information regarding copyright ownership.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ */
+package org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.command.security;
+
+import org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.BlueGigaResponse;
+import org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.enumeration.BgApiResponse;
+
+/**
+ * Class to implement the BlueGiga command whitelistBonds.
+ *
+ * This command will add all bonded devices with a known public or static address to the local
+ * devices white list. Previous entries in the white list will be first cleared. This command
+ * can't be used while advertising, scanning or being connected.
+ *
+ * This class provides methods for processing BlueGiga API commands.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ *
+ * @author Chris Jackson - Initial contribution of Java code generator
+ */
+public class BlueGigaWhitelistBondsResponse extends BlueGigaResponse {
+ public static int COMMAND_CLASS = 0x05;
+ public static int COMMAND_METHOD = 0x07;
+
+ /**
+ * Command result
+ *
+ * BlueGiga API type is BgApiResponse - Java type is {@link BgApiResponse}
+ */
+ private BgApiResponse result;
+
+ /**
+ * Number of whitelisted bonds
+ *
+ * BlueGiga API type is uint8 - Java type is {@link int}
+ */
+ private int count;
+
+ /**
+ * Response constructor
+ */
+ public BlueGigaWhitelistBondsResponse(int[] inputBuffer) {
+ // Super creates deserializer and reads header fields
+ super(inputBuffer);
+
+ event = (inputBuffer[0] & 0x80) != 0;
+
+ // Deserialize the fields
+ result = deserializeBgApiResponse();
+ count = deserializeUInt8();
+ }
+
+ /**
+ * Command result
+ *
+ * BlueGiga API type is BgApiResponse - Java type is {@link BgApiResponse}
+ *
+ * @return the current result as {@link BgApiResponse}
+ */
+ public BgApiResponse getResult() {
+ return result;
+ }
+ /**
+ * Number of whitelisted bonds
+ *
+ * BlueGiga API type is uint8 - Java type is {@link int}
+ *
+ * @return the current count as {@link int}
+ */
+ public int getCount() {
+ return count;
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder builder = new StringBuilder();
+ builder.append("BlueGigaWhitelistBondsResponse [result=");
+ builder.append(result);
+ builder.append(", count=");
+ builder.append(count);
+ builder.append(']');
+ return builder.toString();
+ }
+}
diff --git a/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/system/BlueGigaAddressGetCommand.java b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/system/BlueGigaAddressGetCommand.java
new file mode 100644
index 00000000000..8035c75f402
--- /dev/null
+++ b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/system/BlueGigaAddressGetCommand.java
@@ -0,0 +1,45 @@
+/**
+ * Copyright (c) 2014,2017 Contributors to the Eclipse Foundation
+ *
+ * See the NOTICE file(s) distributed with this work for additional
+ * information regarding copyright ownership.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ */
+package org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.command.system;
+
+import org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.BlueGigaCommand;
+
+/**
+ * Class to implement the BlueGiga command addressGet.
+ *
+ * This command reads the local device's public Bluetooth address.
+ *
+ * This class provides methods for processing BlueGiga API commands.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ *
+ * @author Chris Jackson - Initial contribution of Java code generator
+ */
+public class BlueGigaAddressGetCommand extends BlueGigaCommand {
+ public static int COMMAND_CLASS = 0x00;
+ public static int COMMAND_METHOD = 0x02;
+
+
+ @Override
+ public int[] serialize() {
+ // Serialize the header
+ serializeHeader(COMMAND_CLASS, COMMAND_METHOD);
+
+ return getPayload();
+ }
+
+ @Override
+ public String toString() {
+ return "BlueGigaAddressGetCommand []";
+ }
+}
diff --git a/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/system/BlueGigaAddressGetResponse.java b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/system/BlueGigaAddressGetResponse.java
new file mode 100644
index 00000000000..250f93fb762
--- /dev/null
+++ b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/system/BlueGigaAddressGetResponse.java
@@ -0,0 +1,71 @@
+/**
+ * Copyright (c) 2014,2017 Contributors to the Eclipse Foundation
+ *
+ * See the NOTICE file(s) distributed with this work for additional
+ * information regarding copyright ownership.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ */
+package org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.command.system;
+
+import org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.BlueGigaResponse;
+
+/**
+ * Class to implement the BlueGiga command addressGet.
+ *
+ * This command reads the local device's public Bluetooth address.
+ *
+ * This class provides methods for processing BlueGiga API commands.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ *
+ * @author Chris Jackson - Initial contribution of Java code generator
+ */
+public class BlueGigaAddressGetResponse extends BlueGigaResponse {
+ public static int COMMAND_CLASS = 0x00;
+ public static int COMMAND_METHOD = 0x02;
+
+ /**
+ * Bluetooth address of the local device
+ *
+ * BlueGiga API type is bd_addr - Java type is {@link String}
+ */
+ private String address;
+
+ /**
+ * Response constructor
+ */
+ public BlueGigaAddressGetResponse(int[] inputBuffer) {
+ // Super creates deserializer and reads header fields
+ super(inputBuffer);
+
+ event = (inputBuffer[0] & 0x80) != 0;
+
+ // Deserialize the fields
+ address = deserializeAddress();
+ }
+
+ /**
+ * Bluetooth address of the local device
+ *
+ * BlueGiga API type is bd_addr - Java type is {@link String}
+ *
+ * @return the current address as {@link String}
+ */
+ public String getAddress() {
+ return address;
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder builder = new StringBuilder();
+ builder.append("BlueGigaAddressGetResponse [address=");
+ builder.append(address);
+ builder.append(']');
+ return builder.toString();
+ }
+}
diff --git a/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/system/BlueGigaBootEvent.java b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/system/BlueGigaBootEvent.java
new file mode 100644
index 00000000000..637ffcc6f38
--- /dev/null
+++ b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/system/BlueGigaBootEvent.java
@@ -0,0 +1,192 @@
+/**
+ * Copyright (c) 2014,2017 Contributors to the Eclipse Foundation
+ *
+ * See the NOTICE file(s) distributed with this work for additional
+ * information regarding copyright ownership.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ */
+package org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.command.system;
+
+import org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.BlueGigaResponse;
+
+/**
+ * Class to implement the BlueGiga command bootEvent.
+ *
+ * This event is produced when the device boots up and is ready to receive commands. This event is
+ * not sent over USB interface.
+ *
+ * This class provides methods for processing BlueGiga API commands.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ *
+ * @author Chris Jackson - Initial contribution of Java code generator
+ */
+public class BlueGigaBootEvent extends BlueGigaResponse {
+ public static int COMMAND_CLASS = 0x00;
+ public static int COMMAND_METHOD = 0x00;
+
+ /**
+ * Major software version
+ *
+ * BlueGiga API type is uint16 - Java type is {@link int}
+ */
+ private int major;
+
+ /**
+ * Minor software version
+ *
+ * BlueGiga API type is uint16 - Java type is {@link int}
+ */
+ private int minor;
+
+ /**
+ * Patch ID
+ *
+ * BlueGiga API type is uint16 - Java type is {@link int}
+ */
+ private int patch;
+
+ /**
+ * Build version
+ *
+ * BlueGiga API type is uint16 - Java type is {@link int}
+ */
+ private int build;
+
+ /**
+ * Link layer version
+ *
+ * BlueGiga API type is uint16 - Java type is {@link int}
+ */
+ private int llVersion;
+
+ /**
+ * Protocol version
+ *
+ * BlueGiga API type is uint16 - Java type is {@link int}
+ */
+ private int protocolVersion;
+
+ /**
+ * Hardware version
+ *
+ * BlueGiga API type is uint16 - Java type is {@link int}
+ */
+ private int hardware;
+
+ /**
+ * Event constructor
+ */
+ public BlueGigaBootEvent(int[] inputBuffer) {
+ // Super creates deserializer and reads header fields
+ super(inputBuffer);
+
+ event = (inputBuffer[0] & 0x80) != 0;
+
+ // Deserialize the fields
+ major = deserializeUInt16();
+ minor = deserializeUInt16();
+ patch = deserializeUInt16();
+ build = deserializeUInt16();
+ llVersion = deserializeUInt16();
+ protocolVersion = deserializeUInt16();
+ hardware = deserializeUInt16();
+ }
+
+ /**
+ * Major software version
+ *
+ * BlueGiga API type is uint16 - Java type is {@link int}
+ *
+ * @return the current major as {@link int}
+ */
+ public int getMajor() {
+ return major;
+ }
+ /**
+ * Minor software version
+ *
+ * BlueGiga API type is uint16 - Java type is {@link int}
+ *
+ * @return the current minor as {@link int}
+ */
+ public int getMinor() {
+ return minor;
+ }
+ /**
+ * Patch ID
+ *
+ * BlueGiga API type is uint16 - Java type is {@link int}
+ *
+ * @return the current patch as {@link int}
+ */
+ public int getPatch() {
+ return patch;
+ }
+ /**
+ * Build version
+ *
+ * BlueGiga API type is uint16 - Java type is {@link int}
+ *
+ * @return the current build as {@link int}
+ */
+ public int getBuild() {
+ return build;
+ }
+ /**
+ * Link layer version
+ *
+ * BlueGiga API type is uint16 - Java type is {@link int}
+ *
+ * @return the current ll_version as {@link int}
+ */
+ public int getLlVersion() {
+ return llVersion;
+ }
+ /**
+ * Protocol version
+ *
+ * BlueGiga API type is uint16 - Java type is {@link int}
+ *
+ * @return the current protocol_version as {@link int}
+ */
+ public int getProtocolVersion() {
+ return protocolVersion;
+ }
+ /**
+ * Hardware version
+ *
+ * BlueGiga API type is uint16 - Java type is {@link int}
+ *
+ * @return the current hardware as {@link int}
+ */
+ public int getHardware() {
+ return hardware;
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder builder = new StringBuilder();
+ builder.append("BlueGigaBootEvent [major=");
+ builder.append(major);
+ builder.append(", minor=");
+ builder.append(minor);
+ builder.append(", patch=");
+ builder.append(patch);
+ builder.append(", build=");
+ builder.append(build);
+ builder.append(", llVersion=");
+ builder.append(llVersion);
+ builder.append(", protocolVersion=");
+ builder.append(protocolVersion);
+ builder.append(", hardware=");
+ builder.append(hardware);
+ builder.append(']');
+ return builder.toString();
+ }
+}
diff --git a/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/system/BlueGigaEndpointWatermarkRxEvent.java b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/system/BlueGigaEndpointWatermarkRxEvent.java
new file mode 100644
index 00000000000..3a7b161eb8d
--- /dev/null
+++ b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/system/BlueGigaEndpointWatermarkRxEvent.java
@@ -0,0 +1,94 @@
+/**
+ * Copyright (c) 2014,2017 Contributors to the Eclipse Foundation
+ *
+ * See the NOTICE file(s) distributed with this work for additional
+ * information regarding copyright ownership.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ */
+package org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.command.system;
+
+import org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.BlueGigaResponse;
+
+/**
+ * Class to implement the BlueGiga command endpointWatermarkRxEvent.
+ *
+ * This event is generated if the receive (incoming) buffer of the endpoint has been filled with
+ * a number of bytes equal or higher than the value defined by the command Endpoint Set
+ * Watermarks. Data from the receive buffer can then be read (and consequently cleared) with
+ * the command Endpoint Rx
+ *
+ * This class provides methods for processing BlueGiga API commands.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ *
+ * @author Chris Jackson - Initial contribution of Java code generator
+ */
+public class BlueGigaEndpointWatermarkRxEvent extends BlueGigaResponse {
+ public static int COMMAND_CLASS = 0x00;
+ public static int COMMAND_METHOD = 0x02;
+
+ /**
+ * Endpoint index where data was received
+ *
+ * BlueGiga API type is uint8 - Java type is {@link int}
+ */
+ private int endpoint;
+
+ /**
+ * Space available
+ *
+ * BlueGiga API type is uint8 - Java type is {@link int}
+ */
+ private int data;
+
+ /**
+ * Event constructor
+ */
+ public BlueGigaEndpointWatermarkRxEvent(int[] inputBuffer) {
+ // Super creates deserializer and reads header fields
+ super(inputBuffer);
+
+ event = (inputBuffer[0] & 0x80) != 0;
+
+ // Deserialize the fields
+ endpoint = deserializeUInt8();
+ data = deserializeUInt8();
+ }
+
+ /**
+ * Endpoint index where data was received
+ *
+ * BlueGiga API type is uint8 - Java type is {@link int}
+ *
+ * @return the current endpoint as {@link int}
+ */
+ public int getEndpoint() {
+ return endpoint;
+ }
+ /**
+ * Space available
+ *
+ * BlueGiga API type is uint8 - Java type is {@link int}
+ *
+ * @return the current data as {@link int}
+ */
+ public int getData() {
+ return data;
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder builder = new StringBuilder();
+ builder.append("BlueGigaEndpointWatermarkRxEvent [endpoint=");
+ builder.append(endpoint);
+ builder.append(", data=");
+ builder.append(data);
+ builder.append(']');
+ return builder.toString();
+ }
+}
diff --git a/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/system/BlueGigaEndpointWatermarkTxEvent.java b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/system/BlueGigaEndpointWatermarkTxEvent.java
new file mode 100644
index 00000000000..3320d0dd064
--- /dev/null
+++ b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/system/BlueGigaEndpointWatermarkTxEvent.java
@@ -0,0 +1,94 @@
+/**
+ * Copyright (c) 2014,2017 Contributors to the Eclipse Foundation
+ *
+ * See the NOTICE file(s) distributed with this work for additional
+ * information regarding copyright ownership.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ */
+package org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.command.system;
+
+import org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.BlueGigaResponse;
+
+/**
+ * Class to implement the BlueGiga command endpointWatermarkTxEvent.
+ *
+ * This event is generated when the transmit (outgoing) buffer of the endpoint has free space
+ * for a number of bytes equal or higher than the value defined by the command Endpoint Set
+ * Watermarks. When there is enough free space, data can be sent out of the endpoint by the
+ * command Endpoint Tx.
+ *
+ * This class provides methods for processing BlueGiga API commands.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ *
+ * @author Chris Jackson - Initial contribution of Java code generator
+ */
+public class BlueGigaEndpointWatermarkTxEvent extends BlueGigaResponse {
+ public static int COMMAND_CLASS = 0x00;
+ public static int COMMAND_METHOD = 0x03;
+
+ /**
+ * Endpoint index where data was sent
+ *
+ * BlueGiga API type is uint8 - Java type is {@link int}
+ */
+ private int endpoint;
+
+ /**
+ * Space available
+ *
+ * BlueGiga API type is uint8 - Java type is {@link int}
+ */
+ private int data;
+
+ /**
+ * Event constructor
+ */
+ public BlueGigaEndpointWatermarkTxEvent(int[] inputBuffer) {
+ // Super creates deserializer and reads header fields
+ super(inputBuffer);
+
+ event = (inputBuffer[0] & 0x80) != 0;
+
+ // Deserialize the fields
+ endpoint = deserializeUInt8();
+ data = deserializeUInt8();
+ }
+
+ /**
+ * Endpoint index where data was sent
+ *
+ * BlueGiga API type is uint8 - Java type is {@link int}
+ *
+ * @return the current endpoint as {@link int}
+ */
+ public int getEndpoint() {
+ return endpoint;
+ }
+ /**
+ * Space available
+ *
+ * BlueGiga API type is uint8 - Java type is {@link int}
+ *
+ * @return the current data as {@link int}
+ */
+ public int getData() {
+ return data;
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder builder = new StringBuilder();
+ builder.append("BlueGigaEndpointWatermarkTxEvent [endpoint=");
+ builder.append(endpoint);
+ builder.append(", data=");
+ builder.append(data);
+ builder.append(']');
+ return builder.toString();
+ }
+}
diff --git a/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/system/BlueGigaGetConnectionsCommand.java b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/system/BlueGigaGetConnectionsCommand.java
new file mode 100644
index 00000000000..e5f3c86c446
--- /dev/null
+++ b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/system/BlueGigaGetConnectionsCommand.java
@@ -0,0 +1,45 @@
+/**
+ * Copyright (c) 2014,2017 Contributors to the Eclipse Foundation
+ *
+ * See the NOTICE file(s) distributed with this work for additional
+ * information regarding copyright ownership.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ */
+package org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.command.system;
+
+import org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.BlueGigaCommand;
+
+/**
+ * Class to implement the BlueGiga command getConnections.
+ *
+ * This command reads the number of supported connections from the local device.
+ *
+ * This class provides methods for processing BlueGiga API commands.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ *
+ * @author Chris Jackson - Initial contribution of Java code generator
+ */
+public class BlueGigaGetConnectionsCommand extends BlueGigaCommand {
+ public static int COMMAND_CLASS = 0x00;
+ public static int COMMAND_METHOD = 0x06;
+
+
+ @Override
+ public int[] serialize() {
+ // Serialize the header
+ serializeHeader(COMMAND_CLASS, COMMAND_METHOD);
+
+ return getPayload();
+ }
+
+ @Override
+ public String toString() {
+ return "BlueGigaGetConnectionsCommand []";
+ }
+}
diff --git a/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/system/BlueGigaGetConnectionsResponse.java b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/system/BlueGigaGetConnectionsResponse.java
new file mode 100644
index 00000000000..931e2d79ab2
--- /dev/null
+++ b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/system/BlueGigaGetConnectionsResponse.java
@@ -0,0 +1,71 @@
+/**
+ * Copyright (c) 2014,2017 Contributors to the Eclipse Foundation
+ *
+ * See the NOTICE file(s) distributed with this work for additional
+ * information regarding copyright ownership.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ */
+package org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.command.system;
+
+import org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.BlueGigaResponse;
+
+/**
+ * Class to implement the BlueGiga command getConnections.
+ *
+ * This command reads the number of supported connections from the local device.
+ *
+ * This class provides methods for processing BlueGiga API commands.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ *
+ * @author Chris Jackson - Initial contribution of Java code generator
+ */
+public class BlueGigaGetConnectionsResponse extends BlueGigaResponse {
+ public static int COMMAND_CLASS = 0x00;
+ public static int COMMAND_METHOD = 0x06;
+
+ /**
+ * Max supported connections
+ *
+ * BlueGiga API type is uint8 - Java type is {@link int}
+ */
+ private int maxconn;
+
+ /**
+ * Response constructor
+ */
+ public BlueGigaGetConnectionsResponse(int[] inputBuffer) {
+ // Super creates deserializer and reads header fields
+ super(inputBuffer);
+
+ event = (inputBuffer[0] & 0x80) != 0;
+
+ // Deserialize the fields
+ maxconn = deserializeUInt8();
+ }
+
+ /**
+ * Max supported connections
+ *
+ * BlueGiga API type is uint8 - Java type is {@link int}
+ *
+ * @return the current maxconn as {@link int}
+ */
+ public int getMaxconn() {
+ return maxconn;
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder builder = new StringBuilder();
+ builder.append("BlueGigaGetConnectionsResponse [maxconn=");
+ builder.append(maxconn);
+ builder.append(']');
+ return builder.toString();
+ }
+}
diff --git a/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/system/BlueGigaGetCountersCommand.java b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/system/BlueGigaGetCountersCommand.java
new file mode 100644
index 00000000000..43e3c12ed48
--- /dev/null
+++ b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/system/BlueGigaGetCountersCommand.java
@@ -0,0 +1,45 @@
+/**
+ * Copyright (c) 2014,2017 Contributors to the Eclipse Foundation
+ *
+ * See the NOTICE file(s) distributed with this work for additional
+ * information regarding copyright ownership.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ */
+package org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.command.system;
+
+import org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.BlueGigaCommand;
+
+/**
+ * Class to implement the BlueGiga command getCounters.
+ *
+ * Read packet counters and resets them, also returns available packet buffers.
+ *
+ * This class provides methods for processing BlueGiga API commands.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ *
+ * @author Chris Jackson - Initial contribution of Java code generator
+ */
+public class BlueGigaGetCountersCommand extends BlueGigaCommand {
+ public static int COMMAND_CLASS = 0x00;
+ public static int COMMAND_METHOD = 0x05;
+
+
+ @Override
+ public int[] serialize() {
+ // Serialize the header
+ serializeHeader(COMMAND_CLASS, COMMAND_METHOD);
+
+ return getPayload();
+ }
+
+ @Override
+ public String toString() {
+ return "BlueGigaGetCountersCommand []";
+ }
+}
diff --git a/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/system/BlueGigaGetCountersResponse.java b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/system/BlueGigaGetCountersResponse.java
new file mode 100644
index 00000000000..627f24c47b0
--- /dev/null
+++ b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/system/BlueGigaGetCountersResponse.java
@@ -0,0 +1,151 @@
+/**
+ * Copyright (c) 2014,2017 Contributors to the Eclipse Foundation
+ *
+ * See the NOTICE file(s) distributed with this work for additional
+ * information regarding copyright ownership.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ */
+package org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.command.system;
+
+import org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.BlueGigaResponse;
+
+/**
+ * Class to implement the BlueGiga command getCounters.
+ *
+ * Read packet counters and resets them, also returns available packet buffers.
+ *
+ * This class provides methods for processing BlueGiga API commands.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ *
+ * @author Chris Jackson - Initial contribution of Java code generator
+ */
+public class BlueGigaGetCountersResponse extends BlueGigaResponse {
+ public static int COMMAND_CLASS = 0x00;
+ public static int COMMAND_METHOD = 0x05;
+
+ /**
+ * Number of transmitted packets
+ *
+ * BlueGiga API type is uint8 - Java type is {@link int}
+ */
+ private int txok;
+
+ /**
+ * Number of retransmitted packets
+ *
+ * BlueGiga API type is uint8 - Java type is {@link int}
+ */
+ private int txretry;
+
+ /**
+ * Number of received packets where CRC was OK
+ *
+ * BlueGiga API type is uint8 - Java type is {@link int}
+ */
+ private int rxok;
+
+ /**
+ * Number of received packets with CRC error
+ *
+ * BlueGiga API type is uint8 - Java type is {@link int}
+ */
+ private int rxfail;
+
+ /**
+ * Number of available packet buffers
+ *
+ * BlueGiga API type is uint8 - Java type is {@link int}
+ */
+ private int mbuf;
+
+ /**
+ * Response constructor
+ */
+ public BlueGigaGetCountersResponse(int[] inputBuffer) {
+ // Super creates deserializer and reads header fields
+ super(inputBuffer);
+
+ event = (inputBuffer[0] & 0x80) != 0;
+
+ // Deserialize the fields
+ txok = deserializeUInt8();
+ txretry = deserializeUInt8();
+ rxok = deserializeUInt8();
+ rxfail = deserializeUInt8();
+ mbuf = deserializeUInt8();
+ }
+
+ /**
+ * Number of transmitted packets
+ *
+ * BlueGiga API type is uint8 - Java type is {@link int}
+ *
+ * @return the current txok as {@link int}
+ */
+ public int getTxok() {
+ return txok;
+ }
+ /**
+ * Number of retransmitted packets
+ *
+ * BlueGiga API type is uint8 - Java type is {@link int}
+ *
+ * @return the current txretry as {@link int}
+ */
+ public int getTxretry() {
+ return txretry;
+ }
+ /**
+ * Number of received packets where CRC was OK
+ *
+ * BlueGiga API type is uint8 - Java type is {@link int}
+ *
+ * @return the current rxok as {@link int}
+ */
+ public int getRxok() {
+ return rxok;
+ }
+ /**
+ * Number of received packets with CRC error
+ *
+ * BlueGiga API type is uint8 - Java type is {@link int}
+ *
+ * @return the current rxfail as {@link int}
+ */
+ public int getRxfail() {
+ return rxfail;
+ }
+ /**
+ * Number of available packet buffers
+ *
+ * BlueGiga API type is uint8 - Java type is {@link int}
+ *
+ * @return the current mbuf as {@link int}
+ */
+ public int getMbuf() {
+ return mbuf;
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder builder = new StringBuilder();
+ builder.append("BlueGigaGetCountersResponse [txok=");
+ builder.append(txok);
+ builder.append(", txretry=");
+ builder.append(txretry);
+ builder.append(", rxok=");
+ builder.append(rxok);
+ builder.append(", rxfail=");
+ builder.append(rxfail);
+ builder.append(", mbuf=");
+ builder.append(mbuf);
+ builder.append(']');
+ return builder.toString();
+ }
+}
diff --git a/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/system/BlueGigaGetInfoCommand.java b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/system/BlueGigaGetInfoCommand.java
new file mode 100644
index 00000000000..e6bd8600c99
--- /dev/null
+++ b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/system/BlueGigaGetInfoCommand.java
@@ -0,0 +1,45 @@
+/**
+ * Copyright (c) 2014,2017 Contributors to the Eclipse Foundation
+ *
+ * See the NOTICE file(s) distributed with this work for additional
+ * information regarding copyright ownership.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ */
+package org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.command.system;
+
+import org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.BlueGigaCommand;
+
+/**
+ * Class to implement the BlueGiga command getInfo.
+ *
+ * This command reads the local devices software and hardware versions.
+ *
+ * This class provides methods for processing BlueGiga API commands.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ *
+ * @author Chris Jackson - Initial contribution of Java code generator
+ */
+public class BlueGigaGetInfoCommand extends BlueGigaCommand {
+ public static int COMMAND_CLASS = 0x00;
+ public static int COMMAND_METHOD = 0x08;
+
+
+ @Override
+ public int[] serialize() {
+ // Serialize the header
+ serializeHeader(COMMAND_CLASS, COMMAND_METHOD);
+
+ return getPayload();
+ }
+
+ @Override
+ public String toString() {
+ return "BlueGigaGetInfoCommand []";
+ }
+}
diff --git a/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/system/BlueGigaGetInfoResponse.java b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/system/BlueGigaGetInfoResponse.java
new file mode 100644
index 00000000000..068edde447d
--- /dev/null
+++ b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/system/BlueGigaGetInfoResponse.java
@@ -0,0 +1,191 @@
+/**
+ * Copyright (c) 2014,2017 Contributors to the Eclipse Foundation
+ *
+ * See the NOTICE file(s) distributed with this work for additional
+ * information regarding copyright ownership.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ */
+package org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.command.system;
+
+import org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.BlueGigaResponse;
+
+/**
+ * Class to implement the BlueGiga command getInfo.
+ *
+ * This command reads the local devices software and hardware versions.
+ *
+ * This class provides methods for processing BlueGiga API commands.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ *
+ * @author Chris Jackson - Initial contribution of Java code generator
+ */
+public class BlueGigaGetInfoResponse extends BlueGigaResponse {
+ public static int COMMAND_CLASS = 0x00;
+ public static int COMMAND_METHOD = 0x08;
+
+ /**
+ * Major software version
+ *
+ * BlueGiga API type is uint16 - Java type is {@link int}
+ */
+ private int major;
+
+ /**
+ * Minor software version
+ *
+ * BlueGiga API type is uint16 - Java type is {@link int}
+ */
+ private int minor;
+
+ /**
+ * Patch ID
+ *
+ * BlueGiga API type is uint16 - Java type is {@link int}
+ */
+ private int patch;
+
+ /**
+ * Build version
+ *
+ * BlueGiga API type is uint16 - Java type is {@link int}
+ */
+ private int build;
+
+ /**
+ * Link layer version
+ *
+ * BlueGiga API type is uint16 - Java type is {@link int}
+ */
+ private int llVersion;
+
+ /**
+ * Protocol version
+ *
+ * BlueGiga API type is uint16 - Java type is {@link int}
+ */
+ private int protocolVersion;
+
+ /**
+ * Hardware version
+ *
+ * BlueGiga API type is uint16 - Java type is {@link int}
+ */
+ private int hardware;
+
+ /**
+ * Response constructor
+ */
+ public BlueGigaGetInfoResponse(int[] inputBuffer) {
+ // Super creates deserializer and reads header fields
+ super(inputBuffer);
+
+ event = (inputBuffer[0] & 0x80) != 0;
+
+ // Deserialize the fields
+ major = deserializeUInt16();
+ minor = deserializeUInt16();
+ patch = deserializeUInt16();
+ build = deserializeUInt16();
+ llVersion = deserializeUInt16();
+ protocolVersion = deserializeUInt16();
+ hardware = deserializeUInt16();
+ }
+
+ /**
+ * Major software version
+ *
+ * BlueGiga API type is uint16 - Java type is {@link int}
+ *
+ * @return the current major as {@link int}
+ */
+ public int getMajor() {
+ return major;
+ }
+ /**
+ * Minor software version
+ *
+ * BlueGiga API type is uint16 - Java type is {@link int}
+ *
+ * @return the current minor as {@link int}
+ */
+ public int getMinor() {
+ return minor;
+ }
+ /**
+ * Patch ID
+ *
+ * BlueGiga API type is uint16 - Java type is {@link int}
+ *
+ * @return the current patch as {@link int}
+ */
+ public int getPatch() {
+ return patch;
+ }
+ /**
+ * Build version
+ *
+ * BlueGiga API type is uint16 - Java type is {@link int}
+ *
+ * @return the current build as {@link int}
+ */
+ public int getBuild() {
+ return build;
+ }
+ /**
+ * Link layer version
+ *
+ * BlueGiga API type is uint16 - Java type is {@link int}
+ *
+ * @return the current ll_version as {@link int}
+ */
+ public int getLlVersion() {
+ return llVersion;
+ }
+ /**
+ * Protocol version
+ *
+ * BlueGiga API type is uint16 - Java type is {@link int}
+ *
+ * @return the current protocol_version as {@link int}
+ */
+ public int getProtocolVersion() {
+ return protocolVersion;
+ }
+ /**
+ * Hardware version
+ *
+ * BlueGiga API type is uint16 - Java type is {@link int}
+ *
+ * @return the current hardware as {@link int}
+ */
+ public int getHardware() {
+ return hardware;
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder builder = new StringBuilder();
+ builder.append("BlueGigaGetInfoResponse [major=");
+ builder.append(major);
+ builder.append(", minor=");
+ builder.append(minor);
+ builder.append(", patch=");
+ builder.append(patch);
+ builder.append(", build=");
+ builder.append(build);
+ builder.append(", llVersion=");
+ builder.append(llVersion);
+ builder.append(", protocolVersion=");
+ builder.append(protocolVersion);
+ builder.append(", hardware=");
+ builder.append(hardware);
+ builder.append(']');
+ return builder.toString();
+ }
+}
diff --git a/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/system/BlueGigaHelloCommand.java b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/system/BlueGigaHelloCommand.java
new file mode 100644
index 00000000000..e8b50911be0
--- /dev/null
+++ b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/system/BlueGigaHelloCommand.java
@@ -0,0 +1,46 @@
+/**
+ * Copyright (c) 2014,2017 Contributors to the Eclipse Foundation
+ *
+ * See the NOTICE file(s) distributed with this work for additional
+ * information regarding copyright ownership.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ */
+package org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.command.system;
+
+import org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.BlueGigaCommand;
+
+/**
+ * Class to implement the BlueGiga command hello.
+ *
+ * This command can be used to test if the local device is functional. Similar to a typical "AT" ->
+ * "OK" test.
+ *
+ * This class provides methods for processing BlueGiga API commands.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ *
+ * @author Chris Jackson - Initial contribution of Java code generator
+ */
+public class BlueGigaHelloCommand extends BlueGigaCommand {
+ public static int COMMAND_CLASS = 0x00;
+ public static int COMMAND_METHOD = 0x01;
+
+
+ @Override
+ public int[] serialize() {
+ // Serialize the header
+ serializeHeader(COMMAND_CLASS, COMMAND_METHOD);
+
+ return getPayload();
+ }
+
+ @Override
+ public String toString() {
+ return "BlueGigaHelloCommand []";
+ }
+}
diff --git a/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/system/BlueGigaHelloResponse.java b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/system/BlueGigaHelloResponse.java
new file mode 100644
index 00000000000..b065cd0e04b
--- /dev/null
+++ b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/system/BlueGigaHelloResponse.java
@@ -0,0 +1,50 @@
+/**
+ * Copyright (c) 2014,2017 Contributors to the Eclipse Foundation
+ *
+ * See the NOTICE file(s) distributed with this work for additional
+ * information regarding copyright ownership.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ */
+package org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.command.system;
+
+import org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.BlueGigaResponse;
+
+/**
+ * Class to implement the BlueGiga command hello.
+ *
+ * This command can be used to test if the local device is functional. Similar to a typical "AT" ->
+ * "OK" test.
+ *
+ * This class provides methods for processing BlueGiga API commands.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ *
+ * @author Chris Jackson - Initial contribution of Java code generator
+ */
+public class BlueGigaHelloResponse extends BlueGigaResponse {
+ public static int COMMAND_CLASS = 0x00;
+ public static int COMMAND_METHOD = 0x01;
+
+ /**
+ * Response constructor
+ */
+ public BlueGigaHelloResponse(int[] inputBuffer) {
+ // Super creates deserializer and reads header fields
+ super(inputBuffer);
+
+ event = (inputBuffer[0] & 0x80) != 0;
+
+ // Deserialize the fields
+ }
+
+
+ @Override
+ public String toString() {
+ return "BlueGigaHelloResponse []";
+ }
+}
diff --git a/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/system/BlueGigaNoLicenseKeyEvent.java b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/system/BlueGigaNoLicenseKeyEvent.java
new file mode 100644
index 00000000000..3fae3606e15
--- /dev/null
+++ b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/system/BlueGigaNoLicenseKeyEvent.java
@@ -0,0 +1,51 @@
+/**
+ * Copyright (c) 2014,2017 Contributors to the Eclipse Foundation
+ *
+ * See the NOTICE file(s) distributed with this work for additional
+ * information regarding copyright ownership.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ */
+package org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.command.system;
+
+import org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.BlueGigaResponse;
+
+/**
+ * Class to implement the BlueGiga command noLicenseKeyEvent.
+ *
+ * This error is produced when no valid license key found form the Smart hardware. When there is
+ * no Bluetooth valid license key the Bluetooth radio will not be operational. A new license key
+ * can be requested from the Bluegiga Technical Support.
+ *
+ * This class provides methods for processing BlueGiga API commands.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ *
+ * @author Chris Jackson - Initial contribution of Java code generator
+ */
+public class BlueGigaNoLicenseKeyEvent extends BlueGigaResponse {
+ public static int COMMAND_CLASS = 0x00;
+ public static int COMMAND_METHOD = 0x05;
+
+ /**
+ * Event constructor
+ */
+ public BlueGigaNoLicenseKeyEvent(int[] inputBuffer) {
+ // Super creates deserializer and reads header fields
+ super(inputBuffer);
+
+ event = (inputBuffer[0] & 0x80) != 0;
+
+ // Deserialize the fields
+ }
+
+
+ @Override
+ public String toString() {
+ return "BlueGigaNoLicenseKeyEvent []";
+ }
+}
diff --git a/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/system/BlueGigaProtocolErrorEvent.java b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/system/BlueGigaProtocolErrorEvent.java
new file mode 100644
index 00000000000..7c7acca7e10
--- /dev/null
+++ b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/system/BlueGigaProtocolErrorEvent.java
@@ -0,0 +1,75 @@
+/**
+ * Copyright (c) 2014,2017 Contributors to the Eclipse Foundation
+ *
+ * See the NOTICE file(s) distributed with this work for additional
+ * information regarding copyright ownership.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ */
+package org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.command.system;
+
+import org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.BlueGigaResponse;
+import org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.enumeration.BgApiResponse;
+
+/**
+ * Class to implement the BlueGiga command protocolErrorEvent.
+ *
+ * A protocol error was detected in BGAPI command parser. This event is triggered if a BGAPI
+ * command from the host contains syntax error(s), or if a command is only partially sent. Then
+ * the BGAPI parser has a 1 second command timeout and if a valid command is not transmitted
+ * within this timeout an error is raised and the partial or wrong command will be ignored.
+ *
+ * This class provides methods for processing BlueGiga API commands.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ *
+ * @author Chris Jackson - Initial contribution of Java code generator
+ */
+public class BlueGigaProtocolErrorEvent extends BlueGigaResponse {
+ public static int COMMAND_CLASS = 0x00;
+ public static int COMMAND_METHOD = 0x06;
+
+ /**
+ * Reason for failure
+ *
+ * BlueGiga API type is BgApiResponse - Java type is {@link BgApiResponse}
+ */
+ private BgApiResponse reason;
+
+ /**
+ * Event constructor
+ */
+ public BlueGigaProtocolErrorEvent(int[] inputBuffer) {
+ // Super creates deserializer and reads header fields
+ super(inputBuffer);
+
+ event = (inputBuffer[0] & 0x80) != 0;
+
+ // Deserialize the fields
+ reason = deserializeBgApiResponse();
+ }
+
+ /**
+ * Reason for failure
+ *
+ * BlueGiga API type is BgApiResponse - Java type is {@link BgApiResponse}
+ *
+ * @return the current reason as {@link BgApiResponse}
+ */
+ public BgApiResponse getReason() {
+ return reason;
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder builder = new StringBuilder();
+ builder.append("BlueGigaProtocolErrorEvent [reason=");
+ builder.append(reason);
+ builder.append(']');
+ return builder.toString();
+ }
+}
diff --git a/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/system/BlueGigaResetCommand.java b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/system/BlueGigaResetCommand.java
new file mode 100644
index 00000000000..32ba6879a9b
--- /dev/null
+++ b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/system/BlueGigaResetCommand.java
@@ -0,0 +1,67 @@
+/**
+ * Copyright (c) 2014,2017 Contributors to the Eclipse Foundation
+ *
+ * See the NOTICE file(s) distributed with this work for additional
+ * information regarding copyright ownership.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ */
+package org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.command.system;
+
+import org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.BlueGigaCommand;
+
+/**
+ * Class to implement the BlueGiga command reset.
+ *
+ * This command resets the local device immediately. The command does not have a response.
+ *
+ * This class provides methods for processing BlueGiga API commands.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ *
+ * @author Chris Jackson - Initial contribution of Java code generator
+ */
+public class BlueGigaResetCommand extends BlueGigaCommand {
+ public static int COMMAND_CLASS = 0x00;
+ public static int COMMAND_METHOD = 0x00;
+
+ /**
+ * Selects the boot mode. 0 : boot to main program. 1 : boot to DFU
+ *
+ * BlueGiga API type is boolean - Java type is {@link boolean}
+ */
+ private boolean bootInDfu = false;
+
+ /**
+ * Selects the boot mode. 0 : boot to main program. 1 : boot to DFU
+ *
+ * @param bootInDfu the bootInDfu to set as {@link boolean}
+ */
+ public void setBootInDfu(boolean bootInDfu) {
+ this.bootInDfu = bootInDfu;
+ }
+
+ @Override
+ public int[] serialize() {
+ // Serialize the header
+ serializeHeader(COMMAND_CLASS, COMMAND_METHOD);
+
+ // Serialize the fields
+ serializeBoolean(bootInDfu);
+
+ return getPayload();
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder builder = new StringBuilder();
+ builder.append("BlueGigaResetCommand [bootInDfu=");
+ builder.append(bootInDfu);
+ builder.append(']');
+ return builder.toString();
+ }
+}
diff --git a/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/system/BlueGigaResetResponse.java b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/system/BlueGigaResetResponse.java
new file mode 100644
index 00000000000..8caccc5fb36
--- /dev/null
+++ b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/system/BlueGigaResetResponse.java
@@ -0,0 +1,49 @@
+/**
+ * Copyright (c) 2014,2017 Contributors to the Eclipse Foundation
+ *
+ * See the NOTICE file(s) distributed with this work for additional
+ * information regarding copyright ownership.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ */
+package org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.command.system;
+
+import org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.BlueGigaResponse;
+
+/**
+ * Class to implement the BlueGiga command reset.
+ *
+ * This command resets the local device immediately. The command does not have a response.
+ *
+ * This class provides methods for processing BlueGiga API commands.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ *
+ * @author Chris Jackson - Initial contribution of Java code generator
+ */
+public class BlueGigaResetResponse extends BlueGigaResponse {
+ public static int COMMAND_CLASS = 0x00;
+ public static int COMMAND_METHOD = 0x00;
+
+ /**
+ * Response constructor
+ */
+ public BlueGigaResetResponse(int[] inputBuffer) {
+ // Super creates deserializer and reads header fields
+ super(inputBuffer);
+
+ event = (inputBuffer[0] & 0x80) != 0;
+
+ // Deserialize the fields
+ }
+
+
+ @Override
+ public String toString() {
+ return "BlueGigaResetResponse []";
+ }
+}
diff --git a/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/system/BlueGigaWhitelistAppendCommand.java b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/system/BlueGigaWhitelistAppendCommand.java
new file mode 100644
index 00000000000..fe2a56e9a1c
--- /dev/null
+++ b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/system/BlueGigaWhitelistAppendCommand.java
@@ -0,0 +1,73 @@
+/**
+ * Copyright (c) 2014,2017 Contributors to the Eclipse Foundation
+ *
+ * See the NOTICE file(s) distributed with this work for additional
+ * information regarding copyright ownership.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ */
+package org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.command.system;
+
+import org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.BlueGigaCommand;
+
+/**
+ * Class to implement the BlueGiga command whitelistAppend.
+ *
+ * Add an entry to the running white list. By the white list you can define for example the remote
+ * devices which are allowed to establish a connection. See also Set Filtering Connect
+ * Selective and (if the white list is empty they will not be active). Do not use this command
+ * while advertising, scanning, or while being connected. The current list is discarded upon
+ * reset or power-cycle.
+ *
+ * This class provides methods for processing BlueGiga API commands.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ *
+ * @author Chris Jackson - Initial contribution of Java code generator
+ */
+public class BlueGigaWhitelistAppendCommand extends BlueGigaCommand {
+ public static int COMMAND_CLASS = 0x00;
+ public static int COMMAND_METHOD = 0x0A;
+
+ /**
+ * Bluetooth device address to add to the running white list. Maximum of 8 can be stored before
+ * you must clear or remove entries.
+ *
+ * BlueGiga API type is bd_addr - Java type is {@link String}
+ */
+ private String address;
+
+ /**
+ * Bluetooth device address to add to the running white list. Maximum of 8 can be stored before
+ * you must clear or remove entries.
+ *
+ * @param address the address to set as {@link String}
+ */
+ public void setAddress(String address) {
+ this.address = address;
+ }
+
+ @Override
+ public int[] serialize() {
+ // Serialize the header
+ serializeHeader(COMMAND_CLASS, COMMAND_METHOD);
+
+ // Serialize the fields
+ serializeAddress(address);
+
+ return getPayload();
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder builder = new StringBuilder();
+ builder.append("BlueGigaWhitelistAppendCommand [address=");
+ builder.append(address);
+ builder.append(']');
+ return builder.toString();
+ }
+}
diff --git a/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/system/BlueGigaWhitelistAppendResponse.java b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/system/BlueGigaWhitelistAppendResponse.java
new file mode 100644
index 00000000000..48859101295
--- /dev/null
+++ b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/system/BlueGigaWhitelistAppendResponse.java
@@ -0,0 +1,76 @@
+/**
+ * Copyright (c) 2014,2017 Contributors to the Eclipse Foundation
+ *
+ * See the NOTICE file(s) distributed with this work for additional
+ * information regarding copyright ownership.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ */
+package org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.command.system;
+
+import org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.BlueGigaResponse;
+import org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.enumeration.BgApiResponse;
+
+/**
+ * Class to implement the BlueGiga command whitelistAppend.
+ *
+ * Add an entry to the running white list. By the white list you can define for example the remote
+ * devices which are allowed to establish a connection. See also Set Filtering Connect
+ * Selective and (if the white list is empty they will not be active). Do not use this command
+ * while advertising, scanning, or while being connected. The current list is discarded upon
+ * reset or power-cycle.
+ *
+ * This class provides methods for processing BlueGiga API commands.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ *
+ * @author Chris Jackson - Initial contribution of Java code generator
+ */
+public class BlueGigaWhitelistAppendResponse extends BlueGigaResponse {
+ public static int COMMAND_CLASS = 0x00;
+ public static int COMMAND_METHOD = 0x0A;
+
+ /**
+ * Command result
+ *
+ * BlueGiga API type is BgApiResponse - Java type is {@link BgApiResponse}
+ */
+ private BgApiResponse result;
+
+ /**
+ * Response constructor
+ */
+ public BlueGigaWhitelistAppendResponse(int[] inputBuffer) {
+ // Super creates deserializer and reads header fields
+ super(inputBuffer);
+
+ event = (inputBuffer[0] & 0x80) != 0;
+
+ // Deserialize the fields
+ result = deserializeBgApiResponse();
+ }
+
+ /**
+ * Command result
+ *
+ * BlueGiga API type is BgApiResponse - Java type is {@link BgApiResponse}
+ *
+ * @return the current result as {@link BgApiResponse}
+ */
+ public BgApiResponse getResult() {
+ return result;
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder builder = new StringBuilder();
+ builder.append("BlueGigaWhitelistAppendResponse [result=");
+ builder.append(result);
+ builder.append(']');
+ return builder.toString();
+ }
+}
diff --git a/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/system/BlueGigaWhitelistClearCommand.java b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/system/BlueGigaWhitelistClearCommand.java
new file mode 100644
index 00000000000..7c2a34b756d
--- /dev/null
+++ b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/system/BlueGigaWhitelistClearCommand.java
@@ -0,0 +1,46 @@
+/**
+ * Copyright (c) 2014,2017 Contributors to the Eclipse Foundation
+ *
+ * See the NOTICE file(s) distributed with this work for additional
+ * information regarding copyright ownership.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ */
+package org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.command.system;
+
+import org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.BlueGigaCommand;
+
+/**
+ * Class to implement the BlueGiga command whitelistClear.
+ *
+ * Delete all entries on the white list at once. Do not use this command while advertising or
+ * while being connected.
+ *
+ * This class provides methods for processing BlueGiga API commands.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ *
+ * @author Chris Jackson - Initial contribution of Java code generator
+ */
+public class BlueGigaWhitelistClearCommand extends BlueGigaCommand {
+ public static int COMMAND_CLASS = 0x00;
+ public static int COMMAND_METHOD = 0x0C;
+
+
+ @Override
+ public int[] serialize() {
+ // Serialize the header
+ serializeHeader(COMMAND_CLASS, COMMAND_METHOD);
+
+ return getPayload();
+ }
+
+ @Override
+ public String toString() {
+ return "BlueGigaWhitelistClearCommand []";
+ }
+}
diff --git a/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/system/BlueGigaWhitelistClearResponse.java b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/system/BlueGigaWhitelistClearResponse.java
new file mode 100644
index 00000000000..eed25898c4a
--- /dev/null
+++ b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/system/BlueGigaWhitelistClearResponse.java
@@ -0,0 +1,50 @@
+/**
+ * Copyright (c) 2014,2017 Contributors to the Eclipse Foundation
+ *
+ * See the NOTICE file(s) distributed with this work for additional
+ * information regarding copyright ownership.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ */
+package org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.command.system;
+
+import org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.BlueGigaResponse;
+
+/**
+ * Class to implement the BlueGiga command whitelistClear.
+ *
+ * Delete all entries on the white list at once. Do not use this command while advertising or
+ * while being connected.
+ *
+ * This class provides methods for processing BlueGiga API commands.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ *
+ * @author Chris Jackson - Initial contribution of Java code generator
+ */
+public class BlueGigaWhitelistClearResponse extends BlueGigaResponse {
+ public static int COMMAND_CLASS = 0x00;
+ public static int COMMAND_METHOD = 0x0C;
+
+ /**
+ * Response constructor
+ */
+ public BlueGigaWhitelistClearResponse(int[] inputBuffer) {
+ // Super creates deserializer and reads header fields
+ super(inputBuffer);
+
+ event = (inputBuffer[0] & 0x80) != 0;
+
+ // Deserialize the fields
+ }
+
+
+ @Override
+ public String toString() {
+ return "BlueGigaWhitelistClearResponse []";
+ }
+}
diff --git a/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/system/BlueGigaWhitelistRemoveCommand.java b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/system/BlueGigaWhitelistRemoveCommand.java
new file mode 100644
index 00000000000..dc24cbb5eca
--- /dev/null
+++ b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/system/BlueGigaWhitelistRemoveCommand.java
@@ -0,0 +1,68 @@
+/**
+ * Copyright (c) 2014,2017 Contributors to the Eclipse Foundation
+ *
+ * See the NOTICE file(s) distributed with this work for additional
+ * information regarding copyright ownership.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ */
+package org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.command.system;
+
+import org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.BlueGigaCommand;
+
+/**
+ * Class to implement the BlueGiga command whitelistRemove.
+ *
+ * Remove an entry from the running white list. Do not use this command while advertising or
+ * while being connected.
+ *
+ * This class provides methods for processing BlueGiga API commands.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ *
+ * @author Chris Jackson - Initial contribution of Java code generator
+ */
+public class BlueGigaWhitelistRemoveCommand extends BlueGigaCommand {
+ public static int COMMAND_CLASS = 0x00;
+ public static int COMMAND_METHOD = 0x0B;
+
+ /**
+ * Bluetooth device address to remove from the running white list.
+ *
+ * BlueGiga API type is bd_addr - Java type is {@link String}
+ */
+ private String address;
+
+ /**
+ * Bluetooth device address to remove from the running white list.
+ *
+ * @param address the address to set as {@link String}
+ */
+ public void setAddress(String address) {
+ this.address = address;
+ }
+
+ @Override
+ public int[] serialize() {
+ // Serialize the header
+ serializeHeader(COMMAND_CLASS, COMMAND_METHOD);
+
+ // Serialize the fields
+ serializeAddress(address);
+
+ return getPayload();
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder builder = new StringBuilder();
+ builder.append("BlueGigaWhitelistRemoveCommand [address=");
+ builder.append(address);
+ builder.append(']');
+ return builder.toString();
+ }
+}
diff --git a/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/system/BlueGigaWhitelistRemoveResponse.java b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/system/BlueGigaWhitelistRemoveResponse.java
new file mode 100644
index 00000000000..5424475d862
--- /dev/null
+++ b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/command/system/BlueGigaWhitelistRemoveResponse.java
@@ -0,0 +1,73 @@
+/**
+ * Copyright (c) 2014,2017 Contributors to the Eclipse Foundation
+ *
+ * See the NOTICE file(s) distributed with this work for additional
+ * information regarding copyright ownership.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ */
+package org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.command.system;
+
+import org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.BlueGigaResponse;
+import org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.enumeration.BgApiResponse;
+
+/**
+ * Class to implement the BlueGiga command whitelistRemove.
+ *
+ * Remove an entry from the running white list. Do not use this command while advertising or
+ * while being connected.
+ *
+ * This class provides methods for processing BlueGiga API commands.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ *
+ * @author Chris Jackson - Initial contribution of Java code generator
+ */
+public class BlueGigaWhitelistRemoveResponse extends BlueGigaResponse {
+ public static int COMMAND_CLASS = 0x00;
+ public static int COMMAND_METHOD = 0x0B;
+
+ /**
+ * Command result
+ *
+ * BlueGiga API type is BgApiResponse - Java type is {@link BgApiResponse}
+ */
+ private BgApiResponse result;
+
+ /**
+ * Response constructor
+ */
+ public BlueGigaWhitelistRemoveResponse(int[] inputBuffer) {
+ // Super creates deserializer and reads header fields
+ super(inputBuffer);
+
+ event = (inputBuffer[0] & 0x80) != 0;
+
+ // Deserialize the fields
+ result = deserializeBgApiResponse();
+ }
+
+ /**
+ * Command result
+ *
+ * BlueGiga API type is BgApiResponse - Java type is {@link BgApiResponse}
+ *
+ * @return the current result as {@link BgApiResponse}
+ */
+ public BgApiResponse getResult() {
+ return result;
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder builder = new StringBuilder();
+ builder.append("BlueGigaWhitelistRemoveResponse [result=");
+ builder.append(result);
+ builder.append(']');
+ return builder.toString();
+ }
+}
diff --git a/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/eir/EirDataType.java b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/eir/EirDataType.java
new file mode 100644
index 00000000000..0d6cf9f6ef3
--- /dev/null
+++ b/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/internal/eir/EirDataType.java
@@ -0,0 +1,115 @@
+/**
+ * Copyright (c) 2014,2017 Contributors to the Eclipse Foundation
+ *
+ * See the NOTICE file(s) distributed with this work for additional
+ * information regarding copyright ownership.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ */
+package org.eclipse.smarthome.binding.bluetooth.bluegiga.internal.eir;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * Assigned numbers are used in GAP for inquiry response, EIR data type values, manufacturer-specific data, advertising
+ * data, low energy UUIDs and appearance characteristics, and class of device.
+ *
+ * https://www.bluetooth.com/specifications/assigned-numbers/generic-access-profile
+ *
+ * @author Chris Jackson
+ *
+ */
+public enum EirDataType {
+ /**
+ * Default unknown value
+ */
+ UNKNOWN(-1),
+ NONE(0),
+
+ EIR_FLAGS(0x01),
+ EIR_SVC_UUID16_INCOMPLETE(0x02),
+ EIR_SVC_UUID16_COMPLETE(0x03),
+ EIR_SVC_UUID32_INCOMPLETE(0x04),
+ EIR_SVC_UUID32_COMPLETE(0x05),
+ EIR_SVC_UUID128_INCOMPLETE(0x06),
+ EIR_SVC_UUID128_COMPLETE(0x07),
+ EIR_NAME_SHORT(0x08),
+ EIR_NAME_LONG(0x09),
+ EIR_TXPOWER(0x0A),
+ EIR_DEVICE_CLASS(0x0D),
+ EIR_SIMPLE_PAIRING_RANDOMIZER(0x0F),
+ EIR_SECMAN_TK_VALUE(0x10),
+ EIR_SECMAN_OOB_FLAGS(0x11),
+ EIR_SLAVEINTERVALRANGE(0x12),
+ EIR_SVC_SOLICIT_UUID16(0x14),
+ EIR_SVC_SOLICIT_UUID128(0x15),
+ EIR_SVC_DATA_UUID16(0x16),
+ EIR_PUBLIC_TARGET_ADDR(0x17),
+ EIR_RANDOM_TARGET_ADDR(0x18),
+ EIR_APPEARANCE(0x19),
+ EIR_ADVERTISING_INTERVAL(0x1A),
+ EIR_LE_DEVICE_ADDRESS(0x1B),
+ EIR_LE_ROLE(0x1C),
+ EIR_SIMPLE_PAIRING_HASH(0x1D),
+ EIR_SVC_SOLICIT_UUID32(0x1F),
+ EIR_SVC_DATA_UUID32(0x20),
+ EIR_SVC_DATA_UUID128(0x21),
+ EIR_LE_SEC_CONFIRMATION_VALUE(0x22),
+ EIR_LE_CONNECTION_RANDOM_VALUE(0x23),
+ EIR_URI(0x24),
+ EIR_INDOOR_POSITIONING(0x25),
+ EIR_LE_SUPPORTED_FEATURES(0x27),
+ EIR_MANUFACTURER_SPECIFIC(0xFF);
+
+ /**
+ * A mapping between the integer code and its corresponding type to
+ * facilitate lookup by code.
+ */
+ private static Map
+ * This enumeration contains the reason for an attribute value change.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ *
+ * @author Chris Jackson - Initial contribution of Java code generator
+ */
+public enum AttributeChangeReason {
+ /**
+ * Default unknown value
+ */
+ UNKNOWN(-1),
+
+ /**
+ * [0] Value was written by remote device using write request
+ */
+ ATTRIBUTES_ATTRIBUTE_CHANGE_REASON_WRITE_REQUEST(0x0000),
+
+ /**
+ * [1] Value was written by remote device using write command
+ */
+ ATTRIBUTES_ATTRIBUTE_CHANGE_REASON_WRITE_COMMAND(0x0001),
+
+ /**
+ * [2] Local attribute value was written by the remote device, but the Smart Bluetooth stack is
+ * waiting for the write to be confirmed by the application. User Write Response command should
+ * be used to send the confirmation. For this reason to appear the attribute in the GATT database
+ * must have the user property enabled. See Profile Toolkit Developer Guide for more
+ * information how to enable the user property for an attribute.
+ */
+ ATTRIBUTES_ATTRIBUTE_CHANGE_REASON_WRITE_REQUEST_USER(0x0002);
+
+ /**
+ * A mapping between the integer code and its corresponding type to
+ * facilitate lookup by code.
+ */
+ private static Map
+ * These enumerations are in the Attribute Client class
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ *
+ * @author Chris Jackson - Initial contribution of Java code generator
+ */
+public enum AttributeValueType {
+ /**
+ * Default unknown value
+ */
+ UNKNOWN(-1),
+
+ /**
+ * [0] Value was read
+ */
+ ATTCLIENT_ATTRIBUTE_VALUE_TYPE_READ(0x0000),
+
+ /**
+ * [1] Value was notified
+ */
+ ATTCLIENT_ATTRIBUTE_VALUE_TYPE_NOTIFY(0x0001),
+
+ /**
+ * [2] Value was indicated
+ */
+ ATTCLIENT_ATTRIBUTE_VALUE_TYPE_INDICATE(0x0002),
+
+ /**
+ * [3] Value was read
+ */
+ ATTCLIENT_ATTRIBUTE_VALUE_TYPE_READ_BY_TYPE(0x0003),
+
+ /**
+ * [4] Value was part of a long attribute
+ */
+ ATTCLIENT_ATTRIBUTE_VALUE_TYPE_READ_BLOB(0x0004),
+
+ /**
+ * [5] Value was indicated and the remote device is waiting for a confirmation. Indicate
+ * Confirm command can be used to send a confirmation.
+ */
+ ATTCLIENT_ATTRIBUTE_VALUE_TYPE_INDICATE_RSP_REQ(0x0005);
+
+ /**
+ * A mapping between the integer code and its corresponding type to
+ * facilitate lookup by code.
+ */
+ private static Map
+ * Response codes
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ *
+ * @author Chris Jackson - Initial contribution of Java code generator
+ */
+public enum BgApiResponse {
+ /**
+ * Default unknown value
+ */
+ UNKNOWN(-1),
+
+ /**
+ * [0] Completed successfully.
+ */
+ SUCCESS(0x0000),
+
+ /**
+ * [257] Invalid GATT connection handle.
+ */
+ INVALID_CONN_HANDLE(0x0101),
+
+ /**
+ * [258] Waiting response from GATT server to previous procedure.
+ */
+ WAITING_RESPONSE(0x0102),
+
+ /**
+ * [384] Command contained invalid parameter
+ */
+ INVALID_PARAM(0x0180),
+
+ /**
+ * [385] Device is in wrong state to receive command
+ */
+ WRONG_STATE(0x0181),
+
+ /**
+ * [386] Device has run out of memory
+ */
+ OUT_OF_MEMORY(0x0182),
+
+ /**
+ * [387] Feature is not implemented
+ */
+ NOT_IMPLEMENTED(0x0183),
+
+ /**
+ * [388] Command was not recognized
+ */
+ INVALID_COMMAND(0x0184),
+
+ /**
+ * [389] Command or Procedure failed due to timeout
+ */
+ TIMEOUT(0x0185),
+
+ /**
+ * [390] Connection handle passed is to command is not a valid handle
+ */
+ NOT_CONNECTED(0x0186),
+
+ /**
+ * [391] Command would cause either underflow or overflow error
+ */
+ FLOW(0x0187),
+
+ /**
+ * [392] User attribute was accessed through API which is not supported
+ */
+ USER_ATTRIBUTE(0x0188),
+
+ /**
+ * [393] No valid license key found
+ */
+ INVALID_LICENSE_KEY(0x0189),
+
+ /**
+ * [394] Command maximum length exceeded
+ */
+ COMMAND_TOO_LONG(0x018A),
+
+ /**
+ * [395] Bonding procedure can't be started because device has no space left for bond.
+ */
+ OUT_OF_BONDS(0x018B),
+
+ /**
+ * [396] Unspecified error
+ */
+ UNSPECIFIED(0x018C),
+
+ /**
+ * [397] Hardware failure
+ */
+ HARDWARE(0x018D),
+
+ /**
+ * [398] Command not accepted, because internal buffers are full
+ */
+ BUFFERS_FULL(0x018E),
+
+ /**
+ * [399] Command or Procedure failed due to disconnection
+ */
+ DISCONNECTED(0x018F),
+
+ /**
+ * [400] Too many Simultaneous Requests
+ */
+ TOO_MANY_REQUESTS(0x0190),
+
+ /**
+ * [401] Feature is not supported in this firmware build
+ */
+ NOT_SUPPORTED(0x0191),
+
+ /**
+ * [402] The bonding does not exist.
+ */
+ NO_BONDING(0x0192),
+
+ /**
+ * [403] Error using crypto functions
+ */
+ CRYPTO(0x0193),
+
+ /**
+ * [514] A command was sent from the Host that should identify a connection, but that connection
+ * does not exist.
+ */
+ UNKNOWN_CONNECTION_IDENTIFIER(0x0202),
+
+ /**
+ * [520] Link supervision timeout has expired.
+ */
+ CONNECTION_TIMEOUT(0x0208),
+
+ /**
+ * [521] Controller is at limit of connections it can support.
+ */
+ CONNECTION_LIMIT_EXCEEDED(0x0209),
+
+ /**
+ * [522]
+ */
+ SYNCHRONOUS_CONNECTIONTION_LIMIT_EXCEEDED(0x020A),
+
+ /**
+ * [523] The ACL Connection Already Exists error code indicates that an attempt to create a new
+ * ACL Connection to a device when there is already a connection to this device.
+ */
+ ACL_CONNECTION_ALREADY_EXISTS(0x020B),
+
+ /**
+ * [524] Command requested cannot be executed because the Controller is in a state where it
+ * cannot process this command at this time.
+ */
+ COMMAND_DISALLOWED(0x020C),
+
+ /**
+ * [525] The Connection Rejected Due To Limited Resources error code indicates that an
+ * incoming connection was rejected due to limited resources.
+ */
+ CONNECTION_REJECTED_DUE_TO_LIMITED_RESOURCES(0x020D),
+
+ /**
+ * [526] The Connection Rejected Due To Security Reasons error code indicates that a
+ * connection was rejected due to security requirements not being fulfilled, like
+ * authentication or pairing.
+ */
+ CONNECTION_REJECTED_DUE_TO_SECURITY_REASONS(0x020E),
+
+ /**
+ * [527] The Connection was rejected because this device does not accept the BD_ADDR. This may
+ * be because the device will only accept connections from specific BD_ADDRs.
+ */
+ CONNECTION_REJECTED_DUE_TO_UNACCEPTABLE_BD_ADDR(0x020F),
+
+ /**
+ * [528] The Connection Accept Timeout has been exceeded for this connection attempt.
+ */
+ CONNECTION_ACCEPT_TIMEOUT_EXCEEDED(0x0210),
+
+ /**
+ * [529] A feature or parameter value in the HCI command is not supported.
+ */
+ UNSUPPORTED_FEATURE_OR_PARAMETER_VALUE(0x0211),
+
+ /**
+ * [530] Command contained invalid parameters.
+ */
+ INVALID_COMMAND_PARAMETERS(0x0212),
+
+ /**
+ * [531] User on the remote device terminated the connection.
+ */
+ REMOTE_USER_TERMINATED(0x0213),
+
+ /**
+ * [532] The remote device terminated the connection because of low resources
+ */
+ REMOTE_DEVICE_TERMINATED_CONNECTION_LOW_RESOURCES(0x0214),
+
+ /**
+ * [533] Remote Device Terminated Connection due to Power Off
+ */
+ REMOTE_POWERING_OFF(0x0215),
+
+ /**
+ * [534] Local device terminated the connection.
+ */
+ CONNECTION_TERMINATED_BY_LOCAL_HOST(0x0216),
+
+ /**
+ * [535] The Controller is disallowing an authentication or pairing procedure because too
+ * little time has elapsed since the last authentication or pairing attempt failed.
+ */
+ REPEATED_ATTEMPTS(0x0217),
+
+ /**
+ * [536] The device does not allow pairing. This can be for example, when a device only allows
+ * pairing during a certain time window after some user input allows pairing
+ */
+ PAIRING_NOT_ALLOWED(0x0218),
+
+ /**
+ * [537] The Controller has received an unknown LMP OpCode.
+ */
+ UNKNOWN_LMP_PDU(0x0219),
+
+ /**
+ * [538] The remote device does not support the feature associated with the issued command or
+ * LMP PDU.
+ */
+ UNSUPPORTED_REMOTE_FEATURE(0x021A),
+
+ /**
+ * [560] A parameter value requested is outside the mandatory range of parameters for the given
+ * HCI command or LMP PDU.
+ */
+ PARAMETER_OUT_OF_MANDATORY_RANGE(0x0230),
+
+ /**
+ * [569] The Controller could not calculate an appropriate value for the Channel selection
+ * operation.
+ */
+ CONNECTION_REJECTED_NO_SUITABLE_CHANNEL(0x0239),
+
+ /**
+ * [570] Operation was rejected because the controller is busy and unable to process the
+ * request.
+ */
+ CONTROLLER_BUSY(0x023A),
+
+ /**
+ * [571] Remote device terminated the connection because of an unacceptable connection
+ * interval.
+ */
+ UNACCEPTABLE_CONNECTION_INTERVAL(0x023B),
+
+ /**
+ * [573] Connection was terminated because the Message Integrity Check (MIC) failed on a
+ * received packet.
+ */
+ CONNECTION_TERMINATED_DUE_TO_MIC_FAILURE(0x023D),
+
+ /**
+ * [574] LL initiated a connection but the connection has failed to be established. Controller
+ * did not receive any packets from remote end.
+ */
+ CONNECTION_FAILED_TO_BE_ESTABLISHED(0x023E),
+
+ /**
+ * [575] The MAC of the 802.11 AMP was requested to connect to a peer, but the connection failed.
+ */
+ MAC_CONNECTION_FAILED(0x023F),
+
+ /**
+ * [576] The master, at this time, is unable to make a coarse adjustment to the piconet clock,
+ * using the supplied parameters. Instead the master will attempt to move the clock using clock
+ * dragging.
+ */
+ COARSE_CLOCK_ADJUSTMENT_REJECTED(0x0240),
+
+ /**
+ * [769] The user input of passkey failed, for example, the user cancelled the operation
+ */
+ PASSKEY_ENTRY_FAILED(0x0301),
+
+ /**
+ * [1025] The attribute handle given was not valid on this server
+ */
+ INVALID_HANDLE(0x0401),
+
+ /**
+ * [1026] The attribute cannot be read
+ */
+ READ_NOT_PERMITTED(0x0402),
+
+ /**
+ * [1027] The attribute cannot be written
+ */
+ WRITE_NOT_PERMITTED(0x0403),
+
+ /**
+ * [1028] The attribute PDU was invalid
+ */
+ INVALID_PDU(0x0404),
+
+ /**
+ * [1029] The attribute requires authentication before it can be read or written.
+ */
+ INSUFFICIENT_AUTHENTICATION(0x0405),
+
+ /**
+ * [1030] Attribute Server does not support the request received from the client.
+ */
+ REQUEST_NOT_SUPPORTED(0x0406),
+
+ /**
+ * [1031] Offset specified was past the end of the attribute
+ */
+ INVALID_OFFSET(0x0407),
+
+ /**
+ * [1032] The attribute requires authorization before it can be read or written.
+ */
+ INSUFFICIENT_AUTHORIZATION(0x0408),
+
+ /**
+ * [1033] Too many prepare writes have been queueud
+ */
+ PREPARE_QUEUE_FULL(0x0409),
+
+ /**
+ * [1034] No attribute found within the given attribute handle range.
+ */
+ ATT_NOT_FOUND(0x040A),
+
+ /**
+ * [1035] The attribute cannot be read or written using the Read Blob Request
+ */
+ ATT_NOT_LONG(0x040B),
+
+ /**
+ * [1037] The attribute value length is invalid for the operation
+ */
+ INVALID_ATT_LENGTH(0x040D),
+
+ /**
+ * [1040] The attribute type is not a supported grouping attribute as defined by a higher layer
+ * specification.
+ */
+ UNSUPPORTED_GROUP_TYPE(0x0410),
+
+ /**
+ * [1041] Insufficient Resources to complete the request
+ */
+ INSUFFICIENT_RESOURCES(0x0411),
+
+ /**
+ * [1152] Application error code defined by a higher layer specification.
+ */
+ APPLICATION(0x0480),
+
+ /**
+ * [1537] Service Record not found
+ */
+ RECORD_NOT_FOUND(0x0601),
+
+ /**
+ * [1538] Service Record with this handle already exist
+ */
+ RECORD_ALREADY_EXIST(0x0602),
+
+ /**
+ * [2305] File not found.
+ */
+ FILE_NOT_FOUND(0x0901),
+
+ /**
+ * [2561] File open failed.
+ */
+ FILE_OPEN_FAILED(0x0A01),
+
+ /**
+ * [2562] XML parsing failed.
+ */
+ XML_PARSE_FAILED(0x0A02),
+
+ /**
+ * [2563] Device connection failed.
+ */
+ DEVICE_CONNECTION_FAILED(0x0A03),
+
+ /**
+ * [2817] Device firmware signature verification failed.
+ */
+ IMAGE_SIGNATURE_VERIFICATION_FAILED(0x0B01),
+
+ /**
+ * [2818] File signature verification failed.
+ */
+ FILE_SIGNATURE_VERIFICATION_FAILED(0x0B02),
+
+ /**
+ * [2819] Device firmware checksum is not valid.
+ */
+ IMAGE_CHECKSUM_ERROR(0x0B03);
+
+ /**
+ * A mapping between the integer code and its corresponding type to
+ * facilitate lookup by code.
+ */
+ private static Map
+ * Bluetooth address types
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ *
+ * @author Chris Jackson - Initial contribution of Java code generator
+ */
+public enum BluetoothAddressType {
+ /**
+ * Default unknown value
+ */
+ UNKNOWN(-1),
+
+ /**
+ * [0] Public Address
+ */
+ GAP_ADDRESS_TYPE_PUBLIC(0x0000),
+
+ /**
+ * [1] Random Address
+ */
+ GAP_ADDRESS_TYPE_RANDOM(0x0001);
+
+ /**
+ * A mapping between the integer code and its corresponding type to
+ * facilitate lookup by code.
+ */
+ private static Map
+ * The possible connection status flags are described in the table below. The flags field is a
+ * bit mask, so multiple flags can be set at a time. If the bit is 1 the flag is active and if the bit is
+ * 0 the flag is inactive.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ *
+ * @author Chris Jackson - Initial contribution of Java code generator
+ */
+public enum ConnectionStatusFlag {
+ /**
+ * Default unknown value
+ */
+ UNKNOWN(-1),
+
+ /**
+ * [1] This status flag tells the connection exists to a remote device.
+ */
+ CONNECTION_CONNECTED(0x0001),
+
+ /**
+ * [2] This flag tells the connection is encrypted.
+ */
+ CONNECTION_ENCRYPTED(0x0002),
+
+ /**
+ * [4] Connection completed flag, which is used to tell a new connection has been created.
+ */
+ CONNECTION_COMPLETED(0x0004),
+
+ /**
+ * [8] This flag tells that connection parameters have changed and. It is set when connection
+ * parameters have changed due to a link layer operation.
+ */
+ CONNECTION_PARAMETERS_CHANGE(0x0008);
+
+ /**
+ * A mapping between the integer code and its corresponding type to
+ * facilitate lookup by code.
+ */
+ private static Map
+ * GAP connectable modes
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ *
+ * @author Chris Jackson - Initial contribution of Java code generator
+ */
+public enum GapConnectableMode {
+ /**
+ * Default unknown value
+ */
+ UNKNOWN(-1),
+
+ /**
+ * [0] Not connectable
+ */
+ GAP_NON_CONNECTABLE(0x0000),
+
+ /**
+ * [1] Directed Connectable
+ */
+ GAP_DIRECTED_CONNECTABLE(0x0001),
+
+ /**
+ * [2] Undirected connectable
+ */
+ GAP_UNDIRECTED_CONNECTABLE(0x0002),
+
+ /**
+ * [3] Same as non-connectable, but also supports ADV_SCAN_IND packets. Device accepts scan
+ * requests (active scanning) but is not connectable.
+ */
+ GAP_SCANNABLE_NON_CONNECTABLE(0x0003);
+
+ /**
+ * A mapping between the integer code and its corresponding type to
+ * facilitate lookup by code.
+ */
+ private static Map
+ * GAP discover modes
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ *
+ * @author Chris Jackson - Initial contribution of Java code generator
+ */
+public enum GapDiscoverMode {
+ /**
+ * Default unknown value
+ */
+ UNKNOWN(-1),
+
+ /**
+ * [0] Discover only limited discoverable devices, that is, Slaves which have the LE Limited
+ * Discoverable Mode bit set in the AD type of their Flags advertisement packets.
+ */
+ GAP_DISCOVER_LIMITED(0x0000),
+
+ /**
+ * [1] Discover limited and generic discoverable devices, that is, Slaves which have the LE
+ * Limited Discoverable Mode LE General or the Discoverable Mode bit set in the AD type of their
+ * advertisement Flags packets.
+ */
+ GAP_DISCOVER_GENERIC(0x0001),
+
+ /**
+ * [2] Discover all devices regardless of the AD type, so also devices in Flags
+ * non-discoverable mode will be reported to host.
+ */
+ GAP_DISCOVER_OBSERVATION(0x0002),
+
+ /**
+ * [3] Same as gap_non_discoverable.
+ */
+ GAP_BROADCAST(0x0003),
+
+ /**
+ * [4] In this advertisement the advertisement and scan response data defined by user will be
+ * used. The user is responsible of building the advertisement data so that it also contains the
+ * appropriate desired Flags AD type.
+ */
+ GAP_USER_DATA(0x0004),
+
+ /**
+ * [128] When turning the most highest bit on in GAP discoverable mode, the remote devices that
+ * send scan request packets to the advertiser are reported back to the application through
+ * Scan Response event. This is so called Enhanced Broadcasting mode.
+ */
+ GAP_ENHANCED_BROADCASTING(0x0080);
+
+ /**
+ * A mapping between the integer code and its corresponding type to
+ * facilitate lookup by code.
+ */
+ private static Map
+ * GAP discoverable modes
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ *
+ * @author Chris Jackson - Initial contribution of Java code generator
+ */
+public enum GapDiscoverableMode {
+ /**
+ * Default unknown value
+ */
+ UNKNOWN(-1),
+
+ /**
+ * [0] Non-discoverable mode: the LE Limited Discoverable Mode and the LE General
+ * Discoverable Mode bits are NOT set in the AD Flags type. A master can still connect to the
+ * advertising slave in this mode.
+ */
+ GAP_NON_DISCOVERABLE(0x0000),
+
+ /**
+ * [1] Discoverable using limited scanning mode: the advertisement packets will carry the LE
+ * Limited Discoverable Mode bit set in the Flags AD type.
+ */
+ GAP_LIMITED_DISCOVERABLE(0x0001),
+
+ /**
+ * [2] Discoverable using general scanning mode: the advertisement packets will carry the LE
+ * General Discoverable Mode bit set in the Flags AD type.
+ */
+ GAP_GENERAL_DISCOVERABLE(0x0002),
+
+ /**
+ * [3] Same as gap_non_discoverable.
+ */
+ GAP_BROADCAST(0x0003),
+
+ /**
+ * [4] In this advertisement the advertisement and scan response data defined by user will be
+ * used. The user is responsible of building the advertisement data so that it also contains the
+ * appropriate desired Flags AD type.
+ */
+ GAP_USER_DATA(0x0004),
+
+ /**
+ * [128] When turning the most highest bit on in GAP discoverable mode, the remote devices that
+ * send scan request packets to the advertiser are reported back to the application through
+ * Scan Response event. This is so called Enhanced Broadcasting mode.
+ */
+ GAP_ENHANCED_BROADCASTING(0x0080);
+
+ /**
+ * A mapping between the integer code and its corresponding type to
+ * facilitate lookup by code.
+ */
+ private static Map
+ * Defines the packet types received during a scan response
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ *
+ * @author Chris Jackson - Initial contribution of Java code generator
+ */
+public enum ScanResponseType {
+ /**
+ * Default unknown value
+ */
+ UNKNOWN(-1),
+
+ /**
+ * [0] Connectable Advertisement packet
+ */
+ CONNECTABLE_ADVERTISEMENT(0x0000),
+
+ /**
+ * [2] Non Connectable Advertisement packet
+ */
+ NON_CONNECTABLE_ADVERTISEMENT(0x0002),
+
+ /**
+ * [4] Scan response packet
+ */
+ SCAN_RESPONSE(0x0004),
+
+ /**
+ * [6] Discoverable advertisement packet
+ */
+ DISCOVERABLE_ADVERTISEMENT(0x0006);
+
+ /**
+ * A mapping between the integer code and its corresponding type to
+ * facilitate lookup by code.
+ */
+ private static Map
+ * Security Manager I/O Capabilities
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ *
+ * @author Chris Jackson - Initial contribution of Java code generator
+ */
+public enum SmpIoCapabilities {
+ /**
+ * Default unknown value
+ */
+ UNKNOWN(-1),
+
+ /**
+ * [0] Display Only
+ */
+ SM_IO_CAPABILITY_DISPLAYONLY(0x0000),
+
+ /**
+ * [1] Display with Yes/No-buttons
+ */
+ SM_IO_CAPABILITY_DISPLAYYESNO(0x0001),
+
+ /**
+ * [2] Keyboard Only
+ */
+ SM_IO_CAPABILITY_KEYBOARDONLY(0x0002),
+
+ /**
+ * [3] No Input and No Output
+ */
+ SM_IO_CAPABILITY_NOINPUTNOOUTPUT(0x0003),
+
+ /**
+ * [4] Display with Keyboard
+ */
+ SM_IO_CAPABILITY_KEYBOARDDISPLAY(0x0004);
+
+ /**
+ * A mapping between the integer code and its corresponding type to
+ * facilitate lookup by code.
+ */
+ private static Map
+ * Scanning
+ * The API assumes that the adapter is "always" scanning to enable beacons to be received.
+ * The bridge must decide to enable and disable scanning as it needs. This design choice avoids interaction between
+ * higher layers where a binding may want to enable scanning while another needs to disable scanning for a specific
+ * function (e.g. to connect to a device). The bridge should disable scanning only for the period that is needed.
+ *
+ * @author Chris Jackson - Initial contribution
+ * @author Kai Kreuzer - renamed it, made it identifiable and added listener support
+ */
+@NonNullByDefault
+public interface BluetoothAdapter extends Identifiable
+ * Characteristics are defined attribute types that contain a single logical value.
+ *
+ * https://www.bluetooth.com/specifications/gatt/characteristics
+ *
+ * @author Chris Jackson - Initial contribution
+ * @author Kai Kreuzer - Cleaned up code
+ */
+public class BluetoothCharacteristic {
+ public static final int FORMAT_UINT8 = 0x11;
+ public static final int FORMAT_UINT16 = 0x12;
+ public static final int FORMAT_UINT32 = 0x14;
+ public static final int FORMAT_SINT8 = 0x21;
+ public static final int FORMAT_SINT16 = 0x22;
+ public static final int FORMAT_SINT32 = 0x24;
+ public static final int FORMAT_SFLOAT = 0x32;
+ public static final int FORMAT_FLOAT = 0x34;
+
+ public static final int PROPERTY_BROADCAST = 0x01;
+ public static final int PROPERTY_READ = 0x02;
+ public static final int PROPERTY_WRITE_NO_RESPONSE = 0x04;
+ public static final int PROPERTY_WRITE = 0x08;
+ public static final int PROPERTY_NOTIFY = 0x10;
+ public static final int PROPERTY_INDICATE = 0x20;
+ public static final int PROPERTY_SIGNED_WRITE = 0x40;
+ public static final int PROPERTY_EXTENDED_PROPS = 0x80;
+
+ public static final int PERMISSION_READ = 0x01;
+ public static final int PERMISSION_READ_ENCRYPTED = 0x02;
+ public static final int PERMISSION_READ_ENCRYPTED_MITM = 0x04;
+ public static final int PERMISSION_WRITE = 0x10;
+ public static final int PERMISSION_WRITE_ENCRYPTED = 0x20;
+ public static final int PERMISSION_WRITE_ENCRYPTED_MITM = 0x40;
+ public static final int PERMISSION_WRITE_SIGNED = 0x80;
+ public static final int PERMISSION_WRITE_SIGNED_MITM = 0x100;
+
+ public static final int WRITE_TYPE_DEFAULT = 0x02;
+ public static final int WRITE_TYPE_NO_RESPONSE = 0x01;
+ public static final int WRITE_TYPE_SIGNED = 0x04;
+
+ private final Logger logger = LoggerFactory.getLogger(BluetoothCharacteristic.class);
+
+ /**
+ * The {@link UUID} for this characteristic
+ */
+ protected UUID uuid;
+
+ /**
+ * The handle for this characteristic
+ */
+ protected int handle;
+
+ /**
+ * A map of {@link BluetoothDescriptor}s applicable to this characteristic
+ */
+ protected Map
+ * Descriptors are defined attributes that describe a characteristic value.
+ *
+ * https://www.bluetooth.com/specifications/gatt/descriptors
+ *
+ * @author Chris Jackson - Initial contribution
+ * @author Kai Kreuzer - added constructor and fixed setValue method
+ */
+public class BluetoothDescriptor {
+
+ protected final BluetoothCharacteristic characteristic;
+ protected final UUID uuid;
+ protected byte[] value;
+
+ /**
+ * The main constructor
+ *
+ * @param characteristic the characteristic that this class describes
+ * @param uuid the uuid of the descriptor
+ */
+ public BluetoothDescriptor(BluetoothCharacteristic characteristic, UUID uuid) {
+ this.characteristic = characteristic;
+ this.uuid = uuid;
+ }
+
+ /**
+ * Returns the characteristic this descriptor belongs to.
+ *
+ * @return
+ */
+ BluetoothCharacteristic getCharacteristic() {
+ return characteristic;
+
+ }
+
+ /**
+ * Returns the permissions for this descriptor.
+ *
+ * @return the permissions
+ */
+ public int getPermissions() {
+ return 0;
+ }
+
+ /**
+ * Returns the UUID of this descriptor.
+ *
+ * @return the UUID
+ */
+ public UUID getUuid() {
+ return uuid;
+
+ }
+
+ /**
+ * Returns the stored value for this descriptor. It doesn't read remote data.
+ *
+ * @return the value of the descriptor
+ */
+ public byte[] getValue() {
+ return value;
+ }
+
+ /**
+ * Sets the stored value for this descriptor. It doesn't update remote data.
+ *
+ * @param value the value for this descriptor instance
+ */
+ public void setValue(byte[] value) {
+ this.value = value;
+ }
+
+ public GattDescriptor getDescriptor() {
+ return GattDescriptor.getDescriptor(uuid);
+ }
+
+ public enum GattDescriptor {
+ // Descriptors
+ CHARACTERISTIC_EXTENDED_PROPERTIES(0x2900),
+ CHARACTERISTIC_USER_DESCRIPTION(0x2901),
+ CLIENT_CHARACTERISTIC_CONFIGURATION(0x2902),
+ SERVER_CHARACTERISTIC_CONFIGURATION(0x2903),
+ CHARACTERISTIC_PRESENTATION_FORMAT(0x2904),
+ CHARACTERISTIC_AGGREGATE_FORMAT(0x2905),
+ VALID_RANGE(0x2906),
+ EXTERNAL_REPORT_REFERENCE(0x2907),
+ REPORT_REFERENCE(0x2908),
+ NUMBER_OF_DIGITALS(0x2909),
+ TRIGGER_SETTING(0x290A);
+
+ private static Map
+ * Uses the devices long name if known, otherwise the short name if known
+ */
+ protected String name;
+
+ /**
+ * List of supported services
+ */
+ protected final Map
+ * If the device is already connected, this will return false.
+ *
+ * @return true if the connection process is started successfully
+ */
+ public boolean connect() {
+ return false;
+ }
+
+ /**
+ * Disconnects from a device. Once the connection state is updated, the
+ * {@link BluetoothDeviceListener.onConnectionState}
+ * method will be called with the connection state.
+ *
+ * If the device is not currently connected, this will return false.
+ *
+ * @return true if the disconnection process is started successfully
+ */
+ public boolean disconnect() {
+ return false;
+ }
+
+ /**
+ * Starts a discovery on a device. This will iterate through all services and characteristics to build up a view of
+ * the device.
+ *
+ * This method should be called before attempting to read or write characteristics.
+ *
+ * @return true if the discovery process is started successfully
+ */
+ public boolean discoverServices() {
+ return false;
+ }
+
+ /**
+ * Gets a Bluetooth characteristic if it is known.
+ *
+ * Note that this method will not search for a characteristic in the remote device if it is not known.
+ * You must have previously connected to the device so that the device services and characteristics can
+ * be retrieved.
+ *
+ * @param uuid the {@link UUID} of the characteristic to return
+ * @return the {@link BluetoothCharacteristic} or null if the characteristic is not found in the device
+ */
+ public BluetoothCharacteristic getCharacteristic(UUID uuid) {
+ for (BluetoothService service : supportedServices.values()) {
+ if (service.providesCharacteristic(uuid)) {
+ return service.getCharacteristic(uuid);
+ }
+ }
+ return null;
+ }
+
+ /**
+ * Reads a characteristic. Only a single read or write operation can be requested at once. Attempting to perform an
+ * operation when one is already in progress will result in subsequent calls returning false.
+ *
+ * This is an asynchronous method. Once the read is complete
+ * {@link BluetoothDeviceListener.onCharacteristicReadComplete}
+ * method will be called with the completion state.
+ *
+ * Note that {@link BluetoothDeviceListener.onCharacteristicUpdate} will be called when the read value is received.
+ *
+ * @param characteristic the {@link BluetoothCharacteristic} to read.
+ * @return true if the characteristic read is started successfully
+ */
+ public boolean readCharacteristic(BluetoothCharacteristic characteristic) {
+ return false;
+ }
+
+ /**
+ * Writes a characteristic. Only a single read or write operation can be requested at once. Attempting to perform an
+ * operation when one is already in progress will result in subsequent calls returning false.
+ *
+ * This is an asynchronous method. Once the write is complete
+ * {@link BluetoothDeviceListener.onCharacteristicWriteComplete} method will be called with the completion state.
+ *
+ * @param characteristic the {@link BluetoothCharacteristic} to read.
+ * @return true if the characteristic write is started successfully
+ */
+ public boolean writeCharacteristic(BluetoothCharacteristic characteristic) {
+ return false;
+ }
+
+ /**
+ * Enables notifications for a characteristic. Only a single read or write operation can be requested at once.
+ * Attempting to perform an operation when one is already in progress will result in subsequent calls returning
+ * false.
+ *
+ * Notifications result in CHARACTERISTIC_UPDATED events to the listeners.
+ *
+ * @param characteristic the {@link BluetoothCharacteristic} to receive notifications for.
+ * @return true if the characteristic notification is started successfully
+ */
+ public boolean enableNotifications(BluetoothCharacteristic characteristic) {
+ return false;
+ }
+
+ /**
+ * Disables notifications for a characteristic. Only a single read or write operation can be requested at once.
+ * Attempting to perform an operation when one is already in progress will result in subsequent calls returning
+ * false.
+ *
+ * @param characteristic the {@link BluetoothCharacteristic} to disable notifications for.
+ * @return true if the characteristic notification is stopped successfully
+ */
+ public boolean disableNotifications(BluetoothCharacteristic characteristic) {
+ return false;
+ }
+
+ /**
+ * Enables notifications for a descriptor. Only a single read or write operation can be requested at once.
+ * Attempting to perform an operation when one is already in progress will result in subsequent calls returning
+ * false.
+ *
+ * Notifications result in DESCRIPTOR_UPDATED events to the listeners.
+ *
+ * @param descriptor the {@link BluetoothDescriptor} to receive notifications for.
+ * @return true if the descriptor notification is started successfully
+ */
+ public boolean enableNotifications(BluetoothDescriptor descriptor) {
+ return false;
+ }
+
+ /**
+ * Disables notifications for a descriptor. Only a single read or write operation can be requested at once.
+ * Attempting to perform an operation when one is already in progress will result in subsequent calls returning
+ * false.
+ *
+ * @param descriptor the {@link BluetoothDescriptor} to disable notifications for.
+ * @return true if the descriptor notification is stopped successfully
+ */
+ public boolean disableNotifications(BluetoothDescriptor descriptor) {
+ return false;
+ }
+
+ /**
+ * Adds a service to the device.
+ *
+ * @param service the new {@link BluetoothService} to add
+ * @return true if the service was added or false if the service was already supported
+ */
+ protected boolean addService(BluetoothService service) {
+ if (supportedServices.containsKey(service.getUuid())) {
+ return false;
+ }
+ logger.trace("Adding new service to device {}: {}", address, service);
+ supportedServices.put(service.getUuid(), service);
+ return true;
+ }
+
+ /**
+ * Adds a list of services to the device
+ *
+ * @param uuids
+ */
+ protected void addServices(List
+ * Services are collections of characteristics and relationships to other services that encapsulate the behavior of part
+ * of a device.
+ *
+ * https://www.bluetooth.com/specifications/gatt/services
+ *
+ * @author Chris Jackson - Initial contribution
+ * @author Kai Kreuzer - Cleaned up code
+ */
+public class BluetoothService {
+
+ // The service UUID
+ private final UUID uuid;
+
+ /**
+ * The start handle for this service
+ */
+ private final int handleStart;
+
+ /**
+ * The end handle for this service
+ */
+ private final int handleEnd;
+
+ protected int instanceId;
+
+ /**
+ * Indicates if this is a primary service (true) or secondary service (false)
+ */
+ protected boolean primaryService;
+
+ /**
+ * Map of {@link BluetoothCharacteristic}s supported in this service
+ */
+ protected final Mapnull
, if device is not
+ * supported by this participant
+ */
+ @Nullable
+ public DiscoveryResult createResult(BluetoothDevice device);
+
+ /**
+ * Returns the thing UID for a Bluetooth device
+ *
+ * @param device the Bluetooth device
+ *
+ * @return a thing UID or null
, if the device is not supported by this participant
+ */
+ @Nullable
+ public ThingUID getThingUID(BluetoothDevice device);
+}
diff --git a/extensions/binding/org.eclipse.smarthome.binding.bluetooth/src/main/java/org/eclipse/smarthome/binding/bluetooth/discovery/internal/BluetoothDiscoveryService.java b/extensions/binding/org.eclipse.smarthome.binding.bluetooth/src/main/java/org/eclipse/smarthome/binding/bluetooth/discovery/internal/BluetoothDiscoveryService.java
new file mode 100644
index 00000000000..b153ae78d7f
--- /dev/null
+++ b/extensions/binding/org.eclipse.smarthome.binding.bluetooth/src/main/java/org/eclipse/smarthome/binding/bluetooth/discovery/internal/BluetoothDiscoveryService.java
@@ -0,0 +1,182 @@
+/**
+ * Copyright (c) 2014,2018 Contributors to the Eclipse Foundation
+ *
+ * See the NOTICE file(s) distributed with this work for additional
+ * information regarding copyright ownership.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ */
+package org.eclipse.smarthome.binding.bluetooth.discovery.internal;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Set;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.CopyOnWriteArraySet;
+
+import org.eclipse.smarthome.binding.bluetooth.BluetoothAdapter;
+import org.eclipse.smarthome.binding.bluetooth.BluetoothBindingConstants;
+import org.eclipse.smarthome.binding.bluetooth.BluetoothCompanyIdentifiers;
+import org.eclipse.smarthome.binding.bluetooth.BluetoothDevice;
+import org.eclipse.smarthome.binding.bluetooth.BluetoothDiscoveryListener;
+import org.eclipse.smarthome.binding.bluetooth.discovery.BluetoothDiscoveryParticipant;
+import org.eclipse.smarthome.config.discovery.AbstractDiscoveryService;
+import org.eclipse.smarthome.config.discovery.DiscoveryResult;
+import org.eclipse.smarthome.config.discovery.DiscoveryResultBuilder;
+import org.eclipse.smarthome.config.discovery.DiscoveryService;
+import org.eclipse.smarthome.core.thing.Thing;
+import org.eclipse.smarthome.core.thing.ThingTypeUID;
+import org.eclipse.smarthome.core.thing.ThingUID;
+import org.eclipse.smarthome.core.thing.UID;
+import org.osgi.service.component.annotations.Activate;
+import org.osgi.service.component.annotations.Component;
+import org.osgi.service.component.annotations.Deactivate;
+import org.osgi.service.component.annotations.Modified;
+import org.osgi.service.component.annotations.Reference;
+import org.osgi.service.component.annotations.ReferenceCardinality;
+import org.osgi.service.component.annotations.ReferencePolicy;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * The {@link BluetoothDiscoveryService} handles searching for BLE devices.
+ *
+ * @author Chris Jackson - Initial Contribution
+ * @author Kai Kreuzer - Introduced BluetoothAdapters and BluetoothDiscoveryParticipants
+ *
+ */
+@Component(immediate = true, service = DiscoveryService.class, configurationPid = "discovery.bluetooth")
+public class BluetoothDiscoveryService extends AbstractDiscoveryService {
+
+ private final Logger logger = LoggerFactory.getLogger(BluetoothDiscoveryService.class);
+
+ private final static int SEARCH_TIME = 15;
+
+ private final Set