summaryrefslogtreecommitdiffstats
path: root/device/hid/hid_device_info.h
blob: 2ed51ac4f52c140d03c15025fca10f3182bd2cf1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef DEVICE_HID_HID_DEVICE_INFO_H_
#define DEVICE_HID_HID_DEVICE_INFO_H_

#include <string>
#include <vector>

#include "build/build_config.h"
#include "device/hid/hid_collection_info.h"

#if defined(OS_MACOSX)
#include <IOKit/hid/IOHIDDevice.h>
#endif

namespace device {

enum HidBusType {
  kHIDBusTypeUSB = 0,
  kHIDBusTypeBluetooth = 1,
};

#if defined(OS_MACOSX)
typedef IOHIDDeviceRef HidDeviceId;
const HidDeviceId kInvalidHidDeviceId = NULL;
#else
typedef std::string HidDeviceId;
extern const char kInvalidHidDeviceId[];
#endif

struct HidDeviceInfo {
  HidDeviceInfo();
  ~HidDeviceInfo();

  // Device identification.
  HidDeviceId device_id;
  uint16_t vendor_id;
  uint16_t product_id;
  std::string product_name;
  std::string serial_number;
  HidBusType bus_type;

  // Top-Level Collections information.
  std::vector<HidCollectionInfo> collections;
  int max_input_report_size;
  int max_output_report_size;
  int max_feature_report_size;
};

}  // namespace device

#endif  // DEVICE_HID_HID_DEVICE_INFO_H_