1 /* 2 * Copyright (c) 2021-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 17 #ifndef INTERFACES_INNERKITS_FRAME_SERVER_PROXY_STANDARD_H_ 18 #define INTERFACES_INNERKITS_FRAME_SERVER_PROXY_STANDARD_H_ 19 20 #include "if_softbus_server.h" 21 22 namespace OHOS { 23 class SoftBusServerProxyFrame : public IRemoteProxy<ISoftBusServer> { 24 public: SoftBusServerProxyFrame(const sptr<IRemoteObject> & impl)25 explicit SoftBusServerProxyFrame(const sptr<IRemoteObject> &impl) 26 : IRemoteProxy<ISoftBusServer>(impl) {} 27 virtual ~SoftBusServerProxyFrame() = default; 28 29 int32_t SoftbusRegisterService(const char *clientPkgName, const sptr<IRemoteObject> &object) override; 30 int32_t RegisterBrProxyService(const char *clientPkgName, const sptr<IRemoteObject>& object) override; 31 32 int32_t CreateSessionServer(const char *pkgName, const char *sessionName, uint64_t timestamp) override; 33 int32_t RemoveSessionServer(const char *pkgName, const char *sessionName, uint64_t timestamp) override; 34 int32_t OpenSession(const SessionParam *param, TransInfo *info) override; 35 int32_t OpenAuthSession(const char *sessionName, const ConnectionAddr *addrInfo) override; 36 int32_t NotifyAuthSuccess(int32_t channelId, int32_t channelType) override; 37 int32_t ReleaseResources(int32_t channelId) override; 38 int32_t CloseChannel(const char *sessionName, int32_t channelId, int32_t channelType) override; 39 int32_t CloseChannelWithStatistics(int32_t channelId, int32_t channelType, uint64_t laneId, const void *dataInfo, 40 uint32_t len) override; 41 int32_t SendMessage(int32_t channelId, int32_t channelType, const void *data, 42 uint32_t len, int32_t msgType) override; 43 44 int32_t JoinLNN(const char *pkgName, void *addr, uint32_t addrTypeLen, bool isForceJoin) override; 45 int32_t LeaveLNN(const char *pkgName, const char *networkId) override; 46 int32_t GetAllOnlineNodeInfo(const char *pkgName, void **info, uint32_t infoTypeLen, int *infoNum) override; 47 int32_t GetLocalDeviceInfo(const char *pkgName, void *info, uint32_t infoTypeLen) override; 48 int32_t GetNodeKeyInfo(const char *pkgName, const char *networkId, int key, unsigned char *buf, 49 uint32_t len) override; 50 int32_t SetNodeDataChangeFlag(const char *pkgName, const char *networkId, uint16_t dataChangeFlag) override; 51 int32_t RegDataLevelChangeCb(const char *pkgName) override; 52 int32_t UnregDataLevelChangeCb(const char *pkgName) override; 53 int32_t SetDataLevel(const DataLevel *dataLevel) override; 54 int32_t StartTimeSync(const char *pkgName, const char *targetNetworkId, int32_t accuracy, 55 int32_t period) override; 56 int32_t StopTimeSync(const char *pkgName, const char *targetNetworkId) override; 57 int32_t QosReport(int32_t channelId, int32_t chanType, int32_t appType, int32_t quality) override; 58 int32_t StreamStats(int32_t channelId, int32_t channelType, const StreamSendStats *data) override; 59 int32_t RippleStats(int32_t channelId, int32_t channelType, const TrafficStats *data) override; 60 int32_t EvaluateQos(const char *peerNetworkId, TransDataType dataType, const QosTV *qos, 61 uint32_t qosCount) override; 62 int32_t ProcessInnerEvent(int32_t eventType, uint8_t *buf, uint32_t len) override; 63 int32_t PrivilegeCloseChannel(uint64_t tokenId, int32_t pid, const char *peerNetworkId) override; 64 int32_t RegisterRangeCallbackForMsdp(const char *pkgName) override; 65 int32_t UnregisterRangeCallbackForMsdp(const char *pkgName) override; 66 private: 67 static inline BrokerDelegator<SoftBusServerProxyFrame> delegator_; 68 static sptr<IRemoteObject> clientCallbackStub_; 69 static std::mutex instanceLock; 70 71 static sptr<IRemoteObject> GetRemoteInstance(); 72 }; 73 } // namespace OHOS 74 75 #endif // !defined(INTERFACES_INNERKITS_FRAME_SERVER_PROXY_STANDARD_H_) 76