Numworks Epsilon  1.4.1
Graphing Calculator Operating System
extended_compat_id_descriptor.h
Go to the documentation of this file.
1 #ifndef ION_DEVICE_USB_STACK_EXTENDED_COMPAT_ID_DESCRIPTOR_H
2 #define ION_DEVICE_USB_STACK_EXTENDED_COMPAT_ID_DESCRIPTOR_H
3 
4 #include "streamable.h"
5 
6 namespace Ion {
7 namespace USB {
8 namespace Device {
9 
10 /* We use this descriptor to tell the Windows OS that the device should be
11  * treated as a WinUSB device. The Extended Compat ID Descriptor can set
12  * differents compat IDs according to the interface and function of the device,
13  * but we assume there is only one. */
14 
16 public:
17  static constexpr uint8_t Index = 0x0004;
18  ExtendedCompatIDDescriptor(const char * compatibleID);
19 protected:
20  void push(Channel * c) const override;
21 private:
22  constexpr static uint8_t k_reserved1Size = 7;
23  constexpr static uint8_t k_compatibleIDSize = 8;
24  constexpr static uint8_t k_reserved2Size = 6;
25  // Header
26  uint32_t m_dwLength; // The length, in bytes, of the complete extended compat ID descriptor
27  uint16_t m_bcdVersion; // The descriptor’s version number, in binary coded decimal format
28  uint16_t m_wIndex; // An index that identifies the particular OS feature descriptor
29  uint8_t m_bCount; // The number of function sections
30  uint8_t m_reserved1[k_reserved1Size];
31  // Function
32  uint8_t m_bFirstInterfaceNumber; // The interface or function number
33  uint8_t m_bReserved;
34  uint8_t m_compatibleID[k_compatibleIDSize];
35  uint8_t m_subCompatibleID[k_compatibleIDSize];
36  uint8_t m_reserved2[k_reserved2Size];
37 };
38 
39 }
40 }
41 }
42 
43 #endif
unsigned short uint16_t
Definition: stdint.h:5
unsigned char uint8_t
Definition: stdint.h:4
c(generic_all_nodes)
unsigned int uint32_t
Definition: stdint.h:6
Definition: app.cpp:5
Definition: backlight.h:6