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_BASED_SERVICES_MANAGER_H 17 #define GATT_BASED_SERVICES_MANAGER_H 18 19 #include <memory> 20 #include "base_def.h" 21 #include "dis/device_information_service.h" 22 #include "dispatcher.h" 23 #include "gas/generic_access_service.h" 24 #include "gatts/generic_attribute_service.h" 25 26 namespace OHOS { 27 namespace bluetooth { 28 class GattBasedServicesManager { 29 public: 30 GattBasedServicesManager(GattServerService &server, utility::Dispatcher &dispatcher); 31 32 int Enable() const; 33 void Disable() const; 34 35 ~GattBasedServicesManager(); 36 37 BT_DISALLOW_COPY_AND_ASSIGN(GattBasedServicesManager); 38 39 private: 40 std::unique_ptr<GenericAccessService> gas_ = {nullptr}; 41 std::unique_ptr<DeviceInformationService> dis_ = {nullptr}; 42 std::unique_ptr<GenericAttributeService> gatts_ = {nullptr}; 43 }; 44 } // namespace bluetooth 45 } // namespace OHOS 46 47 #endif // GATT_BASED_SERVICES_MANAGER_H