• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2021 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 #ifndef OHOS_BLUETOOTH_STANDARD_GATT_SERVER_PROXY_H
17 #define OHOS_BLUETOOTH_STANDARD_GATT_SERVER_PROXY_H
18 
19 #include "iremote_proxy.h"
20 #include "i_bluetooth_host.h"
21 #include "i_bluetooth_gatt_server.h"
22 namespace OHOS {
23 namespace Bluetooth {
24 class BluetoothGattServerProxy : public IRemoteProxy<IBluetoothGattServer> {
25 public:
BluetoothGattServerProxy(const sptr<IRemoteObject> & impl)26     explicit BluetoothGattServerProxy(const sptr<IRemoteObject> &impl) : IRemoteProxy<IBluetoothGattServer>(impl){};
~BluetoothGattServerProxy()27     ~BluetoothGattServerProxy(){};
28 
29     int AddService(int32_t appId, BluetoothGattService *services) override;
30     void ClearServices(int appId) override;
31     void CancelConnection(const BluetoothGattDevice &device) override;
32     int RegisterApplication(const sptr<IBluetoothGattServerCallback> &callback) override;
33     int DeregisterApplication(int appId) override;
34     int NotifyClient(
35         const BluetoothGattDevice &device, BluetoothGattCharacteristic *characteristic, bool needConfirm) override;
36     int RemoveService(int32_t appId, const BluetoothGattService &services) override;
37     int RespondCharacteristicRead(
38         const BluetoothGattDevice &device, BluetoothGattCharacteristic *characteristic, int32_t ret) override;
39     int RespondCharacteristicWrite(
40         const BluetoothGattDevice &device, const BluetoothGattCharacteristic &characteristic, int32_t ret) override;
41     int RespondDescriptorRead(
42         const BluetoothGattDevice &device, BluetoothGattDescriptor *descriptor, int32_t ret) override;
43     int RespondDescriptorWrite(
44         const BluetoothGattDevice &device, const BluetoothGattDescriptor &descriptor, int32_t ret) override;
45 
46 private:
47     static inline BrokerDelegator<BluetoothGattServerProxy> delegator_;
48 };
49 }  // namespace Bluetooth
50 }  // namespace OHOS
51 #endif  // OHOS_BLUETOOTH_STANDARD_HOST_PROXY_H