• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2025 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.mcp;
18 
19 import android.bluetooth.BluetoothGattCharacteristic;
20 import android.bluetooth.BluetoothGattDescriptor;
21 
22 import com.google.protobuf.ByteString;
23 
GattOpContext( Operation operation, int requestId, BluetoothGattCharacteristic characteristic, BluetoothGattDescriptor descriptor, boolean preparedWrite, boolean responseNeeded, int offset, ByteString value)24 public record GattOpContext(
25         Operation operation,
26         int requestId,
27         BluetoothGattCharacteristic characteristic,
28         BluetoothGattDescriptor descriptor,
29         boolean preparedWrite,
30         boolean responseNeeded,
31         int offset,
32         ByteString value) {
33     public enum Operation {
34         READ_CHARACTERISTIC,
35         WRITE_CHARACTERISTIC,
36         READ_DESCRIPTOR,
37         WRITE_DESCRIPTOR,
38     }
39 
40     public GattOpContext(
41             Operation operation,
42             int requestId,
43             BluetoothGattCharacteristic characteristic,
44             BluetoothGattDescriptor descriptor,
45             int offset) {
46         this(operation, requestId, characteristic, descriptor, false, false, offset, null);
47     }
48 }
49