1 /* 2 * Copyright (C) 2021-2022 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 GATT_SERVICE_OVER_BREDR_H 17 #define GATT_SERVICE_OVER_BREDR_H 18 19 #include <cstdint> 20 #include "base_def.h" 21 22 namespace OHOS { 23 namespace bluetooth { 24 class GattServiceOverBredrInterface { 25 public: 26 virtual int RegisterSDP(uint16_t startHandle, uint16_t endHandle) = 0; 27 virtual void DeregisterSDP() = 0; 28 ~GattServiceOverBredrInterface()29 virtual ~GattServiceOverBredrInterface() {} 30 }; 31 32 class GattServiceOverBredr : public GattServiceOverBredrInterface { 33 public: GattServiceOverBredr()34 GattServiceOverBredr() {} ~GattServiceOverBredr()35 ~GattServiceOverBredr() {} 36 37 int RegisterSDP(uint16_t startHandle, uint16_t endHandle) override; 38 void DeregisterSDP() override; 39 40 BT_DISALLOW_COPY_AND_ASSIGN(GattServiceOverBredr); 41 private: 42 uint32_t sdpHandle_ = 0; 43 int SdpAddServiceClassIdList() const; 44 int SdpAddProtocol(uint16_t startHandle, uint16_t endHandle) const; 45 int SdpAddBrowseGroupList() const; 46 }; 47 } // namespace bluetooth 48 } // namespace OHOS 49 50 #endif // GATT_SERVICE_OVER_BREDR_H