• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2025 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 "media_log.h"
17 #include "mock_usbfn_mtp_impl.h"
18 
19 namespace OHOS {
20 namespace Media {
Init()21 int32_t MockUsbfnMtpImpl::Init()
22 {
23     return HDF_SUCCESS;
24 }
25 
Release()26 int32_t MockUsbfnMtpImpl::Release()
27 {
28     return HDF_SUCCESS;
29 }
30 
Start()31 int32_t MockUsbfnMtpImpl::Start()
32 {
33     return HDF_SUCCESS;
34 }
35 
Stop()36 int32_t MockUsbfnMtpImpl::Stop()
37 {
38     return HDF_SUCCESS;
39 }
40 
Read(std::vector<uint8_t> & data)41 int32_t MockUsbfnMtpImpl::Read(std::vector<uint8_t> &data)
42 {
43     MEDIA_INFO_LOG("%{public}s: Read", __func__);
44     return HDF_SUCCESS;
45 }
46 
Write(const std::vector<uint8_t> & data)47 int32_t MockUsbfnMtpImpl::Write(const std::vector<uint8_t> &data)
48 {
49     MEDIA_INFO_LOG("%{public}s: Write", __func__);
50     sleep(1);
51     return HDF_FAILURE;
52 }
53 
ReceiveFile(const HDI::Usb::Gadget::Mtp::V1_0::UsbFnMtpFileSlice & mfs)54 int32_t MockUsbfnMtpImpl::ReceiveFile(const HDI::Usb::Gadget::Mtp::V1_0::UsbFnMtpFileSlice &mfs)
55 {
56     return HDF_SUCCESS;
57 }
58 
SendFile(const HDI::Usb::Gadget::Mtp::V1_0::UsbFnMtpFileSlice & mfs)59 int32_t MockUsbfnMtpImpl::SendFile(const HDI::Usb::Gadget::Mtp::V1_0::UsbFnMtpFileSlice &mfs)
60 {
61     return HDF_SUCCESS;
62 }
63 
SendEvent(const std::vector<uint8_t> & eventData)64 int32_t MockUsbfnMtpImpl::SendEvent(const std::vector<uint8_t> &eventData)
65 {
66     MEDIA_INFO_LOG("%{public}s: SendEvent", __func__);
67     sleep(1);
68     return HDF_FAILURE;
69 }
70 
71 } // namespace Media
72 } // namespace OHOS
73