• 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 int AA_START_SCAN = 1;
41     public static final int AA_SCAN_SUCCESS = 2;
42     public static final int AA_SCAN_FAILURE = 3;
43     public static final int AA_SCAN_TIMEOUT = 4;
44     // timeout for internal scan
45     public static final int AA_SCAN_TIMEOUT_MS = 1000;
46     public static final int INVALID_SYNC_HANDLE = -1;
47     public static final int INVALID_ADV_SID = -1;
48     public static final int INVALID_ADV_ADDRESS_TYPE = -1;
49     public static final int INVALID_ADV_INTERVAL = -1;
50     public static final int INVALID_BROADCAST_ID = -1;
51     public static final int BROADCAST_ASSIST_ADDRESS_TYPE_PUBLIC = 0;
52     public static final int INVALID_SOURCE_ID = -1;
53     public static final int ADV_ADDRESS_DONT_MATCHES_EXT_ADV_ADDRESS = 0x00000001;
54     public static final int ADV_ADDRESS_DONT_MATCHES_SOURCE_ADV_ADDRESS = 0x00000002;
55     // types of command for select and add Broadcast source operations
56     public static final int AUTO = 1;
57     public static final int USER = 2;
58     public static final int BASS_MAX_BYTES = 100;
59     // broadcast receiver state indices
60     public static final int BCAST_RCVR_STATE_SRC_ID_IDX = 0;
61     public static final int BCAST_RCVR_STATE_SRC_ADDR_TYPE_IDX = 1;
62     public static final int BCAST_RCVR_STATE_SRC_ADDR_START_IDX = 2;
63     public static final int BCAST_RCVR_STATE_SRC_BCAST_ID_START_IDX = 9;
64     public static final int BCAST_RCVR_STATE_SRC_ADDR_SIZE = 6;
65     public static final int BCAST_RCVR_STATE_SRC_ADV_SID_IDX = 8;
66     public static final int BCAST_RCVR_STATE_PA_SYNC_IDX = 12;
67     public static final int BCAST_RCVR_STATE_ENC_STATUS_IDX = 13;
68     public static final int BCAST_RCVR_STATE_BADCODE_START_IDX = 14;
69     public static final int BCAST_RCVR_STATE_BADCODE_SIZE = 16;
70     public static final int BCAST_RCVR_STATE_BIS_SYNC_SIZE = 4;
71     // 30 secs time out for all gatt writes
72     public static final int GATT_TXN_TIMEOUT_MS = 30000;
73     // 3 min time out for keeping PSYNC active
74     public static final int PSYNC_ACTIVE_TIMEOUT_MS = 3 * 60000;
75     // 2 secs time out achieving psync
76     public static final int PSYNC_TIMEOUT = 200;
77     public static final int PIN_CODE_CMD_LEN = 18;
78     public static final int CONNECT_TIMEOUT_MS = 30000;
79 }
80