sbUSBDeviceUtils.h File Reference

Songbird USB Device Utilities Definitions. More...

#include <nsAutoPtr.h>
#include <nsTArray.h>
Include dependency graph for sbUSBDeviceUtils.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  sbUSBDescriptorHeader
 
struct  sbUSBDeviceDescriptor
 
struct  sbUSBConfigurationDescriptor
 
struct  sbUSBInterfaceDescriptor
 
struct  sbUSBStringDescriptor
 
class  sbUSBDeviceRef
 
class  sbUSBDescriptor
 

Macros

#define SB_USB_DESCRIPTOR_TYPE_DEVICE   1
 
#define SB_USB_DESCRIPTOR_TYPE_CONFIGURATION   2
 
#define SB_USB_DESCRIPTOR_TYPE_STRING   3
 
#define SB_USB_DESCRIPTOR_TYPE_INTERFACE   4
 
#define SB_USB_DESCRIPTOR_TYPE_ENDPOINT   5
 
#define SB_USB_APPLE_VENDOR_ID   0x05ac
 

Typedefs

typedef nsTArray< nsRefPtr
< sbUSBDescriptor > > 
sbUSBDescriptorList
 

Functions

nsresult sbUSBDeviceImplementsClass (sbUSBDescriptorList &aDescriptorList, PRUint8 aUSBClass, PRBool *aImplementsClass)
 
nsresult sbUSBDeviceGetDescriptor (sbUSBDeviceRef *aDeviceRef, PRUint8 aDescriptorType, PRUint8 aDescriptorIndex, PRUint16 aDescriptorIndex2, sbUSBDescriptor **aDescriptor)
 
nsresult sbUSBDeviceGetStringDescriptor (sbUSBDeviceRef *aDeviceRef, PRUint8 aDescriptorIndex, PRUint16 aDescriptorIndex2, nsAString &aString)
 
nsresult sbUSBDeviceGetLanguageList (sbUSBDeviceRef *aDeviceRef, nsTArray< PRUint16 > &aLanguageList)
 
nsresult sbUSBDeviceAddConfigurationDescriptors (sbUSBDeviceRef *aDeviceRef, PRUint8 aConfigurationIndex, sbUSBDescriptorList &aDescriptorList)
 
nsresult sbUSBDeviceGetDescriptor (sbUSBDeviceRef *aDeviceRef, PRUint8 aDescriptorType, PRUint8 aDescriptorIndex, PRUint16 aDescriptorIndex2, PRUint16 aDescriptorLength, sbUSBDescriptor **aDescriptor)
 

Detailed Description

Songbird USB Device Utilities Definitions.

Definition in file sbUSBDeviceUtils.h.

Macro Definition Documentation

#define SB_USB_APPLE_VENDOR_ID   0x05ac

Definition at line 84 of file sbUSBDeviceUtils.h.

#define SB_USB_DESCRIPTOR_TYPE_CONFIGURATION   2

Definition at line 76 of file sbUSBDeviceUtils.h.

#define SB_USB_DESCRIPTOR_TYPE_DEVICE   1

Definition at line 75 of file sbUSBDeviceUtils.h.

#define SB_USB_DESCRIPTOR_TYPE_ENDPOINT   5

Definition at line 79 of file sbUSBDeviceUtils.h.

#define SB_USB_DESCRIPTOR_TYPE_INTERFACE   4

Definition at line 78 of file sbUSBDeviceUtils.h.

#define SB_USB_DESCRIPTOR_TYPE_STRING   3

Definition at line 77 of file sbUSBDeviceUtils.h.

Typedef Documentation

typedef nsTArray<nsRefPtr<sbUSBDescriptor> > sbUSBDescriptorList

Definition at line 61 of file sbUSBDeviceUtils.h.

Function Documentation

nsresult sbUSBDeviceAddConfigurationDescriptors ( sbUSBDeviceRef aDeviceRef,
PRUint8  aConfigurationIndex,
sbUSBDescriptorList aDescriptorList 
)

