* Copyright (C) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef OHOS_BLUETOOTH_STANDARD_GATT_CLIENT_SERVER_H
#define OHOS_BLUETOOTH_STANDARD_GATT_CLIENT_SERVER_H
#include <map>
#include "bluetooth_gatt_client_stub.h"
#include "bluetooth_types.h"
#include "if_system_ability_manager.h"
#include "iservice_registry.h"
#include "system_ability.h"
namespace OHOS {
namespace Bluetooth {
class BluetoothGattClientServer : public BluetoothGattClientStub {
public:
explicit BluetoothGattClientServer();
~BluetoothGattClientServer() override;
int RegisterApplication(const sptr<IBluetoothGattClientCallback> &callback, const BluetoothRawAddress &addr,
int32_t transport, int &appId) override;
int RegisterApplication(const sptr<IBluetoothGattClientCallback> &callback, const BluetoothRawAddress &addr,
int32_t transport) override;
int DeregisterApplication(int32_t appId) override;
int Connect(int32_t appId, bool autoConnect) override;
int Disconnect(int32_t appId) override;
int DiscoveryServices(int32_t appId) override;
int ReadCharacteristic(int32_t appId, const BluetoothGattCharacteristic &characteristic) override;
int WriteCharacteristic(int32_t appId, BluetoothGattCharacteristic *characteristic, bool withoutRespond,
bool isWithContext) override;
int SignedWriteCharacteristic(int32_t appId, BluetoothGattCharacteristic *characteristic) override;
int ReadDescriptor(int32_t appId, const BluetoothGattDescriptor &descriptor) override;
int WriteDescriptor(int32_t appId, BluetoothGattDescriptor *descriptor) override;
int RequestExchangeMtu(int32_t appId, int32_t mtu) override;
void GetAllDevice(::std::vector<BluetoothGattDevice> &device) override;
int RequestConnectionPriority(int32_t appId, int32_t connPriority) override;
int GetServices(int32_t appId, ::std::vector<BluetoothGattService> &service) override;
int RequestFastestConn(const BluetoothRawAddress &addr) override;
int ReadRemoteRssiValue(int32_t appId) override;
int RequestNotification(int32_t appId, uint16_t characterHandle, bool enable) override;
int GetConnectedState(const std::string &deviceId, int &state) override;
int SetPhy(int32_t appId, int32_t txPhy, int32_t rxPhy, int32_t phyOptions) override;
int ReadPhy(int32_t appId) override;
int ReadCharacteristicByUuid(int32_t appId, const std::string &uuid,
int32_t startHandle, int32_t endHandle) override;
private:
BLUETOOTH_DISALLOW_COPY_AND_ASSIGN(BluetoothGattClientServer);
BLUETOOTH_DECLARE_IMPL();
};
}
}
#endif