• 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 #ifndef USBSERIALCOMMONFUNCTION_FUZZER_H
17 #define USBSERIALCOMMONFUNCTION_FUZZER_H
18 
19 #include <unistd.h>
20 #include "usbd_wrapper.h"
21 #include "v1_0/iusb_interface.h"
22 #include "v1_0/usb_types.h"
23 #include "v1_0/iusb_serial_ddk.h"
24 #include "v1_0/usb_serial_ddk_types.h"
25 
26 
27 using OHOS::HDI::Usb::UsbSerialDdk::V1_0::IUsbSerialDdk;
28 using OHOS::HDI::Usb::UsbSerialDdk::V1_0::UsbSerialDeviceHandle;
29 
30 namespace OHOS {
31 namespace USBSerial {
32 constexpr int32_t ZERO_MOVE_LEN = 24;
33 constexpr int32_t FIRST_MOVE_LEN = 16;
34 constexpr int32_t SECOND_MOVE_LEN = 8;
35 constexpr int32_t SECOND_BIT = 2;
36 constexpr int32_t THIRD_BIT = 3;
37 
38 int32_t UsbSerialFuzzTestHostModeInit(const sptr<IUsbSerialDdk> &usbSerialInterface,
39                                       UsbSerialDeviceHandle *device);
40 
41 const int32_t SLEEP_TIME = 3;
42 }
43 } // namespace HDI
44 
45 #endif // USBCOMMONFUNCTION_FUZZER_H