1 // Copyright 2018 The Fuchsia Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #ifndef ZIRCON_SYSTEM_DEV_INPUT_HID_HID_PARSER_H_
6 #define ZIRCON_SYSTEM_DEV_INPUT_HID_HID_PARSER_H_
7 
8 #include <zircon/types.h>
9 
10 #include <stdint.h>
11 
12 __BEGIN_CDECLS;
13 
14 typedef uint8_t input_report_id_t;
15 typedef uint16_t input_report_size_t;
16 
17 typedef struct hid_report_size {
18     uint8_t id;
19     input_report_size_t in_size;
20     input_report_size_t out_size;
21     input_report_size_t feat_size;
22 } hid_report_size_t;
23 
24 typedef struct hid_reports {
25     hid_report_size_t* sizes;
26     size_t sizes_len;
27     size_t num_reports;
28     bool has_rpt_id;
29 } hid_reports_t;
30 
31 zx_status_t hid_lib_parse_reports(const uint8_t* buf, const size_t buf_len,
32                                   hid_reports_t* reports);
33 
34 __END_CDECLS;
35 
36 #endif // ZIRCON_SYSTEM_DEV_INPUT_HID_HID_PARSER_H_
37