class DescriptorList
Defined at line 165 of file ../../src/devices/usb/lib/usb/include/usb/usb.h
DescriptorList is used to iterate all of the USB descriptors of an Interface. It is created by
calling GetDescriptorList on an Interface. The returned descriptor pointers are valid for the
lifetime of the InterfaceList used to create the parent Interface. DescriptorList implements a
standard C++ iterator interface that returns usb_descriptor_header_t*.
Example Usage:
std::optional
<InterfaceList
> interfaces;
status = InterfaceList::Create(my_client, true,
&interfaces
);
if (status != ZX_OK) {
...
}
// Find the first descriptor of type usb_my_device_specific_desc_t.
for (const auto
&
interface : *interfaces) {
for (auto
&
descriptor: interface.GetDescriptorList()) {
if (descriptor.b_descriptor_type == USB_DT_MY_DEVICE_SPECIFIC) {
return make_optional
<usb
_my_device_specific_desc_t*>(
reinterpret_cast
<usb
_my_device_specific_desc_t*>(
&descriptor
));
}
}
}
Public Methods
iterator begin ()
Defined at line 116 of file ../../src/devices/usb/lib/usb/usb-wrapper.cc
const_iterator cbegin ()
Defined at line 126 of file ../../src/devices/usb/lib/usb/usb-wrapper.cc
iterator end ()
Defined at line 130 of file ../../src/devices/usb/lib/usb/usb-wrapper.cc
const_iterator cend ()
Defined at line 135 of file ../../src/devices/usb/lib/usb/usb-wrapper.cc
void DescriptorList (const usb_desc_iter_t & iter, const usb_interface_descriptor_t * descriptor)
Defined at line 173 of file ../../src/devices/usb/lib/usb/include/usb/usb.h
void DescriptorList ()
Defined at line 176 of file ../../src/devices/usb/lib/usb/include/usb/usb.h
const usb_interface_descriptor_t * descriptor ()
Defined at line 178 of file ../../src/devices/usb/lib/usb/include/usb/usb.h