• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 
2 /*
3  * Copyright (C) 2021 Huawei Device Co., Ltd.
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 #ifndef OHOS_BLUETOOTH_STANDARD_GATT_SERVER_INTERFACE_H
17 #define OHOS_BLUETOOTH_STANDARD_GATT_SERVER_INTERFACE_H
18 
19 #include "bluetooth_service_ipc_interface_code.h"
20 #include "i_bluetooth_gatt_server_callback.h"
21 #include "iremote_broker.h"
22 #include "../parcel/bluetooth_gatt_characteristic_parcel.h"
23 #include "../parcel/bluetooth_gatt_descriptor_parcel.h"
24 #include "../parcel/bluetooth_gatt_device.h"
25 #include "../parcel/bluetooth_gatt_service_parcel.h"
26 #include "gatt_data.h"
27 namespace OHOS {
28 namespace Bluetooth {
29 class IBluetoothGattServer : public OHOS::IRemoteBroker {
30 public:
31     DECLARE_INTERFACE_DESCRIPTOR(u"ohos.ipc.IBluetoothGattServer");
32 
33     virtual int AddService(int32_t appId, BluetoothGattService *services) = 0;
34     virtual void ClearServices(int appId) = 0;
35     virtual int RegisterApplication(const sptr<IBluetoothGattServerCallback> &callback) = 0;
36     virtual int DeregisterApplication(int appId) = 0;
37     virtual void CancelConnection(const BluetoothGattDevice &device) = 0;
38     virtual int NotifyClient(
39         const BluetoothGattDevice &device, BluetoothGattCharacteristic *characteristic, bool needConfirm) = 0;
40     virtual int RemoveService(int32_t appId, const BluetoothGattService &services) = 0;
41     virtual int RespondCharacteristicRead(
42         const BluetoothGattDevice &device, BluetoothGattCharacteristic *characteristic, int32_t ret) = 0;
43     virtual int RespondCharacteristicWrite(
44         const BluetoothGattDevice &device, const BluetoothGattCharacteristic &characteristic, int32_t ret) = 0;
45     virtual int RespondDescriptorRead(
46         const BluetoothGattDevice &device, BluetoothGattDescriptor *descriptor, int32_t ret) = 0;
47     virtual int RespondDescriptorWrite(
48         const BluetoothGattDevice &device, const BluetoothGattDescriptor &descriptor, int32_t ret) = 0;
49 };
50 }  // namespace Bluetooth
51 }  // namespace OHOS
52 
53 #endif  // OHOS_BLUETOOTH_STANDARD_GATT_SERVER_INTERFACE_H
54