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