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 HID_ADAPTER_H 17 #define HID_ADAPTER_H 18 19 #include <stdint.h> 20 #include <vector> 21 22 #include "v1_1/ihid_ddk.h" 23 24 namespace OHOS { 25 namespace HDI { 26 namespace Input { 27 namespace Ddk { 28 namespace V1_1 { 29 class HidOsAdapter { 30 public: 31 virtual int32_t GetRawInfo(int32_t fd, HidRawDevInfo& rawDevInfo) = 0; 32 virtual int32_t GetRawName(int32_t fd, std::vector<uint8_t>& data) = 0; 33 virtual int32_t GetPhysicalAddress(int32_t fd, std::vector<uint8_t>& data) = 0; 34 virtual int32_t GetRawUniqueId(int32_t fd, std::vector<uint8_t>& data) = 0; 35 virtual int32_t SendReport(int32_t fd, HidReportType reportType, const std::vector<uint8_t>& data) = 0; 36 virtual int32_t GetReport(int32_t fd, HidReportType reportType, std::vector<uint8_t>& data) = 0; 37 virtual int32_t GetReportDescriptor(int32_t fd, std::vector<uint8_t>& data, uint32_t& bytesRead) = 0; 38 }; 39 } // V1_1 40 } // Ddk 41 } // Input 42 } // HDI 43 } // OHOS 44 45 #endif // HID_ADAPTER_H