1 /* 2 * Copyright (C) 2024 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 TELEPHONY_CLIENT_SESSION_H 17 #define TELEPHONY_CLIENT_SESSION_H 18 19 #include "session_adapter.h" 20 21 namespace OHOS { 22 namespace Telephony { 23 class ClientSession : public SessionAdapter { 24 public: ClientSession(const std::shared_ptr<ISessionCallback> & callback)25 explicit ClientSession(const std::shared_ptr<ISessionCallback> &callback) : SessionAdapter(callback) {} 26 ~ClientSession() override; Create(const std::string & localName,const int32_t & qosMinBw)27 void Create(const std::string &localName, const int32_t &qosMinBw) override {} Destroy()28 void Destroy() override {} 29 void Connect(const std::string &peerDevId, const std::string &localName, const std::string &peerName, 30 const int32_t &qosMinBw) override; 31 void Disconnect() override; 32 void OnSessionBind(int32_t socket) override; 33 void OnSessionShutdown(int32_t socket) override; 34 35 private: 36 int32_t CreateSocket(const std::string &peerDevId, const std::string &localName, const std::string &peerName); 37 38 private: 39 int32_t clientSocket_{INVALID_SOCKET_ID}; 40 }; 41 42 } // namespace Telephony 43 } // namespace OHOS 44 45 #endif // TELEPHONY_CLIENT_SESSION_H 46