1 /*
2 * Copyright (c) 2021 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 #include "softbus_dispatcher.h"
17 #include "softbus_agent.h"
18 #include "utils_log.h"
19
20 namespace OHOS {
21 namespace Storage {
22 namespace DistributedFile {
OnSessionOpened(int sessionId,int result)23 int SoftbusDispatcher::OnSessionOpened(int sessionId, int result)
24 {
25 SoftbusAgent::GetInstance()->OnSessionOpened(sessionId, result);
26 return 0;
27 }
28
OnSessionClosed(int sessionId)29 void SoftbusDispatcher::OnSessionClosed(int sessionId)
30 {
31 SoftbusAgent::GetInstance()->OnSessionClosed(sessionId);
32 }
33
OnSendFileFinished(int sessionId,const char * firstFile)34 int SoftbusDispatcher::OnSendFileFinished(int sessionId, const char *firstFile)
35 {
36 SoftbusAgent::GetInstance()->OnSendFileFinished(sessionId, std::string(firstFile));
37 return 0;
38 }
39
OnFileTransError(int sessionId)40 void SoftbusDispatcher::OnFileTransError(int sessionId)
41 {
42 SoftbusAgent::GetInstance()->OnFileTransError(sessionId);
43 }
44
OnReceiveFileFinished(int sessionId,const char * files,int fileCnt)45 void SoftbusDispatcher::OnReceiveFileFinished(int sessionId, const char *files, int fileCnt)
46 {
47 SoftbusAgent::GetInstance()->OnReceiveFileFinished(sessionId, std::string(files), fileCnt);
48 }
49 } // namespace DistributedFile
50 } // namespace Storage
51 } // namespace OHOS