Add to aDescriptorList the list of configuration descriptors for the device specified by aDeviceRef and configuration index specified by aConfigurationIndex.

Parameters
aDeviceRefDevice reference for which to get descriptors.
aConfigurationIndexIndex of configuration to get.
aDescriptorListList of descriptors.

Definition at line 316 of file sbUSBDeviceUtils.cpp.

Here is the call graph for this function:

nsresult sbUSBDeviceGetDescriptor ( sbUSBDeviceRef aDeviceRef,
PRUint8  aDescriptorType,
PRUint8  aDescriptorIndex,
PRUint16  aDescriptorIndex2,
sbUSBDescriptor **  aDescriptor 
)

Return in aDescriptor the USB descriptor for the device specified by aDeviceRef of descriptor type specified by aDescriptorType and descriptor index specified by aDescriptorIndex and aDescriptorIndex2.

Parameters
aDeviceRefDevice reference for which to get descriptor.
aDescriptorTypeType of descriptor to get.
aDescriptorIndexIndex of descriptor to get.
aDescriptorIndex2Second index of descriptor to get (only used for string descriptors).
aDescriptorReturned descriptor.

Definition at line 140 of file sbUSBDeviceUtils.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

nsresult sbUSBDeviceGetDescriptor ( sbUSBDeviceRef aDeviceRef,
PRUint8  aDescriptorType,
PRUint8  aDescriptorIndex,
PRUint16  aDescriptorIndex2,
PRUint16  aDescriptorLength,
sbUSBDescriptor **  aDescriptor 
)

Return in aDescriptor the USB descriptor for the device specified by aDeviceRef of descriptor type specified by aDescriptorType and descriptor index specified by aDescriptorIndex and aDescriptorIndex2. Read up to aDescriptorLength bytes of descriptor data.

Parameters
aDeviceRefDevice reference for which to get descriptor.
aDescriptorTypeType of descriptor to get.
aDescriptorIndexIndex of descriptor to get.
aDescriptorIndex2Second index of descriptor to get (only used for string descriptors).
aDescriptorLengthNumber of bytes of descriptor data to get.
aDescriptorReturned descriptor.

Definition at line 109 of file sbWindowsUSBDeviceUtils.cpp.

Here is the call graph for this function:

nsresult sbUSBDeviceGetLanguageList ( sbUSBDeviceRef aDeviceRef,
nsTArray< PRUint16 > &  aLanguageList 
)

Return in aLanguageList the list of language ID's supported by the device specified by aDeviceRef.

Parameters
aDeviceRefDevice reference for which to get language ID's.
aLanguageListList of language ID's.

Definition at line 272 of file sbUSBDeviceUtils.cpp.

Here is the call graph for this function:

nsresult sbUSBDeviceGetStringDescriptor ( sbUSBDeviceRef aDeviceRef,
PRUint8  aDescriptorIndex,
PRUint16  aDescriptorIndex2,
nsAString &  aString 
)

Return in aString the USB string descriptor string for the device specified by aDeviceRef with the descriptor index specified by aDescriptorIndex and aDescriptorIndex2.

Parameters
aDeviceRefDevice reference for which to get descriptor.
aDescriptorIndexIndex of descriptor to get.
aDescriptorIndex2Second index of descriptor to get (only used for string descriptors).
aStringReturned descriptor string.

Definition at line 232 of file sbUSBDeviceUtils.cpp.

Here is the call graph for this function:

nsresult sbUSBDeviceImplementsClass ( sbUSBDescriptorList aDescriptorList,
PRUint8  aUSBClass,
PRBool *  aImplementsClass 
)

Return true in aImplementsClass if the USB device with the descriptors specified by aDescriptorList implements the USB class specified by aUSBClass.

Parameters
aDescriptorListList of device USB descriptors.
aUSBClassUSB class to check.
aImplementsClassReturned true if device implements USB class.

Definition at line 67 of file sbUSBDeviceUtils.cpp.

Here is the call graph for this function: