• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright 2022 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 package com.android.bluetooth.bass_client;
18 
19 import android.os.ParcelUuid;
20 
21 import java.util.UUID;
22 
23 /**
24  * Broadcast Audio Scan Service constants class
25  */
26 public class BassConstants {
27     public static final boolean BASS_DBG = true;
28     public static final ParcelUuid BAAS_UUID =
29             ParcelUuid.fromString("00001852-0000-1000-8000-00805F9B34FB");
30     public static final UUID BASS_UUID =
31             UUID.fromString("0000184F-0000-1000-8000-00805F9B34FB");
32     public static final UUID BASS_BCAST_AUDIO_SCAN_CTRL_POINT =
33             UUID.fromString("00002BC7-0000-1000-8000-00805F9B34FB");
34     public static final UUID BASS_BCAST_RECEIVER_STATE =
35             UUID.fromString("00002BC8-0000-1000-8000-00805F9B34FB");
36     public static final UUID CLIENT_CHARACTERISTIC_CONFIG =
37             UUID.fromString("00002902-0000-1000-8000-00805f9b34fb");
38     public static final ParcelUuid BASIC_AUDIO_UUID =
39             ParcelUuid.fromString("00001851-0000-1000-8000-00805F9B34FB");
40     public static final ParcelUuid PUBLIC_BROADCAST_UUID =
41             ParcelUuid.fromString("00001856-0000-1000-8000-00805F9B34FB");
42 
43     public static final int INVALID_SYNC_HANDLE = -1;
44     public static final int INVALID_ADV_SID = -1;
45     public static final int INVALID_ADV_ADDRESS_TYPE = -1;
46     public static final int INVALID_ADV_INTERVAL = -1;
47     public static final int INVALID_BROADCAST_ID = -1;
48     public static final int BROADCAST_ASSIST_ADDRESS_TYPE_PUBLIC = 0;
49     public static final int INVALID_SOURCE_ID = -1;
50     public static final int ADV_ADDRESS_DONT_MATCHES_EXT_ADV_ADDRESS = 0x00000001;
51     public static final int ADV_ADDRESS_DONT_MATCHES_SOURCE_ADV_ADDRESS = 0x00000002;
52     // types of command for select and add Broadcast source operations
53     public static final int AUTO = 1;
54     public static final int USER = 2;
55     public static final int BASS_MAX_BYTES = 100;
56     // broadcast receiver state indices
57     public static final int BCAST_RCVR_STATE_SRC_ID_IDX = 0;
58     public static final int BCAST_RCVR_STATE_SRC_ADDR_TYPE_IDX = 1;
59     public static final int BCAST_RCVR_STATE_SRC_ADDR_START_IDX = 2;
60     public static final int BCAST_RCVR_STATE_SRC_BCAST_ID_START_IDX = 9;
61     public static final int BCAST_RCVR_STATE_SRC_ADDR_SIZE = 6;
62     public static final int BCAST_RCVR_STATE_SRC_ADV_SID_IDX = 8;
63     public static final int BCAST_RCVR_STATE_PA_SYNC_IDX = 12;
64     public static final int BCAST_RCVR_STATE_ENC_STATUS_IDX = 13;
65     public static final int BCAST_RCVR_STATE_BADCODE_START_IDX = 14;
66     public static final int BCAST_RCVR_STATE_BADCODE_SIZE = 16;
67     public static final int BCAST_RCVR_STATE_BIS_SYNC_SIZE = 4;
68     // 30 secs time out for all gatt writes
69     public static final int GATT_TXN_TIMEOUT_MS = 30000;
70     // 3 min time out for keeping PSYNC active
71     public static final int PSYNC_ACTIVE_TIMEOUT_MS = 3 * 60000;
72     // 2 secs time out achieving psync
73     public static final int PSYNC_TIMEOUT = 200;
74     public static final int PIN_CODE_CMD_LEN = 18;
75     public static final int CONNECT_TIMEOUT_MS = 30000;
76     // broadcast name AD type and length
77     public static final int BCAST_NAME_AD_TYPE = 0x30;
78     public static final int BCAST_NAME_LEN_MIN = 4;
79     public static final int BCAST_NAME_LEN_MAX = 32;
80 }
81