]> git.basschouten.com Git - openhab-addons.git/blob
8cb1fa66626c4527a4dbc9647fde42ed8715d991
[openhab-addons.git] /
1 /**
2  * Copyright (c) 2010-2023 Contributors to the openHAB project
3  *
4  * See the NOTICE file(s) distributed with this work for additional
5  * information.
6  *
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
10  *
11  * SPDX-License-Identifier: EPL-2.0
12  */
13 package org.openhab.binding.bluetooth;
14
15 import java.util.UUID;
16
17 import org.eclipse.jdt.annotation.NonNullByDefault;
18 import org.openhab.core.thing.ThingTypeUID;
19
20 /**
21  * The {@link BluetoothBindingConstants} class defines common constants, which are
22  * used across the whole binding.
23  *
24  * @author Chris Jackson - Initial contribution
25  * @author Kai Kreuzer - refactoring and extension
26  */
27 @NonNullByDefault
28 public class BluetoothBindingConstants {
29
30     public static final String BINDING_ID = "bluetooth";
31
32     // List of all Thing Type UIDs
33     public static final ThingTypeUID THING_TYPE_BEACON = new ThingTypeUID(BINDING_ID, "beacon");
34
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";
39
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";
43
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";
48
49     public static final long BLUETOOTH_BASE_UUID = 0x800000805f9b34fbL;
50
51     public static UUID createBluetoothUUID(long uuid16) {
52         return new UUID((uuid16 << 32) | 0x1000, BluetoothBindingConstants.BLUETOOTH_BASE_UUID);
53     }
54
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);
66
67     public static final UUID ATTR_CHARACTERISTIC_DECLARATION = createBluetoothUUID(0x2803);
68 }