| 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 #include "device/hid/hid_report_descriptor_item.h" | 5 #include "device/hid/hid_report_descriptor_item.h" |
| 6 | 6 |
| 7 #include <stdlib.h> | 7 #include <stdlib.h> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "device/hid/hid_usage_and_page.h" | 10 #include "device/hid/hid_usage_and_page.h" |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 DCHECK(!IsLong()); | 83 DCHECK(!IsLong()); |
| 84 return shortData_; | 84 return shortData_; |
| 85 } | 85 } |
| 86 | 86 |
| 87 HidReportDescriptorItem::CollectionType | 87 HidReportDescriptorItem::CollectionType |
| 88 HidReportDescriptorItem::GetCollectionTypeFromValue(uint32_t value) { | 88 HidReportDescriptorItem::GetCollectionTypeFromValue(uint32_t value) { |
| 89 switch (value) { | 89 switch (value) { |
| 90 case 0x00: | 90 case 0x00: |
| 91 return kCollectionTypePhysical; | 91 return kCollectionTypePhysical; |
| 92 case 0x01: | 92 case 0x01: |
| 93 return kCollectionTypePhysical; | 93 return kCollectionTypeApplication; |
| 94 case 0x02: | 94 case 0x02: |
| 95 return kCollectionTypePhysical; | 95 return kCollectionTypeLogical; |
| 96 case 0x03: | 96 case 0x03: |
| 97 return kCollectionTypePhysical; | 97 return kCollectionTypeReport; |
| 98 case 0x04: | 98 case 0x04: |
| 99 return kCollectionTypePhysical; | 99 return kCollectionTypeNamedArray; |
| 100 case 0x05: | 100 case 0x05: |
| 101 return kCollectionTypePhysical; | 101 return kCollectionTypeUsageSwitch; |
| 102 case 0x06: | 102 case 0x06: |
| 103 return kCollectionTypePhysical; | 103 return kCollectionTypeUsageModifier; |
| 104 default: | 104 default: |
| 105 break; | 105 break; |
| 106 } | 106 } |
| 107 if (0x80 < value && value < 0xFF) | 107 if (0x80 < value && value < 0xFF) |
| 108 return kCollectionTypeVendor; | 108 return kCollectionTypeVendor; |
| 109 return kCollectionTypeReserved; | 109 return kCollectionTypeReserved; |
| 110 } | 110 } |
| 111 | 111 |
| 112 } // namespace device | 112 } // namespace device |
| OLD | NEW |