1 /* 2 * Copyright (C) 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 OPP_GAP_SERVER_H 17 #define OPP_GAP_SERVER_H 18 19 #include <cstdint> 20 21 namespace OHOS { 22 namespace bluetooth { 23 class OppGapServer { 24 public: 25 /** 26 * @brief constructor 27 * @details constructor 28 * @param rfcommScn rfcomm channel 29 * @param l2capPsm l2cat psm 30 * @return 31 */ 32 OppGapServer(uint8_t rfcommScn, uint16_t l2capPsm); 33 34 /** 35 * @brief deconstructor 36 * @details deconstructor 37 * @return 38 */ 39 virtual ~OppGapServer() = default; 40 41 /** 42 * @brief register gap 43 * @details register gap service 44 * @return int @c 0 success 45 * @c not 0 failure 46 */ 47 int Register() const; 48 49 /** 50 * @brief deregister gap 51 * @details deregister gap service 52 */ 53 void Deregister() const; 54 55 private: 56 uint8_t rfcommScn_ = 0; // rfcomm channel 57 uint16_t l2capPsm_ = 0; // l2cap psm 58 }; 59 } // namespace bluetooth 60 } // namespace OHOS 61 #endif // OPP_GAP_SERVER_H 62