1/*
2 * Copyright (c) 2022 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_INPUT_V1_0_INPUTTYPES_H
17#define OHOS_HDI_INPUT_V1_0_INPUTTYPES_H
18
19#include <cstdbool>
20#include <cstdint>
21#include <string>
22#include <vector>
23
24namespace OHOS {
25namespace HDI {
26namespace Input {
27namespace V1_0 {
28
29using namespace OHOS;
30
31struct DevDesc {
32    uint32_t devIndex;
33    uint32_t devType;
34} __attribute__ ((aligned(8)));
35
36struct DevIdentify {
37    uint16_t busType;
38    uint16_t vendor;
39    uint16_t product;
40    uint16_t version;
41} __attribute__ ((aligned(8)));
42
43struct DimensionInfo {
44    int32_t axis;
45    int32_t min;
46    int32_t max;
47    int32_t fuzz;
48    int32_t flat;
49    int32_t range;
50} __attribute__ ((aligned(8)));
51
52struct DevAttr {
53    std::string devName;
54    OHOS::HDI::Input::V1_0::DevIdentify id;
55    std::vector<OHOS::HDI::Input::V1_0::DimensionInfo> axisInfo;
56};
57
58struct DevAbility {
59    std::vector<uint64_t> devProp;
60    std::vector<uint64_t> eventType;
61    std::vector<uint64_t> absCode;
62    std::vector<uint64_t> relCode;
63    std::vector<uint64_t> keyCode;
64    std::vector<uint64_t> ledCode;
65    std::vector<uint64_t> miscCode;
66    std::vector<uint64_t> soundCode;
67    std::vector<uint64_t> forceCode;
68    std::vector<uint64_t> switchCode;
69    std::vector<uint64_t> keyType;
70    std::vector<uint64_t> ledType;
71    std::vector<uint64_t> soundType;
72    std::vector<uint64_t> switchType;
73};
74
75struct DeviceInfo {
76    uint32_t devIndex;
77    uint32_t devType;
78    std::string chipInfo;
79    std::string vendorName;
80    std::string chipName;
81    OHOS::HDI::Input::V1_0::DevAttr attrSet;
82    OHOS::HDI::Input::V1_0::DevAbility abilitySet;
83};
84
85struct ExtraCmd {
86    std::string cmdCode;
87    std::string cmdValue;
88};
89
90struct HotPlugEvent {
91    uint32_t devIndex;
92    uint32_t devType;
93    uint32_t status;
94} __attribute__ ((aligned(8)));
95
96struct EventPackage {
97    uint32_t type;
98    uint32_t code;
99    int32_t value;
100    uint64_t timestamp;
101} __attribute__ ((aligned(8)));
102} // V1_0
103} // Input
104} // HDI
105} // OHOS
106
107#endif // OHOS_HDI_INPUT_V1_0_INPUTTYPES_H
108
109