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 OHOS_HDI_USB_V1_0_SERIALIMPL_H 17 #define OHOS_HDI_USB_V1_0_SERIALIMPL_H 18 19 #include "v1_0/iserial_interface.h" 20 21 namespace OHOS { 22 namespace HDI { 23 namespace Usb { 24 namespace Serial { 25 namespace V1_0 { 26 class SerialImpl : public ISerialInterface { 27 public: 28 SerialImpl(); 29 ~SerialImpl() override; 30 int32_t SerialOpen(int32_t portId) override; 31 int32_t SerialClose(int32_t portId) override; 32 int32_t SerialRead(int32_t portId, std::vector<uint8_t>& data, uint32_t size, uint32_t timeout) override; 33 int32_t SerialWrite(int32_t portId, const std::vector<uint8_t>& data, uint32_t size, uint32_t timeout) override; 34 int32_t SerialSetAttribute(int32_t portId, const SerialAttribute& attribute) override; 35 int32_t SerialGetAttribute(int32_t portId, SerialAttribute& attribute) override; 36 int32_t SerialGetPortList(std::vector<SerialPort>& portList) override; 37 }; 38 } // V1_0 39 } // Serial 40 } // Usb 41 } // HDI 42 } // OHOS 43 44 #endif // OHOS_HDI_USB_V1_0_SERIALIMPL_H