| OLD | NEW |
| 1 // Copyright (c) 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef DEVICE_HID_HID_DEVICE_INFO_H_ | 5 #ifndef DEVICE_HID_HID_DEVICE_INFO_H_ |
| 6 #define DEVICE_HID_HID_DEVICE_INFO_H_ | 6 #define DEVICE_HID_HID_DEVICE_INFO_H_ |
| 7 | 7 |
| 8 #include <stdint.h> |
| 9 |
| 8 #include <string> | 10 #include <string> |
| 9 | 11 |
| 10 #include "base/basictypes.h" | 12 #include "build/build_config.h" |
| 13 |
| 14 #if defined(OS_MACOSX) |
| 15 #include <IOKit/hid/IOHIDDevice.h> |
| 16 #endif |
| 11 | 17 |
| 12 namespace device { | 18 namespace device { |
| 13 | 19 |
| 14 enum HidBusType { | 20 enum HidBusType { |
| 15 kHIDBusTypeUSB = 0, | 21 kHIDBusTypeUSB = 0, |
| 16 kHIDBusTypeBluetooth = 1, | 22 kHIDBusTypeBluetooth = 1, |
| 17 }; | 23 }; |
| 18 | 24 |
| 25 #if defined(OS_MACOSX) |
| 26 typedef IOHIDDeviceRef HidDeviceId; |
| 27 const HidDeviceId kInvalidHidDeviceId = NULL; |
| 28 #else |
| 29 typedef std::string HidDeviceId; |
| 30 extern const char kInvalidHidDeviceId[]; |
| 31 #endif |
| 32 |
| 19 struct HidDeviceInfo { | 33 struct HidDeviceInfo { |
| 20 HidDeviceInfo(); | 34 HidDeviceInfo(); |
| 21 ~HidDeviceInfo(); | 35 ~HidDeviceInfo(); |
| 22 | 36 |
| 23 std::string device_id; | 37 HidDeviceId device_id; |
| 24 | 38 |
| 25 HidBusType bus_type; | 39 HidBusType bus_type; |
| 26 uint16 vendor_id; | 40 uint16_t vendor_id; |
| 27 uint16 product_id; | 41 uint16_t product_id; |
| 28 | 42 |
| 29 size_t input_report_size; | 43 int input_report_size; |
| 30 size_t output_report_size; | 44 int output_report_size; |
| 31 size_t feature_report_size; | 45 int feature_report_size; |
| 32 | 46 |
| 33 uint16 usage_page; | 47 uint16_t usage_page; |
| 34 uint16 usage; | 48 uint16_t usage; |
| 35 bool has_report_id; | 49 bool has_report_id; |
| 36 | 50 |
| 37 std::string product_name; | 51 std::string product_name; |
| 38 std::string serial_number; | 52 std::string serial_number; |
| 39 }; | 53 }; |
| 40 | 54 |
| 41 } // namespace device | 55 } // namespace device |
| 42 | 56 |
| 43 #endif // DEVICE_HID_HID_DEVICE_INFO_H_ | 57 #endif // DEVICE_HID_HID_DEVICE_INFO_H_ |
| OLD | NEW |