2 * Copyright (c) 2010-2023 Contributors to the openHAB project
4 * See the NOTICE file(s) distributed with this work for additional
7 * This program and the accompanying materials are made available under the
8 * terms of the Eclipse Public License 2.0 which is available at
9 * http://www.eclipse.org/legal/epl-2.0
11 * SPDX-License-Identifier: EPL-2.0
13 package org.openhab.binding.bluetooth;
15 import java.util.UUID;
17 import org.eclipse.jdt.annotation.NonNullByDefault;
18 import org.openhab.core.thing.ThingTypeUID;
21 * The {@link BluetoothBindingConstants} class defines common constants, which are
22 * used across the whole binding.
24 * @author Chris Jackson - Initial contribution
25 * @author Kai Kreuzer - refactoring and extension
28 public class BluetoothBindingConstants {
30 public static final String BINDING_ID = "bluetooth";
32 // List of all Thing Type UIDs
33 public static final ThingTypeUID THING_TYPE_BEACON = new ThingTypeUID(BINDING_ID, "beacon");
35 // List of all Channel Type IDs
36 public static final String CHANNEL_TYPE_RSSI = "rssi";
37 public static final String CHANNEL_TYPE_ADAPTER = "adapterUID";
38 public static final String CHANNEL_TYPE_ADAPTER_LOCATION = "adapterLocation";
40 public static final String PROPERTY_TXPOWER = "txpower";
41 public static final String PROPERTY_MAXCONNECTIONS = "maxconnections";
42 public static final String PROPERTY_SOFTWARE_VERSION = "softwareVersion";
44 public static final String CONFIGURATION_ADDRESS = "address";
45 public static final String CONFIGURATION_DISCOVERY = "backgroundDiscovery";
46 public static final String CONFIGURATION_ALWAYS_CONNECTED = "alwaysConnected";
47 public static final String CONFIGURATION_IDLE_DISCONNECT_DELAY = "idleDisconnectDelay";
49 public static final long BLUETOOTH_BASE_UUID = 0x800000805f9b34fbL;
51 public static UUID createBluetoothUUID(long uuid16) {
52 return new UUID((uuid16 << 32) | 0x1000, BluetoothBindingConstants.BLUETOOTH_BASE_UUID);
55 // Bluetooth profile UUID definitions
56 public static final UUID PROFILE_GATT = createBluetoothUUID(0x1801);
57 public static final UUID PROFILE_A2DP_SOURCE = createBluetoothUUID(0x110a);
58 public static final UUID PROFILE_A2DP_SINK = createBluetoothUUID(0x110b);
59 public static final UUID PROFILE_A2DP = createBluetoothUUID(0x110d);
60 public static final UUID PROFILE_AVRCP_REMOTE = createBluetoothUUID(0x110c);
61 public static final UUID PROFILE_CORDLESS_TELEPHONE = createBluetoothUUID(0x1109);
62 public static final UUID PROFILE_DID_PNPINFO = createBluetoothUUID(0x1200);
63 public static final UUID PROFILE_HEADSET = createBluetoothUUID(0x1108);
64 public static final UUID PROFILE_HFP = createBluetoothUUID(0x111e);
65 public static final UUID PROFILE_HFP_AUDIOGATEWAY = createBluetoothUUID(0x111f);
67 public static final UUID ATTR_CHARACTERISTIC_DECLARATION = createBluetoothUUID(0x2803);