| OLD | NEW |
| 1 // Copyright 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 <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "build/build_config.h" | 11 #include "build/build_config.h" |
| 12 #include "device/hid/hid_usage_and_page.h" | 12 #include "device/hid/hid_collection_info.h" |
| 13 | 13 |
| 14 #if defined(OS_MACOSX) | 14 #if defined(OS_MACOSX) |
| 15 #include <IOKit/hid/IOHIDDevice.h> | 15 #include <IOKit/hid/IOHIDDevice.h> |
| 16 #endif | 16 #endif |
| 17 | 17 |
| 18 namespace device { | 18 namespace device { |
| 19 | 19 |
| 20 enum HidBusType { | 20 enum HidBusType { |
| 21 kHIDBusTypeUSB = 0, | 21 kHIDBusTypeUSB = 0, |
| 22 kHIDBusTypeBluetooth = 1, | 22 kHIDBusTypeBluetooth = 1, |
| 23 }; | 23 }; |
| 24 | 24 |
| 25 #if defined(OS_MACOSX) | 25 #if defined(OS_MACOSX) |
| 26 typedef IOHIDDeviceRef HidDeviceId; | 26 typedef IOHIDDeviceRef HidDeviceId; |
| 27 const HidDeviceId kInvalidHidDeviceId = NULL; | 27 const HidDeviceId kInvalidHidDeviceId = NULL; |
| 28 #else | 28 #else |
| 29 typedef std::string HidDeviceId; | 29 typedef std::string HidDeviceId; |
| 30 extern const char kInvalidHidDeviceId[]; | 30 extern const char kInvalidHidDeviceId[]; |
| 31 #endif | 31 #endif |
| 32 | 32 |
| 33 struct HidDeviceInfo { | 33 struct HidDeviceInfo { |
| 34 HidDeviceInfo(); | 34 HidDeviceInfo(); |
| 35 ~HidDeviceInfo(); | 35 ~HidDeviceInfo(); |
| 36 | 36 |
| 37 // Device identification. |
| 37 HidDeviceId device_id; | 38 HidDeviceId device_id; |
| 38 | |
| 39 HidBusType bus_type; | |
| 40 uint16_t vendor_id; | 39 uint16_t vendor_id; |
| 41 uint16_t product_id; | 40 uint16_t product_id; |
| 42 | |
| 43 int input_report_size; | |
| 44 int output_report_size; | |
| 45 int feature_report_size; | |
| 46 std::vector<HidUsageAndPage> usages; | |
| 47 bool has_report_id; | |
| 48 | |
| 49 std::string product_name; | 41 std::string product_name; |
| 50 std::string serial_number; | 42 std::string serial_number; |
| 43 HidBusType bus_type; |
| 44 |
| 45 // Top-Level Collections information. |
| 46 std::vector<HidCollectionInfo> collections; |
| 47 int max_input_report_size; |
| 48 int max_output_report_size; |
| 49 int max_feature_report_size; |
| 51 }; | 50 }; |
| 52 | 51 |
| 53 } // namespace device | 52 } // namespace device |
| 54 | 53 |
| 55 #endif // DEVICE_HID_HID_DEVICE_INFO_H_ | 54 #endif // DEVICE_HID_HID_DEVICE_INFO_H_ |
| OLD | NEW |